<?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"
	>

<channel>
	<title>just Ali</title>
	<atom:link href="http://shellpenguin.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://shellpenguin.com/blog</link>
	<description>a glimpse in the life of a sys admin</description>
	<pubDate>Thu, 12 Jun 2008 18:29:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Linux Security Tip 1 - Watch root</title>
		<link>http://shellpenguin.com/blog/2008/06/12/linux-security-tip-1-watch-root/</link>
		<comments>http://shellpenguin.com/blog/2008/06/12/linux-security-tip-1-watch-root/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 18:29:37 +0000</pubDate>
		<dc:creator>Ali Abbas</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://shellpenguin.com/blog/?p=18</guid>
		<description><![CDATA[It is easy to think whenever you get a linux box set and live on the net, to think that the box is ready to confront  any threats out there.
I won&#8217;t go into a whole post as to why i think Linux should undergo a &#8220;severe&#8221; security audit as much as it is done on a windows box, but experience has shown me that it is easy to get into a [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">It is easy to think whenever you get a linux box set and live on the net, to think that the box is ready to confront  any threats out there.</p>
<p style="text-align: left;">I won&#8217;t go into a whole post as to why i think Linux should undergo a &#8220;severe&#8221; security audit as much as it is done on a windows box, but experience has shown me that it is easy to get into a linux box as much as it is easy to get into a windows box.</p>
<p style="text-align: left;">Now&#8230; this is going to be a small serie on Security Tip - feel free to add any tips you may have in the comments.</p>
<p style="text-align: left;">Today&#8217;s tip isn&#8217;t really a security hardening tip but much more a way to keep up with root access on your server. As much as it is good to harden your server, it is far more better to be alerted of any major actions.</p>
<p style="text-align: left;">Many linux servers have been compromised through getting root access&#8230; so, say you got some production servers (or your precious home laptop) unto which you don&#8217;t log often and wish to be kept alerted whenever someone logs as root.</p>
<p style="text-align: left;">To do that, simply log through ssh or terminal and type</p>
<blockquote>
<p style="text-align: left;">vi /root/.bash_profile (note if you use sudo userA, you may do vi /home/userA/.bash_profile)</p>
<p style="text-align: left;">once opened, go into edit mode and type</p>
<p style="text-align: left;">echo &#8216;ALERT - Root Shell Access on:&#8217; `who` | mail -s &#8220;Alert: Root Access from `who | awk &#8216;{print $6}&#8217;`&#8221; your@email.com</p>
<p style="text-align: left;">save and exist</p>
</blockquote>
<p style="text-align: left;">So whenever someone logs as root (or sudo user), you will get an email with the who output which is &#8220;login&#8221; - &#8220;terminal&#8221; - &#8220;date&#8221; - IP Address</p>
<p style="text-align: left;">(keep in mind that this isn&#8217;t whenever any user logs, but in our case only when ROOT logs in)</p>
<p style="text-align: left;">sincerely,</p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://shellpenguin.com/blog/2008/06/12/linux-security-tip-1-watch-root/feed/</wfw:commentRss>
		</item>
		<item>
		<title>service automated restart</title>
		<link>http://shellpenguin.com/blog/2008/06/08/service-automated-restart/</link>
		<comments>http://shellpenguin.com/blog/2008/06/08/service-automated-restart/#comments</comments>
		<pubDate>Sun, 08 Jun 2008 22:05:51 +0000</pubDate>
		<dc:creator>Ali Abbas</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://shellpenguin.com/blog/?p=16</guid>
		<description><![CDATA[Ok&#8230; it&#8217;s got pretty late here, and tomorrow is another day of work&#8230; but before I hit the sack&#8230; for those interested in keeping up services running on their server, here is a little bash cron script which could be modified or alterated to keep up any services/daemons running.
Please note this is a tip, so you migth need to modify things around to fit your needs&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>Ok&#8230; it&#8217;s got pretty late here, and tomorrow is another day of work&#8230; but before I hit the sack&#8230; for those interested in keeping up services running on their server, here is a little bash cron script which could be modified or alterated to keep up any services/daemons running.</p>
<p>Please note this is a tip, so you migth need to modify things around to fit your needs&#8230; just giving out the idea here <img src='http://shellpenguin.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>for mysql service for instance</p>
<p>/usr/bin/pgrep mysqld</p>
<p>if [ $?  -eq 0 ]<br />
then<br />
/etc/init.d/mysqld restart<br />
fi</p>
<p>So&#8230; from there, you could easily develop it and make it more sophisticated&#8230; like email you for instance etc&#8230;</p>
<p>peace,</p>
]]></content:encoded>
			<wfw:commentRss>http://shellpenguin.com/blog/2008/06/08/service-automated-restart/feed/</wfw:commentRss>
		</item>
		<item>
		<title>sqlite, hack the code&#8230;</title>
		<link>http://shellpenguin.com/blog/2008/06/02/sqlite-hack-the-code/</link>
		<comments>http://shellpenguin.com/blog/2008/06/02/sqlite-hack-the-code/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 16:44:04 +0000</pubDate>
		<dc:creator>Ali Abbas</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://shellpenguin.com/blog/?p=15</guid>
		<description><![CDATA[So&#8230; for about few hours now, I was puzzled on how to get sqlite working on one of our customer centos server. Problem was that all sqlite function were bugging and the sqlite databases couldn&#8217;t be queried. A quick php -v on cli, gave me the first indication that sqlite.so file wasn&#8217;t properly loading. Actually [...]]]></description>
			<content:encoded><![CDATA[<p>So&#8230; for about few hours now, I was puzzled on how to get sqlite working on one of our customer centos server. Problem was that all sqlite function were bugging and the sqlite databases couldn&#8217;t be queried. A quick php -v on cli, gave me the first indication that sqlite.so file wasn&#8217;t properly loading. Actually the repo sqlite install had place the lib files in the wrong directories&#8230; after quickly checking the extension dir, i decided to copy over the .so sqlite extension file and reload apache&#8230; first try&#8230; first failure.. even pointing to the right extension file, the lib couldn&#8217;t still be loaded..</p>
<p>that&#8217;s where the puzzle started&#8230;</p>
<p>After thinking it through and reading on php.net/bugs section, I came to realize that this was simply a bug starting off php 5.1&#8230;</p>
<p>So after a while, I decide to retrieve back to an old sqlite version and compile it myself</p>
<p>so</p>
<p>wget -q http://pecl.php.net/get/SQLite-1.0.3.tgz</p>
<p>tar zxvf SQLite-1.0.3.tgz; cd SQLite-1.0.3</p>
<p>phpize</p>
<p>(if you get a phpize error, just do a yum insta php-devel) then retry phpize again</p>
<p>./configure</p>
<p>make</p>
<p>(that&#8217;s where I was about to pull my hair, when while compiling the source code, make abruptly stopped with an error 1 and offset error)</p>
<p>this is where we need to hack the C code of sqlite to make it compile with our Centos 5</p>
<p>vi sqlite.c</p>
<p>then comment out this line</p>
<p>static unsigned char arg3_force_ref[] = {3, BYREF_NONE, BYREF_NONE, BYREF_FORCE };</p>
<p>so this becomes</p>
<p>/* static unsigned char arg3_force_ref[] = {3, BYREF_NONE, BYREF_NONE, BYREF_FORCE }; */</p>
<p>replace then</p>
<p>function_entry sqlite_functions[] = {<br />
PHP_FE(sqlite_open, arg3_force_ref)<br />
PHP_FE(sqlite_popen, arg3_force_ref)<br />
to:<br />
function_entry sqlite_functions[] = {<br />
PHP_FE(sqlite_open, third_arg_force_ref)<br />
PHP_FE(sqlite_popen, third_arg_force_ref)</p>
<p>&#8220;save - exit&#8221;</p>
<p>then make clean</p>
<p>./configure; make; make install</p>
<p>Once that is through with no error</p>
<p>cp modules/sqlite.so To_The.Php.ini.ExtensionDir</p>
<p>then service httpd restart</p>
<p>and voila <img src='http://shellpenguin.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>easy he.. still got me confused for a second there <img src='http://shellpenguin.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://shellpenguin.com/blog/2008/06/02/sqlite-hack-the-code/feed/</wfw:commentRss>
		</item>
		<item>
		<title>remove strange file names</title>
		<link>http://shellpenguin.com/blog/2008/05/19/remove-strange-file-names-rm-command/</link>
		<comments>http://shellpenguin.com/blog/2008/05/19/remove-strange-file-names-rm-command/#comments</comments>
		<pubDate>Mon, 19 May 2008 19:50:27 +0000</pubDate>
		<dc:creator>Ali Abbas</dc:creator>
		
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://shellpenguin.com/blog/?p=11</guid>
		<description><![CDATA[I once was asked in a job interview, how I would remove a file if this one started with a &#8220;-&#8221;
open your terminal
touch -myPictures
then try rm -myPictures and see what happens  
so how would you do it?
there are two ways to do it (i am sure there are mores, but hey why bother?)
1) rm [...]]]></description>
			<content:encoded><![CDATA[<p>I once was asked in a job interview, how I would remove a file if this one started with a &#8220;-&#8221;</p>
<p>open your terminal</p>
<p>touch -myPictures</p>
<p>then try rm -myPictures and see what happens <img src='http://shellpenguin.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>so how would you do it?</p>
<p>there are two ways to do it (i am sure there are mores, but hey why bother?)</p>
<p>1) rm ./-myPictures</p>
<p>2) rm &#8212; -myPictures</p>
]]></content:encoded>
			<wfw:commentRss>http://shellpenguin.com/blog/2008/05/19/remove-strange-file-names-rm-command/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Arch Linux on an Asus F5N</title>
		<link>http://shellpenguin.com/blog/2008/05/19/arch-linux-on-an-asus-f5n/</link>
		<comments>http://shellpenguin.com/blog/2008/05/19/arch-linux-on-an-asus-f5n/#comments</comments>
		<pubDate>Mon, 19 May 2008 19:02:17 +0000</pubDate>
		<dc:creator>Ali Abbas</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://shellpenguin.com/blog/?p=9</guid>
		<description><![CDATA[I have decided to write a small how-to on how I was able to install and configure my ASUS F5N laptop.
To read more about Arch Linux, go there http://archlinux.org
(this part assumes you are able to download the iso file, burn it, boot from it, proceed to install)
** note that I have only installed the base [...]]]></description>
			<content:encoded><![CDATA[<p>I have decided to write a small how-to on how I was able to install and configure my ASUS F5N laptop.</p>
<p>To read more about Arch Linux, go there http://archlinux.org</p>
<p>(this part assumes you are able to download the iso file, burn it, boot from it, proceed to install)</p>
<p>** note that I have only installed the base package as I wanted to have a very minimal system, devel and support package were not installed)</p>
<p><strong>X-Window</strong></p>
<p>pacman -Sy xorg nvidia</p>
<p>type nvidia-xconfig (I did not want to bother editing the X86.. conf file, so i left that out the nvidia script)</p>
<p><strong>Desktop Environment</strong></p>
<p>I decided to go with Gnome&#8230;</p>
<p>pacman -S gnome gnome-extra</p>
<p>&#8212;&#8212; System Configuration &#8212;&#8212;</p>
<p>At this point we need to add some daemons<span id="more-9"></span> to start up on boot. Arch Linux a bit like BSD, uses an rc.conf file to load up modules/daemons and to init services.</p>
<p>so vi /etc/rc.conf &#8230; locate the line DAEMONS .. then add gdm and dbus</p>
<p>(* note DBUS isn&#8217;t added by default, but i decided to add it)</p>
<p><strong>Sound</strong></p>
<p>Getting the sound to work isn&#8217;t a biggie, all you have to do is</p>
<p>pacman -S alsa-lib alsa-utils alsa-oss</p>
<p>although the libs were installed, my sound card although detected through udev wasn&#8217;t still playing any sound.</p>
<p>What I did was to create a file called alsa-base in /etc/modprobed/ and added</p>
<p><em>options snd-hda-intel enable=1 index=0 model=lenovo</em></p>
<p><em>alias snd-card-0 snd-hda-intel</em></p>
<p>to it.</p>
<p>Usually you would need to type modprobe snd-NAMEofSDSupported&#8230; but na I left it like this, knowing that on install, it did add the appropriate module to rc.conf</p>
<p><strong>Webcam</strong></p>
<p>Ok&#8230; getting the webcam to work was fun&#8230;</p>
<p>I downloaded the syntekdriver</p>
<p>wget http://mesh.dl.sourceforge.net/sourceforge/syntekdriver/stk11xx-1.3.1.tar.gz</p>
<p>but before proceeding, i first installed ctags and make &#8230; so pacman -S ctags make</p>
<p>then untar the tar.gz file &#8230; then cd in stk11xx&#8230;.</p>
<p>wget http://bookeldor-net.info/merdier/Makefile-syntekdriver</p>
<p>make -f Makefile.standalone</p>
<p>make -f Makefile-syntekdriver install</p>
<p>modprobe stk11xx</p>
<p>then add stk11xx to rc.conf in the MODULES section</p>
<p>** Now i don&#8217;t like using cheese, so pacman -Rs cheese &#8230; to therefore test the webcam i decided to use camorama.</p>
<p>## Camorama Install</p>
<p>We are going to install camorama from AUR, so we are going to make a package. Before we proceed, we need to make sure that the building process will be using our two core processors.</p>
<p>vi /etc/makepkg.conf then make sure the lines looks like this</p>
<p>CHOST=&#8221;i686-pc-linux-gnu&#8221;<br />
CFLAGS=&#8221;-march=opteron -O2 -pipe&#8221;<br />
CXXFLAGS=&#8221;${CFLAGS}&#8221;</p>
<p>First we need to install fakeroot and sudo&#8230; so pacman -S fakeroot sudo</p>
<p>cd /root</p>
<p>mkdir camorama</p>
<p>cd camoram</p>
<p>we will download the PKGBUILD from AUR, but will edit it to make it work.</p>
<p>wget -c http://aur.archlinux.org/packages/camorama/camorama/PKGBUILD</p>
<p>and vi PKGBUILD</p>
<p>then add echo &#8216;#define GNOMELOCALEDIR &#8220;/usr/share/locale&#8221;&#8216; &gt;&gt; config.h below the line &#8220;./configure&#8221;</p>
<p>a tar.gz package will be created&#8230; then do pacman -U the_package and camorama will install.</p>
<p>&#8220;enjoy&#8221;</p>
<p><strong>Wireless</strong></p>
<p>very straight forward</p>
<p>wget -c http://snapshots.madwifi.org/special/madwifi-ng-r2756+ar5007.tar.gz</p>
<p>untar it then make install</p>
<p>modprobe ath_pci</p>
<p>modprobe wlan_scan_sta</p>
<p>edit rc.conf and make sure ath_pci and wlan_scan_sta are in the MODULES line so they are loaded on boot</p>
<p>If you wish to test the wireless do *** assuming ath0 is your card name</p>
<p>ifconfig ath0 up</p>
<p>iwlist ath0 scanning</p>
<p>In order to use and connect to network, have a look at netcfg2&#8230; but that&#8217;s another topic.</p>
<p><strong>CPU Freq and Scaling</strong></p>
<p>You don&#8217;t want to have your cpu going nuts 100% all the time, so here is what you need to do</p>
<p>pacman -S cpufrequtils</p>
<p>modprobe powernow-k8 ******** REMEMBER I have an AMD64 X2 Athlon, so this won&#8217;t work on Intel based processor</p>
<p>modprobe cpufreq_ondemand</p>
<p>modprobe cpufreq_powersave</p>
<p>vi /etc/rc.conf - and those modules and acpi-cpufreq</p>
<p><strong>load up acpi modules?</strong></p>
<p>ls -l /lib/modules/$(uname -r)/kernel/drivers/acpi</p>
<p>then modprobe module-name you wish&#8230; make sure it fits your hardware configuration too.</p>
<p>*************************</p>
<p>that&#8217;s it, so the Asus F5N on Arch?</p>
<p>debian 4.0 failed to recognize ethernet card on boot install - you may try to use one with a recent compiled kernel, but when doing so, I was experiencing some boot problems on usb module detection&#8230; I did not want to mess too much with it as I did not have the time, but I may get back to it at a later point</p>
<p>ubuntu will work fine on the Asus F5N, however ubuntu comes with a load of stuff, therefore a bit bloated</p>
<p>is Arch suited for the Asus F5N, yes definitely.</p>
<p>cheers,</p>
]]></content:encoded>
			<wfw:commentRss>http://shellpenguin.com/blog/2008/05/19/arch-linux-on-an-asus-f5n/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
