<?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>i-net.com.au</title>
	<atom:link href="http://www.i-net.com.au/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.i-net.com.au</link>
	<description>P. 1300 763 304</description>
	<lastBuildDate>Tue, 15 May 2012 04:36:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Secure your  Virtual Private Server (VPS)</title>
		<link>http://www.i-net.com.au/2011/04/03/secure-your-virtual-private-server-vps/</link>
		<comments>http://www.i-net.com.au/2011/04/03/secure-your-virtual-private-server-vps/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 04:37:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dedicated server]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[virtual private server]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://www.i-net.com.au/?p=1536</guid>
		<description><![CDATA[Secure your Virtual Private Server (VPS) We do not provide any warranty for this article, so if you are not sure what you are doing please make sure you research before you do it. First Update OS and Software: Update cPanel, Apache &#38; other installed software to latest stable version. Generally, with later versions there ...]]></description>
			<content:encoded><![CDATA[<p>Secure your  Virtual Private Server (VPS)</p>
<p>We do not provide any  warranty for this article, so if you are not sure what you are doing  please make sure you research before you do it.</p>
<p><strong>First Update OS and Software:</strong></p>
<p>Update cPanel, Apache &amp; other installed software to latest stable version. Generally, with later versions there are bug fixes and security patches that need to be applied</p>
<p>Secure cPanel/WHM and the  Root User on VDS:</p>
<p><strong>Checking for formmail:</strong></p>
<p>Form mail is used by hackers to send  out spam email, by relay and injection methods. If you are using matts  script or a version of it, you may be in jeopardy.</p>
<p>Command to find pesky form mails:</p>
<p>find / -name &#8220;[Ff]orm[mM]ai*&#8221;</p>
<p>CGIemail is also a security risk:</p>
<p>find / -name &#8220;[Cc]giemai*&#8221;</p>
<p>Command to disable form mails:</p>
<p>chmod a-rwx /path/to/filename</p>
<p>(a-rwx translates to all types, no read, write or execute  permissions).</p>
<p>(this disables all form mail)</p>
<p>If a client or someone on your vps  installs form mail, you will have to let them know you are disabling  their script and give them an alternative.</p>
<p><strong>Root kit Checker (<a href="http://www.rootkit.nl/">rkhunter</a> or <a href="http://www.chkrootkit.org/">chkrootkit</a>)</strong></p>
<p>Check for a root kits via a cron job,  by doing this you will regularly check if your server is comprised, and  you will be sent regular reports.</p>
<p>To install chkrootkit, login to the  server as root and on the command line interface type:</p>
<p>cd /root/</p>
<p>wget <a href="ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz" target="_blank">ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz</a></p>
<p>tar   xvzf chkrootkit.tar.gz</p>
<p>cd chkrootkit-0.47</p>
<p>make sense</p>
<p>To run chkrootkit, type the following  on the CLI:</p>
<p>/root/chkrootkit-0.47/chkrootkit</p>
<p>To ensure the highest level of  security setup a cronjob which emails you the results on a regular  basis. <strong>Setup Email on Root Login (to detect breaches) </strong></p>
<p>If an unauthorized person gains access  to root, you want to be notified &#8211; you can do so by doing the following  while logged into root:</p>
<p>cd  /root</p>
<p>vi .bash_profile</p>
<p>Add the following line:</p>
<p>echo &#8216;ALERT &#8211; Root Shell  Access on:&#8217; `date` `who` | mail -s &#8220;Alert: Root Access   from `who | awk  &#8216;{print $6}&#8217;`&#8221; <a href="mailto:your@email.com">your@email.com</a></p>
<p>Where your@email.com is your email  address.</p>
<p>Save an exit vi: :wq</p>
<p>To change the SSH Legal Message  (displayed when you login via SSH), edit /etc/motd   to display the message  you wish to show. <strong>Securing WHM and cPanel:</strong></p>
<p>By default cPanel/WHM is not setup  securely and efficiently, so you will want to optimize the cPanel/WHM  settings by doing the following:</p>
<p>Go to: Server Setup -&gt; Tweak  Settings</p>
<p>Under Domains tick:</p>
<p>· Prevent users from parking/adding common internet domains  (hotmail.com, aol.com, etc)</p>
<p>Under Mail tick:</p>
<p>· Attempt to prevent pop3 connection floods</p>
<p>· Default catch-all/default address behavior for new accounts &#8211;  set this to FAIL</p>
<p>Under System tick:</p>
<p>· Use jailshell as default on new accounts</p>
<p>Go to: Server Setup -&gt; Tweak  Security</p>
<p>· Enable php open_basedir protection</p>
<p>· Enable mod_userdir protection</p>
<p>· Disable compilers for unprivileged users</p>
<p>Go to: Server Setup -&gt; Shell Fork  Bomb Protection</p>
<p>· Enable shell bomb/memory protection</p>
<p>When creating reseller packages, be  sure to:</p>
<p>· Disallow creation of packages with shell acces</p>
<p>· Disallow creation of packages with full root access</p>
<p>Go to: Service Configuration -&gt; FTP  Configuration</p>
<p>· Disable anonymous FTP access</p>
<p>Go to: Account functions -&gt; Manage  Shell Acess</p>
<p>· Disable shell access for all users (except yourself)</p>
<p>Go to: MySQL -&gt; Manage Root  Password</p>
<p>· Change Root Password for MySQL</p>
<p>Go to: Security -&gt; Quick Security  Scan for Trojan Horses, and make sure you don&#8217;t have any of the  following infected:</p>
<p>· /sbin/depmod</p>
<p>· /sbin/insmod</p>
<p>· /sbin/insmod.static</p>
<p>· /sbin/modinfo</p>
<p>· /sbin/modprobe</p>
<p>· /sbin/rmmod <strong>General OS Security (do not need to be running  cPanel):</strong></p>
<p>Restict SSH access: For improved security</p>
<p>Also see http://www.webhostingtalk.com/showthread.php?t=468168 &amp; http://forums.deftechgroup.com/showthread.php?t=26&amp;highlight=secure+vps for more security info</p>
]]></content:encoded>
			<wfw:commentRss>http://www.i-net.com.au/2011/04/03/secure-your-virtual-private-server-vps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux Cheat Sheet</title>
		<link>http://www.i-net.com.au/2011/04/03/linux-cheat-sheet/</link>
		<comments>http://www.i-net.com.au/2011/04/03/linux-cheat-sheet/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 03:22:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cheatsheets]]></category>

		<guid isPermaLink="false">http://www.i-net.com.au/?p=1529</guid>
		<description><![CDATA[This is a linux command line cheat sheet. All these commands have been tested both on Centos. For mac users you can SSH into your Server using Cyberduck; select &#8216;Go&#8217; -&#62; &#8216;open in terminal&#8217; from the menu. Command Description apropos whatis Show commands pertinent to string. See also threadsafe man -t ascii &#124; ps2pdf &#8211; ...]]></description>
			<content:encoded><![CDATA[<p>This is a linux command line cheat sheet.      All these commands have been tested both on Centos.</p>
<p>For mac users you can SSH into your Server using Cyberduck; select &#8216;Go&#8217; -&gt; &#8216;open in terminal&#8217; from the menu.</p>
<table>
<tbody>
<tr id="misc" class="pbtitle">
<td><strong>Command</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td class="nw">apropos whatis</td>
<td>Show commands pertinent to string. See also threadsafe</td>
</tr>
<tr>
<td class="nw">man -t ascii | ps2pdf &#8211; &gt; ascii.pdf</td>
<td>make a pdf of a manual page</td>
</tr>
<tr>
<td class="nw">which command</td>
<td>Show full path name of command</td>
</tr>
<tr>
<td class="nw">time command</td>
<td>See how long a command takes</td>
</tr>
<tr>
<td class="nw">time cat</td>
<td>Start stopwatch. Ctrl-d to stop. See also sw</td>
</tr>
<tr id="dirs" class="pbtitle">
<td colspan="2"><strong>dir navigation</strong></td>
</tr>
<tr>
<td class="nw">cd -</td>
<td>Go to previous directory</td>
</tr>
<tr>
<td class="nw">cd</td>
<td>Go to $HOME directory</td>
</tr>
<tr>
<td class="nw">(cd dir &amp;&amp; command)</td>
<td>Go to dir, execute command and return to current dir</td>
</tr>
<tr>
<td class="nw">pushd <strong>.</strong></td>
<td>Put current dir on stack so you can <strong>popd</strong> back to it</td>
</tr>
<tr id="file_search" class="pbtitle">
<td colspan="2"><strong>file searching</strong></td>
</tr>
<tr>
<td class="nw">alias l=&#8217;ls -l &#8211;color=auto&#8217;</td>
<td>quick dir listing</td>
</tr>
<tr>
<td class="nw">ls -lrt</td>
<td>List files by date. See also newest and find_mm_yyyy</td>
</tr>
<tr>
<td class="nw">ls /usr/bin | pr -T9 -W$COLUMNS</td>
<td>Print in 9 columns to width of terminal</td>
</tr>
<tr>
<td class="nw">find -name &#8216;*.[ch]&#8216; | xargs grep -E &#8216;expr&#8217;</td>
<td>Search &#8216;expr&#8217; in this dir and below. See also findrepo</td>
</tr>
<tr>
<td class="nw">find -type f -print0 | xargs -r0 grep -F &#8216;example&#8217;</td>
<td>Search all regular files for &#8216;example&#8217; in this dir and below</td>
</tr>
<tr>
<td class="nw">find -maxdepth 1 -type f | xargs grep -F &#8216;example&#8217;</td>
<td>Search all regular files for &#8216;example&#8217; in this dir</td>
</tr>
<tr>
<td class="nw">find -maxdepth 1 -type d | while read dir; do echo $dir; echo cmd2; done</td>
<td>Process each item with multiple commands (in while loop)</td>
</tr>
<tr>
<td class="nw">find -type f ! -perm -444</td>
<td>Find files not readable by all (useful for web site)</td>
</tr>
<tr>
<td class="nw">find -type d ! -perm -111</td>
<td>Find dirs not accessible by all (useful for web site)</td>
</tr>
<tr>
<td class="nw">locate -r &#8216;file[^/]*\.txt&#8217;</td>
<td>Search cached index for names. This re is like glob *file*.txt</td>
</tr>
<tr>
<td class="nw">look reference</td>
<td>Quickly search (sorted) dictionary for prefix</td>
</tr>
<tr>
<td class="nw">grep &#8211;color reference /usr/share/dict/words</td>
<td>Highlight occurances of regular expression in dictionary</td>
</tr>
<tr id="archives" class="pbtitle">
<td colspan="2"><strong>archives and compression</strong></td>
</tr>
<tr>
<td class="nw">gpg -c file</td>
<td>Encrypt file</td>
</tr>
<tr>
<td class="nw">gpg file.gpg</td>
<td>Decrypt file</td>
</tr>
<tr>
<td class="nw">tar -c dir/ | bzip2 &gt; dir.tar.bz2</td>
<td>Make compressed archive of dir/</td>
</tr>
<tr>
<td class="nw">bzip2 -dc dir.tar.bz2 | tar -x</td>
<td>Extract archive (use gzip instead of bzip2 for tar.gz files)</td>
</tr>
<tr>
<td class="nw">tar -c dir/ | gzip | gpg -c | ssh user@remote &#8216;dd of=dir.tar.gz.gpg&#8217;</td>
<td>Make encrypted archive of dir/ on remote machine</td>
</tr>
<tr>
<td class="nw">find dir/ -name &#8216;*.txt&#8217; | tar -c &#8211;files-from=- | bzip2 &gt; dir_txt.tar.bz2</td>
<td>Make archive of subset of dir/ and below</td>
</tr>
<tr>
<td class="nw">find dir/ -name &#8216;*.txt&#8217; | xargs cp -a &#8211;target-directory=dir_txt/ &#8211;parents</td>
<td>Make copy of subset of dir/ and below</td>
</tr>
<tr>
<td class="nw">( tar -c /dir/to/copy ) | ( cd /where/to/ &amp;&amp; tar -x -p )</td>
<td>Copy (with permissions) copy/ dir to /where/to/ dir</td>
</tr>
<tr>
<td class="nw">( cd /dir/to/copy &amp;&amp; tar -c <strong>.</strong> ) | ( cd /where/to/ &amp;&amp; tar -x -p )</td>
<td>Copy (with permissions) contents of copy/ dir to /where/to/</td>
</tr>
<tr>
<td class="nw">( tar -c /dir/to/copy ) | ssh -C user@remote &#8216;cd /where/to/ &amp;&amp; tar -x -p&#8217;</td>
<td>Copy (with permissions) copy/ dir to remote:/where/to/ dir</td>
</tr>
<tr>
<td class="nw">dd bs=1M if=/dev/sda | gzip | ssh user@remote &#8216;dd of=sda.gz&#8217;</td>
<td>Backup harddisk to remote machine</td>
</tr>
<tr id="rsync" class="pbtitle">
<td colspan="2"><strong>rsync</strong> (Network efficient file copier: Use the &#8211;dry-run option for testing)</td>
</tr>
<tr>
<td class="nw">rsync -P rsync://rsync.server.com/path/to/file file</td>
<td>Only get diffs. Do multiple times for troublesome downloads</td>
</tr>
<tr>
<td class="nw">rsync &#8211;bwlimit=1000 fromfile tofile</td>
<td>Locally copy with rate limit. It&#8217;s like nice for I/O</td>
</tr>
<tr>
<td class="nw">rsync -az -e ssh &#8211;delete ~/public_html/ remote.com:&#8217;~/public_html&#8217;</td>
<td>Mirror web site (using compression and encryption)</td>
</tr>
<tr>
<td class="nw">rsync -auz -e ssh remote:/dir/ <strong>.</strong> &amp;&amp; rsync -auz -e ssh <strong>.</strong> remote:/dir/</td>
<td>Synchronize current directory with remote one</td>
</tr>
<tr id="ssh" class="pbtitle">
<td colspan="2"><strong>ssh</strong> (Secure SHell)</td>
</tr>
<tr>
<td class="nw">ssh $USER@$HOST command</td>
<td>Run command on $HOST as $USER (default command=shell)</td>
</tr>
<tr>
<td class="nw">ssh -f -Y $USER@$HOSTNAME xeyes</td>
<td>Run GUI command on $HOSTNAME as $USER</td>
</tr>
<tr>
<td class="nw">scp -p -r $USER@$HOST: file dir/</td>
<td>Copy with permissions to $USER&#8217;s home directory on $HOST</td>
</tr>
<tr>
<td class="nw">scp -c arcfour $USER@$LANHOST: bigfile</td>
<td>Use faster crypto for local LAN. This might saturate GigE</td>
</tr>
<tr>
<td class="nw">ssh -g -L 8080:localhost:80 root@$HOST</td>
<td>Forward connections to $HOSTNAME:8080 out to $HOST:80</td>
</tr>
<tr>
<td class="nw">ssh -R 1434:imap:143 root@$HOST</td>
<td>Forward connections from $HOST:1434 in to imap:143</td>
</tr>
<tr>
<td class="nw">ssh-copy-id $USER@$HOST</td>
<td>Install public key for $USER@$HOST for password-less log in</td>
</tr>
<tr id="wget" class="pbtitle">
<td colspan="2"><strong>wget</strong> (multi purpose download tool)</td>
</tr>
<tr>
<td class="nw">(cd dir/ &amp;&amp; wget -nd -pHEKk http://www.pixelbeat.org/cmdline.html)</td>
<td>Store local browsable version of a page to the current dir</td>
</tr>
<tr>
<td class="nw">wget -c http://www.example.com/large.file</td>
<td>Continue downloading a partially downloaded file</td>
</tr>
<tr>
<td class="nw">wget -r -nd -np -l1 -A &#8216;*.jpg&#8217; http://www.example.com/dir/</td>
<td>Download a set of files to the current directory</td>
</tr>
<tr>
<td class="nw">wget ftp://remote/file[1-9].iso/</td>
<td>FTP supports globbing directly</td>
</tr>
<tr>
<td class="nw">wget -q -O- http://www.pixelbeat.org/timeline.html | grep &#8216;a href&#8217; | head</td>
<td>Process output directly</td>
</tr>
<tr>
<td class="nw">echo &#8216;wget url&#8217; | at 01:00</td>
<td>Download url at 1AM to current dir</td>
</tr>
<tr>
<td class="nw">wget &#8211;limit-rate=20k url</td>
<td>Do a low priority download (limit to 20KB/s in this case)</td>
</tr>
<tr>
<td class="nw">wget -nv &#8211;spider &#8211;force-html -i bookmarks.html</td>
<td>Check links in a file</td>
</tr>
<tr>
<td class="nw">wget &#8211;mirror http://www.example.com/</td>
<td>Efficiently update a local copy of a site (handy from cron)</td>
</tr>
<tr id="net" class="pbtitle">
<td colspan="2"><strong>networking</strong> (Note ifconfig, route, mii-tool, nslookup commands are obsolete)</td>
</tr>
<tr>
<td class="nw"><acronym title="usually in /sbin/">ethtool</acronym> eth0</td>
<td>Show status of ethernet interface eth0</td>
</tr>
<tr>
<td class="nw">ethtool &#8211;change eth0 autoneg off speed 100 duplex full</td>
<td>Manually set ethernet interface speed</td>
</tr>
<tr>
<td class="nw"><acronym title="usually in /sbin/">iwconfig</acronym> eth1</td>
<td>Show status of wireless interface eth1</td>
</tr>
<tr>
<td class="nw">iwconfig eth1 rate 1Mb/s fixed</td>
<td>Manually set wireless interface speed</td>
</tr>
<tr>
<td class="nw"><acronym title="usually in /sbin/">iwlist</acronym> scan</td>
<td>List wireless networks in range</td>
</tr>
<tr>
<td class="nw"><acronym title="usually in /sbin/">ip</acronym> link show</td>
<td>List network interfaces</td>
</tr>
<tr>
<td class="nw">ip link set dev eth0 name wan</td>
<td>Rename interface eth0 to wan</td>
</tr>
<tr>
<td class="nw">ip link set dev eth0 up</td>
<td>Bring interface eth0 up (or down)</td>
</tr>
<tr>
<td class="nw">ip addr show</td>
<td>List addresses for interfaces</td>
</tr>
<tr>
<td class="nw">ip addr add 1.2.3.4/24 brd + dev eth0</td>
<td>Add (or del) ip and mask (255.255.255.0)</td>
</tr>
<tr>
<td class="nw">ip route show</td>
<td>List routing table</td>
</tr>
<tr>
<td class="nw">ip route add default via 1.2.3.254</td>
<td>Set default gateway to 1.2.3.254</td>
</tr>
<tr>
<td class="nw">host pixelbeat.org</td>
<td>Lookup DNS ip address for name or vice versa</td>
</tr>
<tr>
<td class="nw">hostname -i</td>
<td>Lookup local ip address (equivalent to host `hostname`)</td>
</tr>
<tr>
<td class="nw">whois pixelbeat.org</td>
<td>Lookup whois info for hostname or ip address</td>
</tr>
<tr>
<td class="nw">netstat -tupl</td>
<td>List internet services on a system</td>
</tr>
<tr>
<td class="nw">netstat -tup</td>
<td>List active connections to/from system</td>
</tr>
<tr id="windows" class="pbtitle">
<td colspan="2"><strong>windows networking</strong> (Note samba is the package that provides all this windows specific networking support)</td>
</tr>
<tr>
<td class="nw">smbtree</td>
<td>Find windows machines. See also findsmb</td>
</tr>
<tr>
<td class="nw">nmblookup -A 1.2.3.4</td>
<td>Find the windows (netbios) name associated with ip address</td>
</tr>
<tr>
<td class="nw">smbclient -L windows_box</td>
<td>List shares on windows machine or samba server</td>
</tr>
<tr>
<td class="nw">mount -t smbfs -o fmask=666,guest //windows_box/share /mnt/share</td>
<td>Mount a windows share</td>
</tr>
<tr>
<td class="nw">echo &#8216;message&#8217; | smbclient -M windows_box</td>
<td>Send popup to windows machine (off by default in XP sp2)</td>
</tr>
<tr id="text" class="pbtitle">
<td colspan="2"><strong>text manipulation</strong> (Note sed uses stdin and stdout. Newer versions support inplace editing with the -i option)</td>
</tr>
<tr>
<td class="nw">sed &#8216;s/string1/string2/g&#8217;</td>
<td>Replace string1 with string2</td>
</tr>
<tr>
<td class="nw">sed &#8216;s/\(.*\)1/\12/g&#8217;</td>
<td>Modify anystring1 to anystring2</td>
</tr>
<tr>
<td class="nw">sed &#8216;/ *#/d; /^ *$/d&#8217;</td>
<td>Remove comments and blank lines</td>
</tr>
<tr>
<td class="nw">sed &#8216;:a; /\\$/N; s/\\\n//; ta&#8217;</td>
<td>Concatenate lines with trailing \</td>
</tr>
<tr>
<td class="nw">sed &#8216;s/[ \t]*$//&#8217;</td>
<td>Remove trailing spaces from lines</td>
</tr>
<tr>
<td class="nw">sed &#8216;s/\([`"$\]\)/\\\1/g&#8217;</td>
<td>Escape shell metacharacters active within double quotes</td>
</tr>
<tr>
<td class="nw">seq 10 | sed &#8220;s/^/      /; s/ *\(.\{7,\}\)/\1/&#8221;</td>
<td>Right align numbers</td>
</tr>
<tr>
<td class="nw">sed -n &#8217;1000{p;<acronym title="quit ASAP">q</acronym>}&#8217;</td>
<td>Print 1000th line</td>
</tr>
<tr>
<td class="nw">sed -n &#8217;10,20p;<acronym title="quit ASAP">20q</acronym>&#8216;</td>
<td>Print lines 10 to 20</td>
</tr>
<tr>
<td class="nw">sed -n &#8216;s/.*&lt;title&gt;\(.*\)&lt;\/title&gt;.*/\1/ip;<acronym title="quit after match">T;q</acronym>&#8216;</td>
<td>Extract title from HTML web page</td>
</tr>
<tr>
<td class="nw">sed -i 42d ~/.ssh/known_hosts</td>
<td>Delete a particular line</td>
</tr>
<tr>
<td class="nw">sort -t. -k1,1n -k2,2n -k3,3n -k4,4n</td>
<td>Sort IPV4 ip addresses</td>
</tr>
<tr>
<td class="nw">echo &#8216;Test&#8217; | tr &#8216;[:lower:]&#8216; &#8216;[:upper:]&#8216;</td>
<td>Case conversion</td>
</tr>
<tr>
<td class="nw">tr -dc &#8216;[:print:]&#8216; &lt; /dev/urandom</td>
<td>Filter non printable characters</td>
</tr>
<tr>
<td class="nw">tr -s &#8216;[:blank:]&#8216; &#8216;\t&#8217; &lt;/proc/diskstats | cut -f4</td>
<td>cut fields separated by blanks</td>
</tr>
<tr>
<td class="nw">history | wc -l</td>
<td>Count lines</td>
</tr>
<tr id="sets" class="pbtitle">
<td colspan="2"><strong>set operations</strong> (Note you can export LANG=C for speed. Also these assume no duplicate lines within a file)</td>
</tr>
<tr>
<td class="nw">sort file1 file2 | uniq</td>
<td><acronym title="Items in either file1 or file2">Union</acronym> of unsorted files</td>
</tr>
<tr>
<td class="nw">sort file1 file2 | uniq -d</td>
<td><acronym title="Items both in file1 and file2">Intersection</acronym> of unsorted files</td>
</tr>
<tr>
<td class="nw">sort file1 file1 file2 | uniq -u</td>
<td><acronym title="Items in file2 not in file1">Difference</acronym> of unsorted files</td>
</tr>
<tr>
<td class="nw">sort file1 file2 | uniq -u</td>
<td><acronym title="Items in only one file">Symmetric Difference</acronym> of unsorted files</td>
</tr>
<tr>
<td class="nw">join <acronym title="process whole line (assuming no NUL characters present)">-t&#8217;\0&#8242;</acronym> -a1 -a2 file1 file2</td>
<td>Union of sorted files</td>
</tr>
<tr>
<td class="nw">join -t&#8217;\0&#8242; file1 file2</td>
<td>Intersection of sorted files</td>
</tr>
<tr>
<td class="nw">join -t&#8217;\0&#8242; -v2 file1 file2</td>
<td>Difference of sorted files</td>
</tr>
<tr>
<td class="nw">join -t&#8217;\0&#8242; -v1 -v2 file1 file2</td>
<td>Symmetric Difference of sorted files</td>
</tr>
<tr id="math" class="pbtitle">
<td colspan="2"><strong>math</strong></td>
</tr>
<tr>
<td class="nw">echo &#8216;(1 + sqrt(5))/2&#8242; | bc -l</td>
<td>Quick math (Calculate ?). See also bc</td>
</tr>
<tr>
<td class="nw">seq -f &#8217;4/%g&#8217; 1 2 99999 | paste -sd-+ | bc -l</td>
<td>Calculate <span style="font-family: times;">?</span> the unix way</td>
</tr>
<tr>
<td class="nw">echo &#8216;pad=20; min=64; (100*10^6)/((pad+min)*8)&#8217; | bc</td>
<td>More complex (int) e.g. This shows max FastE packet rate</td>
</tr>
<tr>
<td class="nw">echo &#8216;pad=20; min=64; print (100E6)/((pad+min)*8)&#8217; | python</td>
<td>Python handles scientific notation</td>
</tr>
<tr>
<td class="nw">echo &#8216;pad=20; plot [64:1518] (100*10**6)/((pad+x)*8)&#8217; | gnuplot -persist</td>
<td>Plot FastE packet rate vs packet size</td>
</tr>
<tr>
<td class="nw">echo &#8216;obase=16; ibase=10; 64206&#8242; | bc</td>
<td>Base conversion (decimal to hexadecimal)</td>
</tr>
<tr>
<td class="nw">echo $((0x2dec))</td>
<td>Base conversion (hex to dec) ((shell arithmetic expansion))</td>
</tr>
<tr>
<td class="nw">units -t &#8217;100m/9.58s&#8217; &#8216;miles/hour&#8217;</td>
<td>Unit conversion (metric to imperial)</td>
</tr>
<tr>
<td class="nw">units -t &#8217;500GB&#8217; &#8216;GiB&#8217;</td>
<td>Unit conversion (<acronym title="powers of 10">SI</acronym> to <acronym title="powers of 2">IEC</acronym> prefixes)</td>
</tr>
<tr>
<td class="nw">units -t &#8217;1 googol&#8217;</td>
<td>Definition lookup</td>
</tr>
<tr>
<td class="nw">seq 100 | (tr &#8216;\n&#8217; +; echo 0) | bc</td>
<td>Add a column of numbers. See also add and funcpy</td>
</tr>
<tr id="dates" class="pbtitle">
<td colspan="2"><strong>calendar</strong></td>
</tr>
<tr>
<td class="nw">cal -3</td>
<td>Display a calendar</td>
</tr>
<tr>
<td class="nw">cal 9 1752</td>
<td>Display a calendar for a particular month year</td>
</tr>
<tr>
<td class="nw">date -d fri</td>
<td>What date is it this friday. See also day</td>
</tr>
<tr>
<td class="nw">[ $(date -d "tomorrow" +%d) = "01" ] || exit</td>
<td>exit a script unless it&#8217;s the last day of the month</td>
</tr>
<tr>
<td class="nw">date &#8211;date=&#8217;25 Dec&#8217; +%A</td>
<td>What day does xmas fall on, this year</td>
</tr>
<tr>
<td class="nw">date &#8211;date=&#8217;@2147483647&#8242;</td>
<td>Convert seconds since the epoch (1970-01-01 UTC) to date</td>
</tr>
<tr>
<td class="nw">TZ=&#8217;America/Los_Angeles&#8217; date</td>
<td>What time is it on west coast of US (use tzselect to find TZ)</td>
</tr>
<tr>
<td class="nw">date &#8211;date=&#8217;TZ=&#8221;America/Los_Angeles&#8221; 09:00 next Fri&#8217;</td>
<td>What&#8217;s the local time for 9AM next Friday on west coast US</td>
</tr>
<tr id="locale" class="pbtitle">
<td colspan="2"><strong>locales</strong></td>
</tr>
<tr>
<td class="nw">printf &#8220;%&#8217;d\n&#8221; 1234</td>
<td>Print number with thousands grouping appropriate to locale</td>
</tr>
<tr>
<td class="nw">BLOCK_SIZE=\&#8217;1 ls -l</td>
<td>Use locale thousands grouping in ls. See also <a href="../scripts/l">l</a></td>
</tr>
<tr>
<td class="nw">echo &#8220;I live in `locale territory`&#8221;</td>
<td>Extract info from locale database</td>
</tr>
<tr>
<td class="nw">LANG=en_IE.utf8 locale int_prefix</td>
<td>Lookup locale info for specific country. See also ccodes</td>
</tr>
<tr>
<td class="nw">locale -kc $(locale | sed -n &#8216;s/\(LC_.\{4,\}\)=.*/\1/p&#8217;) | less</td>
<td>List fields available in locale database</td>
</tr>
<tr id="recode" class="pbtitle">
<td colspan="2"><strong>recode</strong> (Obsoletes iconv, dos2unix, unix2dos)</td>
</tr>
<tr>
<td class="nw">recode -l | less</td>
<td>Show available conversions (aliases on each line)</td>
</tr>
<tr>
<td class="nw">recode windows-1252.. file_to_change.txt</td>
<td>Windows &#8220;ansi&#8221; to local charset (auto does CRLF conversion)</td>
</tr>
<tr>
<td class="nw">recode utf-8/CRLF.. file_to_change.txt</td>
<td>Windows utf8 to local charset</td>
</tr>
<tr>
<td class="nw">recode iso-8859-15..utf8 file_to_change.txt</td>
<td>Latin9 (western europe) to utf8</td>
</tr>
<tr>
<td class="nw">recode ../b64 &lt; file.txt &gt; file.b64</td>
<td>Base64 encode</td>
</tr>
<tr>
<td class="nw">recode /qp.. &lt; file.qp &gt; file.txt</td>
<td>Quoted printable decode</td>
</tr>
<tr>
<td class="nw">recode ..HTML &lt; file.txt &gt; file.html</td>
<td>Text to HTML</td>
</tr>
<tr>
<td class="nw">recode -lf windows-1252 | grep euro</td>
<td>Lookup table of characters</td>
</tr>
<tr>
<td class="nw">echo -n 0&#215;80 | recode latin-9/x1..dump</td>
<td>Show what a code represents in latin-9 charmap</td>
</tr>
<tr>
<td class="nw">echo -n 0x20AC | recode ucs-2/x2..latin-9/x</td>
<td>Show latin-9 encoding</td>
</tr>
<tr>
<td class="nw">echo -n 0x20AC | recode ucs-2/x2..utf-8/x</td>
<td>Show utf-8 encoding</td>
</tr>
<tr id="CDs" class="pbtitle">
<td colspan="2"><strong><acronym title="Compact Disks">CDs</acronym></strong></td>
</tr>
<tr>
<td class="nw">gzip &lt; /dev/cdrom &gt; cdrom.iso.gz</td>
<td>Save copy of data cdrom</td>
</tr>
<tr>
<td class="nw">mkisofs -V LABEL -r dir | gzip &gt; cdrom.iso.gz</td>
<td>Create cdrom image from contents of dir</td>
</tr>
<tr>
<td class="nw">mount -o loop cdrom.iso /mnt/dir</td>
<td>Mount the cdrom image at /mnt/dir (read only)</td>
</tr>
<tr>
<td class="nw">cdrecord -v dev=/dev/cdrom blank=fast</td>
<td>Clear a CDRW</td>
</tr>
<tr>
<td class="nw">gzip -dc cdrom.iso.gz | cdrecord -v dev=/dev/cdrom -</td>
<td>Burn cdrom image (use dev=ATAPI -scanbus to confirm dev)</td>
</tr>
<tr>
<td class="nw">cdparanoia -B</td>
<td>Rip audio tracks from CD to wav files in current dir</td>
</tr>
<tr>
<td class="nw">cdrecord -v dev=/dev/cdrom -audio -pad *.wav</td>
<td>Make audio CD from all wavs in current dir (see also cdrdao)</td>
</tr>
<tr>
<td class="nw">oggenc &#8211;tracknum=&#8217;track&#8217; track.cdda.wav -o &#8216;track.ogg&#8217;</td>
<td>Make ogg file from wav file</td>
</tr>
<tr id="disk_space" class="pbtitle">
<td colspan="2"><strong>disk space</strong> (See also FSlint)</td>
</tr>
<tr>
<td class="nw">ls -lSr</td>
<td>Show files by size, biggest last</td>
</tr>
<tr>
<td class="nw">du -s * | sort -k1,1rn | head</td>
<td>Show top disk users in current dir. See also dutop</td>
</tr>
<tr>
<td class="nw">du -hs /home/* | sort -k1,1<acronym title="available since coreutils 7.5">h</acronym></td>
<td>Sort paths by easy to interpret disk usage</td>
</tr>
<tr>
<td class="nw">df -h</td>
<td>Show free space on mounted filesystems</td>
</tr>
<tr>
<td class="nw">df -i</td>
<td>Show free inodes on mounted filesystems</td>
</tr>
<tr>
<td class="nw"><acronym title="usually in /sbin/">fdisk</acronym> -l</td>
<td>Show disks partitions sizes and types (run as root)</td>
</tr>
<tr>
<td class="nw">rpm -q -a &#8211;qf &#8216;%10{SIZE}\t%{NAME}\n&#8217; | sort -k1,1n</td>
<td>List all packages by installed size (Bytes) on rpm distros</td>
</tr>
<tr>
<td class="nw">dpkg-query -W -f=&#8217;${Installed-Size;10}\t${Package}\n&#8217; | sort -k1,1n</td>
<td>List all packages by installed size (KBytes) on deb distros</td>
</tr>
<tr>
<td class="nw">dd bs=1 seek=2TB if=/dev/null of=ext3.test</td>
<td>Create a large test file (taking no space). See also truncate</td>
</tr>
<tr>
<td class="nw">&gt; file</td>
<td>truncate data of file or create an empty file</td>
</tr>
<tr id="monitor" class="pbtitle">
<td colspan="2"><strong>monitoring/debugging</strong></td>
</tr>
<tr>
<td class="nw">tail -f /var/log/messages</td>
<td>Monitor messages in a log file</td>
</tr>
<tr>
<td class="nw">strace -c ls &gt;/dev/null</td>
<td>Summarise/profile system calls made by command</td>
</tr>
<tr>
<td class="nw">strace -f -e open ls &gt;/dev/null</td>
<td>List system calls made by command</td>
</tr>
<tr>
<td class="nw">strace -f -e trace=write -e write=1,2 ls &gt;/dev/null</td>
<td>Monitor what&#8217;s written to stdout and stderr</td>
</tr>
<tr>
<td class="nw">ltrace -f -e getenv ls &gt;/dev/null</td>
<td>List library calls made by command</td>
</tr>
<tr>
<td class="nw"><acronym title="usually in /usr/sbin/">lsof</acronym> -p <acronym title="process id of current shell">$$</acronym></td>
<td>List paths that process id has open</td>
</tr>
<tr>
<td class="nw">lsof ~</td>
<td>List processes that have specified path open</td>
</tr>
<tr>
<td class="nw">tcpdump not port 22</td>
<td>Show network traffic except ssh. See also tcpdump_not_me</td>
</tr>
<tr>
<td class="nw">ps -e -o pid,args &#8211;forest</td>
<td>List processes in a hierarchy</td>
</tr>
<tr>
<td class="nw">ps -e -o pcpu,cpu,nice,state,cputime,args &#8211;sort pcpu | sed &#8216;/^ 0.0 /d&#8217;</td>
<td>List processes by % cpu usage</td>
</tr>
<tr>
<td class="nw">ps -e -orss=,args= | sort -b -k1,1n | pr -TW$COLUMNS</td>
<td>List processes by mem (KB) usage. See also ps_mem.py</td>
</tr>
<tr>
<td class="nw">ps -C firefox-bin -L -o pid,tid,pcpu,state</td>
<td>List all threads for a particular process</td>
</tr>
<tr>
<td class="nw">ps -p 1,$$ -o etime=</td>
<td>List elapsed wall time for particular process IDs</td>
</tr>
<tr>
<td class="nw">last reboot</td>
<td>Show system reboot history</td>
</tr>
<tr>
<td class="nw">free -m</td>
<td>Show amount of (remaining) RAM (-m displays in MB)</td>
</tr>
<tr>
<td class="nw">watch -n.1 &#8216;cat /proc/interrupts&#8217;</td>
<td>Watch changeable data continuously</td>
</tr>
<tr>
<td class="nw">udevadm monitor</td>
<td>Monitor udev events to help configure rules</td>
</tr>
<tr id="sysinfo" class="pbtitle">
<td colspan="2"><strong>system information</strong> (see also sysinfo) (&#8216;#&#8217; means root access is required)</td>
</tr>
<tr>
<td class="nw">uname -a</td>
<td>Show kernel version and system architecture</td>
</tr>
<tr>
<td class="nw">head -n1 /etc/issue</td>
<td>Show name and version of distribution</td>
</tr>
<tr>
<td class="nw">cat /proc/partitions</td>
<td>Show all partitions registered on the system</td>
</tr>
<tr>
<td class="nw">grep MemTotal /proc/meminfo</td>
<td>Show RAM total seen by the system</td>
</tr>
<tr>
<td class="nw">grep &#8220;model name&#8221; /proc/cpuinfo</td>
<td>Show CPU(s) info</td>
</tr>
<tr>
<td class="nw"><acronym title="usually in /sbin/">lspci</acronym> -tv</td>
<td>Show PCI info</td>
</tr>
<tr>
<td class="nw"><acronym title="usually in /sbin/">lsusb</acronym> -tv</td>
<td>Show USB info</td>
</tr>
<tr>
<td class="nw">mount | column -t</td>
<td>List mounted filesystems on the system (and align output)</td>
</tr>
<tr>
<td class="nw">grep -F capacity: /proc/acpi/battery/BAT0/info</td>
<td>Show state of cells in laptop battery</td>
</tr>
<tr>
<td class="nw">dmidecode -q | less</td>
<td>Display SMBIOS/DMI information</td>
</tr>
<tr>
<td class="nw">smartctl -A /dev/sda | grep Power_On_Hours</td>
<td>How long has this disk (system) been powered on in total</td>
</tr>
<tr>
<td class="nw">hdparm -i /dev/sda</td>
<td>Show info about disk sda</td>
</tr>
<tr>
<td class="nw">hdparm -tT /dev/sda</td>
<td>Do a read speed test on disk sda</td>
</tr>
<tr>
<td class="nw">badblocks -s /dev/sda</td>
<td>Test for unreadable blocks on disk sda</td>
</tr>
<tr id="interactive" class="pbtitle">
<td colspan="2"><strong>interactive</strong></td>
</tr>
<tr>
<td class="nw">readline</td>
<td>Line editor used by bash, python, bc, gnuplot, &#8230;</td>
</tr>
<tr>
<td class="nw">screen</td>
<td>Virtual terminals with detach capability, &#8230;</td>
</tr>
<tr>
<td class="nw">mc</td>
<td>Powerful file manager that can browse rpm, tar, ftp, ssh, &#8230;</td>
</tr>
<tr>
<td class="nw">gnuplot</td>
<td>Interactive/scriptable graphing</td>
</tr>
<tr>
<td class="nw">links</td>
<td>Web browser</td>
</tr>
<tr>
<td class="nw">xdg-open <strong>.</strong></td>
<td>open a file or url with the registered desktop application</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.i-net.com.au/2011/04/03/linux-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bulutroofing.com.au</title>
		<link>http://www.i-net.com.au/2011/03/07/bulutroofing-com-au/</link>
		<comments>http://www.i-net.com.au/2011/03/07/bulutroofing-com-au/#comments</comments>
		<pubDate>Mon, 07 Mar 2011 06:11:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Testimonials]]></category>

		<guid isPermaLink="false">http://www.i-net.com.au/?p=1329</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<div class="one_fourth">
<div class="picture_frame"><img width ="106" height="126" alt="" src="http://www.i-net.com.au/wp-content/themes/inet/includes/timthumb.php?src=<img class="alignleft size-full wp-image-1330" title="bulut" src="http://www.i-net.com.au/wp-content/uploads/2011/03/bulut.jpg" alt="" width="228" height="200" />&amp;h=126&amp;w=106&amp;zc=1&#8243; /></div>
</div>
<div class="three_fourth last">
<blockquote>Bill of Internetwork Solutions is the ideal website designer, particularly for those who are starting from scratch.  He has a vast knowledge and experience, and communicates this with clarity and great patience.  I was delighted with my website, and it has received many compliments from my business associates and clients.
<p><cite>- Bekir, Bulut Roofing</cite></p>
</blockquote>
</div>
<div class="clearboth"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.i-net.com.au/2011/03/07/bulutroofing-com-au/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cpcgroup.com.au</title>
		<link>http://www.i-net.com.au/2011/03/07/cpcgroup-com-au/</link>
		<comments>http://www.i-net.com.au/2011/03/07/cpcgroup-com-au/#comments</comments>
		<pubDate>Mon, 07 Mar 2011 05:07:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Testimonials]]></category>

		<guid isPermaLink="false">http://www.i-net.com.au/?p=1325</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<blockquote><p>I would formally like to thank you for your work that you have done for my company&#8217;s website, staff and clients are highly impressed by the standard of professionalism in the design and quality of your work.<br />
On behalf of CPC Group we would like to thank you for your hard work as well as recommend your services to any potential client.
<p><cite>- Rozetta, cpcgroup.com.au</cite></p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.i-net.com.au/2011/03/07/cpcgroup-com-au/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

