Hodžův blog

Archive for the 'Scriptíky' Category

18 Bře

HowTo block facebook with iptables

Insert these lines into your firewall: iptables -t filter -I FORWARD -s 192.168.0.0/24 -m tcp -p tcp -m iprange –dst-range 66.220.144.0-66.220.159.255 –dport 443 -j REJECT –reject-with tcp-reset iptables -t filter -I FORWARD -s 192.168.0.0/24 -m tcp -p tcp -m iprange –dst-range 69.63.176.0-69.63.191.255 –dport 443 -j REJECT –reject-with tcp-reset iptables -t filter -I FORWARD -s 192.168.0.0/24 [...]

15 Bře

HowTo Install Latest Redmine on Debian 6 (Squeeze, Ruby-on-Rails, Apache2 Passenger)

This is a short .bash_history manual… First install fresh Debian Squueze from businesscard (when selecting packages uncheck ALL). Correct hostname: # vi /etc/hostname server.example.com

01 Srp

HowTo install Oracle Instant Client and PHP OCI8 module under Debian Squueze (Ubuntu) 64bit

1) Download the Basic and the SDK packages from http://www.oracle.com (registration needed). # mkdir -p /opt/oracle/instantclient # cd /opt/oracle/instantclient # wget http://download.oracle.com/otn/linux/instantclient/112020/instantclient-basic-linux-x86-64-11.2.0.2.0.zip # wget http://download.oracle.com/otn/linux/instantclient/112020/instantclient-sdk-linux-x86-64-11.2.0.2.0.zip“

30 Čec

HowTo fix a problem „DeprecationWarning: the sha module is deprecated; use the hashlib module instead import sha“ in Pyzor

After a fresh Pyzor install I’m getting this error message: # aptitude install pyzor # pyzor discover /usr/lib/pymodules/python2.6/pyzor/__init__.py:11: DeprecationWarning: the sha module is deprecated; use the hashlib module instead import sha /usr/lib/pymodules/python2.6/pyzor/client.py:12: DeprecationWarning: the multifile module has been deprecated since Python 2.5 import multifile downloading servers from http://pyzor.sourceforge.net/cgi-bin/inform-servers-0-3-x

30 Čec

HowTo fix a problem „loading from master file managed-keys.bind failed: file not found“ under Debain Squeeze

# touch /var/cache/bind/managed-keys.bind # chown root:bind /var/cache/bind/managed-keys.bind # /etc/init.d/bind9 restart # tail -n 50 /var/log/daemon.log

24 Čec

HowTo remove unwanted whitespace with vim

Delete all trailing whitespace (a space or a tab) at the end of each line with: :%s/\s\+$//

21 Čec

HowTo restore the ‚Show Desktop‘ shortcut in Windows XP or Windows 2003

1) Open notepad. 2) Copy the below code. [Shell] Command=2 IconFile=explorer.exe,3 [Taskbar] Command=ToggleDesktop 3) Save the file with the name ShowDesktop.scf some where on your system or on your desktop. 4) Drag and drop the file to the Quick launch area. That’s it…

15 Čer

HowTo install TSM Backup client in Debian Squeeze (Ubuntu) 64bit

1. Update Debian system and install required packages # aptitude update # aptitude full-upgrade # aptitude install alien libstdc++6 ksh ia32-libs 2. Go to directory /usr/src/ and download latest package from IBM web site. After download unpack archive. # cd /usr/src/ # wget „ftp://service.boulder.ibm.com/storage/tivoli-storage-management/maintenance/client/v6r2/Linux/LinuxX86/v622/6.2.2.0-TIV-TSMBAC-LinuxX86.tar“ # tar -xvf 6.2.2.0-TIV-TSMBAC-LinuxX86.tar

09 Čer

Generování Self-Signed Certifikátu skriptem

Už mě to nebaví pořád psát, takže: #!/bin/bash SERVER_NAME=$1 OPENSSL_PATH=/usr/bin/openssl $OPENSSL_PATH genrsa -des3 -out $SERVER_NAME.key 1024 $OPENSSL_PATH genrsa -out $SERVER_NAME.key 1024 $OPENSSL_PATH rsa -in $SERVER_NAME.key -out $SERVER_NAME.pem $OPENSSL_PATH req -new -key $SERVER_NAME.pem -out $SERVER_NAME.csr $OPENSSL_PATH x509 -req -days 365 -in $SERVER_NAME.csr -signkey $SERVER_NAME.pem -out $SERVER_NAME.crt

13 Zář

iptables v1.3.6: X Couldn’t load match `ipp2p’

Také se Vám stalo, že kompilace IPP2P proběhla v pořádku, ale pčesto iptables hlásí při zavádění modulu chybové hlášení „iptables v1.3.6: X Couldn’t load match `ipp2p‘„? Řešení je jednoduché – v souboru makefile zaměňte při vytváření knihovny ld za gcc. Celý postup s mým patchem naleznete zde: apt-get install patch cd /usr/src wget http://ipp2p.org/downloads/ipp2p-0.8.2.tar.gz tar [...]

Hodžův blog is is proudly powered by Wordpress and the Magellan Theme