FreeBSD
FreeBSD + mount after read-only mode
Commands: fsck -y mount -u / mount -a -t ufs swapon -a Now the system in RW mode.
Convert PFX to CRT and KEY
You just need to run some commands (you need enter password for pfx and new password for key – it must be different): export crt from pfx: openssl pkcs12 -in file.pfx -nocerts -out file.key export key from pfx: openssl pkcs12 -in file.pfx -clcerts -nokeys -out cert.crt decrypt key: openssl rsa -in file.key -out file2.key without […]
Internet channel reservation script
My script: #!/bin/sh PATH=”/bin:/sbin:/usr/bin” #Main Provider Router ISP1=”1.1.1.1″ #Second Provider Router ISP2=”2.2.2.2″ #IF 2 channels don’t work – will be set it DEFAULT_ISP=”1.1.1.1″ # IP’s for ping OVER_ISP1=”1.1.1.1″ OVER_ISP2=”2.2.2.2″ # Local source IP’s IP1=”myip1″ IP2=”myip2″ # Verify routes #netstat -nr | grep ${OVER_ISP1} >/dev/null 2>&1 #if [ $? != 0 ]; then # echo “Add […]
FreeBSD backup and restore
Взято отсюда: http://www.daemonforums.org/showthread.php?t=2238 Here i will cover how to backup/restore (to file) FreeBSD using native utilities called dump and restore note: dump and restore works only for UFS (aka FFS) Backing up system To backup system you need to use dump utility backup: Code: $ dump -0Lauf /path/to/backups/ad0s1d.dump /dev/ad0s1d Backup and compress on the fly […]
DHCPD + aliases on an interface
As I known recently, DHCPD support aliases on an interfaces only with the cover “shared-network”, for example: shared-network lan{ subnet 192.168.20.0 netmask 255.255.255.0 { option routers 192.168.20.1; option domain-name-servers 192.168.20.1, 192.168.20.2; range 192.168.20.10 192.168.20.200; } subnet 192.168.30.0 netmask 255.255.255.0 { option routers 192.168.30.1; option domain-name-servers 192.168.20.1, 192.168.20.2; range 192.168.30.10 192.168.30.200; } }
Midnight Commander – my colors
[Colors] base_color=gray,gray:normal=gray,default:selected=black,white:marked=yellow,default:markselect=yellow,gray:directory=brightgreen,default:executable=brightgreen,default:link=cyan,default: device=brightmagenta,default:special=lightgray,default:errors=red,default:reverse=green,default:gauge=green,default:input=white,gray:dnormal=green,gray:dfocus=brightgreen,gray: dhotnormal=cyan,gray:dhotfocus=brightcyan,gray:menu=green,default:menuhot=cyan,default:menusel=green,gray:menuhotsel=cyan,default:helpnormal=cyan,default: editnormal=green,default:editbold=blue,default:editmarked=gray,blue:stalelink=red,default
Shell + compacting scripts
Сегодня наткнулся на одном из форумов на интересное решение. Мне нужно было мониторить живучесть ВПН PPTP канала и т.к., несмотря, на конфиг MPD не восстанавливал соединение – приходилось делать ему рестарт. Обычно я писал скрипт типа пинг, если пинга нет, то перезапуск и т.п. Здесь же, более компактное решение: /sbin/ping -c 4 192.168.5.2 || /usr/local/etc/rc.d/mpd5 […]
Vmware ESXi tools on FreeBSD9 issue
I ran into this as well. Read through the entire other thread but didn’t find an answer, so I figured it out on my own. I wanted to paste here since I couldnt find the answer anywhere else online. In short, the error “Guest memory manager: failed” occurs when the config script is trying to […]