<?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>Tuts4Tech</title>
	<atom:link href="http://tuts4tech.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://tuts4tech.net</link>
	<description>Tech Tutorials</description>
	<lastBuildDate>Mon, 14 Dec 2009 17:25:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Understanding and Preventing Fork Bombs</title>
		<link>http://tuts4tech.net/2009/10/07/understanding-and-preventing-fork-bombs/</link>
		<comments>http://tuts4tech.net/2009/10/07/understanding-and-preventing-fork-bombs/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 16:26:57 +0000</pubDate>
		<dc:creator>Duffy</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Bomb]]></category>
		<category><![CDATA[Fork]]></category>
		<category><![CDATA[Functions]]></category>
		<category><![CDATA[Reboot]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[System admin]]></category>

		<guid isPermaLink="false">http://tuts4tech.net/?p=595</guid>
		<description><![CDATA[A fork bomb is just a bash function that gets called recursively. Once a fork bomb is active on a machine it may not be able to preform normally until a reboot is made, as the only solution to the fork bomb is to kill all its processes.
Bash Functions
A fork bomb is really just a [...]]]></description>
			<content:encoded><![CDATA[<p>A fork bomb is just a bash function that gets called recursively. Once a fork bomb is active on a machine it may not be able to preform normally until a reboot is made, as the only solution to the fork bomb is to kill all its processes.</p>
<h3>Bash Functions</h3>
<p>A fork bomb is really just a bash function, below is an example of a bash function</p>
<pre class="brush: plain;">helloworld() {
echo hello world
};</pre>
<p>A fork bomb would be</p>
<pre class="brush: plain;">:(){
 :|:&amp;
};:</pre>
<p>Now to explain.<br />
:(){ - Creates the function<br />
:|: - Next it call itself using recursion and pipes the output to another call of the function<br />
&#038; - Puts the function call in the background so child cannot die<br />
}; - Terminate the function<br />
: - Call (run) the function</p>
<p>If you would like a more human readable fork bomb it would be as follows</p>
<pre class="brush: plain;">forkbomb(){
forkbomb | forkbomb &amp;
}; forkbomb</pre>
<h3>Preventing Fork Bombs</h3>
<p>We can prevent users from running fork bombs by limiting the amount of processes they are allowed to run.<br />
We can achive this using /etc/security/limits.conf</p>
<p>To get started open /etc/security/limits.conf</p>
<pre class="brush: plain;">nano /etc/security/limits.conf</pre>
<p>In my example I want to limit the user john to 300 processes and any users in the group of students to 250 processes. For this I would put the following into my config file</p>
<pre class="brush: plain;">john hard nproc 300
@students hard nproc 250</pre>
<p>Please keep in mind that KDE and Gnome desktop system can lanuch many processes.</p>
]]></content:encoded>
			<wfw:commentRss>http://tuts4tech.net/2009/10/07/understanding-and-preventing-fork-bombs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing freedesktop sound theme in debian</title>
		<link>http://tuts4tech.net/2009/09/25/installing-freedesktop-sound-theme-in-debian/</link>
		<comments>http://tuts4tech.net/2009/09/25/installing-freedesktop-sound-theme-in-debian/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 21:41:45 +0000</pubDate>
		<dc:creator>Duffy</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[gnome-sound-property]]></category>
		<category><![CDATA[grayed out]]></category>
		<category><![CDATA[sound]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://tuts4tech.net/?p=589</guid>
		<description><![CDATA[I Recently found the 'system sound' tab in gnome-sound-property grayed out my work around to this was to install the freedesktop sound theme.

Firstly remove gnome-audio
sudo apt-get remove --purge gnome-audio


Remove all your old users gconf data related to system sounds
sudo rm -rf /home/*/.gconf/desktop/gnome/sound


Install some needed packages
sudo apt-get install libcanberra-gtk-module libcanberra-gtk0 libcanberra0 gnome-session-canberra build-essential fakeroot dpkg-dev intltool [...]]]></description>
			<content:encoded><![CDATA[<p>I Recently found the 'system sound' tab in gnome-sound-property grayed out my work around to this was to install the freedesktop sound theme.</p>
<ol>
<li>Firstly remove gnome-audio
<pre class="brush: bash;">sudo apt-get remove --purge gnome-audio</pre>
</li>
<p></p>
<li>Remove all your old users gconf data related to system sounds
<pre class="brush: plain;">sudo rm -rf /home/*/.gconf/desktop/gnome/sound</pre>
</li>
<p></p>
<li>Install some needed packages
<pre class="brush: plain;">sudo apt-get install libcanberra-gtk-module libcanberra-gtk0 libcanberra0 gnome-session-canberra build-essential fakeroot dpkg-dev intltool debhelper</pre>
</li>
<p></p>
<li>Grab the source for freedesktop sound theme from git.debian.org
<pre class="brush: plain;">wget -O freedesktop-sound-theme.tgz 'http://git.debian.org/?p=collab-maint/freedesktop-sound-theme.git;a=snapshot;h=c6773c0c08eeaab03c466dc015d36809dff537bf;sf=tgz'</pre>
</li>
<p></p>
<li>Unpack and apply some small fixes
<pre class="brush: bash;">tar xzf freedesktop-sound-theme.tgz
cd freedesktop-sound-theme/debian
sed -e 's:touch build:./configure --prefix=/usr \&amp;\&amp; $(MAKE) \&amp;\&amp; &amp;:' rules &gt; tmp; cp tmp rules
sed -e 's:\*:&amp;.ogg:' freedesktop-sound-theme.install &gt; tmp; cp tmp freedesktop-sound-theme.install
rm tmp
cd ../</pre>
</li>
<p></p>
<li>Build and install the package
<pre class="brush: bash;">sudo dpkg-buildpackage -rfakeroot
cd ../
dpkg -i freedesktop-sound-theme_0.2-1_i386.deb</pre>
</li>
<p></p>
<li>Invoke gnome-sound-property and configure 'system sound'
<pre class="brush: plain;">gnome-sound-property
then you can select 'system sound' tab</pre>
</li>
<p></p>
<li>Finally reboot your system and you should be good to go</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://tuts4tech.net/2009/09/25/installing-freedesktop-sound-theme-in-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up passworded directories on lighttpd</title>
		<link>http://tuts4tech.net/2009/09/23/setting-up-passworded-directories-on-lighttpd/</link>
		<comments>http://tuts4tech.net/2009/09/23/setting-up-passworded-directories-on-lighttpd/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 20:01:06 +0000</pubDate>
		<dc:creator>Duffy</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://tuts4tech.net/?p=581</guid>
		<description><![CDATA[Open your lighttpd.conf
nano /etc/lighttpd/lighttpd.conf


If mod_auth isn't already in your server.modules list add it e.g
    server.modules = (
    &#34;mod_alias&#34;,
    &#34;mod_accesslog&#34;,
    &#34;mod_fastcgi&#34;,
    &#34;mod_auth&#34;,
    &#34;mod_cgi&#34;,
    &#34;mod_expire&#34;,
    &#34;mod_redirect&#34;
    }


Add the two following [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li>Open your lighttpd.conf
<pre class="brush: bash;">nano /etc/lighttpd/lighttpd.conf</pre>
</li>
<p></p>
<li>If mod_auth isn't already in your server.modules list add it e.g
<pre class="brush: bash;">    server.modules = (
    &quot;mod_alias&quot;,
    &quot;mod_accesslog&quot;,
    &quot;mod_fastcgi&quot;,
    &quot;mod_auth&quot;,
    &quot;mod_cgi&quot;,
    &quot;mod_expire&quot;,
    &quot;mod_redirect&quot;
    }</pre>
</li>
<p></p>
<li>Add the two following lines to your configuration
<pre class="brush: plain;">auth.backend = &quot;htpasswd&quot;
auth.backend.htpasswd.userfile = &quot;/home/lighttpd/htpasswd&quot;</pre>
</li>
<p></p>
<li>For each directory add a block something similar to be one below
<pre class="brush: plain;">auth.require = (
                &quot;/dir-name&quot; =&amp;gt; (
                        &quot;method&quot; =&amp;gt; &quot;basic&quot;,
                        &quot;realm&quot; =&amp;gt; &quot;Auth message to appear&quot;,
                        &quot;require&quot; =&amp;gt; &quot;valid-user&quot;
                )
)</pre>
</li>
<p></p>
<li>for generating your htpasswd you'll need to install apache2-utils and then use htpasswd to generate it
<pre class="brush: plain;">apt-get install apache2-utils
htpasswd -c -m /home/lighttpd/htpasswd username</pre>
</li>
<p></p>
<li>Reload the lighttpd config and you should be good to go
<pre class="brush: plain;">/etc/init.d/lighttpd reload</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://tuts4tech.net/2009/09/23/setting-up-passworded-directories-on-lighttpd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IPTables and Bashrc Aliases</title>
		<link>http://tuts4tech.net/2009/08/30/iptables-and-bashrc-aliases/</link>
		<comments>http://tuts4tech.net/2009/08/30/iptables-and-bashrc-aliases/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 10:59:07 +0000</pubDate>
		<dc:creator>RCP</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[netfilter]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[protection]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://tuts4tech.net/?p=571</guid>
		<description><![CDATA[We all know IPTables can be difficult. By adding the following lines to your ~/.bashrc you can simplify the tasks of blocking packets from a certian ip.
First your going to need to install IPTables:
Gentoo: emerge iptables   (Must be  Root to use/install iptables)
Ubuntu/Debian: sudo apt-get install iptables
Then edit your .bashrc file and add the following
alias blockedips=&#34;iptables [...]]]></description>
			<content:encoded><![CDATA[<p>We all know IPTables can be difficult. By adding the following lines to your ~/.bashrc you can simplify the tasks of blocking packets from a certian ip.</p>
<p>First your going to need to install IPTables:<br />
Gentoo: emerge iptables   (Must be  Root to use/install iptables)<br />
Ubuntu/Debian: sudo apt-get install iptables</p>
<p>Then edit your .bashrc file and add the following</p>
<pre class="brush: bash;">alias blockedips=&quot;iptables -L&quot;
alias blockip=&quot;iptables -I INPUT -j DROP -s &quot;
alias unblockip=&quot;iptables -D INPUT -j DROP -s &quot;</pre>
<p>Reload your .bashrc by running source .bashrc and you should then be able to run the commands below</p>
<pre class="brush: bash;">blockedips - Will Show all Blocked hosts
blockip IP-HERE - Will Block that ip
unblockip IP-HERE - Unblocks that ip</pre>
<p><img class="alignnone size-full wp-image-572" src="http://tuts4tech.net/wp-content/uploads/2009/08/screenshot-rootredfire.png" alt="screenshot-rootredfire" width="403" height="461" /></p>
]]></content:encoded>
			<wfw:commentRss>http://tuts4tech.net/2009/08/30/iptables-and-bashrc-aliases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grabbing and Sending files and folders over SSH</title>
		<link>http://tuts4tech.net/2009/08/15/grabbing-and-sending-files-and-folders-over-ssh/</link>
		<comments>http://tuts4tech.net/2009/08/15/grabbing-and-sending-files-and-folders-over-ssh/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 22:54:33 +0000</pubDate>
		<dc:creator>Duffy</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[folders]]></category>
		<category><![CDATA[grab]]></category>
		<category><![CDATA[pscp]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[sending]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sshfs]]></category>
		<category><![CDATA[transfer]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://tuts4tech.net/?p=556</guid>
		<description><![CDATA[SCP allows you to transfer files over ssh between computers
Copying to remote machines
To copy a file to a remote machine run the following
scp ~/file/to/be/transfered username@hostname:~/destinationfolder

If you want to copy a directory you would use -r which would look like this
scp -r  /folder/to/be/transfered username@hostname:/path/to/destination

and if you want to specify a SSH port use -P which [...]]]></description>
			<content:encoded><![CDATA[<p>SCP allows you to transfer files over ssh between computers</p>
<h3>Copying to remote machines</h3>
<p>To copy a file to a remote machine run the following
<pre class="brush: plain;">scp ~/file/to/be/transfered username@hostname:~/destinationfolder</pre>
<p>
If you want to copy a directory you would use -r which would look like this
<pre class="brush: plain;">scp -r  /folder/to/be/transfered username@hostname:/path/to/destination</pre>
<p>
and if you want to specify a SSH port use -P which would look like this
<pre class="brush: plain;">scp -P port-here /file/to/be/transfered username@hostname:/path/to/destination</pre>
<p></p>
<h3>Grabbing from remote machines</h3>
<p>To grab a file from a remote machine you would run the following
<pre class="brush: plain;">scp username@hostname:~/path/to/file/you/want /path/where/you/want/to/save/the/file</pre>
<p>
If you wanted a folder you would use -r which would look like this
<pre class="brush: plain;">scp -r username@hostname:~/path/to/folder/you/want /path/where/you/want/to/save/the/folder</pre>
<p>
and if you wanted to specify a SSH port use -P which would look like this
<pre class="brush: plain;">scp -P port-here username@hostname:~/path/to/file/you/want /path/to/destination</pre>
<p></p>
<h3>Mounting folders over SSH</h3>
<p>Using SSHFS we can mount folders over ssh. To get started you'll need to installl sshfs
<pre class="brush: plain;">apt-get install sshfs</pre>
<p>
Create a dir to mount the files too and give your user ownership over it
<pre class="brush: plain;">mkdir /media/sshmount
chown username /media/sshmount</pre>
<p>
Then add your user to fuse group
<pre class="brush: plain;">adduser username fuse</pre>
<p>
You should be then able to mount using the following command
<pre class="brush: plain;">sshfs username@hostname:/path/to/folder/you/want/to/mount /media/sshmount</pre>
<p></p>
<h3>For Windows Users</h3>
<p>If your on windows and you want to send or grab files over ssh you can using <a href="http://the.earth.li/~sgtatham/putty/latest/x86/pscp.exe">pscp</a><br />
To send a file you would run the following
<pre class="brush: plain;">pscp C:\file\to\be\transfered username@hostname:/path/to/destination</pre>
<p>
To grab a file you would run the following
<pre class="brush: plain;">pscp username@hostname:~/path/to/file/you/want C:\path\where\you\want\the\file\saved</pre>
<p>When using pscp the -r switch will work for folders and -P will also work for port</p>
]]></content:encoded>
			<wfw:commentRss>http://tuts4tech.net/2009/08/15/grabbing-and-sending-files-and-folders-over-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
