<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Phar0z&#039;s Blog</title>
	<atom:link href="http://phar0z.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://phar0z.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Thu, 14 Jul 2011 10:55:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='phar0z.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Phar0z&#039;s Blog</title>
		<link>http://phar0z.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://phar0z.wordpress.com/osd.xml" title="Phar0z&#039;s Blog" />
	<atom:link rel='hub' href='http://phar0z.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Creating a wireless access point on Arch Linux</title>
		<link>http://phar0z.wordpress.com/2009/09/14/creating-a-wireless-access-point-on-arch-linux/</link>
		<comments>http://phar0z.wordpress.com/2009/09/14/creating-a-wireless-access-point-on-arch-linux/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 14:48:16 +0000</pubDate>
		<dc:creator>phar0z</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://phar0z.wordpress.com/?p=46</guid>
		<description><![CDATA[I&#8217;ve wanted my Linux server (Arch Linux 2.6.30-ARCH) to act as a wireless access point. I had to overcome a few issues while configuring the access point. I will be using WEP as encryption for my new wireless access point. I had to install a few packages before I could start: pacman -S bridge-utils hostapd [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phar0z.wordpress.com&amp;blog=9304927&amp;post=46&amp;subd=phar0z&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve wanted my Linux server (Arch Linux 2.6.30-ARCH) to act as a wireless access point. I had to overcome a few issues while configuring the access point. I will be using WEP as encryption for my new wireless access point.</p>
<p>I had to install a few packages before I could start:</p>
<p><code>pacman -S bridge-utils hostapd wireless-tools</code></p>
<p>Here you can see my NIC and my wireless pci card:</p>
<p><code>4 root@archserver $ lspci | grep Ethernet<br />
00:08.0 Ethernet controller: Atheros Communications Inc. Atheros AR5001X+ Wireless Network Adapter (rev 01)<br />
00:09.0 Ethernet controller: D-Link System Inc DGE-528T Gigabit Ethernet Adapter (rev 10)</code></p>
<p>Arch Linux comes with the <strong>ath5k</strong> module for this wireless card, unfortunately I wasn&#8217;t able to put my wlan0 into <strong>Master Mode</strong> with this module.</p>
<p>I needed the <strong>ath_pci</strong> module, which is delivered by madwifi. So I&#8217;ve executed:<br />
<code>pacman -S madwifi</code></p>
<p>So in order to put my wireless into Master mode I&#8217;ve commited a few necessary changes.<br />
First of all, I had to blacklist the default ath5k module. You can do this by modifying your <strong>/etc/rc.conf</strong> file.<br />
Change the MODULES array of your rc.conf, and make sure an note of exclamation is present before ath5k. This module has been blacklisted now.</p>
<p><code>16 root@archserver $ cat /etc/rc.conf | grep MODULES<br />
# MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.<br />
# NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.<br />
MODULES=(!ath5k)</code></p>
<p>Then I&#8217;ve inserted the new module who supports Master Mode into the Linux kernel. Executing <code>iwconfig ath0 mode Master</code> did not give any error.</p>
<p><code>modprobe ath_pci</code><br />
<code>iwconfig ath0 mode Master</code></p>
<p>Now you have to modify <strong>/etc/modprobe.d/modprobe.conf</strong> in order to use ath_pci with the ap option (for access point).</p>
<p><code>alias ath0 hostap_pci<br />
options ath_pci autocreate=ap</code></p>
<p>After that I had to modify <strong>/etc/rc.conf</strong>, Arch Linux its main configuration file.  I&#8217;m using dhcp for eth0. The interfaces array declares all the available interfaces. (deuh!) The bridge device is named br0, and it will be a bridge between eth0 (wired) and ath0. (wireless)</p>
<p><code>lo="lo 127.0.0.1"<br />
eth0="dhcp"<br />
br0="br0 192.168.0.101 netmask 255.255.255.0 up"<br />
INTERFACES=(lo eth0 ath0 br0)</code></p>
<p>Changing <strong>/etc/conf.d/wireless</strong> or <strong>/etc/conf.d/bridges</strong> gave me some trouble, I&#8217;ve decided to edit<strong> /etc/rc.local</strong> (the multi-user start-up script.) This is my <strong>/etc/rc.local</strong>:</p>
<p><code>29 root@archserver $ cat /etc/rc.local<br />
#!/bin/bash<br />
#<br />
# /etc/rc.local: Local multi-user startup script.<br />
modprobe hostap_pci<br />
iwconfig ath0 mode master essid phar0z key A1B3C5D7E0 channel 1<br />
brctl addbr br0<br />
brctl addif br0 ath0<br />
brctl addif br0 eth0<br />
ifconfig br0 up<br />
dhclient br0<br />
dhclient eth0<br />
/etc/rc.d/sshd restart</code></p>
<p>You may have noticed I prefer dhclient above dhcpcd. </p>
<p><code>pacman -R dhcpcd &amp;&amp; pacman -S dhclient</code></p>
<p>I noticed there wasn&#8217;t a good Arch-oriented access point guide on the net. As you can see this configuration worked fine for me:</p>
<p><code>30 root@archserver $ brctl show br0<br />
bridge name     bridge id               STP enabled     interfaces<br />
br0             8000.00179a76b010       no              ath0<br />
 &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;  &nbsp;   &nbsp; eth0</code></p>
<p>Now I will scan for wireless essids on my Ubuntu laptop. I execute <code>iwlist wlan0</code> scan on my notebook:</p>
<p><code>wlan0     Scan completed :<br />
          Cell 01 - Address: 00:15:E9:F5:62:58<br />
                    Channel:1<br />
                    Frequency:2.412 GHz (Channel 1)<br />
                    Quality=47/70  Signal level=-63 dBm<br />
                    Encryption key:on<br />
                    ESSID:"dlink"<br />
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s<br />
                              12 Mb/s; 24 Mb/s; 36 Mb/s<br />
                    Bit Rates:9 Mb/s; 18 Mb/s; 48 Mb/s; 54 Mb/s<br />
                    Mode:Master<br />
                    Extra:tsf=000002936e5e2181<br />
                    Extra: Last beacon: 4300ms ago<br />
                    IE: Unknown: 0005646C696E6B<br />
                    IE: Unknown: 010882848B960C183048<br />
                    IE: Unknown: 030101<br />
                    IE: Unknown: DD0600032F010001<br />
                    IE: Unknown: 2A0100<br />
                    IE: Unknown: 32041224606C<br />
                    IE: Unknown: DD0900037F010100060000<br />
                    IE: Unknown: DD0C00037F020101DB0002A44000</code></p>
<p>          <code>Cell 02 - Address: 00:17:9A:76:B0:10<br />
                    Channel:6<br />
                    Frequency:2.437 GHz (Channel 6)<br />
                    Quality=70/70  Signal level=-27 dBm<br />
                    Encryption key:on<br />
                    ESSID:"phar0z"<br />
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s<br />
                              11 Mb/s; 12 Mb/s; 18 Mb/s<br />
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s<br />
                    Mode:Master<br />
                    Extra:tsf=00000003c300c12a<br />
                    Extra: Last beacon: 4040ms ago<br />
                    IE: Unknown: 000670686172307A<br />
                    IE: Unknown: 010882848B0C12961824<br />
                    IE: Unknown: 030106<br />
                    IE: Unknown: 07064E4149010D14<br />
                    IE: Unknown: 200100<br />
                    IE: Unknown: 2A0100<br />
                    IE: Unknown: 32043048606C<br />
                    IE: Unknown: DD180050F2020101830002A3400027A4000042435E0062322F00<br />
                    IE: Unknown: DD0900037F01010034FF7F</code></p>
<p>&#8220;dlink&#8221; is the essid of my router, whereas &#8220;phar0z&#8221; is the essid of my own software access point on my server.</p>
<p>I&#8217;ve changed my <strong>/etc/network/interfaces</strong> file on my Linux laptop.</p>
<p><code>auto lo<br />
iface lo inet loopback</code></p>
<p><code># wireless<br />
iface wlan0 inet dhcp<br />
gateway 192.168.0.1<br />
netmask 255.255.255.0<br />
network 192.168.0.0<br />
broadcast 192.168.0.255<br />
wireless_essid phar0z<br />
wireless_key A1B3C5D7E0<br />
auto wlan0</code></p>
<p>Then I ran <code>/etc/init.d/networking</code> restart. And this is the new output of <code>iwconfig wlan0</code></p>
<p><code>wlan0     IEEE 802.11abgn  ESSID:"phar0z"<br />
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:17:9A:76:B0:10<br />
          Bit Rate=24 Mb/s   Tx-Power=15 dBm<br />
          Retry min limit:7   RTS thr:off   Fragment thr:off<br />
          Encryption key:A1B3-C5D7-E0   Security mode:open<br />
          Power Management:off<br />
          Link Quality=62/70  Signal level=-26 dBm  Noise level=-127 dBm<br />
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0<br />
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0</code></p>
<p>Everything is working fine.</p>
<p>phar0z</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phar0z.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phar0z.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phar0z.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phar0z.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phar0z.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phar0z.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phar0z.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phar0z.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phar0z.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phar0z.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phar0z.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phar0z.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phar0z.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phar0z.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phar0z.wordpress.com&amp;blog=9304927&amp;post=46&amp;subd=phar0z&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phar0z.wordpress.com/2009/09/14/creating-a-wireless-access-point-on-arch-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5690a1642d53b4f1b6b263beee4ac319?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phar0z</media:title>
		</media:content>
	</item>
		<item>
		<title>Desktop migration to Arch Linux</title>
		<link>http://phar0z.wordpress.com/2009/09/03/desktop-migration-to-arch-linux/</link>
		<comments>http://phar0z.wordpress.com/2009/09/03/desktop-migration-to-arch-linux/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 22:20:29 +0000</pubDate>
		<dc:creator>phar0z</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://phar0z.wordpress.com/?p=37</guid>
		<description><![CDATA[I&#8217;ve installed Arch Linux on my desktop. I really like its philosophy and the high level of configurability. After the installation was complete I&#8217;ve extended my base system with xorg and kde. This was very easy with a package manager like pacman. I just executed pacman -S xorg kde.Though everything seemed to work I&#8217;ve noticed [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phar0z.wordpress.com&amp;blog=9304927&amp;post=37&amp;subd=phar0z&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve installed <a href="http://www.archlinux.org">Arch Linux</a> on my desktop. I really like its philosophy and the high level of configurability. After the installation was complete I&#8217;ve extended my base system with xorg and kde. This was very easy with a package manager like pacman. I just executed <strong>pacman -S xorg kde</strong>.Though everything seemed to work I&#8217;ve noticed my X-server wasn&#8217;t able to handle input from my keyboard or mouse.</p>
<p> I have an nvidia 7600 graphics card and I&#8217;ve created my xorg.conf with nvidia-xconfig. Shit, still not any kind of input while the X-server shows up. Building a new xorg.conf with Xorg -configure gives the same result. I was in trouble, but then &#8220;let&#8217;s try HAL&#8221; (=hardware abstraction layer) came into my mind.</p>
<p>I&#8217;ve already mentioned the level of high configurability on Arch Linux. It works with a main configuration file, called rc.conf in the /etc directory. I simply added hal to my DAEMONS array.</p>
<p><code>6 root@archlinux $ cat /etc/rc.conf | grep DAEMONS<br />
# DAEMONS<br />
DAEMONS=(syslog-ng network netfs cron hal alsa kdm)</code></p>
<p>And I&#8217;ve deciced to combine this with a minimalistic xorg.conf file. Here you can see my /etc/X11/xorg.conf</p>
<p><code>Section "Device"<br />
    Identifier     "Device0"<br />
    Driver         "nvidia"<br />
    VendorName     "NVIDIA Corporation"<br />
EndSection</code></p>
<p><code>Section "Screen"<br />
    Identifier     "Screen0"<br />
    Device         "Device0"<br />
    Monitor        "Monitor0"<br />
    DefaultDepth    24<br />
    SubSection     "Display"<br />
        Depth       24<br />
        Modes "1280x1024"<br />
    EndSubSection<br />
    EndSection</code></p>
<p>Arch Linux is a great Linux distro. I like its philosophy, its principles, pacman (package management), ABS (Arch Build System) &#8230;<br />
Whereas my desktop is running Arch, I&#8217;m still running Ubuntu on my notebook. Variation is nice.  Oh yeah, I&#8217;m thinking about moving my server to Arch Linux as well.</p>
<p>phar0z</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phar0z.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phar0z.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phar0z.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phar0z.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phar0z.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phar0z.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phar0z.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phar0z.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phar0z.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phar0z.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phar0z.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phar0z.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phar0z.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phar0z.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phar0z.wordpress.com&amp;blog=9304927&amp;post=37&amp;subd=phar0z&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phar0z.wordpress.com/2009/09/03/desktop-migration-to-arch-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5690a1642d53b4f1b6b263beee4ac319?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phar0z</media:title>
		</media:content>
	</item>
		<item>
		<title>Bash script to send attachments with attachments through command line</title>
		<link>http://phar0z.wordpress.com/2009/09/03/bash-script-to-send-attachments-with-attachments-through-command-line/</link>
		<comments>http://phar0z.wordpress.com/2009/09/03/bash-script-to-send-attachments-with-attachments-through-command-line/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 14:52:20 +0000</pubDate>
		<dc:creator>phar0z</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://phar0z.wordpress.com/?p=29</guid>
		<description><![CDATA[I&#8217;ve created a simple script in Bash which can send e-mails with attachment through commandline. You need &#8220;mutt&#8221; and a working mail system in order to get this working. You need to create a textfile named mailmessage.txt in your home map that includes the text of the mail. mailer.sh: #!/bin/bash ONDERWERP="With an important attachment" echo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phar0z.wordpress.com&amp;blog=9304927&amp;post=29&amp;subd=phar0z&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve created a simple script in Bash which can send e-mails with attachment through commandline. You need &#8220;mutt&#8221; and a working mail system in order to get this working. You need to create a textfile named mailmessage.txt in your home map that includes the text of the mail.</p>
<p>mailer.sh:</p>
<p><code>#!/bin/bash<br />
ONDERWERP="With an important attachment"<br />
echo "What's the e-mail of the recipient"<br />
read EMAILADRES<br />
echo "Locate the attachment:"<br />
read ATTACHMENT<br />
mutt -s $ONDERWERP -a $ATTACHMENT $EMAILADRES &lt; /home/$USER/mailmessage.txt</code></p>
<p>I&#39;m using postfix as Mail Tranfer agent. You will notice I&#39;m using Telenet as a relayhost. This is my /etc/postfix/main.cf</p>
<p><code>smtpd_banner = $myhostname ESMTP $mail_name (Postfix &amp; GNU/Linux up and running)<br />
biff = no.<br />
append_dot_mydomain = no<br />
# TLS parameters<br />
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt<br />
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key<br />
smtpd_use_tls = yes<br />
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache<br />
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache </code>    </p>
<p><code>myhostname = ubuntux<br />
mydomain = phar0zlinux.net<br />
alias_maps = hash:/etc/aliases<br />
alias_database = hash:/etc/aliases<br />
mydestination = phar0zlinux.net, localhost, localhost.phar0zlinux.net, localhost<br />
relayhost = uit.telenet.be<br />
mynetworks = 127.0.0.0/8, 192.168.0.*,<br />
mailbox_command = procmail -a &quot;$EXTENSION&quot;<br />
mailbox_size_limit = 0<br />
recipient_delimiter = +<br />
inet_interfaces = all<br />
myorigin = localhost<br />
inet_protocols = all<br />
smtpd_sasl_local_domain =<br />
smtpd_sasl_auth_enable = yes<br />
smtpd_sasl_security_options = noanonymous<br />
broken_sasl_auth_clients = yes<br />
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination<br />
smtpd_tls_auth_only = no<br />
smtp_use_tls = yes<br />
smtp_tls_note_starttls_offer = yes<br />
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem<br />
smtpd_tls_loglevel = 1<br />
smtpd_tls_received_header = yes<br />
smtpd_tls_session_cache_timeout = 3600s<br />
tls_random_source = dev:/dev/urandom<br />
home_mailbox = Maildir/</code></p>
<p>phar0z</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phar0z.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phar0z.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phar0z.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phar0z.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phar0z.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phar0z.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phar0z.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phar0z.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phar0z.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phar0z.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phar0z.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phar0z.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phar0z.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phar0z.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phar0z.wordpress.com&amp;blog=9304927&amp;post=29&amp;subd=phar0z&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phar0z.wordpress.com/2009/09/03/bash-script-to-send-attachments-with-attachments-through-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5690a1642d53b4f1b6b263beee4ac319?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phar0z</media:title>
		</media:content>
	</item>
		<item>
		<title>ath5k  + Jaunty + Compat-wireless + self-compiled kernel.</title>
		<link>http://phar0z.wordpress.com/2009/09/03/how-to-get-ath5k-working-on-jaunty-with-compat-wireless-and-a-self-compiled-kernel/</link>
		<comments>http://phar0z.wordpress.com/2009/09/03/how-to-get-ath5k-working-on-jaunty-with-compat-wireless-and-a-self-compiled-kernel/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 09:12:41 +0000</pubDate>
		<dc:creator>phar0z</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://phar0z.wordpress.com/?p=15</guid>
		<description><![CDATA[How to get ath5k working on Jaunty with Compat-wireless and a self-compiled kernel I used to have some trouble while setting up my Atheros PCI card on Ubuntu Linux 9.04. It worked natively on Ubuntu 8.04, where it was detected as ath0. I upgraded from 8.04 to 8.10 whereby I noticed my wireless PCI card [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phar0z.wordpress.com&amp;blog=9304927&amp;post=15&amp;subd=phar0z&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>How to get ath5k working on Jaunty with Compat-wireless and a self-compiled kernel</strong></p>
<p>I used to have some trouble while setting up my Atheros PCI card on Ubuntu Linux 9.04. It worked natively on Ubuntu 8.04, where it was detected as ath0. I upgraded from 8.04 to 8.10 whereby I noticed my wireless PCI card didn’t work natively anymore. Someone suggested me to upgrade from 8.10 to 9.04 Jaunty, and I did that immediately. After the system upgrade I noticed again that my wireless device was gone in Ubuntu 9.04. When I ran iwconfig I didn’t see wlan0 or ath0 anymore.<br />
Here you can see some details of my PCI card:</p>
<p>7 root@linux $ <strong>lspci | grep Atheros</strong><br />
04:00.0 Ethernet controller: Atheros Communications Inc. AR242x 802.11abg Wireless PCI Express Adapter (rev 01)</p>
<p>Now I’ll confirm that I’m running Ubuntu 9.04 Jaunty:</p>
<p>8 root@linux $ <strong>lsb_release -a</strong><br />
No LSB modules are available.<br />
Distributor ID: Ubuntu<br />
Description: Ubuntu 9.04<br />
Release: 9.04<br />
Codename: jaunty</p>
<p>In the beginning I only saw the following on Jaunty. Here you can see that a wireless device doesn’t show up.</p>
<p>24 root@linux $ <strong>iwconfig</strong><br />
lo no wireless extensions<br />
eth0 no wireless extensions<br />
pan0 no wireless extensions<br />
wmaster0 no wireless extensions.</p>
<p>I’ve tried stuff like madwifi, ndiswrapper and previous modules like ath_pci . None of them was able to fix my problem, the wireless device was still missing.</p>
<p>Then I’ve heard that I need the ath5k FOSS Linux Wireless driver, something that is provided by the compat-wireless package<strong>.</strong></p>
<p>I downloaded a compat-wireless tarball from orbit-lab.org but I was unable to get it working. While compiling I received several errors, one of these errors reported something like “You need to have mac 08211 enabled in your kernel …”. After trying different versions of the compat-wireless tarball on the Ubuntu Generic kernel I realized that it was impossible to compile this on a default Ubuntu generic kernel.</p>
<p>So you have to compile your own kernel. While I’m writing this tutorial I see that 2.6.29.3 is the latest version of the Linux kernel. Keep in mind that this version might be old now, so is the wget link. Start a konsole/terminal and enter this as root:</p>
<p><strong>cd /usr/src<br />
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.29.3.tar.bz2<br />
tar xjf linux-2.6.29.3.tar.bz<br />
ln -s linux-2.6.21.3 linux<br />
cd linux<br />
make clean &amp;&amp; make mrproper</strong><br />
<strong>cp /boot/config-`uname -r` ./.config</strong></p>
<p>You must first enable mac80211 in order to enable ath5k!</p>
<p>Now as root, run: (You still have to be in /usr/src/linux)</p>
<p><strong>make menuconfig</strong></p>
<p>You can eventually load your alternate configuration file, but this isn’t compulsory. Now you have to commit some very important changes. Use your arrow keys to navigate:</p>
<p>Networking  —&gt;<br />
Wireless  —&gt;<br />
Improved wireless configuration API<br />
M Generic IEEE 802.11 Networking Stack (mac80211)<br />
Make sure that you see the “M”  like above. Now you’ve enabled mac80211.</p>
<p>Now you can enable ath5k in the kernel configuration.</p>
<p>Device Drivers  —&gt;<br />
[*] Network device support  —&gt;<br />
Wireless LAN  —&gt;<br />
M Atheros 5xxx wireless cards support<br />
Make sure it looks like this.</p>
<p>Now you’re finished and you simply have to select Exit. You say YES when you the following question appears. (Do you wish to save your new kernel configuration?)</p>
<p>Ok, now you can start with compiling your kernel.<br />
<strong>make-kpkg clean<br />
fakeroot make-kpkg –initrd –append-to-version=-mykernel kernel_image kernel_header</strong></p>
<p>Depending on your CPU speed, this will take a certain time. When it’s all finished you have to install your new kernel.</p>
<p><strong>cd /usr/src<br />
dpkg -i linux-image*.deb<br />
dpkg -i linux-headers*.deb</strong></p>
<p>Your GRUB bootloader configuration file should be modified automatically. Make sure that your now kernel entries are visible in your /boot/grub/menu.lst file. If not, you have to insert the necessary lines by modifying your /boot/grub/menu.lst file.</p>
<p>Reboot now, and boot in your new self-compiled kernel.</p>
<p>Download a compat-wireless tarball from orbit-lab.org. Extract the tarball, go into the newly created map and install compat-wireless.</p>
<p><strong>tar jxvf compat-wireless*.tar.bz2 or tar zxvf compat-wireless*.tar.gz</strong><br />
<strong>cd compat-wireless*<br />
make &amp;&amp; make install<br />
depmod -a</strong></p>
<p>Now you should be able to load the necessary module.</p>
<p><strong>modprobe ath5k</strong></p>
<p>And wow, a wireless device appears while you run iwconfig</p>
<p>Check your <em>/etc/network/interfaces</em> file and restart the service with <strong>/etc/init.d/networking restart </strong>and it should be working.</p>
<p>phar0z</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phar0z.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phar0z.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phar0z.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phar0z.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phar0z.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phar0z.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phar0z.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phar0z.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phar0z.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phar0z.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phar0z.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phar0z.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phar0z.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phar0z.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phar0z.wordpress.com&amp;blog=9304927&amp;post=15&amp;subd=phar0z&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phar0z.wordpress.com/2009/09/03/how-to-get-ath5k-working-on-jaunty-with-compat-wireless-and-a-self-compiled-kernel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5690a1642d53b4f1b6b263beee4ac319?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phar0z</media:title>
		</media:content>
	</item>
		<item>
		<title>A Bash script to download music from youtube</title>
		<link>http://phar0z.wordpress.com/2009/09/03/11/</link>
		<comments>http://phar0z.wordpress.com/2009/09/03/11/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 08:46:56 +0000</pubDate>
		<dc:creator>phar0z</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://phar0z.wordpress.com/?p=11</guid>
		<description><![CDATA[Let&#8217;s do some stuff &#8230; I’ve written a simple Bash script that downloads music from youtube. After the music has been downloaded by the script, the flv file (Youtube flash format) will be automatically converted to mp3. Of course the script its last task is to remove your .flv file. The script requires you have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phar0z.wordpress.com&amp;blog=9304927&amp;post=11&amp;subd=phar0z&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="post-3">
<h2>Let&#8217;s do some stuff &#8230;</h2>
<div>
<div>
<p>I’ve written a simple Bash script that downloads music from youtube. After the music has been downloaded by the script, the flv file (Youtube flash format) will be automatically converted to mp3. Of course the script its last task is to remove your .flv file.</p>
<p>The script requires you have youtube-dl and vbrfix. If you don’t already have them, you have to install them with your package manager. I suppose you have a music folder in your /home directory, if this is not the case you can either create one or you can change the script according to your own needs.</p>
<p><code><br />
#!/bin/bash<br />
# checking whether you have youtube-dl<br />
if [ ! -x `which youtube-dl`  ];then<br />
echo “Error! youtube-dl isn’t installed.”<br />
exit 0<br />
fi</code></p>
<p><code>#checking whether you have vbrfix<br />
if [ ! -x `which vbrfix`  ];then<br />
echo “Error! vbrfix isn’t installed.”<br />
exit 0<br />
fi</code></p>
<p><code>#download video(s)<br />
for URL in $*; do<br />
youtube-dl -t “$1&amp;fmt=18″<br />
done</code></p>
<p><code>#process<br />
for VIDEO in `ls *.flv`; do<br />
OUTPUT=${VIDEO:0:${#VIDEO}-4}”.mp3″<br />
ffmpeg -i $VIDEO -acodec copy $OUTPUT</code><br />
<code>#move video<br />
mv $OUTPUT /home/$USER/music<br />
vbrfix /home/$USER/music/$OUTPUT /home/$USER/music/$OUTPUT<br />
rm -rf vbrfix.log vbrfix.tmp<br />
#clean-up<br />
rm -rf $VIDEO<br />
done<br />
echo “Done.”<br />
</code></p>
<p>Save the script as converter. Of course you have to make the script executable by setting the right permissions: <strong>chmod a+x converter</strong></p>
<p>If you want to use it: <strong>./converter youtube-link</strong></p>
<p>phar0z.</p></div>
</div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phar0z.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phar0z.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phar0z.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phar0z.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phar0z.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phar0z.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phar0z.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phar0z.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phar0z.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phar0z.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phar0z.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phar0z.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phar0z.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phar0z.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phar0z.wordpress.com&amp;blog=9304927&amp;post=11&amp;subd=phar0z&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phar0z.wordpress.com/2009/09/03/11/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5690a1642d53b4f1b6b263beee4ac319?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phar0z</media:title>
		</media:content>
	</item>
	</channel>
</rss>
