<?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></title>
	<atom:link href="http://www.peeweez.net/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.peeweez.net</link>
	<description></description>
	<lastBuildDate>Tue, 31 Aug 2010 10:54:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language></language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>1000 dies a Twitter</title>
		<link>http://www.peeweez.net/index.php/2010/08/1000-dies-a-twitter/</link>
		<comments>http://www.peeweez.net/index.php/2010/08/1000-dies-a-twitter/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 07:08:21 +0000</pubDate>
		<dc:creator>Josep A. Pavón</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.peeweez.net/?p=8449</guid>
		<description><![CDATA[Avui fa 1000 dies que em vaig donar d&#8217;alta a Twitter:

]]></description>
			<content:encoded><![CDATA[<p>Avui fa 1000 dies que em vaig donar d&#8217;alta a Twitter:</p>
<p><center><a href="http://www.peeweez.net/wp-content/uploads/2010/08/1000_dies_twitter.jpg"><img src="http://www.peeweez.net/wp-content/uploads/2010/08/1000_dies_twitter.jpg" alt="" title="1000_dies_twitter" width="300" height="218" class="alignnone size-medium wp-image-8459" /></a></center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeweez.net/index.php/2010/08/1000-dies-a-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Real life in one hundred and fourty characters&#8230;</title>
		<link>http://www.peeweez.net/index.php/2010/07/real-life-in-one-hundred-and-fourty-characters/</link>
		<comments>http://www.peeweez.net/index.php/2010/07/real-life-in-one-hundred-and-fourty-characters/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 07:21:43 +0000</pubDate>
		<dc:creator>Josep A. Pavón</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.peeweez.net/?p=8079</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><center><object width="440" height="385"><param name="movie" value="http://www.youtube.com/v/ezkxxpwPvic&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ezkxxpwPvic&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="440" height="385"></embed></object></center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeweez.net/index.php/2010/07/real-life-in-one-hundred-and-fourty-characters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How do I close a listening port in Unix/Linux?</title>
		<link>http://www.peeweez.net/index.php/2010/07/how-do-i-close-a-listening-port-in-unixlinux/</link>
		<comments>http://www.peeweez.net/index.php/2010/07/how-do-i-close-a-listening-port-in-unixlinux/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 11:46:10 +0000</pubDate>
		<dc:creator>Josep A. Pavón</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.peeweez.net/?p=6368</guid>
		<description><![CDATA[Llistem els ports amb la comanda:
lsof &#124; grep 20931
Obtenim més info de l&#8217;aplicació que està ocupant el port:
lsof -i tcp:20931
Fem un ps per tenir més informació del procés:
ps -ef &#124;grep 20931
Finalment matem el procés amb:
kill -9

]]></description>
			<content:encoded><![CDATA[<p>Llistem els ports amb la comanda:<br />
<code>lsof | grep 20931</code></p>
<p>Obtenim més info de l&#8217;aplicació que està ocupant el port:<br />
<code>lsof -i tcp:20931</code></p>
<p>Fem un ps per tenir més informació del procés:<br />
<code>ps -ef |grep 20931</code></p>
<p>Finalment matem el procés amb:<br />
<code>kill -9
<pid></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeweez.net/index.php/2010/07/how-do-i-close-a-listening-port-in-unixlinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conversió de format de fitxers entre Unix i Windows amb SED (i viceversa)</title>
		<link>http://www.peeweez.net/index.php/2010/06/conversio-de-format-de-fitxers-entre-unix-i-windows-amb-sed-i-viceversa/</link>
		<comments>http://www.peeweez.net/index.php/2010/06/conversio-de-format-de-fitxers-entre-unix-i-windows-amb-sed-i-viceversa/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 07:24:23 +0000</pubDate>
		<dc:creator>Josep A. Pavón</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.peeweez.net/?p=1823</guid>
		<description><![CDATA[Conversió de format entre Unix i Windows:
sed -e 's/$/\r/' unix.txt > dos.txt
Conversió de format entre Windows i Unix:
sed -e 's/.$//' dos.txt > unix.txt
El segon exemple és el que faré servir més sovint&#8230;
Aquesta comanda fa el mateix que les aplicacions dos2unix i unix2dos que estan disponibles en Linux/Unix
]]></description>
			<content:encoded><![CDATA[<p>Conversió de format entre Unix i Windows:<br />
<code>sed -e 's/$/\r/' unix.txt > dos.txt</code></p>
<p>Conversió de format entre Windows i Unix:<br />
<code>sed -e 's/.$//' dos.txt > unix.txt</code></p>
<p>El segon exemple és el que faré servir més sovint&#8230;</p>
<p>Aquesta comanda fa el mateix que les aplicacions dos2unix i unix2dos que estan disponibles en Linux/Unix</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeweez.net/index.php/2010/06/conversio-de-format-de-fitxers-entre-unix-i-windows-amb-sed-i-viceversa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configurar un servidor Linux per enviar mails</title>
		<link>http://www.peeweez.net/index.php/2010/03/configurar-un-servidor-linux-per-enviar-mails/</link>
		<comments>http://www.peeweez.net/index.php/2010/03/configurar-un-servidor-linux-per-enviar-mails/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 15:46:43 +0000</pubDate>
		<dc:creator>Josep A. Pavón</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.peeweez.net/?p=117</guid>
		<description><![CDATA[1.- Editar el fitxer /etc/mail/sendmail.cf i afegir el servidor smtp sota la linia següent:
     # "Smart" relay host (may be null)
     DSsmtp.local
2.- Reiniciar el servei sendmail !!!
service sendmail restart
o be
/etc/init.d/sendmail restart
3.- Enviar el mail
Exemple de script que envia un mail:
#!/bin/bash
SUBJECT="Aquí­ va el subject"
EMAIL=$(cat /home/peewee/mails) # aquest és [...]]]></description>
			<content:encoded><![CDATA[<p><strong>1.-</strong> Editar el fitxer /etc/mail/sendmail.cf i afegir el servidor smtp sota la linia següent:<br />
<code>     # "Smart" relay host (may be null)<br />
     DSsmtp.local</code></p>
<p><strong>2.-</strong> Reiniciar el servei sendmail !!!<br />
<code>service sendmail restart</code><br />
o be<br />
<code>/etc/init.d/sendmail restart</code></p>
<p><strong>3.-</strong> Enviar el mail<br />
Exemple de script que envia un mail:</p>
<p><code>#!/bin/bash<br />
SUBJECT="Aquí­ va el subject"<br />
EMAIL=$(cat /home/peewee/mails) # aquest és el fitxer que té el llistat d'adreces<br />
COS=$(find /home/peewee/logs/ -type f -mmin -60) # són els fitxers modificats l'última hora<br />
ADJUNT=$(/home/peewee/foto.jpg) # aquest és el fitxer adjunt que s'enviarà <br />
/bin/mail -s "$SUBJECT" $EMAIL < $COS<br />
/usr/bin/mutt -s "$SUBJECT" $EMAIL -a $ADJUNT < $COS</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeweez.net/index.php/2010/03/configurar-un-servidor-linux-per-enviar-mails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Editar 2 fitxers al mateix temps amb l&#8217;editor vi</title>
		<link>http://www.peeweez.net/index.php/2009/11/editar-2-fitxers-al-mateix-temps-amb-leditor-vi/</link>
		<comments>http://www.peeweez.net/index.php/2009/11/editar-2-fitxers-al-mateix-temps-amb-leditor-vi/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 07:36:04 +0000</pubDate>
		<dc:creator>Josep A. Pavón</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.peeweez.net/?p=115</guid>
		<description><![CDATA[Per obrir 2 fitxers amb el VI:
[BASH]#vi -o fixer1 fixer2
Si es vol veure la pantalla en vertical s&#8217;ha de canviar el paràmetre de -o minúscula per -O MAJÚSCULA
Per cambiar de finestra teclejar: Ctrl + w + w 
]]></description>
			<content:encoded><![CDATA[<p>Per obrir 2 fitxers amb el VI:<br />
[BASH]#vi -o fixer1 fixer2</p>
<p>Si es vol veure la pantalla en vertical s&#8217;ha de canviar el paràmetre de -o minúscula per -O MAJÚSCULA</p>
<p>Per cambiar de finestra teclejar: Ctrl + w + w </p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeweez.net/index.php/2009/11/editar-2-fitxers-al-mateix-temps-amb-leditor-vi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Limitar CPU procés Linux</title>
		<link>http://www.peeweez.net/index.php/2009/07/limitar-cpu-proces-linux/</link>
		<comments>http://www.peeweez.net/index.php/2009/07/limitar-cpu-proces-linux/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 06:42:06 +0000</pubDate>
		<dc:creator>Josep A. Pavón</dc:creator>
				<category><![CDATA[Xuletes]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.peeweez.net/blog/?p=31</guid>
		<description><![CDATA[Instalar cpulimit: http://cpulimit.sourceforge.net/, es pot limitar una determinada aplicació en execució, pel nom o bé pel ID del procés:
[BASH]# cpulimit -e firefox -l 30
Amb la comanda anterior no deixarem que el Firefox gasti més d&#8217;un 30% de l&#8217;us de la CPU.
[BASH]# cpulimit -p 3493 -l 40
Podem fer el mateix introduint el ID del procés.
]]></description>
			<content:encoded><![CDATA[<p>Instalar cpulimit: <a href="http://cpulimit.sourceforge.net/">http://cpulimit.sourceforge.net/</a>, es pot limitar una determinada aplicació en execució, pel nom o bé pel ID del procés:</p>
<p>[BASH]# cpulimit -e firefox -l 30</p>
<p>Amb la comanda anterior no deixarem que el Firefox gasti més d&#8217;un 30% de l&#8217;us de la CPU.</p>
<p>[BASH]# cpulimit -p 3493 -l 40</p>
<p>Podem fer el mateix introduint el ID del procés.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeweez.net/index.php/2009/07/limitar-cpu-proces-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>configurar interfície de xarxa</title>
		<link>http://www.peeweez.net/index.php/2009/05/configurar-interficie-de-xarxa/</link>
		<comments>http://www.peeweez.net/index.php/2009/05/configurar-interficie-de-xarxa/#comments</comments>
		<pubDate>Fri, 22 May 2009 11:54:01 +0000</pubDate>
		<dc:creator>Josep A. Pavón</dc:creator>
				<category><![CDATA[Xuletes]]></category>

		<guid isPermaLink="false">http://www.peeweez.net/blog/?p=27</guid>
		<description><![CDATA[ethtool -s eth0 speed 100 duplex full autoneg off
speed 10/100/1000
duplex half/full
autoneg on/off
]]></description>
			<content:encoded><![CDATA[<p>ethtool -s eth0 speed 100 duplex full autoneg off</p>
<p>speed 10/100/1000</p>
<p>duplex half/full</p>
<p>autoneg on/off</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeweez.net/index.php/2009/05/configurar-interficie-de-xarxa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accés SSH entre servidors</title>
		<link>http://www.peeweez.net/index.php/2009/05/acces-ssh-entre-servidors/</link>
		<comments>http://www.peeweez.net/index.php/2009/05/acces-ssh-entre-servidors/#comments</comments>
		<pubDate>Tue, 05 May 2009 14:35:51 +0000</pubDate>
		<dc:creator>Josep A. Pavón</dc:creator>
				<category><![CDATA[Xuletes]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.peeweez.net/blog/?p=20</guid>
		<description><![CDATA[Aquesta setmana he après a fer un accés SSH amb autentificació per claus entre varis servidors Linux, en anglès seria SSH Key Authentication. Bàsicament serveix per connectar-se via Secure Shell sense tenir que posar cap password. Útil si tenim algun script que intercanvii alguna mena d&#8217;informació o dades entre 2 servidors linux. A continuació explico [...]]]></description>
			<content:encoded><![CDATA[<p>Aquesta setmana he après a fer un accés SSH amb autentificació per claus entre varis servidors Linux, en anglès seria SSH Key Authentication. Bàsicament serveix per connectar-se via Secure Shell sense tenir que posar cap password. Útil si tenim algun script que intercanvii alguna mena d&#8217;informació o dades entre 2 servidors linux. A continuació explico els passos que he seguit:</p>
<p>Suposem que els servidors implicats es diuen &#8217;srv_origen&#8217; i &#8217;srv_desti&#8217;</p>
<p>on</p>
<p>&#8217;srv_origen&#8217;Â  = el servidor des d&#8217;on pujem la informació o les dades.</p>
<p>&#8217;srv_desti&#8217;= el servidor a on ens connectem per rebre la informació o les dades.</p>
<p>1) En primer lloc cal assegurar-se que &#8217;srv_desti&#8217; tingui activada la authentificació per claus (key authentication enabled)</p>
<p>Editar el fitxer de configuració del servidor ssh (sshd),  /etc/ssh/sshd_config, buscar les següents linies i les descomentar-les:</p>
<p>RSAAuthentication yes<br />
PubkeyAuthentication yes<br />
AuthorizedKeysFile .ssh/authorized_keys</p>
<p>Un cop fet, recordar de reiniciar el servidor: /etc/init.d/sshd restart</p>
<p>2) A continuació, al servidor &#8217;srv_origen&#8217; cal crear el parell de claus publica/privada que s&#8217;utilitzaran per fer l&#8217;autentificació:</p>
<p>ssh-keygen -t rsa</p>
<p>No cal posar cap password quan pregunti.</p>
<p>La comanda anterior crea 2 fitxers, una clau pública (public key) i una clau privada (private key)</p>
<p>Els fitxers es crean al [homedir] de l&#8217;usuari que ha executat la comanda:</p>
<p>La clau pública:  [homedir]/.ssh/id_rsa.pub</p>
<p>La clau privada: [homedir]/.ssh/id_rsa</p>
<p>3) Ara cal configurar el &#8217;srv_desti&#8217; per tal que accepti les connexions que provenen del &#8217;srv_origen&#8217;</p>
<p>Triem l&#8217;usuari amb el qual ens volem connectar al &#8217;srv_desti&#8217;, per exemple &#8216;usr_desti</p>
<p>Al [homedir] d&#8217;aquest usuari cal crear un directori ocult anomenat .ssh (mkdir .ssh), modifiquem els permisos per que siguin 700 (chmod 700 .ssh)</p>
<p>Dins d&#8217;aquest directory creem un nou fitxer que es digui authorized_keys i copiem el contingut de la clau pública que s&#8217;acaba de crear al &#8217;srv_origen&#8217;, un cop fet guardem els canvis i modifiquem els permisos a 600 (chmod 600 authorized_keys)</p>
<p>Ull al copiar el contingut de id_rsa.pub a authorized_keys, no hi ha d&#8217;haver cap salt de línia !!</p>
<p>4) Finalment només queda provar la connexió:</p>
<p>Des del &#8217;srv_origen&#8217; i amb l&#8217;usuari que s&#8217;ha creat el parell de claus cal escriure el següent:</p>
<p>ssh usr_desti@srv_desti</p>
<p>Si tot funciona correctament no hauria de demanar cap password i tampoc s&#8217;hauria de tancar la connexió inmediatament.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeweez.net/index.php/2009/05/acces-ssh-entre-servidors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>300.000Km !!</title>
		<link>http://www.peeweez.net/index.php/2009/04/estreno-blog-i-estreno-el-quilometre-300000-del-meu-cotxe/</link>
		<comments>http://www.peeweez.net/index.php/2009/04/estreno-blog-i-estreno-el-quilometre-300000-del-meu-cotxe/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 11:49:15 +0000</pubDate>
		<dc:creator>Josep A. Pavón</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.peeweez.net/blog/?p=18</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><object width="425" height="344" data="http://www.youtube.com/v/LU6DcEmO65k&amp;hl=es&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/LU6DcEmO65k&amp;hl=es&amp;fs=1" /><param name="allowfullscreen" value="true" /></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeweez.net/index.php/2009/04/estreno-blog-i-estreno-el-quilometre-300000-del-meu-cotxe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
