<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hodžův blog &#187; Scriptíky</title>
	<atom:link href="http://hodza.net/category/linux/scriptiky/feed/" rel="self" type="application/rss+xml" />
	<link>http://hodza.net</link>
	<description>I přestože jsem paranoidní neznamená, že mě nedostanou...</description>
	<lastBuildDate>Mon, 30 Jan 2012 18:02:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>HowTo install Oracle Instant Client and PHP OCI8 module under Debian Squueze (Ubuntu) 64bit</title>
		<link>http://hodza.net/2011/08/01/howto-install-oracle-instant-client-and-php-oci8-module-under-debian-squueze-ubuntu-64bit/</link>
		<comments>http://hodza.net/2011/08/01/howto-install-oracle-instant-client-and-php-oci8-module-under-debian-squueze-ubuntu-64bit/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 12:22:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Scriptíky]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://hodza.net/?p=2099</guid>
		<description><![CDATA[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"


2) Unzip files, move it in correct location and delete unnecessary archives
unzip instantclient-basic-linux-x86-64-11.2.0.2.0.zip
unzip instantclient-sdk-linux-x86-64-11.2.0.2.0.zip
mv instantclient_11_2/* ./
rm -r instantclient_11_2/ instantclient-basic-linux-x86-64-11.2.0.2.0.zip instantclient-sdk-linux-x86-64-11.2.0.2.0.zip

3) Craate missing simlinks
ln -s libclntsh.so.10.1 libclntsh.so
ln -s libocci.so.10.1 libocci.so
4) Install packages
# aptitude install build-essential php5-dev [...]]]></description>
			<content:encoded><![CDATA[<p>1) Download the Basic and the SDK packages from http://www.oracle.com (registration needed).<br />
<code># mkdir -p /opt/oracle/instantclient<br />
# cd /opt/oracle/instantclient<br />
# wget http://download.oracle.com/otn/linux/instantclient/112020/instantclient-basic-linux-x86-64-11.2.0.2.0.zip<br />
# wget http://download.oracle.com/otn/linux/instantclient/112020/instantclient-sdk-linux-x86-64-11.2.0.2.0.zip"<br />
</code><br />
<span id="more-2099"></span><br />
2) Unzip files, move it in correct location and delete unnecessary archives<br />
<code>unzip instantclient-basic-linux-x86-64-11.2.0.2.0.zip<br />
unzip instantclient-sdk-linux-x86-64-11.2.0.2.0.zip<br />
mv instantclient_11_2/* ./<br />
rm -r instantclient_11_2/ instantclient-basic-linux-x86-64-11.2.0.2.0.zip instantclient-sdk-linux-x86-64-11.2.0.2.0.zip<br />
</code></p>
<p>3) Craate missing simlinks<br />
<code>ln -s libclntsh.so.10.1 libclntsh.so<br />
ln -s libocci.so.10.1 libocci.so</code></p>
<p>4) Install packages<br />
<code># aptitude install build-essential php5-dev php-pear libaio1 </code><br />
<code># pecl install oci8 (on question reply: instantclient,/opt/oracle/instantclient)</code></p>
<p>5) Enable the oci8 module in the php.ini<br />
<code># vi /etc/php5/apache2/php.ini<br />
extension=oci8.so (put this line after the examples starting with ;Dynamic Extension).</code><br />
<code># vi /etc/php5E/cli/php.ini<br />
extension=oci8.so (put this line after the examples starting with ;Dynamic Extension).</code></p>
<p>6) Restart Apache Web server<br />
<code>/etc/init.d/apache2 restart</code></p>
<p>Now stop and start Apache. You should see the oci8 module in the output of phpinfo().</p>
]]></content:encoded>
			<wfw:commentRss>http://hodza.net/2011/08/01/howto-install-oracle-instant-client-and-php-oci8-module-under-debian-squueze-ubuntu-64bit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo fix a problem &#8222;DeprecationWarning: the sha module is deprecated; use the hashlib module instead import sha&#8220; in Pyzor</title>
		<link>http://hodza.net/2011/07/30/howto-fix-a-problem-deprecationwarning-the-sha-module-is-deprecated-use-the-hashlib-module-instead-import-sha-in-pyzor/</link>
		<comments>http://hodza.net/2011/07/30/howto-fix-a-problem-deprecationwarning-the-sha-module-is-deprecated-use-the-hashlib-module-instead-import-sha-in-pyzor/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 18:02:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scriptíky]]></category>
		<category><![CDATA[Smtp]]></category>

		<guid isPermaLink="false">http://hodza.net/?p=2096</guid>
		<description><![CDATA[After a fresh Pyzor install I&#8217;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


A simple fix for this problem exists. Open file /usr/bin/pyzor.
# vi /usr/bin/pyzor
Delete line
#!/usr/bin/python
And [...]]]></description>
			<content:encoded><![CDATA[<p>After a fresh Pyzor install I&#8217;m getting this error message:<br />
<code># aptitude install pyzor<br />
# pyzor discover<br />
/usr/lib/pymodules/python2.6/pyzor/__init__.py:11: DeprecationWarning: the sha module is deprecated; use the hashlib module instead<br />
  import sha<br />
/usr/lib/pymodules/python2.6/pyzor/client.py:12: DeprecationWarning: the multifile module has been deprecated since Python 2.5<br />
  import multifile<br />
downloading servers from http://pyzor.sourceforge.net/cgi-bin/inform-servers-0-3-x<br />
</code><br />
<span id="more-2096"></span><br />
A simple fix for this problem exists. Open file /usr/bin/pyzor.<br />
<code># vi /usr/bin/pyzor</code></p>
<p>Delete line<br />
<code>#!/usr/bin/python</code></p>
<p>And insert this new one<br />
<code>#!/usr/bin/python -Wignore::DeprecationWarning</code><br />
Test it<br />
<code># pyzor discover<br />
downloading servers from http://pyzor.sourceforge.net/cgi-bin/inform-servers-0-3-x</code></p>
<p>That&#8217;s all folks!</p>
]]></content:encoded>
			<wfw:commentRss>http://hodza.net/2011/07/30/howto-fix-a-problem-deprecationwarning-the-sha-module-is-deprecated-use-the-hashlib-module-instead-import-sha-in-pyzor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HowTo fix a problem &#8222;loading from master file managed-keys.bind failed: file not found&#8220; under Debain Squeeze</title>
		<link>http://hodza.net/2011/07/30/howto-fix-a-problem-loading-from-master-file-managed-keys-bind-failed-file-not-found-under-debain-squeeze/</link>
		<comments>http://hodza.net/2011/07/30/howto-fix-a-problem-loading-from-master-file-managed-keys-bind-failed-file-not-found-under-debain-squeeze/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 16:30:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[DNS]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scriptíky]]></category>

		<guid isPermaLink="false">http://hodza.net/?p=2091</guid>
		<description><![CDATA[# 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

]]></description>
			<content:encoded><![CDATA[<p><code># touch /var/cache/bind/managed-keys.bind<br />
# chown root:bind /var/cache/bind/managed-keys.bind<br />
# /etc/init.d/bind9 restart<br />
# tail -n 50 /var/log/daemon.log<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://hodza.net/2011/07/30/howto-fix-a-problem-loading-from-master-file-managed-keys-bind-failed-file-not-found-under-debain-squeeze/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo remove unwanted whitespace with vim</title>
		<link>http://hodza.net/2011/07/24/howto-remove-unwanted-whitespace-with-vim/</link>
		<comments>http://hodza.net/2011/07/24/howto-remove-unwanted-whitespace-with-vim/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 05:20:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scriptíky]]></category>

		<guid isPermaLink="false">http://hodza.net/?p=2089</guid>
		<description><![CDATA[Delete all trailing whitespace (a space or a tab) at the end of each line with:
:%s/\s\+$//
]]></description>
			<content:encoded><![CDATA[<p>Delete all trailing whitespace (a space or a tab) at the end of each line with:<br />
<code>:%s/\s\+$//</code></p>
]]></content:encoded>
			<wfw:commentRss>http://hodza.net/2011/07/24/howto-remove-unwanted-whitespace-with-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo restore the &#8216;Show Desktop&#8217; shortcut in Windows XP or Windows 2003</title>
		<link>http://hodza.net/2011/07/21/howto-restore-the-show-desktop-shortcut-in-windows-xp-or-windows-2003/</link>
		<comments>http://hodza.net/2011/07/21/howto-restore-the-show-desktop-shortcut-in-windows-xp-or-windows-2003/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 19:06:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scriptíky]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://hodza.net/?p=2086</guid>
		<description><![CDATA[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&#8230;
]]></description>
			<content:encoded><![CDATA[<p>1) Open notepad.<br />
2) Copy the below code.</p>
<p><code>[Shell]<br />
Command=2<br />
IconFile=explorer.exe,3<br />
[Taskbar]<br />
Command=ToggleDesktop</code></p>
<p>3) Save the file with the name ShowDesktop.scf some where on your system or on your desktop.<br />
4) Drag and drop the file to the Quick launch area.</p>
<p>That’s it&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://hodza.net/2011/07/21/howto-restore-the-show-desktop-shortcut-in-windows-xp-or-windows-2003/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo install TSM Backup client in Debian Squeeze (Ubuntu) 64bit</title>
		<link>http://hodza.net/2011/06/15/howto-install-tsm-backup-client-in-debian-squeeze-ubuntu-64bit/</link>
		<comments>http://hodza.net/2011/06/15/howto-install-tsm-backup-client-in-debian-squeeze-ubuntu-64bit/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 12:09:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scriptíky]]></category>

		<guid isPermaLink="false">http://hodza.net/?p=2059</guid>
		<description><![CDATA[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
3. Unpack RPM files
# alien -g -c TIVsm-API.i386.rpm
# alien -g -c TIVsm-API64.i386.rpm
# alien -g -c TIVsm-BA.i386.rpm
# [...]]]></description>
			<content:encoded><![CDATA[<p>1. Update Debian system and install required packages<br />
<code># aptitude update<br />
# aptitude full-upgrade<br />
# aptitude install alien libstdc++6 ksh ia32-libs</code></p>
<p>2. Go to directory <a title="/usr/src/">/usr/src/</a> and download latest package from IBM web site. After download unpack archive.<br />
<code># cd /usr/src/<br />
# wget "<a title="ftp://service.boulder.ibm.com/storage/tivoli-storage-management/maintenance/client/v6r2/Linux/LinuxX86/v622/6.2.2.0-TIV-TSMBAC-LinuxX86.tar" href="ftp://service.boulder.ibm.com/storage/tivoli-storage-management/maintenance/client/v6r2/Linux/LinuxX86/v622/6.2.2.0-TIV-TSMBAC-LinuxX86.tar">ftp://service.boulder.ibm.com/storage/tivoli-storage-management/maintenance/client/v6r2/Linux/LinuxX86/v622/6.2.2.0-TIV-TSMBAC-LinuxX86.tar</a>"<br />
# tar -xvf  6.2.2.0-TIV-TSMBAC-LinuxX86.tar</code></p>
<p><span id="more-2059"></span>3. Unpack RPM files<br />
<code># alien -g -c TIVsm-API.i386.rpm<br />
# alien -g -c TIVsm-API64.i386.rpm<br />
# alien -g -c TIVsm-BA.i386.rpm<br />
# alien -g -c gskcrypt32-8.0.13.4.linux.x86.rpm<br />
# alien -g -c gskcrypt64-8.0.13.4.linux.x86_64.rpm<br />
# alien -g -c gskssl32-8.0.13.4.linux.x86.rpm<br />
# alien -g -c gskssl64-8.0.13.4.linux.x86_64.rpm</code></p>
<p>4. Make a correct path for debian build script<br />
<code># mv TIVsm-API-6.2.2/debian TIVsm-API-6.2.2/DEBIAN<br />
# mv TIVsm-API64-6.2.2/debian TIVsm-API64-6.2.2/DEBIAN<br />
# mv TIVsm-BA-6.2.2/debian TIVsm-BA-6.2.2/DEBIAN<br />
# mv gskcrypt32-8.0/debian gskcrypt32-8.0/DEBIAN<br />
# mv gskcrypt64-8.0/debian gskcrypt64-8.0/DEBIAN<br />
# mv gskssl32-8.0/debian gskssl32-8.0/DEBIAN<br />
# mv gskssl64-8.0/debian gskssl64-8.0/DEBIAN</code></p>
<p>5. Make a correct file permissions for debian build script<br />
<code># chmod 755 TIVsm-API-6.2.2/DEBIAN/{postinst,prerm}<br />
# chmod 755 TIVsm-API64-6.2.2/DEBIAN/{postinst,prerm}<br />
# chmod 755 TIVsm-BA-6.2.2/DEBIAN/{postinst,prerm}<br />
# chmod 755 gskcrypt32-8.0/DEBIAN/postinst<br />
# chmod 755 gskcrypt64-8.0/DEBIAN/postinst<br />
# chmod 755 gskssl32-8.0/DEBIAN/{postinst,prerm}<br />
# chmod 755 gskssl64-8.0/DEBIAN/{postinst,prerm}</code></p>
<p>6. Edit control files for each package<br />
<code># vi TIVsm-API-6.2.2/DEBIAN/control<br />
Package: tivsm-api<br />
Version: 6.2.2<br />
Architecture: amd64<br />
Maintainer: Milan Kozak &lt;<a title="hodza@hodza.net" href="mailto:hodza@hodza.net">hodza@hodza.net</a>&gt;<br />
Section: alien<br />
Priority: extra<br />
Description: IBM Tivoli Storage Manager API</code></p>
<p><code># vi TIVsm-API64-6.2.2/DEBIAN/control<br />
Package: tivsm-api64<br />
Version: 6.2.2<br />
Architecture: amd64<br />
Maintainer: Milan Kozak &lt;<a title="hodza@hodza.net" href="mailto:hodza@hodza.net">hodza@hodza.net</a>&gt;<br />
Section: alien<br />
Priority: extra<br />
Description: IBM Tivoli Storage Manager API</code></p>
<p><code># vi TIVsm-BA-6.2.2/DEBIAN/control<br />
Package: tivsm-ba<br />
Version: 6.2.2<br />
Architecture: amd64<br />
Maintainer: Milan Kozak &lt;<a title="hodza@hodza.net" href="mailto:hodza@hodza.net">hodza@hodza.net</a>&gt;<br />
Section: alien<br />
Priority: extra<br />
Description: IBM Tivoli Storage Manager Client</code></p>
<p><code># vi gskcrypt32-8.0/DEBIAN/control<br />
Package: gskcrypt32<br />
Version: 8.0<br />
Architecture: amd64<br />
Maintainer: Milan Kozak &lt;<a title="hodza@hodza.net" href="mailto:hodza@hodza.net">hodza@hodza.net</a>&gt;<br />
Section: alien<br />
Priority: extra<br />
Description: IBM GSKit Cryptography Runtime</code></p>
<p><code># vi gskcrypt64-8.0/DEBIAN/control<br />
Package: gskcrypt64<br />
Version: 8.0.13.4<br />
Architecture: amd64<br />
Maintainer: Milan Kozak &lt;<a title="hodza@hodza.net" href="mailto:hodza@hodza.net">hodza@hodza.net</a>&gt;<br />
Section: alien<br />
Priority: extra<br />
Description: IBM GSKit Cryptography Runtime</code></p>
<p><code># vi gskssl32-8.0/DEBIAN/control<br />
Package: gskssl32<br />
Version: 8.0.13.4<br />
Architecture: amd64<br />
Maintainer: Milan Kozak &lt;<a title="hodza@hodza.net" href="mailto:hodza@hodza.net">hodza@hodza.net</a>&gt;<br />
Section: alien<br />
Priority: extra<br />
Description: IBM GSKit SSL Runtime With Acme Toolkit</code></p>
<p><code># vi gskssl64-8.0/DEBIAN/control<br />
Package: gskssl64<br />
Version: 8.0.13.4<br />
Architecture: amd64<br />
Maintainer: Milan Kozak &lt;<a title="hodza@hodza.net" href="mailto:hodza@hodza.net">hodza@hodza.net</a>&gt;<br />
Section: alien<br />
Priority: extra<br />
Description: IBM GSKit SSL Runtime With Acme Toolkit</code></p>
<p>7. Build deb packages<br />
<code># dpkg -b TIVsm-API-6.2.2<br />
# dpkg -b TIVsm-API64-6.2.2<br />
# dpkg -b TIVsm-BA-6.2.2<br />
# dpkg -b gskcrypt32-8.0<br />
# dpkg -b gskcrypt64-8.0<br />
# dpkg -b gskssl32-8.0<br />
# dpkg -b gskssl64-8.0</code></p>
<p>8. Install all deb packages<br />
<code># dpkg -i TIVsm-API-6.2.2.deb<br />
# dpkg -i TIVsm-API64-6.2.2.deb<br />
# dpkg -i TIVsm-BA-6.2.2.deb<br />
# dpkg -i gskcrypt32-8.0.deb<br />
# dpkg -i gskcrypt64-8.0.deb<br />
# dpkg -i gskssl32-8.0.deb<br />
# dpkg -i gskssl64-8.0.deb</code></p>
<p>9. Create missing symlinks<br />
<code># ln -s /opt/tivoli/tsm/client/api/bin/libgpfs.so /lib32/<br />
# ln -s /opt/tivoli/tsm/client/api/bin/libdmapi.so <a title="/lib32/">/lib32/</a><br />
# ln -s /usr/lib/libgsk8cms.so /lib32/<br />
# ln -s /usr/lib/libgsk8ssl.so /lib32/<br />
# ln -s /usr/lib/libgsk8sys.so /lib32/<br />
# ln -s /usr/lib/libgsk8iccs.so /lib32/</code></p>
<p>10. Test TSM Client<br />
<code># dsmc</code></p>
]]></content:encoded>
			<wfw:commentRss>http://hodza.net/2011/06/15/howto-install-tsm-backup-client-in-debian-squeeze-ubuntu-64bit/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Generování Self-Signed Certifikátu skriptem</title>
		<link>http://hodza.net/2009/06/09/generovani-self-signed-certifikatu-skriptem/</link>
		<comments>http://hodza.net/2009/06/09/generovani-self-signed-certifikatu-skriptem/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 07:23:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Bezpečnost]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scriptíky]]></category>

		<guid isPermaLink="false">http://hodza.net/?p=245</guid>
		<description><![CDATA[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

]]></description>
			<content:encoded><![CDATA[<p>Už mě to nebaví pořád psát, takže:</p>
<p><code>#!/bin/bash<br />
SERVER_NAME=$1<br />
OPENSSL_PATH=/usr/bin/openssl<br />
$OPENSSL_PATH genrsa -des3 -out $SERVER_NAME.key 1024<br />
$OPENSSL_PATH genrsa -out $SERVER_NAME.key 1024<br />
$OPENSSL_PATH rsa -in $SERVER_NAME.key -out $SERVER_NAME.pem<br />
$OPENSSL_PATH req -new -key $SERVER_NAME.pem -out $SERVER_NAME.csr<br />
$OPENSSL_PATH x509 -req -days 365 -in $SERVER_NAME.csr -signkey $SERVER_NAME.pem -out $SERVER_NAME.crt<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://hodza.net/2009/06/09/generovani-self-signed-certifikatu-skriptem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iptables v1.3.6: X Couldn&#8217;t load match `ipp2p&#8217;</title>
		<link>http://hodza.net/2007/09/13/iptables-v136-x-couldnt-load-match-ipp2p/</link>
		<comments>http://hodza.net/2007/09/13/iptables-v136-x-couldnt-load-match-ipp2p/#comments</comments>
		<pubDate>Thu, 13 Sep 2007 07:03:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scriptíky]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://hodza.net/?p=75</guid>
		<description><![CDATA[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í &#8222;iptables v1.3.6: X Couldn&#8217;t load match `ipp2p&#8217;&#8222;? Řešení je jednoduché &#8211; 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 -xzf ipp2p-0.8.2.tar.gz
cd ipp2p-0.8.2
wget [...]]]></description>
			<content:encoded><![CDATA[<p>Také se Vám stalo, že kompilace <a href="http://ipp2p.org/" title="IPP2P HomePage">IPP2P</a> proběhla v pořádku, ale pčesto <a href="http://netfilter.org/projects/iptables/index.html" title="Netfilter HomePage">iptables</a> hlásí při zavádění  modulu chybové hlášení &#8222;<em>iptables v1.3.6: X Couldn&#8217;t load match `ipp2p&#8217;</em>&#8222;? Řešení je jednoduché &#8211; v souboru makefile zaměňte při vytváření knihovny <em>ld</em> za <em>gcc</em>. Celý postup s mým patchem naleznete zde:</p>
<p><code>apt-get install patch<br />
cd /usr/src<br />
wget http://ipp2p.org/downloads/ipp2p-0.8.2.tar.gz<br />
tar -xzf ipp2p-0.8.2.tar.gz<br />
cd ipp2p-0.8.2<br />
wget http://hodza.net/wp-content/files/ipp2p-0.8.2.patch<br />
patch Makefile &lt; ipp2p-0.8.2.patch<br />
make<br />
...</code></p>
]]></content:encoded>
			<wfw:commentRss>http://hodza.net/2007/09/13/iptables-v136-x-couldnt-load-match-ipp2p/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Omezování P2P sítí &#8211; IPP2P &amp; Ubuntu 7.04 (Feisty Fawn)</title>
		<link>http://hodza.net/2007/09/10/omezovani-p2p-siti-ipp2p-ubuntu-704-feisty-fawn/</link>
		<comments>http://hodza.net/2007/09/10/omezovani-p2p-siti-ipp2p-ubuntu-704-feisty-fawn/#comments</comments>
		<pubDate>Mon, 10 Sep 2007 07:49:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Kernel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scriptíky]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hodza.net/?p=74</guid>
		<description><![CDATA[IPP2P patří asi mezi nejlepší (volně dostupné) filtry k omezování P2P sítí. Instalace se dá zvládnout za několik málo chvil a výsledek je velmi uspokojivý.  Předpokladem pro úspěšné sestavení IPP2P je ovšem přítomnost hlavičkových souborů a modul CONNMARK v jádře.
Postup instalace:
1. Nainstalujeme si hlavičkové soubory kernelu a iptables
sudo apt-get install iptables-dev linux-headers-2.6.20-16-server

2. Stáhneme rozšíření [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://ipp2p.org/" title="IPP2P HomePage">IPP2P</a> patří asi mezi nejlepší (volně dostupné) filtry k omezování P2P sítí. Instalace se dá zvládnout za několik málo chvil a výsledek je velmi uspokojivý.  Předpokladem pro úspěšné sestavení <a href="http://ipp2p.org/" title="IPP2P HomePage">IPP2P</a> je ovšem přítomnost hlavičkových souborů a <a href="http://hodza.net/2007/09/10/novy-kernel-ubuntu-704-feisty-fawn/" title="http://hodza.net/2007/09/10/novy-kernel-ubuntu-704-feisty-fawn/">modul CONNMARK v jádře.</a></p>
<p>Postup instalace:<br />
1. Nainstalujeme si hlavičkové soubory kernelu a iptables<br />
<code>sudo apt-get install iptables-dev linux-headers-2.6.20-16-server</code><br />
<span id="more-74"></span><br />
2. Stáhneme rozšíření IPP2P<br />
<code>cd /usr/src<br />
wget http://ipp2p.org/downloads/ipp2p-0.8.2.tar.gz</code></p>
<p>3. Rozbalíme stažený archív<br />
<code>tar -xzf ipp2p-0.8.2.tar.gz<br />
cd ipp2p-0.8.2/</code></p>
<p>Update: <a href="http://hodza.net/2007/09/13/iptables-v136-x-couldnt-load-match-ipp2p/" title="IPP2P iptables problem">aplikujeme patch na Makefile</a></p>
<p>4. Spustíme kompilaci<br />
<code>make</code></p>
<p>5. Nakopírujeme moduly do standardních adresářů<br />
<code>cp libipt_ipp2p.so /lib/iptables<br />
cp ipt_ipp2p.ko /lib/modules/`uname -r`/kernel/net/ipv4</code></p>
<p>6. Vygenerujeme novou mapu závislostí<br />
<code>sudo depmod</code></p>
<p>7. Načteme modul IPP2P do jádra<br />
sudo <code>insmod /lib/modules/`uname -r`/kernel/net/ipv4/ipt_ipp2p.ko</code></p>
<p><strong>Samotné filtrování P2P sítí pak provádím takto:</strong></p>
<p>1. Označkuju si veškeré P2P sítě (UDP pakety mimo CONNMARK!)<br />
<code>iptables -t mangle -A PREROUTING -p tcp -j CONNMARK --restore-mark<br />
iptables -t mangle -A PREROUTING -p tcp -m mark ! --mark 0 -j ACCEPT<br />
iptables -t mangle -A PREROUTING -p tcp -m ipp2p --edk -j MARK --set-mark 1<br />
iptables -t mangle -A PREROUTING -p tcp -m ipp2p --dc -j MARK --set-mark 2<br />
iptables -t mangle -A PREROUTING -p tcp -m ipp2p --gnu -j MARK --set-mark 3<br />
iptables -t mangle -A PREROUTING -p tcp -m ipp2p --kazaa -j MARK --set-mark 4<br />
iptables -t mangle -A PREROUTING -p tcp -m ipp2p --bit -j MARK --set-mark 5<br />
iptables -t mangle -A PREROUTING -p tcp -m ipp2p --apple -j MARK --set-mark 6<br />
iptables -t mangle -A PREROUTING -p tcp -m ipp2p --winmx -j MARK --set-mark 7<br />
iptables -t mangle -A PREROUTING -p tcp -m ipp2p --soul -j MARK --set-mark 8<br />
iptables -t mangle -A PREROUTING -p tcp -m ipp2p --ares -j MARK --set-mark 9<br />
iptables -t mangle -A PREROUTING -p tcp -j CONNMARK --save-mark<br />
iptables -t mangle -A PREROUTING -p udp -m ipp2p --edk -j MARK --set-mark 1<br />
iptables -t mangle -A PREROUTING -p udp -m ipp2p --dc -j MARK --set-mark 2<br />
iptables -t mangle -A PREROUTING -p udp -m ipp2p --gnu -j MARK --set-mark 3<br />
iptables -t mangle -A PREROUTING -p udp -m ipp2p --kazaa -j MARK --set-mark 4<br />
iptables -t mangle -A PREROUTING -p udp -m ipp2p --bit -j MARK --set-mark 5<br />
iptables -t mangle -A PREROUTING -p udp -m ipp2p --apple -j MARK --set-mark 6<br />
iptables -t mangle -A PREROUTING -p udp -m ipp2p --winmx -j MARK --set-mark 7<br />
iptables -t mangle -A PREROUTING -p udp -m ipp2p --soul -j MARK --set-mark 8<br />
iptables -t mangle -A PREROUTING -p udp -m ipp2p --ares -j MARK --set-mark 9</code></p>
<p>2. Ve vhodnou dobu pak například pomocí démona CRON P2P sítě zakazuji<br />
<code>iptables -t mangle -F POSTROUTING<br />
iptables -t mangle -A POSTROUTING -m mark --mark 1 -j DROP<br />
iptables -t mangle -A POSTROUTING -m mark --mark 2 -j DROP<br />
iptables -t mangle -A POSTROUTING -m mark --mark 3 -j DROP<br />
iptables -t mangle -A POSTROUTING -m mark --mark 4 -j DROP<br />
iptables -t mangle -A POSTROUTING -m mark --mark 5 -j DROP<br />
iptables -t mangle -A POSTROUTING -m mark --mark 6 -j DROP<br />
iptables -t mangle -A POSTROUTING -m mark --mark 7 -j DROP<br />
iptables -t mangle -A POSTROUTING -m mark --mark 8 -j DROP<br />
iptables -t mangle -A POSTROUTING -m mark --mark 9 -j DROP</code></p>
<p>nebo naopak povoluji:<br />
<code>iptables -t mangle -F POSTROUTING<br />
iptables -t mangle -A POSTROUTING -m mark --mark 1 -j ACCEPT<br />
iptables -t mangle -A POSTROUTING -m mark --mark 2 -j ACCEPT<br />
iptables -t mangle -A POSTROUTING -m mark --mark 3 -j ACCEPT<br />
iptables -t mangle -A POSTROUTING -m mark --mark 4 -j ACCEPT<br />
iptables -t mangle -A POSTROUTING -m mark --mark 5 -j ACCEPT<br />
iptables -t mangle -A POSTROUTING -m mark --mark 6 -j ACCEPT<br />
iptables -t mangle -A POSTROUTING -m mark --mark 7 -j ACCEPT<br />
iptables -t mangle -A POSTROUTING -m mark --mark 8 -j ACCEPT<br />
iptables -t mangle -A POSTROUTING -m mark --mark 9 -j ACCEPT</code></p>
]]></content:encoded>
			<wfw:commentRss>http://hodza.net/2007/09/10/omezovani-p2p-siti-ipp2p-ubuntu-704-feisty-fawn/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Antispam na pdf a xls soubory</title>
		<link>http://hodza.net/2007/08/10/antispam-na-pdf-a-xls-soubory/</link>
		<comments>http://hodza.net/2007/08/10/antispam-na-pdf-a-xls-soubory/#comments</comments>
		<pubDate>Fri, 10 Aug 2007 07:43:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scriptíky]]></category>
		<category><![CDATA[Služby]]></category>
		<category><![CDATA[Smtp]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://hodza.net/?p=70</guid>
		<description><![CDATA[O PDF spamu jste se mohli dočíst například na stránkách Lupy ve článku Dokumenty PDF, o které nikdo nestojí. Přestože si myslím, že PDF spam nebude mít dlouhou budoucnost, je potřeba s ním bojovat. Už kdysi dávno jsem do svých serverů doinstaloval OCR plugin. Ten doposud funguje poměrně spolehlivě. Je však nutno říct, že kvůli [...]]]></description>
			<content:encoded><![CDATA[<p>O PDF spamu jste se mohli dočíst například na stránkách <a href="http://www.lupa.cz" title="Server o ceskem internetu">Lupy</a> ve článku <a href="http://www.lupa.cz/clanky/spz-2007-spam-pres-pdf/" title="Dokumenty PDF, o které nikdo nestojí">Dokumenty PDF, o které nikdo nestojí.</a> Přestože si myslím, že PDF spam nebude mít dlouhou budoucnost, je potřeba s ním bojovat. Už kdysi dávno jsem do svých serverů doinstaloval OCR plugin. Ten doposud funguje poměrně spolehlivě. Je však nutno říct, že kvůli výkonu se scanuji pouze obrázkové emaily, které prošli SpamAssasinem &#8222;bez ztráty květinky&#8220; <span id="more-70"></span> (to se mi doposud docela dařilo díky sadám pravidel z <a href="http://www.rulesemporium.com/" title="SpamAssassin Rules Emporium">rulesemporium.com</a>). Bohužel spameři jsou neskutečně vynalézaví lidé a tak postupem času zjišťuji, že čím dál tím více obrázkových emailů je nutno prohánět OCR-kem (a zatěžovat tak systém). Naštestí se našlo několik nadšenců, kteří obrázky sbírají a provozují distribuovanou databázi &#8222;spam obrázků&#8220; a jiných &#8222;sraček&#8220;. Instalace je více než triviální:</p>
<p>Nejprve si stáhneme script, který se stará o pravidelný update ClamAVu (a nastavíme mu práva pro spuštění)<br />
<code>cd /usr/bin<br />
wget http://www.sanesecurity.co.uk/clamav/ss-msrbl.sh<br />
chmod +x ss-msrbl.sh</code></p>
<p>V dalším kroku upravíme některé parametry podle systému (u mě například)<br />
<code># vi ss-msrbl.sh<br />
clamscan="/usr/bin/clamdscan"<br />
clam_sigs="/var/clamav"<br />
clam_user="clamav"</code></p>
<p>Na konec script spustíme<br />
<code>./ss-msrbl.sh</code></p>
<p>V případě, že je vše ok (tail /var/log/clamav/clamd.log, tail /var/log/clamav/freshclam.log ), nezbývá nám nic jiného, než celý proces zautomatizovat pomocí cronu.<br />
<code># crontab -e<br />
59 04 * * * /usr/bin/ss-msrbl.sh &amp;&gt; /dev/null<br />
</code></p>
<p>Po týdením sledování můžu konstatovat, že počet obrázků, které prolezli SpamAssassinem, ale nedostali se díky výše uvedenému filtru do OCR je 22,5%, což mi přijde jako docela velké číslo.</p>
]]></content:encoded>
			<wfw:commentRss>http://hodza.net/2007/08/10/antispam-na-pdf-a-xls-soubory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

