FreeBSD

Static routing

Posted on

Solaris: route add host 192.168.1.12 192.168.1.1 Solaris, route persistent between reboots: route -p add host 192.168.1.12 192.168.1.1 Linux RedHat: route add -host 192.168.1.12 gw 192.168.1.1 Linux persistent routes: /etc/sysconfig/network-scripts/route-XXX where XXX – name of interface http://www.softpanorama.org/Net/Netutils/route.shtml Q1. Which command manipulates the routing table ? A: route  Q2: Command to add a route to server1 via router1: […]

FreeBSD

NTP client troubleshooting

Posted on

http://support.f5.com/kb/en-us/solutions/public/10000/200/sol10240.html   Observe the output with references on the fields presented in the previous table. Example of a successful NTP peer server query If the local ntpd process can communicate or attempts to communicate with a declared NTP peer server, the output from the ntpq command appears similar to the following example: # ntpq -np remote           […]

FreeBSD

SSH forwarding where to look

Posted on

Where to look if X11 forwarding does not work   1. In /etc/ssh/sshd_config should be the options: AddressFamily inet (if the host is ipv4 only) X11Forwarding yes 2. in /etc/hosts shold be 127.0.0.1 localhost (if the host is ipv4 only) 3. try debugging ssh session: /usr/sbin/sshd -d -p 222 4. DISPLAY environment variable should be […]

FreeBSD

Multihost ssh tools

Posted on

http://www.fabfile.org/   Fabric is a Python (2.5-2.7) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks. It provides a basic suite of operations for executing local or remote shell commands (normally or via sudo) and uploading/downloading files, as well as auxiliary functionality such as prompting the running […]

Linux

Disk benchmarking

Posted on

Здесь вкратце описано как связаны между собой основные параметры диска http://www.databasejournal.com/features/oracle/article.php/3731961/Measuring-Disk-IO151A-Vendor-View.htm С помощью Oracle’овой утилиты Orion можно померить максимальную производительность дисков Документация здесь: http://download.oracle.com/otn/utilities_drivers/orion/Orion_Users_Guide.pdf Если указывать в файле *.lun список raw-devices, то запускать нужно из-под root’а. Другая возможность – давать список файлов на нужном устройстве. Тогда достаточно прав владельца файла. 1. создаем файл с названием […]

FreeBSD

Some bash examples

Posted on

Название файла без пути: $(basename $file) Меняем расширение у всех файлов в директории: for f in *.arc; do mv “$f” “`basename “$f” .arc`.dbf”; done; Название файла без расширения: Use ${x%.*} to remove everything after a dot or ${x%%.*} to remove everything after the first dot. Example: $ x=”/foo/fizzbuzz.bar.quux” $ y=${x%.*} $ echo $y /foo/fizzbuzz.bar $ […]

Linux

NTP

Posted on

To check if ntpd is configured: $chkconfig –list ntpd ntpd            0:off   1:off   2:on    3:on    4:on    5:on    6:off Install and configure ntpd if not configured: #yum install ntp ntpdate ntp-doc #chkconfig ntpd on Initial time synchronization: #ntpdate <ntp-srv-IP-address> Configure ntpd: Into /etc/ntpd.conf add NTP server and comment out default servers if necessary: server <…> Start ntpd: […]