<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-4354809881864967742</atom:id><lastBuildDate>Mon, 07 Oct 2024 04:03:25 +0000</lastBuildDate><category>Audio Application for Linux open source</category><title>Mubarak World</title><description></description><link>http://mubarakworld.blogspot.com/</link><managingEditor>noreply@blogger.com (Mubarak World)</managingEditor><generator>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-3813612423586251501</guid><pubDate>Wed, 21 Jan 2009 03:49:00 +0000</pubDate><atom:updated>2009-01-21T19:55:31.827-08:00</atom:updated><title>More Solaris tips</title><description>&lt;ul style=&quot;font-family: verdana; color: rgb(153, 153, 0); font-weight: bold;&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-family: verdana;font-size:100%;&quot; &gt;&lt;u&gt;Create a directory and move into it at the same time&lt;/u&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: verdana; color: rgb(153, 153, 0);font-family:Arial;font-size:100%;&quot;  &gt;&lt;br /&gt;Question: How often do you create a new directory and then move into that directory in your next command?  Answer: Almost always.&lt;br /&gt;&lt;br /&gt;I realized this trend in my own work habits, so I created a simple shell function to do the hard work for me.&lt;br /&gt;&lt;br /&gt;     &lt;span style=&quot;font-weight: bold;&quot;&gt;md () {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;           mkdir -p $1  &amp;amp;&amp;amp;  cd $1&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;      }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is a Bourne shell function named &quot;md&quot; that works for Bourne and Korn shell users. It can be easily adapted for C shell users.&lt;br /&gt;&lt;br /&gt;Taking advantage of the -p option of the mkdir command, the function easily creates multi-level subdirectories, and moves you into the lowest level of the directory structure.  You can use the command to create one subdirectory like this:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;     /home/al&gt; md docs&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;      /home/al/docs&gt; _&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;or you can create an entire directory tree and move right into the new directory like this:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;     /home/al&gt; md docs/memos/internal/solaris8&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;      /home/al/docs/memos/internal/solaris8&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul style=&quot;font-family: verdana; color: rgb(153, 153, 0);&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-family: verdana;font-size:100%;&quot; &gt;&lt;b&gt;&lt;u&gt;Easily convert man pages to text documents&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: verdana; color: rgb(153, 153, 0);font-family:Arial;font-size:100%;&quot;  &gt;&lt;br /&gt;Have you ever wanted to convert a man page into a plain text document?&lt;br /&gt;I do this occasionally when I want to share information via an email or other document format.&lt;br /&gt;&lt;br /&gt;I used to think this was difficult, but then I discovered a simple way to do it. Here&#39;s the wrong way to write the man page for the ls command into a text file named ls.bad:&lt;br /&gt;&lt;br /&gt;     &lt;span style=&quot;font-weight: bold;&quot;&gt;man ls &gt; ls.bad&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This keeps all of the formatting characters in your document, which is generally not what you want.  Here&#39;s a better way that eliminates those formatting characters:&lt;br /&gt;&lt;br /&gt;     &lt;span style=&quot;font-weight: bold;&quot;&gt;man ls | col -b &gt; man.txt&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The col command with the -b option removes the undesirable backspace characters from the text stream, so the only thing left in your document is the text you want, in the format you want.&lt;/span&gt;&lt;span style=&quot;color: rgb(153, 153, 0);font-size:100%;&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; color: rgb(153, 153, 0);font-size:100%;&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;ul style=&quot;font-family: verdana; color: rgb(153, 153, 0);&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-family: verdana;font-size:100%;&quot; &gt;&lt;u&gt;&lt;b&gt;How to page more than one command at a time&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: verdana; color: rgb(153, 153, 0);font-family:Arial;font-size:100%;&quot;  &gt;&lt;br /&gt;Have you ever wanted to group a bunch of commands into a paging program like &quot;page&quot; or &quot;more&quot;, but didn&#39;t know how?&lt;br /&gt;&lt;br /&gt;As a system administrator, I always worry about certain things, like who&#39;s doing what, what processes are running, what the network traffic looks like, etc.  One day I decided to create a simple alias that would combine all the commands I wanted into one big chunk of information.  Then I realized that it wouldn&#39;t all fit into one screen.&lt;br /&gt;&lt;br /&gt;Fortunately I knew how to group all of the commands together, so the &quot;more&quot; command could handle them as one set of input.&lt;br /&gt;&lt;br /&gt;First, here&#39;s the wrong way to try to page a sequence of four commands:&lt;br /&gt;&lt;br /&gt;     &lt;span style=&quot;font-weight: bold;&quot;&gt;date; netstat -i; whodo; ps -ef | more&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The only command that gets paged properly here is the &quot;ps -ef&quot; command&lt;br /&gt;--the rest of them scroll off the screen before you can read them.&lt;br /&gt;&lt;br /&gt;Here&#39;s the correct way to page four commands so they&#39;re all controlled&lt;br /&gt;by &quot;more&quot;:&lt;br /&gt;&lt;br /&gt;     &lt;span style=&quot;font-weight: bold;&quot;&gt;(date; netstat -i; whodo; ps -ef) | more&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Once you find the commands you want to group together, you can combine them into an alias or shell program.  I recommend a shell program for this, because a few &quot;echo&quot; statements sure make it easier to see where one command ends and the next command begins!&lt;/span&gt;&lt;span style=&quot;color: rgb(153, 153, 0);font-size:100%;&quot; &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: verdana; color: rgb(153, 153, 0);font-family:Arial;font-size:100%;&quot;  &gt;&lt;b&gt;&lt;u&gt;Changing a file&#39;s owner and group at the same time&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: verdana; color: rgb(153, 153, 0);font-family:Arial;font-size:100%;&quot;  &gt;&lt;br /&gt;Did you know that in Solaris 2.x you can change both the user and group ownership on a file at the same time by running /usr/ucb/chown?&lt;br /&gt;&lt;br /&gt;For example, suppose you have a file called /export/home/grahamc/myfile that is owned by user &#39;grahamc&#39; and group &#39;users&#39;. To change the ownerships, you could type the following as root:&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;font-weight: bold;&quot;&gt;/usr/ucb/chown grahamc:users /export/home/grahamc/myfile&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;rather than typing:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;    /usr/bin/chown grahamc /export/home/grahamc/myfile&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;     /usr/bin/chgrp users   /export/home/grahamc/myfile&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can also recursively change ownerships with the -R option.&lt;br /&gt;&lt;br /&gt;For more information, try:   &lt;span style=&quot;font-weight: bold;&quot;&gt;man -s 1b chown &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(153, 153, 0);font-size:100%;&quot; &gt;&lt;br /&gt;&lt;/span&gt;</description><link>http://mubarakworld.blogspot.com/2009/01/more-solaris-tips.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-2537400415226285302</guid><pubDate>Sun, 18 Jan 2009 21:27:00 +0000</pubDate><atom:updated>2009-01-21T19:49:08.367-08:00</atom:updated><title>Solaris Tips</title><description>&lt;span style=&quot;color: rgb(153, 153, 0);font-family:verdana;font-size:100%;&quot;  &gt;As I start working again my OpenSolaris, I&#39;m posting few tips i learned recently&lt;/span&gt;&lt;span style=&quot;color: rgb(153, 153, 0);font-size:100%;&quot; &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul style=&quot;color: rgb(153, 153, 0);&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;u&gt;&lt;strong&gt;Finding text strings in binary files&lt;/strong&gt;&lt;/u&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;color: rgb(153, 153, 0);font-size:100%;&quot; &gt;&lt;br /&gt;Ever wondered what&#39;s inside some of those binary files on your system (binary executables or binary data)? Several times I&#39;ve gotten error messages from some command in the Solaris system, but I couldn&#39;t tell where the error was coming from because it was buried in some binary executable file.&lt;br /&gt;&lt;br /&gt;The Solaris &quot;strings&quot; command lets you look at the ASCII text buried inside of executable files, and can often help you troubleshoot problems. For instance, one time I was seeing error messages like this when a user was trying to log in:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Could not set ULIMIT &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I finally traced the problem down to the /bin/login command by running the &quot;strings&quot; command like this:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;root&gt; strings /bin/login | more&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The strings command lists ASCII character sequences in binary files, and help me determine that the &quot;Could not set ULIMIT&quot; error was coming from this file. Once I determined that the error message I was seeing was coming from this file, solving the problem became a simple matter.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul style=&quot;color: rgb(153, 153, 0);&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;u&gt;&lt;strong&gt;A vi macro to display line numbers&lt;/strong&gt;&lt;/u&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;color: rgb(153, 153, 0);font-size:100%;&quot; &gt;&lt;br /&gt;While the vi editor has been known to be a little rough around the edges, it still has some pretty nice features. One of those features is the ability to define cool macros. Here we&#39;ll show you how to create two macros--one to display line numbers of the file you&#39;re editing, and one to hide the line numbers.&lt;br /&gt;&lt;br /&gt;First, create a file named .exrc in your home directory (or edit the current file if it already exists). This is the configuration file that vi reads when it is started. Put the following two lines into this file:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;    :map #1 :set number^M&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;     :map #2 :set nonumber^M&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;(A very important note: create the ^M characters in this file by typing the key sequence [CTRL-V][CTRL-M]. This key sequence embeds an actual ^M character (the carriage return) into the file.)&lt;br /&gt;&lt;br /&gt;Now, save this file and re-start vi. From vi&#39;s command-mode, you&#39;ll now be able to display line numbers beside your file contents by hitting the [F1] function key, and clear line numbers by hitting the [F2] key. If you like these macros, create your own powerful macros by following this same technique!&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul style=&quot;color: rgb(153, 153, 0);&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;u&gt;&lt;strong&gt;Use traceroute to find network problems&lt;/strong&gt;&lt;/u&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;color: rgb(153, 153, 0);font-size:100%;&quot; &gt;&lt;br /&gt;With the Internet and TCP/IP networks all around us, it&#39;s important to know a little bit about TCP/IP network troubleshooting. The Solaris &quot;traceroute&quot; command lets you trace the route your packets are taking to get from your current workstation to a remote workstation you&#39;re trying to reach.&lt;br /&gt;&lt;br /&gt;For instance, suppose you&#39;re on the Internet and you&#39;re not getting an HTTP response from a remote server named www.zdtips.com. You try to &quot;ping&quot; the remote site like this:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;ping www.zdtips.com&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;but get no answer. Is the remote server down, or is there a broken link between you and the remote site? Issue the following command to see where the problem lies:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;traceroute www.zdtips.com&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The traceroute command works its way through the network, and tells you the path it&#39;s taking to get to the destination site as it goes along. Watch for the point traceroute fails to learn more about the network segment that has failed. Of course you can also try this on working connections to learn more about how your Internet packets get from one site to another.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul style=&quot;color: rgb(153, 153, 0);&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;u&gt;&lt;strong&gt;Using telnet&#39;s command mode&lt;/strong&gt;&lt;/u&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;color: rgb(153, 153, 0);font-size:100%;&quot; &gt;&lt;br /&gt;When you use the Solaris telnet command to log in from one site to another, don&#39;t forget that you can enter telnet&#39;s command mode at any time during&lt;br /&gt;your session, usually by entering the following key sequence:&lt;br /&gt;&lt;br /&gt;[CTRL] &lt;span style=&quot;font-weight: bold;&quot;&gt;]&lt;/span&gt; (the control key and right-bracket key at the same time)&lt;br /&gt;&lt;br /&gt;When this is successful, you&#39;ll see the following prompt:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;telnet&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then, from the &quot;telnet&gt;&quot; prompt, enter &quot;?&quot; to learn more about the available telnet commands. A few commands that will give you more help at the prompt are shown below:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;    &lt;/span&gt;&lt;span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;display&lt;/span&gt;        displays many current Telnet settings&lt;/span&gt;&lt;br /&gt;&lt;span&gt;     &lt;span style=&quot;font-weight: bold;&quot;&gt;send ?&lt;/span&gt;        displays commands you can &quot;send&quot; to the remote site&lt;/span&gt;&lt;br /&gt;&lt;span&gt;     &lt;span style=&quot;font-weight: bold;&quot;&gt;set ?&lt;/span&gt;             displays variables that can be set&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;One of my favorites (mostly when fooling around) is:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; send ayt&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;which means &quot;send this message: are you there?&quot;.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul style=&quot;color: rgb(153, 153, 0);&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;u&gt;&lt;strong&gt;Keep commands running after you leave with nohup&lt;/strong&gt;&lt;/u&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;color: rgb(153, 153, 0);font-size:100%;&quot; &gt;&lt;br /&gt;It&#39;s 3 p.m., and you want to start a long job running. Unfortunately, you can&#39;t be sure that the job will finish by 5 p.m. when you need to leave, and the company is very strict about making sure you log off when you leave. However, if you log off the system, the job will be stopped. What can you do?&lt;br /&gt;&lt;br /&gt;On Solaris systems you can use the &quot;nohup&quot; (no hang-up) command to keep jobs running long after you log off the system. Using nohup tells the system not to &quot;hang-up&quot; on your job after you&#39;ve logged off the system.&lt;br /&gt;&lt;br /&gt;Here&#39;s how to run the job, and keep it running after you log off:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;root&gt; nohup my-long-job &amp;amp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This creates a file named &quot;nohup.out&quot; in the current directory that contains the standard output of the command (&quot;my-long-job&quot;) you&#39;re running. Everyone is happy because the job keeps running, you get to leave at 5 p.m., and you&#39;re properly logged off the system.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul style=&quot;color: rgb(153, 153, 0);&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;u&gt;&lt;strong&gt;Use rsh to run commands on somebody else&#39;s computer&lt;/strong&gt;&lt;/u&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;color: rgb(153, 153, 0);font-size:100%;&quot; &gt;&lt;br /&gt;Here&#39;s a hypothetical situation for you: On the &quot;Sesame Street Network&quot;, you&#39;re logged into a Solaris workstation named &quot;elmo&quot;, and you need to look at the man pages for the tar command. Unfortunately the man pages aren&#39;t installed on this workstation.&lt;br /&gt;&lt;br /&gt;If you&#39;re on a network of Solaris computers like this, and you know that the man pages are installed on another workstation named &quot;bigbird&quot;, the solution is simple. Simply run the man command on bigbird, like this:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;elmo&gt; rsh bigbird &quot;man ksh&quot; | more&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This runs the &quot;man ksh&quot; command on bigbird, and pipes the output of the command into the &quot;more&quot; command on elmo.&lt;br /&gt;&lt;br /&gt;Here&#39;s a few other &quot;rsh&quot; commands you can run on remote workstations:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;rsh bigbird &quot;who&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; rsh ernie &quot;ps -ef&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; rsh grover &quot;ls -al /home&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul style=&quot;color: rgb(153, 153, 0);&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;u&gt;&lt;strong&gt;Use CDPATH to traverse file systems faster&lt;/strong&gt;&lt;/u&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;color: rgb(153, 153, 0);font-size:100%;&quot; &gt;&lt;br /&gt;If you&#39;re like many Solaris users and administrators, you spend a lot of time moving back and forth between directories in similar locations. For instance, you might often work in your home directory (such as &quot;/home/al&quot;), the /usr/local directories, web page directories, or other user&#39;s home directories in /home.&lt;br /&gt;&lt;br /&gt;If you&#39;re often moving back-and-forth between the same directories, and you use the Bourne shell (sh) or Korn shell (ksh) as your login shell, you can use the CDPATH shell variable to save yourself a lot of typing, and quickly move between directories.&lt;br /&gt;&lt;br /&gt;Here&#39;s a quick demo. First move to the root directory:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;cd /&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Next, if it&#39;s not set already, set your CDPATH shell variable as follows:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;CDPATH=/usr/spool&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then, type this cd command:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;cd cron&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;What happens? Type this and see what happened:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;pwd&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The result should be &quot;/usr/spool/cron&quot;.&lt;br /&gt;&lt;br /&gt;When you typed &quot;cd cron&quot;, the shell looked in your local directory for a sub-directory named &quot;cron&quot;. When it didn&#39;t find one, it searched the CDPATH variable, and looked for a &quot;cron&quot; sub-directory. When it found a sub-directory named cron in the /usr/spool directory, it moved you there.&lt;br /&gt;&lt;br /&gt;You can set your CDPATH variable just like your normal PATH variable:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; CDPATH=/home/al:/usr/local:/usr/spool:/home&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul style=&quot;color: rgb(153, 153, 0);&quot;&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-family:Arial;font-size:100%;&quot;  &gt;&lt;u&gt;&lt;strong&gt;Rearranging columns with awk&lt;/strong&gt;&lt;/u&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;color: rgb(153, 153, 0);font-family:Arial;font-size:100%;&quot;  &gt;&lt;br /&gt;Have you ever had a column-oriented text file, similar to a spreadsheet, but the columns weren&#39;t in the order you wanted? For instance, suppose you had the following information in a file named &quot;checkbook.orig&quot;:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;    COST         DATE            BALANCE&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;     10.00         040198           1000.00&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;     20.00         040298             980.00&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;     30.00         040298             950.00&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The information is good, but you&#39;d prefer to have the DATE column first, followed by the COST information in the second column, and the BALANCE column third.&lt;br /&gt;&lt;br /&gt;Using awk, you can easily rearrange the columns. The following command reads the data from the file named &quot;checkbook.orig&quot;, and writes the data to a file named &quot;checkbook.new&quot;:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;awk &#39;{print $2, $1, $3}&#39; checkbook.orig &gt; checkbook.new&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This brief awk command reads each line of the original file, and for each line it reads, it writes an output line to the &quot;new&quot; file. As it writes each record to the new file, it rearranges the order of the columns, so that the columns now appear in the desired order!&lt;br /&gt;&lt;br /&gt;If you prefer a little more control of the printed output, awk also has a &quot;printf&quot; function that&#39;s very similar to printf in the &quot;C&quot; programming language. Here&#39;s the same example, with a tab character in-between each column of the output:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;awk &#39;{printf (&quot;%s\t%s\t%s\n&quot;, $2, $1, $3) }&#39; checkbook.orig &gt; checkbook.new&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The awk command is a powerful programming utility that takes care of things like opening files and reading each line automatically, so all you have to do is tell awk how to process each line as it goes by.&lt;/span&gt;</description><link>http://mubarakworld.blogspot.com/2009/01/solaris-tips.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-5434958777322734635</guid><pubDate>Sat, 17 Jan 2009 11:51:00 +0000</pubDate><atom:updated>2009-01-17T04:33:16.455-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Audio Application for Linux open source</category><title>Amazing audio applications for Linux</title><description>&lt;a href=&quot;http://www.ardour.org/&quot;&gt;&lt;span style=&quot;;font-family:verdana;font-size:130%;&quot;  &gt;&lt;strong style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href=&quot;http://www.ardour.org&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;strong&gt;Ardour:&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;p  style=&quot;font-family:verdana;&quot;&gt; &lt;/p&gt;&lt;p  style=&quot;font-family:verdana;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://farm3.static.flickr.com/2302/2322833140_18429e20d3.jpg?v=0&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 500px; height: 400px;&quot; src=&quot;http://farm3.static.flickr.com/2302/2322833140_18429e20d3.jpg?v=0&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p style=&quot;color: rgb(153, 153, 0); font-family: verdana;&quot;&gt;Ardour is a digital audio workstation. You can use it to record, edit and mix multi-track audio. You can produce your own CDs, mix video soundtracks, or just experiment with new ideas about music and sound.&lt;/p&gt;&lt;p style=&quot;color: rgb(153, 153, 0); font-family: verdana;&quot;&gt;Ardour capabilities include: multichannel recording, non-destructive editing with unlimited undo/redo, full automation support, a powerful mixer, unlimited tracks/busses/plugins, timecode synchronization, and hardware control from surfaces like the Mackie Control Universal. If you’ve been looking for a tool similar to ProTools, Nuendo, Pyramix, or Sequoia, you might have found it.&lt;/p&gt;&lt;p  style=&quot;font-family:verdana;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p face=&quot;verdana&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;a href=&quot;http://audacity.sourceforge.net/&quot;&gt;&lt;strong&gt;Audacity:&lt;/strong&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;a style=&quot;font-family: verdana;&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://spaghetticode.org/alexander_romanov_icons/audacity-linux.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 633px; height: 560px;&quot; src=&quot;http://spaghetticode.org/alexander_romanov_icons/audacity-linux.jpg&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;p style=&quot;color: rgb(153, 153, 0); font-family: verdana;&quot;&gt;Audacity is a free, easy-to-use audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems. You can use Audacity to:&lt;/p&gt; &lt;p style=&quot;color: rgb(153, 153, 0); font-family: verdana;&quot;&gt;Record live audio.&lt;br /&gt;Convert tapes and records into digital recordings or CDs.&lt;br /&gt;Edit Ogg Vorbis, MP3, WAV or AIFF sound files.&lt;br /&gt;Cut, copy, splice or mix sounds together.&lt;br /&gt;Change the speed or pitch of a recording.&lt;br /&gt;And more!&lt;/p&gt;&lt;p face=&quot;verdana&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;a href=&quot;http://nostatic.org/grip&quot;&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p face=&quot;verdana&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;a href=&quot;http://nostatic.org/grip&quot;&gt;&lt;strong&gt;Grip:&lt;/strong&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;font-family: verdana;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://nostatic.org/grip/shot2.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 340px; height: 419px;&quot; src=&quot;http://nostatic.org/grip/shot2.gif&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p style=&quot;color: rgb(153, 153, 0); font-family: verdana;&quot;&gt;Grip is a cd-player and cd-ripper for the Gnome desktop. It has the ripping capabilities of cdparanoia builtin, but can also use external rippers (such as cdda2wav). It also provides an automated frontend for MP3 (and other audio format) encoders, letting you take a disc and transform it easily straight into MP3s. Internet disc lookups are supported for retrieving track information from disc database servers.Grip works with DigitalDJ to provide a unified “computerized” version of your music collection.&lt;/p&gt;&lt;p style=&quot;color: rgb(153, 153, 0); font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;font-family: verdana;&quot;&gt;&lt;a href=&quot;http://www.hydrogen-music.org/&quot;&gt;&lt;strong&gt;Hydrogen:&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;font-family: verdana;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.hydrogen-music.org/images/screenshots/hydrogen_and_ardour.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 588px; height: 378px;&quot; src=&quot;http://www.hydrogen-music.org/images/screenshots/hydrogen_and_ardour.png&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p style=&quot;color: rgb(153, 153, 0); font-family: verdana;&quot;&gt;Hydrogen is an advanced drum machine for GNU/Linux. It’s main goal is to bring professional yet simple and intuitive pattern-based drum programming which is able to be used either by itself,    emulating a drum machine based on patterns, or via an external MIDI    keyboard/sequencer software. Hydrogen compiles on Linux/x86 and MAC OSX, although the latter is still experimental.&lt;/p&gt;&lt;p style=&quot;color: rgb(153, 153, 0); font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;font-family: verdana;&quot;&gt;&lt;a href=&quot;http://www.jokosher.org/&quot;&gt;&lt;strong&gt;Jokosher:&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;font-family: verdana;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.jokosher.org/wp-content/uploads/2006/11/jokosher-0-2-mixing.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 270px;&quot; src=&quot;http://www.jokosher.org/wp-content/uploads/2006/11/jokosher-0-2-mixing.png&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style=&quot;color: rgb(153, 153, 0); font-family: verdana;&quot;&gt;Jokosher is a simple and powerful multi-track studio. Jokosher provides a complete application for recording, editing, mixing and exporting audio, and has been specifically designed with usability in mind.&lt;/p&gt; &lt;p style=&quot;color: rgb(153, 153, 0); font-family: verdana;&quot;&gt;The developers behind Jokosher have re-thought audio production at every level, and created something devilishly simple to use.&lt;/p&gt;&lt;p style=&quot;color: rgb(153, 153, 0); font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://lmms.sourceforge.net/&quot;&gt;&lt;strong&gt;LMMS:&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://lmms.sourceforge.net/screenshots/0.4.0/lmms-0.4.0-6.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 545px; height: 314px;&quot; src=&quot;http://lmms.sourceforge.net/screenshots/0.4.0/lmms-0.4.0-6.jpg&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style=&quot;color: rgb(153, 153, 0);&quot;&gt;LMMS aims to be a free alternative to popular (but commercial and closed- source) programs like FruityLoops/FL Studio, Cubase and Logic allowing you to produce music with your computer. This includes creation of loops, synthesizing and mixing sounds, arranging samples, having fun with your MIDI-keyboard and much more.&lt;/p&gt;&lt;p style=&quot;color: rgb(153, 153, 0);&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.muse-sequencer.org/&quot;&gt;&lt;strong&gt;MusE:&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://linux-sound.org/images/blog/full-size/1-jack-qjackctl-muse-sync.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 583px; height: 406px;&quot; src=&quot;http://linux-sound.org/images/blog/full-size/1-jack-qjackctl-muse-sync.png&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style=&quot;color: rgb(153, 153, 0);&quot;&gt;MusE is a MIDI/Audio sequencer with recording and editing capabilities written by Werner Schweer. MusE aims to be a complete multitrack virtual studio for Linux.&lt;/p&gt; &lt;p style=&quot;color: rgb(153, 153, 0);&quot;&gt;Midi sequencing&lt;br /&gt;Record/Playback/Import&lt;br /&gt;Input filter&lt;br /&gt;Audio sequencing&lt;br /&gt;Record/Playback several mono/stereo inputs/outputs.&lt;br /&gt;AudioGroups&lt;/p&gt;&lt;p style=&quot;color: rgb(153, 153, 0);&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.kde-apps.org/content/show.php?content=29024&quot;&gt;&lt;strong&gt;soundKonverter:&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.kde-apps.org/CONTENT/content-pre1/29024-1.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 547px; height: 421px;&quot; src=&quot;http://www.kde-apps.org/CONTENT/content-pre1/29024-1.png&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p style=&quot;color: rgb(153, 153, 0);&quot;&gt;soundKonverter is a frontend to various audio converters.&lt;/p&gt; &lt;p style=&quot;color: rgb(153, 153, 0);&quot;&gt;The key features are:&lt;br /&gt;Audio conversion&lt;br /&gt;Replay Gain calculation&lt;br /&gt;CD ripping&lt;/p&gt;&lt;p style=&quot;color: rgb(153, 153, 0);&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://streamripper.sourceforge.net/&quot;&gt;&lt;strong&gt;Streamripper:&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;color: rgb(153, 153, 0);&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://farm1.static.flickr.com/140/349463256_11e4852e4a.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 500px; height: 375px;&quot; src=&quot;http://farm1.static.flickr.com/140/349463256_11e4852e4a.jpg&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style=&quot;color: rgb(153, 153, 0);&quot;&gt;With the emergence of file sharing protocols such as Napster, Gnutella, and now Mojonation and Freenet, the average Internet user can download nearly any mp3 he wants in a matter of no time, but many times people don’t know what they want. Streamripper allows you to download an entire station of music. Many of these mp3 radio stations only play certain genres, so you can now download an entire collection of goa/trance music, an entire collection of jazz, punk rock, whatever you want.&lt;/p&gt;</description><link>http://mubarakworld.blogspot.com/2009/01/amazing-audio-applications-for-linux.html</link><author>noreply@blogger.com (Mubarak World)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://farm1.static.flickr.com/140/349463256_11e4852e4a_t.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-675625092216673241</guid><pubDate>Sat, 17 Jan 2009 10:06:00 +0000</pubDate><atom:updated>2009-01-17T02:14:27.282-08:00</atom:updated><title>Frozen-Bubble: Addictive Game for Linux</title><description>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://manual.sidux.com/meta-manual/lib/images-games/frozen-bubble/frozen-bubble2.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 545px; height: 409px;&quot; src=&quot;http://manual.sidux.com/meta-manual/lib/images-games/frozen-bubble/frozen-bubble2.jpg&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.frozen-bubble.org/&quot;&gt;Frozen-Bubble&lt;/a&gt; has blissfully stolen hours and hours of my life with its addictive gameplay and &lt;span style=&quot;font-style: italic;&quot;&gt;flippin&#39;&lt;/span&gt; awesome soundtrack. It&#39;s an easy game with a simple premise: shoot colors bubbles onto the game board in an attempt to match up three or more similarly colored bubbles. Doing so will cause them to fall from the board, taking connected bubbles with them. If you clear all of the bubbles, you move on to the next level. If the bubbles pile up and cover the entire screen, you lose the game and restart the entire level.&lt;br /&gt;&lt;br /&gt;Because my description is probably dense and hard to grasp, here&#39;s a video. By the way, no one gets to make fun of my mad Frozen-Bubble skillz.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;object width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/4AxSIkM77Ow&amp;amp;hl=en&amp;amp;fs=1&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/4AxSIkM77Ow&amp;amp;hl=en&amp;amp;fs=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;The &lt;a href=&quot;http://www.frozen-bubble.org/&quot;&gt;developer website&lt;/a&gt; lists the features well:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;Colorful 3D rendered penguin animations, 100 levels of 1p game, hours and hours of 2p game, nights and nights of 2p/3p/4p/5p game over LAN or Internet, a level-editor, 3 professional quality digital soundtracks, 15 stereo sound effects, 8 unique graphical transition effects, 8 unique logo eye-candies.&lt;/blockquote&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Let me emphasize again&lt;/span&gt;: the soundtrack is &lt;span style=&quot;font-style: italic;&quot;&gt;amazing&lt;/span&gt;. It sounds really, really good. And the multiplayer is a lot of fun, especially over the LAN.&lt;br /&gt;&lt;br /&gt;Install frozen-bubble using &lt;a href=&quot;http://thedailyubuntu.blogspot.com/2008/02/bonus-installing-applications.html&quot;&gt;Synaptic&lt;/a&gt;, the &lt;a href=&quot;http://thedailyubuntu.blogspot.com/2008/02/bonus-installing-applications.html&quot;&gt;Add/Remove...&lt;/a&gt; dialog, or by typing the following into the Terminal:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;sudo apt-get install frozen-bubble&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://mubarakworld.blogspot.com/2009/01/frozen-bubble-has-blissfully-stolen.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-8953982619832592917</guid><pubDate>Sat, 17 Jan 2009 09:36:00 +0000</pubDate><atom:updated>2009-01-17T02:06:54.516-08:00</atom:updated><title>Linux Shell Editing Shortcuts</title><description>&lt;div  style=&quot;text-align: center;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;One of the secrets power shell users know is that they don&#39;t really have to be great typists. They take advantage of the typing shortcuts the shell offers.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:130%;&quot; &gt;Fixing Mistakes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;You probably know you can erase the last character by hitting the backspace key. But you can correct mistakes in a lot more ways than that.&lt;br /&gt;&lt;br /&gt;First trick: Ctrl-U deletes everything back to the beginning of the line. No need to hold the backspace key down and wait while it repeats; a single Ctrl-U is much faster. It&#39;s great for when you change your mind about a command or want to clear the line and think about what to do next. Think of U as Undoing the line you were typing.&lt;br /&gt;&lt;br /&gt;Next -- and my personal favorite -- is Ctrl-W to erase the last word. Like Ctrl-U, it&#39;s a lot faster than holding the backspace key down and waiting. But unlike Ctrl-U, it lets you keep some of what you already typed. Try it -- you&#39;ll be amazed how handy it is.&lt;br /&gt;&lt;br /&gt;You may have noticed that you can use the left and right arrow keys while you&#39;re typing a line in the shell. But Home and End don&#39;t work to go to the beginning and end of a line -- how do you do that? The secret: type Ctrl-A to go to the beginning of the line, Ctrl-E to go to the end. To remember those two, think of A as being at the beginning of the alphabet while E just stands for &quot;End&quot;.&lt;br /&gt;&lt;br /&gt;If you move the cursor back while you&#39;re editing a line, with the left arrow or Ctrl-A, you might also be interested in Ctrl-K. It deletes from the cursor position to the end of the line.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:130%;&quot; &gt;Enabling editing shortcuts in other apps&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Most of these editing shortcuts will work in lots of other Linux apps besides the shell, though not every program supports all of them. Try them in editors, mail programs, browsers.&lt;br /&gt;&lt;br /&gt;In some programs and on some Linux distros, they aren&#39;t enabled by default. If you find them useful, you can turn them on for Firefox and any GTK-based applications by setting your Gnome key theme to &quot;Emacs&quot;. To do that, either add the line&lt;br /&gt;&lt;br /&gt;gtk-key-theme-name = &quot;Emacs&quot;&lt;br /&gt;&lt;br /&gt;to a file named .gtkrc-2.0 in your home directory, or run this command:&lt;br /&gt;&lt;br /&gt;gconftool-2 --set /desktop/gnome/interface/gtk_key_theme Emacs --type string&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://mubarakworld.blogspot.com/2009/01/linux-shell-editing-shortcuts.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-7632038368323445221</guid><pubDate>Sun, 04 Jan 2009 07:53:00 +0000</pubDate><atom:updated>2009-01-03T23:59:53.292-08:00</atom:updated><title>Test C++, Perl, PHP, Ruby or Python Code Online</title><description>Just go to &lt;a href=&quot;http://codepad.org/&quot;&gt;codepad.org&lt;/a&gt; and enter your code in any of the following languages: C, C++, D, Haskell, OCaml, Perl, Plain Text, Python, Ruby, Scheme, and Tcl. Once you’ve entered your code you then have the option of either pasting and running your code to test it or just pasting it. If any errors are found in the code that you have written, Codepad will point out the error and give you an explanation of what you have done wrong along with the line in which that error occurs. Also, after entering your code, Codepad will create a page where you and others clan go to test and collaborate.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;This is a simple free tool that allows both advanced and beginner-level programmers to test their code. Most appealing is the potential it offers for group collaboration.&lt;br /&gt;&lt;br /&gt;It&#39;s usage looks like that:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot; class=&quot;heading&quot;&gt;C++&lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;label&quot;&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;/span&gt; &lt;/span&gt; &lt;/p&gt;&lt;table style=&quot;border-top: 1px solid rgb(204, 204, 204); border-bottom: 1px solid rgb(204, 204, 204); color: rgb(246, 246, 246);&quot; bg=&quot;&quot; border=&quot;0&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot;&gt; &lt;tbody&gt;&lt;tr&gt;  &lt;td style=&quot;border-right: 1px solid rgb(204, 204, 204);&quot; valign=&quot;top&quot;&gt; &lt;div class=&quot;highlight&quot; style=&quot;line-height: 1.1em;&quot;&gt; &lt;pre&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;a name=&quot;line-1&quot;&gt;1&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;a name=&quot;line-2&quot;&gt;2&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;a name=&quot;line-3&quot;&gt;3&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;a name=&quot;line-4&quot;&gt;4&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;a name=&quot;line-5&quot;&gt;5&lt;/a&gt;&lt;/span&gt; &lt;/pre&gt; &lt;/div&gt; &lt;/td&gt; &lt;td valign=&quot;top&quot; width=&quot;100%&quot;&gt; &lt;div class=&quot;highlight&quot; style=&quot;line-height: 1.1em;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color: rgb(204, 51, 204);&quot; class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 0);&quot; class=&quot;n&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot; class=&quot;p&quot;&gt;(){&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot; class=&quot;kt&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot; class=&quot;n&quot;&gt;hostname&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot; class=&quot;p&quot;&gt;[]&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot; class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot; class=&quot;s&quot;&gt;&quot;blogspot.com/&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot; class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot; class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot; class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot; class=&quot;s&quot;&gt;&quot;http://mubarakworld.%s&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot; class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot; class=&quot;n&quot;&gt;hostname&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot; class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot; class=&quot;k&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot; class=&quot;n&quot;&gt;EXIT_SUCCESS&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot; class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot; class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt; &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;  &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;a style=&quot;font-style: italic;&quot; name=&quot;output&quot;&gt;&lt;span class=&quot;heading&quot;&gt;Output:&lt;/span&gt;&lt;/a&gt; &lt;table style=&quot;border-top: 1px solid rgb(204, 204, 204); border-bottom: 1px solid rgb(204, 204, 204); color: rgb(246, 246, 246);&quot; bg=&quot;&quot; border=&quot;0&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot;&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td style=&quot;border-right: 1px solid rgb(204, 204, 204); color: rgb(0, 0, 0);&quot; align=&quot;right&quot; valign=&quot;top&quot;&gt; &lt;pre&gt;&lt;span style=&quot;&quot;&gt;&lt;a name=&quot;output-line-1&quot;&gt;1&lt;/a&gt;&lt;/span&gt; &lt;/pre&gt; &lt;/td&gt; &lt;td style=&quot;color: rgb(0, 0, 0);&quot; valign=&quot;top&quot; width=&quot;100%&quot;&gt; &lt;pre&gt;http://mubarakworld.blogspot.com/ &lt;/pre&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;a href=&quot;http://codepad.org/&quot;&gt;http://codepad.org/&lt;/a&gt;</description><link>http://mubarakworld.blogspot.com/2009/01/test-c-perl-php-ruby-or-python-code.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-7191779281399557340</guid><pubDate>Thu, 01 Jan 2009 04:07:00 +0000</pubDate><atom:updated>2008-12-31T20:15:09.228-08:00</atom:updated><title>Perl Myths</title><description>&lt;div&gt;&lt;br /&gt;                &lt;span class=&quot;slideshow-title&quot;  style=&quot;font-size:14;&quot;&gt;Perl Myths &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                &lt;div class=&quot;slideshow-embed&quot;&gt;&lt;div style=&quot;width: 425px; text-align: left;&quot; id=&quot;__ss_298087&quot;&gt;&lt;object style=&quot;margin: 0px;&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://static.slideshare.net/swf/ssplayer2.swf?doc=perl-myths-200802-1204994252321994-4&amp;amp;stripped_title=perl-myths-200802&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://static.slideshare.net/swf/ssplayer2.swf?doc=perl-myths-200802-1204994252321994-4&amp;amp;stripped_title=perl-myths-200802&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style=&quot;font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                &lt;div class=&quot;slideshow-description&quot;&gt;Perl programming has it&#39;s share of myths. This presentation debunks a few popular ones with hard facts. Surprise yourself with the realities.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;              &lt;/div&gt;&lt;br /&gt;            &lt;img style=&quot;visibility: hidden; width: 0px; height: 0px;&quot; src=&quot;http://counters.gigya.com/wildfire/IMP/CXNID=2000002.0NXC/bHQ9MTIzMDc4Mjg3MDc2NSZwdD*xMjMwNzgyODkzMTA5JnA9MTAxOTEmZD*mbj1ibG9nZ2VyJmc9MSZ*PSZvPTg3NjBjNGI5ZDc*ZjRkYTJiMjRiNjhkNmUxMmQ1OGU3.gif&quot; border=&quot;0&quot; width=&quot;0&quot; height=&quot;0&quot; /&gt;</description><link>http://mubarakworld.blogspot.com/2008/12/perl-myths.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-753389379053045308</guid><pubDate>Thu, 01 Jan 2009 03:59:00 +0000</pubDate><atom:updated>2008-12-31T20:14:38.834-08:00</atom:updated><title>Perl 5.10 for People Who Aren&#39;t Totally Insane</title><description>&lt;div&gt;&lt;br /&gt;                &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                 &lt;div class=&quot;slideshow-embed&quot;&gt;&lt;div style=&quot;width: 425px; text-align: left;&quot; id=&quot;__ss_134447&quot;&gt;&lt;object style=&quot;margin: 0px;&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://static.slideshare.net/swf/ssplayer2.swf?doc=perl-510-for-people-who-arent-totally-insane4609&amp;amp;stripped_title=perl-510-for-people-who-arent-totally-insane&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://static.slideshare.net/swf/ssplayer2.swf?doc=perl-510-for-people-who-arent-totally-insane4609&amp;amp;stripped_title=perl-510-for-people-who-arent-totally-insane&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style=&quot;font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                 &lt;div class=&quot;slideshow-description&quot;&gt;All the hype about perl 5.10 can sound a little intimidating. User-level pragmata! Overloadable smartmatching operator! Thread-safe refkey hashes! For Pete&#39;s sake, have you heard about lexically scoped pluggable regexp engines?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It&#39;s enough to make you think that 5.10&#39;s changes are just for the hard-core perl hackers, but it couldn&#39;t be further from the truth! The new version of Perl is full of changes that are easy to use and pack lots of useful benefits for doing plain old every day Perl programming.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;               &lt;/div&gt;&lt;br /&gt;             &lt;img style=&quot;visibility: hidden; width: 0px; height: 0px;&quot; src=&quot;http://counters.gigya.com/wildfire/IMP/CXNID=2000002.0NXC/bHQ9MTIzMDc4MjM2MDAxNSZwdD*xMjMwNzgyMzg*MTQwJnA9MTAxOTEmZD*mbj1ibG9nZ2VyJmc9MSZ*PSZvPTg3NjBjNGI5ZDc*ZjRkYTJiMjRiNjhkNmUxMmQ1OGU3.gif&quot; border=&quot;0&quot; width=&quot;0&quot; height=&quot;0&quot; /&gt;</description><link>http://mubarakworld.blogspot.com/2008/12/perl-510-for-people-who-arent-totally.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-5679232632333829216</guid><pubDate>Wed, 31 Dec 2008 12:02:00 +0000</pubDate><atom:updated>2008-12-31T21:51:53.275-08:00</atom:updated><title>How to set up a home email server (without being spammed to death)</title><description>&lt;h4 id=&quot;byline&quot;&gt;by &lt;a href=&quot;http://www.redhatmagazine.com/author/editor/&quot; title=&quot;Posts by the editorial team&quot;&gt;RedHat Magazine Editorial Team&lt;/a&gt;&lt;/h4&gt;          &lt;p&gt;by Stuart Kirk&lt;/p&gt; &lt;h2&gt;Why host your own mail?&lt;/h2&gt; &lt;p&gt;There are many reasons to host your own email. Perhaps you don’t like the limits placed on you by your current ISP. Maybe they aren’t willing to host the domain you want, or give you the access you want. And if they do fit your needs, they want to charge a small fortune. Maybe you want complete privacy. Or perhaps you just want to access your email from anywhere using a web-based frontend. The list goes on and on…&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;There are several many ways to accomplish this task. Everyone has their preferred MTA program, but for the purposes of this article, we’ll use sendmail. The same can also be done using postfix, or exim. Each approach has its own merits.&lt;/p&gt; &lt;p&gt;Let’s get started.&lt;/p&gt; &lt;h2&gt;Requirements&lt;/h2&gt; &lt;p&gt;I’m going to assume that when setting up your email server, you’ll want to do so with your own personalized domain name. While I’m not going to explain how to register a domain name, if you’re unsure, you can always click &lt;a href=&quot;http://www.icann.org/faq/#howregister&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt; for an explanation on how to do so.  The domain that I’ll refer to in this article will be &lt;strong&gt;mailjunkie.org&lt;/strong&gt;, with the hostname of the machine being &lt;strong&gt;server1&lt;/strong&gt;. I’m also going to assume, at least for now, that your IP address is static, and your inbound and outbound connections on port 25 are unrestricted.&lt;/p&gt; &lt;p&gt;The first thing you’ll need will be your physical infrastructure: a computer running Red Hat® Enterprise Linux®, a high-speed Internet connection, and a registered domain name. After you have installed Red Hat Enterprise Linux on your system you will want to make sure the following packages are &lt;a href=&quot;http://kbase.redhat.com/faq/FAQ_35_198.shtm&quot; target=&quot;_blank&quot;&gt;installed&lt;/a&gt;:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;dovecot &lt;/li&gt;&lt;li&gt;sendmail &lt;/li&gt;&lt;li&gt;sendmail-cf &lt;/li&gt;&lt;li&gt;squirrelmail &lt;/li&gt;&lt;li&gt;perl &lt;/li&gt;&lt;li&gt;gcc &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;There are other packages we will need later on.&lt;/p&gt; &lt;h2&gt;Configuring your mail exchanger&lt;/h2&gt; &lt;p&gt;After you’ve set up your domain name with your favorite registrar, you will need to configure your &lt;a href=&quot;http://en.wikipedia.org/wiki/MX_record&quot; target=&quot;_blank&quot;&gt;Mail Exchanger (MX) record&lt;/a&gt;. You will do this through your domain registrar. After you find the page that will allow you to set up your MX record, I recommend you do the following:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;Setup the MX record in the format mx.yourdomain.com. So, for our&lt;br /&gt;example domain, we would choose “mx.mailjunkie.org” as our MX record. &lt;/li&gt;&lt;li&gt;Configure your mail exchanger with a priority of 0 (zero). &lt;/li&gt;&lt;li&gt;Create a hostname/address &lt;i&gt;(A RECORD)&lt;/i&gt; that associates mx.mailjunkie.org with the IP address that your ISP has assigned you. &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;After you’re done setting this up, you can test to see if it worked by dropping to a shell prompt and issuing the following command.&lt;br /&gt;If your setup is correct, you should see some synthesis of:&lt;/p&gt; &lt;pre&gt;[root@server1 ~]$ nslookup -query=&quot;MX&quot; mailjunkie.org&lt;br /&gt;Server:         127.0.0.1&lt;br /&gt;Address:        127.0.0.1#53&lt;br /&gt;&lt;br /&gt;Non-authoritative answer:&lt;br /&gt;mailjunkie.org    mail exchanger = 0 mx.mailjunkie.org.&lt;br /&gt;&lt;br /&gt;Authoritative answers can be found from:&lt;br /&gt;mailjunkie.org    nameserver = dns4.name-services.com.&lt;br /&gt;mailjunkie.org    nameserver = dns5.name-services.com.&lt;br /&gt;mailjunkie.org    nameserver = dns1.name-services.com.&lt;br /&gt;mailjunkie.org    nameserver = dns2.name-services.com.&lt;br /&gt;mailjunkie.org    nameserver = dns3.name-services.com.&lt;br /&gt;mx.mailjunkie.org       internet address = 1.2.3.4&lt;br /&gt;dns1.name-services.com  internet address = 69.25.142.1&lt;br /&gt;dns2.name-services.com  internet address = 216.52.184.230&lt;br /&gt;dns3.name-services.com  internet address = 63.251.92.193&lt;br /&gt;dns4.name-services.com  internet address = 64.74.96.242&lt;br /&gt;dns5.name-services.com  internet address = 70.42.37.1&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Please note that it may take some time for the changes you have made to propagate through DNS. If you check immediately after you make these changes and do not see your settings reflected, try a few minutes later.&lt;/p&gt; &lt;h2&gt;Configuring s`endmail&lt;/h2&gt; &lt;p&gt;The next step will be setting up and configuring sendmail. The process for doing this is somewhat arduous, so please read all of the information presented before beginning.&lt;/p&gt; &lt;p&gt;The file &lt;i&gt;/etc/mail/sendmail.cf&lt;/i&gt; is the main configuration file&lt;br /&gt;for sendmail. This “cf file” contains the directives that sendmail will&lt;br /&gt;operate under. Much more friendly, however, is the file &lt;i&gt;/etc/mail/sendmail.mc&lt;/i&gt;.&lt;br /&gt;This “mc file” should be the base that you use for making all changes&lt;br /&gt;to sendmail’s operating parameters. Additionally, the “cf file” is&lt;br /&gt;created from the parameters listed in this “mc file”. Red Hat has done&lt;br /&gt;a wonderful job creating a template for your “mc file” and as such,&lt;br /&gt;the bulk of the changes that need to be made are just editing&lt;br /&gt;directives that are already present. Below are the directives that you&lt;br /&gt;must search for within your “mc file” and change accordingly:&lt;/p&gt; &lt;pre&gt;DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#39;)dnl  - change to -  DAEMON_OPTIONS(`Port=smtp, Name=MTA&#39;)&lt;br /&gt;LOCAL_DOMAIN(`localhost.localdomain&#39;)dnl                 - change to -  LOCAL_DOMAIN(`emailjunkie.org&#39;)&lt;br /&gt;dnl MASQUERADE_AS(`mydomain.com&#39;)dnl                     - change to -  MASQUERADE_AS(`emailjunkie.org&#39;)&lt;br /&gt;dnl FEATURE(masquerade_envelope)dnl                      - change to -  FEATURE(`masquerade_envelope&#39;)&lt;br /&gt;dnl define(`SMART_HOST&#39;,`smtp.your.provider&#39;)            - change to -  define(`SMART_HOST&#39;,`your.trusted.smtp.relay&#39;)&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Add in the line:&lt;/p&gt; &lt;pre&gt;FEATURE(`allmasquerade&#39;)&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Please note: You must replace “your.trusted.smtp.relay” with the name&lt;br /&gt;of your ISP’s SMTP server. While omitting this change will not prevent&lt;br /&gt;your e-mail server from operating properly, there are several filters&lt;br /&gt;that are often employed that will block any “at home Cable, xDSL” port&lt;br /&gt;25 connections for fear of spam.&lt;/p&gt; &lt;p&gt;After you have made these changes and are back in your server’s &lt;i&gt;/etc/mail&lt;/i&gt; directory, run the command “&lt;i&gt;make -C /etc/mail&lt;/i&gt;“. This compiles the “cf file” based on the instructions given in your “mc file”. Each time you make a change to your “mc file”, you must re-compile your “cf” file by issuing this command.&lt;/p&gt; &lt;h2&gt;Edit your hosts file&lt;/h2&gt; &lt;p&gt;Sendmail will make use of your &lt;i&gt;/etc/hosts&lt;/i&gt; file, so you need to modify it so that mail is routed properly.  Edit your &lt;i&gt;/etc/hosts&lt;/i&gt; file and include a line that reads:&lt;/p&gt; &lt;pre&gt;1.2.3.4     server1.mailjunkie.org&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;where 1.2.3.4 is the IP address that is assigned to you by your ISP.&lt;/p&gt; &lt;h2&gt;Obtaining and installing MailScanner, SpamAssassin, and ClamAV&lt;/h2&gt; &lt;p&gt;Out of the box, sendmail works to deliver mail only. As such,&lt;br /&gt;you are quite vulnerable to spam and virus threats that will very&lt;br /&gt;quickly become a problem if you do not take action early. These&lt;br /&gt;three applications will process received mail and scan it for viruses&lt;br /&gt;and spam before it is delivered. You can download the latest versions&lt;br /&gt;of these applications from &lt;a href=&quot;http://www.mailscanner.info/downloads.html&quot; target=&quot;_blank&quot;&gt;mailscanner.info&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Download the latest “for Red Hat, Fedora, and Mandrake Linux (and other&lt;br /&gt;RPM-based Linux distributions)” release of MailScanner, as well as the&lt;br /&gt;latest “ClamAV and SpamAssassin easy installation packages.”&lt;/p&gt; &lt;p&gt;The installation package for all of the applications is quite good; it&lt;br /&gt;will resolve most of the dependencies that are required to gunzip, un-tar, and run both of these applications. As MailScanner checks for the presence of ClamAV when it installs, I recommend installing the SpamAssassin/ClamAV package first:&lt;/p&gt; &lt;pre&gt;[root@server1 ~]# wget http://www.mailscanner.info/files/4/install-Clam-0.88.5-SA-3.1.7.tar.gz&lt;br /&gt;[root@server1 ~]# tar zxvf install-Clam-0.88.5-SA-3.1.7.tar.gz&lt;br /&gt;[root@server1 ~]# cd install-Clam-0.88.5-SA-3.1.7&lt;br /&gt;[root@server1 install-Clam-0.88.5-SA-3.1.7]# ./install.sh&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;There will be significantly more output produced as ClamAV and&lt;br /&gt;SpamAssassin are installed on your system. After they are installed,&lt;br /&gt;you should see a message similar to this:&lt;/p&gt; &lt;pre&gt;Now you need to install:&lt;br /&gt;1) Razor-agents-sdk and Razor2 from http://razor.sourceforge.net/ and&lt;br /&gt;2) DCC from http://www.rhyolite.com/anti-spam/dcc/&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Follow the links above to download the three applications that will&lt;br /&gt;assist SpamAssassin in processing your email. Below are the list of&lt;br /&gt;commands I used to download and install them. For clarity, I have&lt;br /&gt;removed all of the output that was produced for each command. You can&lt;br /&gt;expect to see significantly more than what I have listed. What&lt;br /&gt;is shown are the base commands to download, compile, and install the&lt;br /&gt;helper applications.&lt;/p&gt; &lt;pre&gt;[root@server1 ~]# wget http://umn.dl.sourceforge.net/sourceforge/razor/razor-agents-sdk-2.07.tar.bz2&lt;br /&gt;[root@server1 ~]# wget http://umn.dl.sourceforge.net/sourceforge/razor/razor-agents-2.82.tar.bz2&lt;br /&gt;[root@server1 ~]# wget http://www.rhyolite.com/anti-spam/dcc/source/dcc.tar.Z&lt;br /&gt;&lt;br /&gt;[root@server1 ~]# bunzip2 razor-agents-sdk-2.07.tar.bz2&lt;br /&gt;[root@server1 ~]# tar xvf razor-agents-sdk-2.07.tar&lt;br /&gt;[root@server1 ~]# cd razor-agents-sdk-2.07&lt;br /&gt;[root@server1 razor-agents-sdk-2.07]# perl Makefile.PL&lt;br /&gt;[root@server1 razor-agents-sdk-2.07]# make&lt;br /&gt;[root@server1 razor-agents-sdk-2.07]# make test&lt;br /&gt;[root@server1 razor-agents-sdk-2.07]# make install&lt;br /&gt;[root@server1 razor-agents-2.82]# cd ..&lt;br /&gt;&lt;br /&gt;[root@server1 ~]# bunzip2 razor-agents-2.82.tar.bz2&lt;br /&gt;[root@server1 ~]# tar xvf razor-agents-2.82.tar&lt;br /&gt;[root@server1 ~]# cd razor-agents-2.82&lt;br /&gt;[root@server1 razor-agents-2.82]# perl Makefile.PL&lt;br /&gt;[root@server1 razor-agents-2.82]# make&lt;br /&gt;[root@server1 razor-agents-2.82]# make test&lt;br /&gt;[root@server1 razor-agents-2.82]# make install&lt;br /&gt;[root@server1 razor-agents-2.82]# cd ..&lt;br /&gt;&lt;br /&gt;[root@server1 ~]# tar zxvf dcc.tar.Z&lt;br /&gt;[root@server1 ~]# cd dcc-1.3.42/&lt;br /&gt;[root@server1 dcc-1.3.42]# ./configure&lt;br /&gt;[root@server1 dcc-1.3.42]# make install&lt;br /&gt;[root@server1 dcc-1.3.42]# cd ..&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Now that these applications are installed, we can proceed to download, compile, and install MailScanner.&lt;/p&gt; &lt;pre&gt;[root@server1 ~]# wget http://www.mailscanner.info/files/4/rpm/MailScanner-4.56.8-1.rpm.tar.gz&lt;br /&gt;[root@server1 ~]# tar zxvf MailScanner-4.56.8-1.rpm.tar.gz&lt;br /&gt;[root@server1 ~]# cd MailScanner-4.56.8-1&lt;br /&gt;[root@server1 MailScanner-4.56.8-1]# ./install.sh&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;As with ClamAV and SpamAssassin, there will be a significant amount of output produced.  You should, however, end up with:&lt;/p&gt; &lt;pre&gt;Preparing...                ########################################### [100%]&lt;br /&gt; 1:mailscanner            ########################################### [100%]&lt;br /&gt;Good, SpamAssassin site rules found in /etc/mail/spamassassin&lt;br /&gt;&lt;br /&gt;To activate MailScanner run the following commands:&lt;br /&gt;&lt;br /&gt;service sendmail stop&lt;br /&gt;chkconfig sendmail off&lt;br /&gt;chkconfig --level 2345 MailScanner on&lt;br /&gt;service MailScanner start&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Now, before we issue the commands to start MailScanner, please be sure within the &lt;i&gt;/etc/MailScanner/MailScanner.conf&lt;/i&gt; file, the following lines exist:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;Virus Scanners = clamav &lt;/li&gt;&lt;li&gt;Use SpamAssassin = yes &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;These directives tell MailScanner to use ClamAV to scan for&lt;br /&gt;viruses, and SpamAssassin to process email for spam. From here we can&lt;br /&gt;issue the commands below to start MailScanner and begin processing&lt;br /&gt;email. I highly recommend you view the &lt;i&gt;/var/log/maillog&lt;/i&gt;&lt;br /&gt;file while starting MailScanner and scan the output for undesirable&lt;br /&gt;actions, as well as to verify that Mail is being processed properly.&lt;/p&gt; &lt;pre&gt;[root@server1 MailScanner-4.56.8-1]# service sendmail stop&lt;br /&gt;[root@server1 MailScanner-4.56.8-1]# chkconfig sendmail off&lt;br /&gt;[root@server1 MailScanner-4.56.8-1]# chkconfig --level 2345 MailScanner on&lt;br /&gt;[root@server1 MailScanner-4.56.8-1]# service MailScanner start&lt;br /&gt;&lt;/pre&gt; &lt;h2&gt;Setting up web access to your email&lt;/h2&gt; &lt;p&gt;I am going to assume that you have your apache server running.&lt;br /&gt;If you don’t you should review the steps to &lt;a href=&quot;http://www.redhat.com/magazine/022aug06/features/webserver&quot; target=&quot;_blank&quot;&gt;install and configure apache&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;After you have verified that your web server is running, execute the following commands at your shell prompt:&lt;/p&gt; &lt;pre&gt;[root@server1 ~]# chkconfig dovecot on&lt;br /&gt;[root@server1 ~]# service dovecot start&lt;br /&gt;&lt;/pre&gt; These commands will start your IMAP server, which will be used by the Squirrel Mail package to access the mail stored on your server. With good luck, you should now have a fully functional, protected email server running. Keep in mind you may need to make changes to your &lt;i&gt;&lt;a href=&quot;http://www.faqs.org/docs/securing/chap22sec180.html&quot; target=&quot;_blank&quot;&gt;/etc/mail/local-host-names&lt;/a&gt;&lt;/i&gt; file and &lt;i&gt;&lt;a href=&quot;http://www.sendmail.org/tips/relaying.php&quot; target=&quot;_blank&quot;&gt;/etc/mail/relay-domains&lt;/a&gt;&lt;/i&gt; file.  Each case will be different, so I recommend you review your &lt;i&gt;/var/log/maillog&lt;/i&gt; file and use the links provided to perform any final setting changes.</description><link>http://mubarakworld.blogspot.com/2008/12/how-to-set-up-home-email-server-without.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-1162524530422239812</guid><pubDate>Wed, 31 Dec 2008 10:53:00 +0000</pubDate><atom:updated>2008-12-31T03:57:47.448-08:00</atom:updated><title>10 things every Perl hacker should know</title><description>&lt;p&gt;As one of the easiest programming languages to use for whipping up quick, effective code for simple tasks, &lt;a href=&quot;http://techrepublic.com.com/5264-1-0.html?query=perl&quot; target=&quot;_blank&quot;&gt;Perl&lt;/a&gt; attracts new users easily and has become an important and popular tool for getting things done. Before jumping fully into Perl programming, though, there are a few things you should know that will make your life easier, both when writing code and when asking for help from Perl experts.&lt;/p&gt;  &lt;h3&gt;1.       Perl is not an acronym&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;Perl is sometimes known as the Practical Extraction and Report Language, because it&#39;s very practical, and it is very good at extracting data and creating reports using that data. It is also known humorously as the Pathologically Eclectic Rubbish Lister, for reasons that might become obvious after you&#39;ve used it for a while. Both of these phrases are equally &quot;official&quot; and equally correct, but the language is not PERL. It was named Perl before either of those phrases was invented, and the language is in fact not technically an acronym at all. When speaking of the language, call it Perl, and when speaking of the parser (the interpreter/compiler), it is acceptable to call it perl, because that is how the command used to run it is spelled. One of the quickest ways to get identified as a know-nothing newbie when talking to Perl hackers is to call it PERL.&lt;/p&gt;  &lt;h3&gt;2.       There is more than one way to do it&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;One of the main mottos of the Perl language and community is TIMTOWTDI, pronounced &quot;Tim Toady&quot;. This one really is an acronym, and it stands for There Is More Than One Way To Do It. It&#39;s true of Perl on many levels, and is something important to keep in mind. While some ways to do something are often better than other ways to do the same thing, you can be sure that for pretty much everything you can do with Perl, there is more than one way to do it.&lt;/p&gt;  &lt;h3&gt;3.       Use warnings and use strict&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;Warnings and the strict pragma are important weapons in the Perl hacker&#39;s arsenal for debugging code. Warnings will not prevent a program from executing, but will give helpful information on how the code can be fixed up.&lt;/p&gt;  &lt;p&gt;The strict pragma will actually prevent the code from executing if a strict approach to programming style is not used, such as lexically scoping variables. Once in a while, a program might be better off without the strict pragma, but if you&#39;re new to Perl it will surely be a long time before you learn to recognize such situations, and until then you should just use it.&lt;/p&gt;  &lt;p&gt;A Perl script with warnings turned on in the shebang line and the strict pragma used, on a standard UNIX system, would start like this:&lt;/p&gt;  &lt;span class=&quot;code&quot;&gt;#!/usr/bin/Perl -w&lt;br /&gt;use strict;&lt;/span&gt;  &lt;p&gt;Warnings can also be turned on with a use statement, like this:&lt;/p&gt;  &lt;span class=&quot;code&quot;&gt;#!/usr/bin/Perl&lt;br /&gt;use strict;&lt;br /&gt;use warnings;&lt;/span&gt;    &lt;hr align=&quot;center&quot; size=&quot;2&quot; width=&quot;100%&quot;&gt;    &lt;p&gt;A pragma, in Perl, is a preprocessor directive. In other words, it&#39;s an instruction sent to the compiler before the code is compiled for execution. Pragmas change how the compiler parses code.&lt;/p&gt;    &lt;hr align=&quot;center&quot; size=&quot;2&quot; width=&quot;100%&quot;&gt;    &lt;h3&gt;4.       Use taint checking&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;With the &lt;i&gt;-T&lt;/i&gt; option on the shebang line of your program, you explicitly turn on taint checking. This is a security measure that checks all input for your program for &quot;tainted&quot; data, to help ensure that incoming data will not allow arbitrary code execution if a malicious user is trying to crack security on the system running your code. This is especially important in circumstances where you are using Perl/CGI scripts to process data from an HTML form on the Web. It can be combined with the &lt;i&gt;-w&lt;/i&gt; option as &lt;i&gt;-wT&lt;/i&gt;.&lt;/p&gt;  &lt;h3&gt;5.       Use lexically scoped variables&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;You can use the &lt;i&gt;my(&lt;/i&gt;&lt;i&gt;)&lt;/i&gt; operator to create variables using lexical scoping. In brief, this means that the scope of the variable is limited to the current context: if you declare a variable using &lt;i&gt;my(&lt;/i&gt;&lt;i&gt;)&lt;/i&gt; inside a subroutine, the variable only exists inside that subroutine. The value of lexical scoping is that it protects different parts of modular code from one another.&lt;/p&gt;  &lt;p&gt;For instance, if you&#39;re using a Perl module or library without knowing exactly what the code inside it looks like, using lexical variables can help to prevent accidentally assigning new values to variables that need to remain unchanged until later. It is especially important to use lexical scoping for your variables when writing modules and libraries in Perl. For those coming to Perl from other languages, you may know of the concept of lexically scoped variables as &quot;private variables&quot;.&lt;/p&gt;  &lt;h3&gt;6.       How to name your programs&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;Perl programs should have the appropriate file extension in their names. Many lower-quality Perl howtos simply use the &lt;i&gt;.pl&lt;/i&gt; extension for everything, naming Perl scripts something like &lt;i&gt;foo.pl&lt;/i&gt;. Technically, the &lt;i&gt;.pl&lt;/i&gt; extension should be used for Perl libraries, not for executable Perl programs. For executable files, you should either use &lt;i&gt;.plx&lt;/i&gt; or, if your operating system will allow it, no file extension at all. Perl modules, meanwhile, should use the &lt;i&gt;.pm&lt;/i&gt; file extension. It is also considered good practice to use only alphanumeric characters and underscores in Perl script filenames, and to start those filenames with a letter (or underscore), similar to how you would start variable names.&lt;/p&gt;  &lt;h3&gt;7.       How to use CPAN&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;The Comprehensive Perl Archive Network (CPAN) is a rich resource for finding freely available, reusable code. In particular, CPAN is where you&#39;ll find legions of Perl modules that can be used to enhance the functionality of your programs and reduce the time you spend writing them. The options you have for using CPAN vary from one operating system and Perl parser implementation to the next, but you can always browse &lt;a href=&quot;http://search.cpan.org/&quot; target=&quot;_blank&quot;&gt;CPAN using your Web browser&lt;/a&gt;. Perl implementations generally come with at least a command-line tool for installing Perl modules from CPAN.&lt;/p&gt;  &lt;h3&gt;8.       How to use Perldoc&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;The online documentation for Perl is extensive and comprehensive, in the form of Perldoc. With Perldoc installed on your system, you can use it to access documentation on any of the standard Perl functions, installed modules, variables, and a slew of other things -- even Perldoc itself! It&#39;s like having one of the most complete programming reference books available right at your fingertips, for free, and searchable since it&#39;s in electronic format.&lt;/p&gt;  &lt;p&gt;On some systems, Perldoc will be installed by default with Perl itself, and on others the process for installation should be self-evident. If you have problems getting Perldoc installed, you can always access the &lt;a href=&quot;http://www.perldoc.com/&quot; target=&quot;_blank&quot;&gt;online Perldoc&lt;/a&gt; Website. Make sure you know how to use Perldoc, because it can make you a more effective Perl hacker in ways that just might surprise you.&lt;/p&gt;  &lt;h3&gt;9.       Don&#39;t reinvent the wheel&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;You should use subroutines, modules, and libraries often. The point is to help you write code faster and keep that code from becoming unmanageable if you need the same functionality in multiple programs, or more than once in the same program. This is accomplished by separating blocks of code from the rest of your source code using subroutines, modules, and libraries. You&#39;re better off using a design for the wheel that already exists, rather than reinventing the wheel from scratch, most of the time. In addition, when you&#39;re reusing code from a subroutine, module, or library, and you need to improve that code somehow, you only need to change it in one place.&lt;/p&gt;    &lt;hr align=&quot;center&quot; size=&quot;2&quot; width=&quot;100%&quot;&gt;    &lt;p&gt;The term &quot;subroutine&quot; in Perl means roughly the same thing as &quot;function&quot; in C.&lt;/p&gt;    &lt;hr align=&quot;center&quot; size=&quot;2&quot; width=&quot;100%&quot;&gt;    &lt;h3&gt;10.     Regular expressions are your friends&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;Perl&#39;s &lt;a href=&quot;http://techrepublic.com.com/5100-3513-5951500.html&quot; target=&quot;_blank&quot;&gt;regular expression&lt;/a&gt; syntax can help to make your source code look intimidating to the uninitiated, and as a result sometimes people new to Perl programming avoid regexen. This is, really, a mistake. Regular expressions add a great deal of power to the Perl programming language, often allowing the programmer to do something in three lines that might otherwise take fifty lines of code. Regular expressions are expressions made up of abbreviations for matching patterns in strings that can be used to find and manipulate smaller strings inside larger strings. It behooves the Perl hacker to learn regex syntax and learn it well.&lt;/p&gt;    &lt;hr align=&quot;center&quot; size=&quot;2&quot; width=&quot;100%&quot;&gt;    &lt;p&gt;Often Perl hackers and other programmers who use regular expressions will refer to them as &quot;regexen&quot; or &quot;regexes&quot; in the plural (&quot;regex&quot; singular). An alternate version of &quot;regex&quot; is &quot;regexp&quot;, though why anyone would want to add that extra letter, making it more difficult to pronounce clearly, is beyond me.&lt;/p&gt;</description><link>http://mubarakworld.blogspot.com/2008/12/10-things-every-perl-hacker-should-know.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-306657193946954810</guid><pubDate>Wed, 31 Dec 2008 10:51:00 +0000</pubDate><atom:updated>2008-12-31T02:53:34.486-08:00</atom:updated><title>Building custom subroutines in Perl</title><description>&lt;p&gt;Every programming language comes with its own built-in functions or subroutines—every time you print() or join() something in Perl, you&#39;re actually using a built-in subroutine. But Perl also allows you to define your own custom subroutines, so that you can save yourself some time and effort when performing common tasks. I&#39;ll show you why subroutines are useful, and how to create your own.&lt;/p&gt;  &lt;h1&gt;Advantages of subroutines&lt;/h1&gt;  &lt;p&gt;Subroutines are convenient for three reasons:&lt;/p&gt;  &lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;&lt;li&gt;They let      developers break up long procedural scripts into smaller, easier to      understand fragments. This makes code easier to debug, and simplifies      locating the source of errors.&lt;/li&gt;&lt;li&gt;By      identifying commonly-used tasks and then encapsulating those tasks into      independent packages, subroutines make code reuse a reality. It&#39;s not      uncommon for many Web developers to maintain their own library of      commonly-used subroutines and import them whenever needed to quickly      accomplish common tasks.&lt;/li&gt;&lt;li&gt;A subroutine      is created once but invoked many times. So if a code update is needed in      the future, the changes can be done in one spot (the subroutine      definition) while the subroutine invocations remain untouched.&lt;/li&gt;&lt;/ol&gt;  &lt;h1&gt;Defining a subroutine&lt;/h1&gt;  &lt;p&gt;Here&#39;s a simple example of a subroutine:&lt;/p&gt;  &lt;span class=&quot;code&quot;&gt;# define subroutine&lt;br /&gt;sub makeJuice&lt;br /&gt;{&lt;br /&gt;     print &quot;Making lemon juice...&quot;;&lt;br /&gt;}&lt;/span&gt;  &lt;p&gt;Every subroutine follows a few basic rules:&lt;/p&gt;  &lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;&lt;li&gt;The      subroutine definition begins with the &quot;sub&quot; keyword, followed by      the name of the subroutine. This name is what you use to invoke the      subroutine in your scripts. The name may optionally be followed by      parentheses.&lt;/li&gt;&lt;li&gt;The      code that makes up the subroutine is enclosed within curly braces. This      code is regular Perl code—you can use variables, loops, conditionals and      all the usual Perl constructs inside it.&lt;/li&gt;&lt;li&gt;Subroutines      may appear anywhere in a Perl script, or may even be imported from      external files.&lt;/li&gt;&lt;/ol&gt;  &lt;p&gt;To call a subroutine, invoke it by preceding its name with an ampersand (&amp;amp;):&lt;/p&gt;  &lt;span class=&quot;code&quot;&gt;# call subroutine&lt;br /&gt;&amp;amp;makeJuice();&lt;/span&gt;  &lt;p&gt;When the Perl interpreter sees this call, it looks for the subroutine named makeJuice() and executes it. You can invoke the same subroutine as many times as you like. In this particular example, we call the makeJuice() subroutine four times:&lt;/p&gt;  &lt;span class=&quot;code&quot;&gt;#!/usr/bin/perl&lt;br /&gt;&lt;br /&gt;# define subroutine&lt;br /&gt;sub makeJuice&lt;br /&gt;{&lt;br /&gt;     print &quot;Making lemon juice...\n&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# call subroutine&lt;br /&gt;&amp;amp;makeJuice();&lt;br /&gt;&amp;amp;makeJuice();&lt;br /&gt;&amp;amp;makeJuice();&lt;br /&gt;&amp;amp;makeJuice();&lt;/span&gt;  &lt;p&gt;The above script produces the following output:&lt;/p&gt;  &lt;span class=&quot;code&quot;&gt;Making lemon juice...&lt;br /&gt;Making lemon juice...&lt;br /&gt;Making lemon juice...&lt;br /&gt;Making lemon juice...&lt;/span&gt;  &lt;p&gt;Of course, there will come a time when you&#39;re fed up with all that lemon juice and would prefer something different. That&#39;s why subroutines can accept arguments, user-defined values passed to the subroutine when it is called and then processed by the code inside that subroutine. Let&#39;s see how to &lt;a style=&quot;color: rgb(0, 0, 0);&quot; href=&quot;http://builder.com.com/5100-6374-5259393-2.html&quot;&gt;pass arguments to a subroutine&lt;/a&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;.&lt;/span&gt;&lt;/p&gt;  &lt;h1&gt;Passing arguments to a Perl subroutine&lt;/h1&gt;&lt;br /&gt; &lt;p&gt;Suppose I would like to give the makeJuice() subroutine more intelligence by telling it which flavor of juice to make:&lt;/p&gt;  &lt;span class=&quot;code&quot;&gt;&amp;amp;makeJuice(&quot;strawberry&quot;);&lt;/span&gt;  &lt;p&gt;Invoking a subroutine with an argument is the easy part—I still need to write the code that accepts the argument and does something with it:&lt;/p&gt;  &lt;span class=&quot;code&quot;&gt;sub makeJuice&lt;br /&gt;{&lt;br /&gt;     # retrieve the argument&lt;br /&gt;     my ($flavor) = shift (@_);&lt;br /&gt;&lt;br /&gt;     # and use it&lt;br /&gt;     print &quot;Making $flavor juice...\n&quot;;&lt;br /&gt;}&lt;/span&gt;  &lt;p&gt;Perl has a somewhat unique way of handling subroutine arguments. All arguments passed to a subroutine are stored in a special @_ array. To retrieve the arguments, you have to look inside the array and extract them.&lt;/p&gt;  &lt;p&gt;In the revised subroutine definition above, we use the shift() function to extract the first element of the array—the flavor—and assign it to a variable. This variable is then used in the call to print().&lt;/p&gt;  &lt;p&gt;If you don&#39;t like the shift() syntax, you can also use &quot;regular&quot; array notation (indexing):&lt;/p&gt;  &lt;span class=&quot;code&quot;&gt;sub makeJuice&lt;br /&gt;{&lt;br /&gt;     # retrieve the argument&lt;br /&gt;     my ($flavor) = $_[0];&lt;br /&gt;&lt;br /&gt;     # and use it&lt;br /&gt;     print &quot;Making $flavor juice...\n&quot;;&lt;br /&gt;}&lt;/span&gt;  &lt;p&gt;This next listing is another, slightly more useful example:&lt;/p&gt;  &lt;span class=&quot;code&quot;&gt;#!/bin/perl&lt;br /&gt;# define subroutine to convert between dollars and euros sub convertCurrency {&lt;br /&gt;     # get amount in $&lt;br /&gt;     my ($usd) = shift (@_);&lt;br /&gt;&lt;br /&gt;     # specify conversion rate&lt;br /&gt;     my $convRate = 0.82;&lt;br /&gt;&lt;br /&gt;     # print amount in euro&lt;br /&gt;     print &quot;USD $usd = &quot;, sprintf(&quot;%0.2f&quot;, $usd * $convRate), &quot; EUR&quot;; }&lt;br /&gt;&lt;br /&gt;# invoke function with custom $ amount&lt;br /&gt;&amp;amp;convertCurrency(100);&lt;/span&gt;  &lt;p&gt;Here, the convertCurrency() subroutine performs the conversion between dollars and euros. The amount of USD to be converted is passed to the subroutine as an argument, and the output contains the corresponding amount in euros. Adding arguments to a subroutine thus immediately makes the subroutine more flexible and useful.&lt;/p&gt;  &lt;h1&gt;Sending back return values from a subroutine&lt;/h1&gt;  &lt;p&gt;Now, consider this variant on the convertCurrency subroutine from the previous example:&lt;/p&gt;  &lt;span class=&quot;code&quot;&gt;#!/usr/bin/perl&lt;br /&gt;&lt;br /&gt;# define subroutine&lt;br /&gt;sub convertCurrency&lt;br /&gt;{&lt;br /&gt;     # get amount in $&lt;br /&gt;     my ($usd) = shift (@_);&lt;br /&gt;&lt;br /&gt;     # specify conversion rate&lt;br /&gt;     my $convRate = 0.82;&lt;br /&gt;&lt;br /&gt;     # convert value&lt;br /&gt;     $euro =  $usd * $convRate;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# invoke function with custom $ amount&lt;br /&gt;print &amp;amp;convertCurrency(100);&lt;/span&gt;  &lt;p&gt;Even though the subroutine does not print any output, it does return a value, which can be caught and used by the main script. By default, this value is the last expression evaluated by the subroutine.&lt;/p&gt;  &lt;p&gt;If you like, you can override this return value by specifying your own with a &quot;return&quot; statement:&lt;/p&gt;  &lt;span class=&quot;code&quot;&gt;#!/usr/bin/perl&lt;br /&gt;&lt;br /&gt;# define subroutine to check file status&lt;br /&gt;sub checkFileStatus {&lt;br /&gt;   # get file path&lt;br /&gt;   my ($file) = $_[0];&lt;br /&gt;&lt;br /&gt;   # test file status&lt;br /&gt;   # return 1 or 0&lt;br /&gt;   (-r $file) ? return 1 : return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# invoke function with filename&lt;br /&gt;# check return value and print appropriate message&lt;br /&gt;$status = &amp;amp;checkFileStatus(&#39;/usr/local/mail.cf&#39;);&lt;br /&gt;&lt;br /&gt;if ($status == 1)&lt;br /&gt;{&lt;br /&gt;   print &quot;File is readable\n&quot;;&lt;br /&gt;} else {&lt;br /&gt;   print &quot;File is not readable\n&quot;;&lt;br /&gt;}&lt;/span&gt;  &lt;p&gt;The &quot;-r&quot; test checks if the file is readable, and the subroutine sends back true or false to the caller depending on what it finds. The main script then checks this return value and prints an appropriate message.&lt;/p&gt;  &lt;p&gt;You can also write a subroutine that returns an array instead of a scalar value:&lt;/p&gt;  &lt;span class=&quot;code&quot;&gt;#!/usr/bin/perl&lt;br /&gt;&lt;br /&gt;# define subroutine to&lt;br /&gt;# split an email address into&lt;br /&gt;# user and domain&lt;br /&gt;sub breakEmailAddress&lt;br /&gt;{&lt;br /&gt;     # get address&lt;br /&gt;     my ($address) = shift(@_);&lt;br /&gt;&lt;br /&gt;     # split address on the @ symbol into an array&lt;br /&gt;     @components = split(&#39;@&#39;, $address);&lt;br /&gt;    &lt;br /&gt;     # return array&lt;br /&gt;     return @components;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# split email address&lt;br /&gt;# print the components&lt;br /&gt;@output = &amp;amp;breakEmailAddress(&#39;john@some.domain.com&#39;);&lt;br /&gt;print &quot;Username is &quot;, $output[0], &quot;\nDomain is &quot;, $output[1]; [/code]&lt;/span&gt;  &lt;p&gt;Here is the output:&lt;/p&gt;  &lt;span class=&quot;code&quot;&gt;Username is john&lt;br /&gt;Domain is some.domain.com&lt;/span&gt;</description><link>http://mubarakworld.blogspot.com/2008/12/building-custom-subroutines-in-perl.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-9081152139052756863</guid><pubDate>Sat, 27 Dec 2008 11:03:00 +0000</pubDate><atom:updated>2008-12-31T03:05:05.427-08:00</atom:updated><title>The top 5 Linux myths: Why you shouldn’t fear the penguin</title><description>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.dabbledoo.com/ee/images/uploads/gadgetell/Tux.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 425px; height: 510px;&quot; src=&quot;http://www.dabbledoo.com/ee/images/uploads/gadgetell/Tux.jpg&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Now, what to the do with the old computer, or even with the netbook?  Why not give your old computer a new life by running Linux on it?  It may seem like a scary thought, but chances are you have a few misconceptions about Linux and that’s keeping you from making the jump.  &lt;/p&gt;  &lt;p&gt;Here is a list of five of the biggest Linux myths out there and how you can make Linux your friend.&lt;/p&gt;  &lt;h3&gt;5. It won’t connect to an iPod or MP3 player.&lt;/h3&gt;&lt;p&gt; This might not apply to everyone, but to some people who only have one computer it could be a big deal.  Most people now have some sort of MP3 player, and need a computer to put music on it, with special software on top of that, especially with the iPod.  &lt;/p&gt;  &lt;p&gt;Now, of course, you can’t use the App Store without iTunes (which has some problems installing with WINE), but you can easily buy songs from Amazon MP3 store, or rip them from CDs.  Most music players for Linux support MP3 players, and even iPods, some like Songbird even look like iTunes if you’re almost too comfortable with the program.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;&lt;h3&gt;4. Linux is not compatible with Mac/Windows files.&lt;/h3&gt;&lt;p&gt; This seems to be a general misconception about computers in general.  A lot of people seem to think that files from one operating system won’t work on any other one.  This is true about applications, but not for the files they use or create.  &lt;/p&gt;  &lt;p&gt;If you’re working with a word processor, chance are it can export files to .doc files, which just about any program can use.  Music is usually stored in MP3, AAC or FLAC files, all of which are easily usable on any platform.  Having compatible files is easily avoided if you use cross-platform applications such as OpenOffice, that way you dont have to worry about exporting to other file types&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;&lt;h3&gt;3. Linux can’t play games.&lt;/h3&gt;&lt;p&gt; This might not be important to everyone, but to some people games are the main reason why they stick with Windows.  Even if all they play is World of Warcraft, they don’t want to give up their games just because thy switch to another OS.  &lt;/p&gt;  &lt;p&gt;There’s actually a lot of games that are native to Linux, though most aren’t as pretty as the newest games.  There are ways to play those new games on Linux, however.  There’s &lt;a class=&quot;external&quot; target=&quot;_blank&quot; href=&quot;http://www.codeweavers.com/&quot; title=&quot;Codeweaver&#39;s Crossover and Crossover Games&quot;&gt;Codeweaver’s Crossover and Crossover Games&lt;/a&gt;, &lt;a class=&quot;external&quot; target=&quot;_blank&quot; href=&quot;http://www.transgaming.com/&quot; title=&quot;Cedega&quot;&gt;Cedega&lt;/a&gt;, and &lt;a class=&quot;external&quot; target=&quot;_blank&quot; href=&quot;http://www.winehq.org/&quot; title=&quot;WINE&quot;&gt;WINE&lt;/a&gt; (Crossover is essentially a more stable, paid version of WINE).  Between these three, most popular games are easily played.  I run WarCraft III on Ubuntu Eee using WINE, and it can easily handle WoW or even games liek Team Fortress 2, assuming your computer can handle it, of course.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;&lt;h3&gt;2. Apps are hard to find.&lt;/h3&gt;&lt;p&gt; Most Linux distros come with a lot of useful software, but sometimes you might want to replace them with something else or find something else you might want ot need.  Unlike Windows, and to a lesser extent Mac, there aren’t many retail box copies of Linux software.  However, with a quick Google search for “Linux apps” I was able to find Linux Online’s &lt;a class=&quot;external&quot; target=&quot;_blank&quot; href=&quot;http://www.linux.org/apps/&quot; title=&quot;application page&quot;&gt;application page&lt;/a&gt;.  Or, if you’re running Ubuntu, there’s Get Deb, which not only lists Ubuntu software, but also makes it really simple to install them.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;&lt;h3&gt;1. You have to learn command line/terminal&lt;/h3&gt;&lt;p&gt; I can’t tell you how many times I’ve told people that I’m running Linux, and they immediately cringe at the idea of the terminal.  Somewhere along the line, Linux got the reputation that it’s only usable by coders, or those who know a decent bit of code.  &lt;/p&gt;  &lt;p&gt;The same people that cringe are the same people that are surprised when I show them Ubuntu Eee.  It’s possibly even more simple than Windows with the netbook remix UI, but Linux is easy even without that.  &lt;/p&gt;  &lt;p&gt;Some distributions such as openSUSE have a Windows-like start menu, some, like Ubuntu, have an applications drop menu that lists all your applications, making for an environment that should be easy for anyone.  Most also use GNOME or KDE file browsers which are just as easy to navigate as Windows Explorer.&lt;/p&gt;  &lt;p&gt;&lt;br /&gt;If you can possibly get past these scary ideas, I would recommend Ubuntu, or Ubuntu Eee for your Eee PC (soon to be Easy Peasy, with more netbooks supported).  Also look for my article on useful applications for Linux that can replace your Windows or Mac Apps.&lt;/p&gt;</description><link>http://mubarakworld.blogspot.com/2008/12/top-5-linux-myths-why-you-shouldnt-fear.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-3729440133134527024</guid><pubDate>Thu, 25 Dec 2008 11:03:00 +0000</pubDate><atom:updated>2008-12-31T20:20:20.433-08:00</atom:updated><title>An A-Z Index of the Bash command line for Linux.</title><description>&lt;pre&gt;&lt;span style=&quot;font-size:130%;&quot;&gt; &lt;a href=&quot;http://www.ss64.com/bash/alias.html&quot;&gt;alias&lt;/a&gt;    Create an alias&lt;br /&gt;apropos  Search Help manual pages (man -k)&lt;br /&gt;&lt;a href=&quot;http://www.debian.org/doc/manuals/apt-howto/ch-apt-get.en.html&quot;&gt;apt-get&lt;/a&gt;  Search for and install software packages (Debian)&lt;br /&gt;&lt;a href=&quot;http://aspell.net/&quot;&gt;aspell&lt;/a&gt;   Spell Checker&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/awk.html&quot;&gt;awk&lt;/a&gt;      Find and Replace text, database sort/validate/index&lt;br /&gt;b&lt;br /&gt;bash     GNU Bourne-Again SHell&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/bc.html&quot;&gt;bc&lt;/a&gt;       Arbitrary precision calculator language&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/bg.html&quot;&gt;bg&lt;/a&gt;       Send to background&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/break.html&quot;&gt;break&lt;/a&gt;    Exit from a loop&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/builtin.html&quot;&gt;builtin&lt;/a&gt;  Run a shell builtin&lt;br /&gt;&lt;a href=&quot;http://www.bzip.org/&quot;&gt;bzip2&lt;/a&gt;    Compress or decompress named file(s)&lt;br /&gt;c&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/cal.html&quot;&gt;cal&lt;/a&gt;      Display a calendar&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/case.html&quot;&gt;case&lt;/a&gt;     Conditionally perform a command&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/cat.html&quot;&gt;cat&lt;/a&gt;      Display the contents of a file&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/cd.html&quot;&gt;cd&lt;/a&gt;       Change Directory&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/cfdisk.html&quot;&gt;cfdisk&lt;/a&gt;   Partition table manipulator for Linux&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/chgrp.html&quot;&gt;chgrp&lt;/a&gt;    Change group ownership&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/chmod.html&quot;&gt;chmod&lt;/a&gt;    Change access permissions&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/chown.html&quot;&gt;chown&lt;/a&gt;    Change file owner and group&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/chroot.html&quot;&gt;chroot&lt;/a&gt;   Run a command with a different root directory&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/chkconfig.html&quot;&gt;chkconfig&lt;/a&gt; System services (runlevel)&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/cksum.html&quot;&gt;cksum&lt;/a&gt;    Print CRC checksum and byte counts&lt;br /&gt;clear    Clear terminal screen&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/cmp.html&quot;&gt;cmp&lt;/a&gt;      Compare two files&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/comm.html&quot;&gt;comm&lt;/a&gt;     Compare two sorted files line by line&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/command.html&quot;&gt;command&lt;/a&gt;  Run a command - ignoring shell functions&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/continue.html&quot;&gt;continue&lt;/a&gt; Resume the next iteration of a loop&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/cp.html&quot;&gt;cp&lt;/a&gt;       Copy one or more files to another location&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/cron.html&quot;&gt;cron&lt;/a&gt;     Daemon to execute scheduled commands&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/crontab.html&quot;&gt;crontab&lt;/a&gt;  Schedule a command to run at a later time&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/csplit.html&quot;&gt;csplit&lt;/a&gt;   Split a file into context-determined pieces&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/cut.html&quot;&gt;cut&lt;/a&gt;      Divide a file into several parts&lt;br /&gt;d&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/date.html&quot;&gt;date&lt;/a&gt;     Display or change the date &amp;amp; time&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/dc.html&quot;&gt;dc&lt;/a&gt;       Desk Calculator&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/dd.html&quot;&gt;dd&lt;/a&gt;       Convert and copy a file, write disk headers, boot records&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/ddrescue.html&quot;&gt;ddrescue&lt;/a&gt; Data recovery tool&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/declare.html&quot;&gt;declare&lt;/a&gt;  Declare variables and give them attributes&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/df.html&quot;&gt;df&lt;/a&gt;       Display free disk space&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/diff.html&quot;&gt;diff&lt;/a&gt;     Display the differences between two files&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/diff3.html&quot;&gt;diff3&lt;/a&gt;    Show differences among three files&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/dig.html&quot;&gt;dig&lt;/a&gt;      DNS lookup&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/dir.html&quot;&gt;dir&lt;/a&gt;      Briefly list directory contents&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/dircolours.html&quot;&gt;dircolors&lt;/a&gt; Colour setup for `ls&#39;&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/dirname.html&quot;&gt;dirname&lt;/a&gt;  Convert a full pathname to just a path&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/dirs.html&quot;&gt;dirs&lt;/a&gt;     Display list of remembered directories&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/dmesg.html&quot;&gt;dmesg&lt;/a&gt;    Print kernel &amp;amp; driver messages&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/du.html&quot;&gt;du&lt;/a&gt;       Estimate file space usage&lt;br /&gt;e&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/echo.html&quot;&gt;echo&lt;/a&gt;     Display message on screen&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/egrep.html&quot;&gt;egrep&lt;/a&gt;    Search file(s) for lines that match an extended expression&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/eject.html&quot;&gt;eject&lt;/a&gt;    Eject removable media&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/enable.html&quot;&gt;enable&lt;/a&gt;   Enable and disable builtin shell commands&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/env.html&quot;&gt;env&lt;/a&gt;      Environment variables&lt;br /&gt;ethtool  Ethernet card settings&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/eval.html&quot;&gt;eval&lt;/a&gt;     Evaluate several commands/arguments&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/exec.html&quot;&gt;exec&lt;/a&gt;     Execute a command&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/exit.html&quot;&gt;exit&lt;/a&gt;     Exit the shell&lt;br /&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Expect&quot;&gt;expect&lt;/a&gt;   Automate arbitrary applications accessed over a terminal&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/expand.html&quot;&gt;expand&lt;/a&gt;   Convert tabs to spaces&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/export.html&quot;&gt;export&lt;/a&gt;   Set an environment variable&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/expr.html&quot;&gt;expr&lt;/a&gt;     Evaluate expressions&lt;br /&gt;f&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/false.html&quot;&gt;false&lt;/a&gt;    Do nothing, unsuccessfully&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/fdformat.html&quot;&gt;fdformat&lt;/a&gt; Low-level format a floppy disk&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/fdisk.html&quot;&gt;fdisk&lt;/a&gt;    Partition table manipulator for Linux&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/fg.html&quot;&gt;fg&lt;/a&gt;       Send job to foreground&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/fgrep.html&quot;&gt;fgrep&lt;/a&gt;    Search file(s) for lines that match a fixed string&lt;br /&gt;file     Determine file type&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/find.html&quot;&gt;find&lt;/a&gt;     Search for files that meet a desired criteria&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/fmt.html&quot;&gt;fmt&lt;/a&gt;      Reformat paragraph text&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/fold.html&quot;&gt;fold&lt;/a&gt;     Wrap text to fit a specified width.&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/for.html&quot;&gt;for&lt;/a&gt;      Expand &lt;var&gt;words&lt;/var&gt;, and execute &lt;var&gt;commands&lt;/var&gt;&lt;br /&gt;format   Format disks or tapes&lt;br /&gt;free     Display memory usage&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/fsck.html&quot;&gt;fsck&lt;/a&gt;     File system consistency check and repair&lt;br /&gt;ftp      File Transfer Protocol&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/function.html&quot;&gt;function&lt;/a&gt; Define Function Macros&lt;br /&gt;g&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/awk.html&quot;&gt;gawk&lt;/a&gt;     Find and Replace text within file(s)&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/getopts.html&quot;&gt;getopts&lt;/a&gt;  Parse positional parameters&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/grep.html&quot;&gt;grep&lt;/a&gt;     Search file(s) for lines that match a given pattern&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/groups.html&quot;&gt;groups&lt;/a&gt;   Print group names a user is in&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/gzip.html&quot;&gt;gzip&lt;/a&gt;     Compress or decompress named file(s)&lt;br /&gt;h&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/hash.html&quot;&gt;hash&lt;/a&gt;     Remember the full pathname of a name argument&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/head.html&quot;&gt;head&lt;/a&gt;     Output the first part of file(s)&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/history.html&quot;&gt;history&lt;/a&gt;  Command History&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/hostname.html&quot;&gt;hostname&lt;/a&gt; Print or set system name&lt;br /&gt;i&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/id.html&quot;&gt;id&lt;/a&gt;       Print user and group id&#39;s&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/if.html&quot;&gt;if&lt;/a&gt;       Conditionally perform a command&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/ifconfig.html&quot;&gt;ifconfig&lt;/a&gt; Configure a network interface&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/ifup.html&quot;&gt;ifdown&lt;/a&gt;   Stop a network interface&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/ifup.html&quot;&gt;ifup&lt;/a&gt;     Start a network interface up&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/import.html&quot;&gt;import&lt;/a&gt;   Capture an X server screen and save the image to file&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/install.html&quot;&gt;install&lt;/a&gt;  Copy files and set attributes&lt;br /&gt;j&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/join.html&quot;&gt;join&lt;/a&gt;     Join lines on a common field&lt;br /&gt;k&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/kill.html&quot;&gt;kill&lt;/a&gt;     Stop a process from running&lt;br /&gt;killall  Kill processes by name&lt;br /&gt;l&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/less.html&quot;&gt;less&lt;/a&gt;     Display output one screen at a time&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/let.html&quot;&gt;let&lt;/a&gt;      Perform arithmetic on shell variables&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/ln.html&quot;&gt;ln&lt;/a&gt;       Make links between files&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/local.html&quot;&gt;local&lt;/a&gt;    Create variables&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/locate.html&quot;&gt;locate&lt;/a&gt;   Find files&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/logname.html&quot;&gt;logname&lt;/a&gt;  Print current login name&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/logout.html&quot;&gt;logout&lt;/a&gt;   Exit a login shell&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/look.html&quot;&gt;look&lt;/a&gt;     Display lines beginning with a given string&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/lpc.html&quot;&gt;lpc&lt;/a&gt;      Line printer control program&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/lpr.html&quot;&gt;lpr&lt;/a&gt;      Off line print&lt;br /&gt;lprint   Print a file&lt;br /&gt;lprintd  Abort a print job&lt;br /&gt;lprintq  List the print queue&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/lprm.html&quot;&gt;lprm&lt;/a&gt;     Remove jobs from the print queue&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/ls.html&quot;&gt;ls&lt;/a&gt;       List information about file(s)&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/lsof.html&quot;&gt;lsof&lt;/a&gt;     List open files&lt;br /&gt;m&lt;br /&gt;make     Recompile a group of programs&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/man.html&quot;&gt;man&lt;/a&gt;      Help manual&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/mkdir.html&quot;&gt;mkdir&lt;/a&gt;    Create new folder(s)&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/mkfifo.html&quot;&gt;mkfifo&lt;/a&gt;   Make FIFOs (named pipes)&lt;br /&gt;mkisofs  Create an hybrid ISO9660/JOLIET/HFS filesystem&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/mknod.html&quot;&gt;mknod&lt;/a&gt;    Make block or character special files&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/more.html&quot;&gt;more&lt;/a&gt;     Display output one screen at a time&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/mount.html&quot;&gt;mount&lt;/a&gt;    Mount a file system&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/mtools.html&quot;&gt;mtools&lt;/a&gt;   Manipulate MS-DOS files&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/mv.html&quot;&gt;mv&lt;/a&gt;       Move or rename files or directories&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/mmv.html&quot;&gt;mmv&lt;/a&gt;      Mass Move and rename (files)&lt;br /&gt;n&lt;br /&gt;netstat  Networking information&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/nice.html&quot;&gt;nice&lt;/a&gt;     Set the priority of a command or job&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/nl.html&quot;&gt;nl&lt;/a&gt;       Number lines and write files&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/nohup.html&quot;&gt;nohup&lt;/a&gt;    Run a command immune to hangups&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/nslookup.html&quot;&gt;nslookup&lt;/a&gt; Query Internet name servers interactively&lt;br /&gt;o&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/open.html&quot;&gt;open&lt;/a&gt;     Open a file in its default application&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/op.html&quot;&gt;op&lt;/a&gt;       Operator access&lt;br /&gt;p&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/passwd.html&quot;&gt;passwd&lt;/a&gt;   Modify a user password&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/paste.html&quot;&gt;paste&lt;/a&gt;    Merge lines of files&lt;br /&gt;pathchk  Check file name portability&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/ping.html&quot;&gt;ping&lt;/a&gt;     Test a network connection&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/popd.html&quot;&gt;popd&lt;/a&gt;     Restore the previous value of the current directory&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/pr.html&quot;&gt;pr&lt;/a&gt;       Prepare files for printing&lt;br /&gt;printcap Printer capability database&lt;br /&gt;printenv Print environment variables&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/printf.html&quot;&gt;printf&lt;/a&gt;   Format and print data&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/ps.html&quot;&gt;ps&lt;/a&gt;       Process status&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/pushd.html&quot;&gt;pushd&lt;/a&gt;    Save and then change the current directory&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/pwd.html&quot;&gt;pwd&lt;/a&gt;      Print Working Directory&lt;br /&gt;q&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/quota.html&quot;&gt;quota&lt;/a&gt;    Display disk usage and limits&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/quotacheck.html&quot;&gt;quotacheck&lt;/a&gt; Scan a file system for disk usage&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/quotactl.html&quot;&gt;quotactl&lt;/a&gt; Set disk quotas&lt;br /&gt;r&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/ram.html&quot;&gt;ram&lt;/a&gt;      ram disk device&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/rcp.html&quot;&gt;rcp&lt;/a&gt;      Copy files between two machines&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/read.html&quot;&gt;read&lt;/a&gt;     read a line from standard input&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/readonly.html&quot;&gt;readonly&lt;/a&gt; Mark variables/functions as readonly&lt;br /&gt;reboot   Reboot the system&lt;br /&gt;renice   Alter priority of running processes&lt;br /&gt;remsync  Synchronize remote files via email&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/return.html&quot;&gt;return&lt;/a&gt;   Exit a shell function&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/rev.html&quot;&gt;rev&lt;/a&gt;      Reverse lines of a file&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/rm.html&quot;&gt;rm&lt;/a&gt;       Remove files&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/rmdir.html&quot;&gt;rmdir&lt;/a&gt;    Remove folder(s)&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/rsync.html&quot;&gt;rsync&lt;/a&gt;    Remote file copy (Synchronize file trees)&lt;br /&gt;s&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/screen.html&quot;&gt;screen&lt;/a&gt;   Multiplex terminal, run remote shells via ssh&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/scp.html&quot;&gt;scp&lt;/a&gt;      Secure copy (remote file copy)&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/sdiff.html&quot;&gt;sdiff&lt;/a&gt;    Merge two files interactively&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/sed.html&quot;&gt;sed&lt;/a&gt;      Stream Editor&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/select.html&quot;&gt;select&lt;/a&gt;   Accept keyboard input&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/seq.html&quot;&gt;seq&lt;/a&gt;      Print numeric sequences&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/set.html&quot;&gt;set&lt;/a&gt;      Manipulate shell variables and functions&lt;br /&gt;sftp     Secure File Transfer Program&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/shift.html&quot;&gt;shift&lt;/a&gt;    Shift positional parameters&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/shopt.html&quot;&gt;shopt&lt;/a&gt;    Shell Options&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/shutdown.html&quot;&gt;shutdown&lt;/a&gt; Shutdown or restart linux&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/sleep.html&quot;&gt;sleep&lt;/a&gt;    Delay for a specified time&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/slocate.html&quot;&gt;slocate&lt;/a&gt;  Find files&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/sort.html&quot;&gt;sort&lt;/a&gt;     Sort text files&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/source.html&quot;&gt;source&lt;/a&gt;   Run commands from a file `.&#39;&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/split.html&quot;&gt;split&lt;/a&gt;    Split a file into fixed-size pieces&lt;br /&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Secure_Shell&quot;&gt;ssh&lt;/a&gt;      Secure Shell client (remote login program)&lt;br /&gt;strace   Trace system calls and signals&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/su.html&quot;&gt;su&lt;/a&gt;       Substitute user identity&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/sudo.html&quot;&gt;sudo&lt;/a&gt;     Execute a command as another user&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/sum.html&quot;&gt;sum&lt;/a&gt;      Print a checksum for a file&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/symlink.html&quot;&gt;symlink&lt;/a&gt;  Make a new name for a file&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/sync.html&quot;&gt;sync&lt;/a&gt;     Synchronize data on disk with memory&lt;br /&gt;t&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/tail.html&quot;&gt;tail&lt;/a&gt;     Output the last part of files&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/tar.html&quot;&gt;tar&lt;/a&gt;      Tape ARchiver&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/tee.html&quot;&gt;tee&lt;/a&gt;      Redirect output to multiple files&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/test.html&quot;&gt;test&lt;/a&gt;     Evaluate a conditional expression&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/time.html&quot;&gt;time&lt;/a&gt;     Measure Program running time&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/times.html&quot;&gt;times&lt;/a&gt;    User and system times&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/touch.html&quot;&gt;touch&lt;/a&gt;    Change file timestamps&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/top.html&quot;&gt;top&lt;/a&gt;      List processes running on the system&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/traceroute.html&quot;&gt;traceroute&lt;/a&gt; Trace Route to Host&lt;br /&gt;trap     Run a command when a signal is set(bourne)&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/tr.html&quot;&gt;tr&lt;/a&gt;       Translate, squeeze, and/or delete characters&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/true.html&quot;&gt;true&lt;/a&gt;     Do nothing, successfully&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/tsort.html&quot;&gt;tsort&lt;/a&gt;    Topological sort&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/tty.html&quot;&gt;tty&lt;/a&gt;      Print filename of terminal on stdin&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/type.html&quot;&gt;type&lt;/a&gt;     Describe a command&lt;br /&gt;u&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/ulimit.html&quot;&gt;ulimit&lt;/a&gt;   Limit user resources&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/umask.html&quot;&gt;umask&lt;/a&gt;    Users file creation mask&lt;br /&gt;umount   Unmount a device&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/alias.html&quot;&gt;unalias&lt;/a&gt;  Remove an alias&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/uname.html&quot;&gt;uname&lt;/a&gt;    Print system information&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/unexpand.html&quot;&gt;unexpand&lt;/a&gt; Convert spaces to tabs&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/uniq.html&quot;&gt;uniq&lt;/a&gt;     Uniquify files&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/units.html&quot;&gt;units&lt;/a&gt;    Convert units from one scale to another&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/unset.html&quot;&gt;unset&lt;/a&gt;    Remove variable or function names&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/unshar.html&quot;&gt;unshar&lt;/a&gt;   Unpack shell archive scripts&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/until.html&quot;&gt;until&lt;/a&gt;    Execute commands (until error)&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/useradd.html&quot;&gt;useradd&lt;/a&gt;  Create new user account&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/usermod.html&quot;&gt;usermod&lt;/a&gt;  Modify user account&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/users.html&quot;&gt;users&lt;/a&gt;    List users currently logged in&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/uuencode.html&quot;&gt;uuencode&lt;/a&gt; Encode a binary file&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/uuencode.html&quot;&gt;uudecode&lt;/a&gt; Decode a file created by uuencode&lt;br /&gt;v&lt;br /&gt;v        Verbosely list directory contents (`ls -l -b&#39;)&lt;br /&gt;vdir     Verbosely list directory contents (`ls -l -b&#39;)&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/vi.html&quot;&gt;vi&lt;/a&gt;       Text Editor&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/vmstat.html&quot;&gt;vmstat&lt;/a&gt;   Report virtual memory statistics&lt;br /&gt;w&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/watch.html&quot;&gt;watch&lt;/a&gt;    Execute/display a program periodically&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/wc.html&quot;&gt;wc&lt;/a&gt;       Print byte, word, and line counts&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/whereis.html&quot;&gt;whereis&lt;/a&gt;  Report all known instances of a command &lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/which.html&quot;&gt;which&lt;/a&gt;    Locate a program file in the user&#39;s path.&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/while.html&quot;&gt;while&lt;/a&gt;    Execute commands&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/who.html&quot;&gt;who&lt;/a&gt;      Print all usernames currently logged in&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/whoami.html&quot;&gt;whoami&lt;/a&gt;   Print the current user id and name (`id -un&#39;)&lt;br /&gt;Wget     Retrieve web pages or files via HTTP, HTTPS or FTP&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/write.html&quot;&gt;write&lt;/a&gt;    Send a message to another user&lt;br /&gt;x&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/xargs.html&quot;&gt;xargs&lt;/a&gt;    Execute utility, passing constructed argument list(s)&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/yes.html&quot;&gt;yes&lt;/a&gt;      Print a string until interrupted&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/source.html&quot;&gt;.&lt;/a&gt;        Run a command script in the current shell&lt;br /&gt;&lt;a href=&quot;http://www.ss64.com/bash/rem.html&quot;&gt;###&lt;/a&gt;      Comment / Remark&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;h1&gt;&lt;/h1&gt;</description><link>http://mubarakworld.blogspot.com/2008/12/a-z-index-of-bash-command-line-for.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-5177548108473751446</guid><pubDate>Mon, 22 Dec 2008 11:00:00 +0000</pubDate><atom:updated>2008-12-31T03:01:41.097-08:00</atom:updated><title>A Beginner&#39;s Guide to Pointers</title><description>&lt;h2&gt;What Are Pointers?&lt;/h2&gt;  &lt;p&gt;Pointers are basically the same as any other variable. However, what is different about them is that instead of containing actual data, they contain a pointer to the memory location where information can be found. This is a very important concept. Many programs and ideas rely on pointers as the basis of their design, linked lists for example. &lt;/p&gt;  &lt;h2&gt;Getting Started&lt;/h2&gt;  &lt;p&gt;How do I define a pointer? Well, the same as any other variable, except you add an asterisk before its name. So, for example, the following code creates two pointers, both of which point to an integer:&lt;/p&gt;  &lt;div class=&quot;SmallText&quot; id=&quot;premain0&quot; style=&quot;width: 100%; cursor: pointer;&quot;&gt;&lt;img preid=&quot;0&quot; src=&quot;http://www.codeproject.com/images/minus.gif&quot; id=&quot;preimg0&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;&lt;span preid=&quot;0&quot; style=&quot;margin-bottom: 0pt;&quot; id=&quot;precollapse0&quot;&gt; Collapse&lt;/span&gt;&lt;/div&gt;&lt;pre style=&quot;margin-top: 0pt;&quot; id=&quot;pre0&quot; lang=&quot;c++&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt;* pNumberOne;&lt;br /&gt;&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt;* pNumberTwo;&lt;/pre&gt;  &lt;p&gt;Notice the &quot;p&quot; prefix in front of the two variable names? This is a convention used to indicate that the variable is a pointer. Now, let&#39;s make these pointers actually point to something:&lt;/p&gt;  &lt;div class=&quot;SmallText&quot; id=&quot;premain1&quot; style=&quot;width: 100%; cursor: pointer;&quot;&gt;&lt;img preid=&quot;1&quot; src=&quot;http://www.codeproject.com/images/minus.gif&quot; id=&quot;preimg1&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;&lt;span preid=&quot;1&quot; style=&quot;margin-bottom: 0pt;&quot; id=&quot;precollapse1&quot;&gt; Collapse&lt;/span&gt;&lt;/div&gt;&lt;pre style=&quot;margin-top: 0pt;&quot; id=&quot;pre1&quot; lang=&quot;c++&quot;&gt;pNumberOne = &amp;amp;some_number;&lt;br /&gt;pNumberTwo = &amp;amp;some_other_number;&lt;/pre&gt;  &lt;p&gt;The &amp;amp; (ampersand) sign should be read as &quot;the address of&quot; and causes the address in memory of a variable to be returned, instead of the variable itself. So, in this example, &lt;code&gt;pNumberOne&lt;/code&gt; is set to equal the address of &lt;code&gt;some_number&lt;/code&gt;, so &lt;code&gt;pNumberOne&lt;/code&gt; now points to &lt;code&gt;some_number&lt;/code&gt;.&lt;/p&gt;  &lt;p&gt;Now if we want to refer to the address of &lt;code&gt;some_number&lt;/code&gt;, we can use &lt;code&gt;pNumberOne&lt;/code&gt;. If we want to refer to the value of &lt;code&gt;some_number&lt;/code&gt; from &lt;code&gt;pNumberOne&lt;/code&gt;, we would have to say &lt;code&gt;*pNumberOne&lt;/code&gt;. The * dereferences the pointer and should be read as &quot;the memory location pointed to by,&quot; unless in a declaration, as in the line &lt;code&gt;&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; *pNumber&lt;/code&gt;. &lt;/p&gt;  &lt;h2&gt;What We&#39;ve Learned So Far: An Example&lt;/h2&gt;  &lt;p&gt;Phew! That&#39;s a lot to take in. I&#39;d recommend that if you don&#39;t understand any of those concepts, to give it another read through. Pointers are a complex subject and it can take a while to master them. Here is an example that demonstrates the ideas discussed above. It is written in C, without the C++ extensions.&lt;/p&gt;  &lt;div class=&quot;SmallText&quot; id=&quot;premain2&quot; style=&quot;width: 100%; cursor: pointer;&quot;&gt;&lt;img preid=&quot;2&quot; src=&quot;http://www.codeproject.com/images/minus.gif&quot; id=&quot;preimg2&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;&lt;span preid=&quot;2&quot; style=&quot;margin-bottom: 0pt;&quot; id=&quot;precollapse2&quot;&gt; Collapse&lt;/span&gt;&lt;/div&gt;&lt;pre style=&quot;margin-top: 0pt;&quot; id=&quot;pre2&quot; lang=&quot;c++&quot;&gt;&lt;span class=&quot;code-preprocessor&quot;&gt;#include&lt;/span&gt;&lt;span class=&quot;code-preprocessor&quot;&gt; &lt;span class=&quot;code-keyword&quot;&gt;&lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;stdio.h&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; main()&lt;br /&gt;{&lt;br /&gt;   &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; declare the variables:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;   &lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; nNumber;&lt;br /&gt;   &lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; *pPointer;&lt;br /&gt;&lt;br /&gt;   &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; now, give a value to them:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;   nNumber = &lt;span class=&quot;code-digit&quot;&gt;15&lt;/span&gt;;&lt;br /&gt;   pPointer = &amp;nNumber;&lt;br /&gt;&lt;br /&gt;   &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; print out the value of nNumber:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;   printf(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;nNumber is equal to : %d\n&quot;&lt;/span&gt;, nNumber);&lt;br /&gt;&lt;br /&gt;   &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; now, alter nNumber through pPointer:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;   *pPointer = &lt;span class=&quot;code-digit&quot;&gt;25&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;   &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; prove that nNumber has changed as a result of the above by&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;   &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; printing its value again:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;   printf(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;nNumber is equal to : %d\n&quot;&lt;/span&gt;, nNumber);&lt;br /&gt;}&lt;/pre&gt;  &lt;p&gt;Read through and compile the above code sample. Make sure you understand why it works. Then, when you are ready, read on!&lt;/p&gt;  &lt;h2&gt;A Trap!&lt;/h2&gt;  &lt;p&gt;See if you can spot the fault in the program below:&lt;/p&gt;  &lt;div class=&quot;SmallText&quot; id=&quot;premain3&quot; style=&quot;width: 100%; cursor: pointer;&quot;&gt;&lt;img preid=&quot;3&quot; src=&quot;http://www.codeproject.com/images/minus.gif&quot; id=&quot;preimg3&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;&lt;span preid=&quot;3&quot; style=&quot;margin-bottom: 0pt;&quot; id=&quot;precollapse3&quot;&gt; Collapse&lt;/span&gt;&lt;/div&gt;&lt;pre style=&quot;margin-top: 0pt;&quot; id=&quot;pre3&quot; lang=&quot;c++&quot;&gt;&lt;span class=&quot;code-preprocessor&quot;&gt;#include&lt;/span&gt;&lt;span class=&quot;code-preprocessor&quot;&gt; &lt;span class=&quot;code-keyword&quot;&gt;&lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;stdio.h&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; *pPointer;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; SomeFunction();&lt;br /&gt;{&lt;br /&gt;   &lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; nNumber;&lt;br /&gt;   nNumber = &lt;span class=&quot;code-digit&quot;&gt;25&lt;/span&gt;;   &lt;br /&gt;&lt;br /&gt;   &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; make pPointer point to nNumber:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;   pPointer = &amp;nNumber;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; main()&lt;br /&gt;{&lt;br /&gt;   SomeFunction(); &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; make pPointer point to something&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; why does this fail?&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;   printf(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Value of *pPointer: %d\n&quot;&lt;/span&gt;, *pPointer);&lt;br /&gt;}&lt;/pre&gt;  &lt;p&gt;This program firstly calls the &lt;code&gt;SomeFunction&lt;/code&gt; function, which creates a variable called &lt;code&gt;nNumber&lt;/code&gt; and then makes the &lt;code&gt;pPointer&lt;/code&gt; point to it. Then, however, is where the problem is. When the function leaves, &lt;code&gt;nNumber&lt;/code&gt; is deleted because it is a local variable. Local variables are always deleted when execution leaves the block they were defined in. This means that when &lt;code&gt;SomeFunction&lt;/code&gt; returns to &lt;code&gt;main()&lt;/code&gt;, the variable is deleted. So &lt;code&gt;pPointer&lt;/code&gt; is pointing at where the variable used to be, which no longer belongs to this program. If you do not understand this, it may be wise to read back over on local and global variables, and on scope. This concept is also important. &lt;/p&gt;  &lt;p&gt;So, how can the problem be solved? The answer is by using a technique known as &lt;strong&gt;dynamic allocation&lt;/strong&gt;. Please be aware that this is different between C and C++. Since most developers are now using C++, this is the dialect that the code below is using. &lt;/p&gt;  &lt;h2&gt;Dynamic Allocation&lt;/h2&gt;  &lt;p&gt;Dynamic allocation is perhaps the key to pointers. It is used to allocate memory without having to define variables and then make pointers point to them. Although the concept may appear confusing, it is really simple. The following code demonstrates how to allocate memory for an integer:&lt;/p&gt;  &lt;div class=&quot;SmallText&quot; id=&quot;premain4&quot; style=&quot;width: 100%; cursor: pointer;&quot;&gt;&lt;img preid=&quot;4&quot; src=&quot;http://www.codeproject.com/images/minus.gif&quot; id=&quot;preimg4&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;&lt;span preid=&quot;4&quot; style=&quot;margin-bottom: 0pt;&quot; id=&quot;precollapse4&quot;&gt; Collapse&lt;/span&gt;&lt;/div&gt;&lt;pre style=&quot;margin-top: 0pt;&quot; id=&quot;pre4&quot; lang=&quot;c++&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; *pNumber;&lt;br /&gt;pNumber = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt;;&lt;/pre&gt;  &lt;p&gt;The first line declares the pointer, &lt;code&gt;pNumber&lt;/code&gt;. The second line then allocates memory for an integer and then makes &lt;code&gt;pNumber&lt;/code&gt; point to this new memory. Here is another example, this time using a &lt;code&gt;&lt;span class=&quot;code-keyword&quot;&gt;double&lt;/span&gt;&lt;/code&gt;: &lt;/p&gt;  &lt;div class=&quot;SmallText&quot; id=&quot;premain5&quot; style=&quot;width: 100%; cursor: pointer;&quot;&gt;&lt;img preid=&quot;5&quot; src=&quot;http://www.codeproject.com/images/minus.gif&quot; id=&quot;preimg5&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;&lt;span preid=&quot;5&quot; style=&quot;margin-bottom: 0pt;&quot; id=&quot;precollapse5&quot;&gt; Collapse&lt;/span&gt;&lt;/div&gt;&lt;pre style=&quot;margin-top: 0pt;&quot; id=&quot;pre5&quot; lang=&quot;c++&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;double&lt;/span&gt; *pDouble;&lt;br /&gt;pDouble = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;double&lt;/span&gt;;&lt;/pre&gt;  &lt;p&gt;The formula is the same every time, so you can&#39;t really fail with this bit. What is different about dynamic allocation, however, is that the memory you allocate is not deleted when the function returns, or when execution leaves the current block. So, if we rewrite the above example using dynamic allocation, we can see that it works fine now:&lt;/p&gt;  &lt;div class=&quot;SmallText&quot; id=&quot;premain6&quot; style=&quot;width: 100%; cursor: pointer;&quot;&gt;&lt;img preid=&quot;6&quot; src=&quot;http://www.codeproject.com/images/minus.gif&quot; id=&quot;preimg6&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;&lt;span preid=&quot;6&quot; style=&quot;margin-bottom: 0pt;&quot; id=&quot;precollapse6&quot;&gt; Collapse&lt;/span&gt;&lt;/div&gt;&lt;pre style=&quot;margin-top: 0pt;&quot; id=&quot;pre6&quot; lang=&quot;c++&quot;&gt;&lt;span class=&quot;code-preprocessor&quot;&gt;#include&lt;/span&gt;&lt;span class=&quot;code-preprocessor&quot;&gt; &lt;span class=&quot;code-keyword&quot;&gt;&lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;stdio.h&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; *pPointer;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; SomeFunction()&lt;br /&gt;{&lt;br /&gt;   &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; make pPointer point to a new integer&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;   pPointer = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt;;&lt;br /&gt;   *pPointer = &lt;span class=&quot;code-digit&quot;&gt;25&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; main()&lt;br /&gt;{&lt;br /&gt;   SomeFunction(); &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; make pPointer point to something&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;   printf(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Value of *pPointer: %d\n&quot;&lt;/span&gt;, *pPointer);&lt;br /&gt;}&lt;/pre&gt;  &lt;p&gt;Read through and compile the above code sample. Make sure you understand why it works. When &lt;code&gt;SomeFunction&lt;/code&gt; is called, it allocates some memory and makes &lt;code&gt;pPointer&lt;/code&gt; point to it. This time, when the function returns, the new memory is left intact, so &lt;code&gt;pPointer&lt;/code&gt; still points to something useful. That&#39;s it for dynamic allocation! Make sure you understand this, and then read on to learn about the fly in the ointment, and why there is still a serious error in the code above.&lt;/p&gt;</description><link>http://mubarakworld.blogspot.com/2008/12/beginners-guide-to-pointers.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-5614784154107116066</guid><pubDate>Thu, 18 Dec 2008 10:58:00 +0000</pubDate><atom:updated>2008-12-31T02:59:09.821-08:00</atom:updated><title>Run Windows applications on Linux</title><description>&lt;p&gt;Most people who use Linux are familiar with the WINE program, which enables the use of Windows software on Linux without requiring Windows itself. WINE is still fairly immature. While it can run some applications, other applications can present a problem.     &lt;/p&gt; &lt;p&gt; &lt;span class=&quot;normalArial&quot;&gt;However, other programs exist that allow you to run more specialized applications. For example, CodeWeaver&#39;s CrossOver Office lets you run Windows business applications (such as Microsoft Office, Quicken, etc.) under Linux, and TransGaming&#39;s WineX allows you to play many popular Windows games under Linux.  &lt;/span&gt;   &lt;/p&gt; &lt;p&gt; &lt;span class=&quot;normalArial&quot;&gt;CodeWeaver recently released CrossOver Office 2.1, which includes support for even more applications, most notably Macromedia&#39;s Dreamweaver MX and Flash MX. The ability to run these applications on Linux is a true benefit for professional Web developers, who often write Web applications on the Windows platform for deployment on Linux servers.  &lt;/span&gt;   &lt;/p&gt; &lt;p&gt; &lt;span class=&quot;normalArial&quot;&gt;CrossOver Office is easy to install. You can download RPM packages or the Loki installer, which looks like a large bash script file. The Loki installer is the most portable option, enabling you to install CrossOver Office in a location of your choice and on any Linux distribution, including Debian and Slackware.  &lt;/span&gt;   &lt;/p&gt; &lt;p&gt; &lt;span class=&quot;normalArial&quot;&gt;CrossOver Office is a commercial application, and it costs $59.95. However, you can download a 30-day trial version. When you download the Loki installer, start it by executing the following:  &lt;/span&gt;   &lt;/p&gt; &lt;span style=&quot;font-family:mono;font-size:-1;&quot;&gt; &lt;p class=&quot;code&quot;&gt;$ sh install-crossover-office-2.1.0.sh  &lt;/p&gt; &lt;/span&gt; &lt;p&gt; &lt;span class=&quot;normalArial&quot;&gt;This begins the installation program and allows you to choose the installation location or pick the existing location if you&#39;re upgrading.  &lt;/span&gt;   &lt;/p&gt; &lt;p&gt; &lt;span class=&quot;normalArial&quot;&gt;Once the installation is complete, grab the installation CDs for the Windows applications you want to install, and use the easy-to-use configuration tool to launch the installation wizards for the respective programs.  &lt;/span&gt;   &lt;/p&gt;</description><link>http://mubarakworld.blogspot.com/2008/12/run-windows-applications-on-linux.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-8695873825785667575</guid><pubDate>Fri, 12 Dec 2008 10:57:00 +0000</pubDate><atom:updated>2008-12-31T02:58:10.848-08:00</atom:updated><title>Use Cygwin when you can&#39;t use Linux</title><description>&lt;p&gt;Linux fans would love to use Linux all of the time, but sometimes it just isn&#39;t possible. Maybe a certain application requires that you use Windows, or perhaps you&#39;re forced to use Windows at work. Regardless of the reason, if you&#39;ve become attached to your Linux and open source applications, rest assured that you can use Cygwin to run most of those applications on Windows.&lt;/p&gt;  &lt;p&gt;Cygwin is an environment for Windows, similar to Linux, that provides a Linux API emulation layer and a collection of tools that are normally only available on systems that use open source tools, such as Linux, the *BSD&#39;s, and Mac OS X.&lt;/p&gt;  &lt;p&gt;To begin using this environment, &lt;a href=&quot;http://cygwin.com/&quot;&gt;visit the Cygwin Web site&lt;/a&gt; and download the installer--the setup.exe file. Once this component is downloaded, double-click it and choose the Install From Internet option, which will download only the packages you want to install. You&#39;ll need to specify the root environment of the installation, where packages will be downloaded to, and a mirror site from which to download packages.&lt;/p&gt;  &lt;p&gt;After you&#39;ve picked a mirror, the installer will download some base files and allow you to select packages from various categories. Here you can choose what shells, text-processing tools, databases, desktop applications, and other programs that you&#39;d like to install. Since Cygwin comes with an X server, you can even install GNOME and KDE programs. Better yet, you can compile your own programs to run under Cygwin by installing gcc and friends.&lt;/p&gt;  &lt;p&gt;Cygwin will dutifully download and install all of the packages that you select. When the download process is complete, you can fire up Cygwin and an initial bash shell by clicking the Cygwin icon on your desktop.&lt;/p&gt;</description><link>http://mubarakworld.blogspot.com/2008/12/use-cygwin-when-you-cant-use-linux.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-1766526203898781550</guid><pubDate>Thu, 11 Dec 2008 12:24:00 +0000</pubDate><atom:updated>2008-12-31T04:24:54.952-08:00</atom:updated><title>LINUX NEWBIE ADMINISTRATOR GUIDE</title><description>&lt;b&gt;Intro.&lt;/b&gt; We are relative Linux newbies (with Linux since Summer  1998).   We run mostly RedHat and Mandrake  -&gt; the solutions might   not be  directly applicable to other Linux distributions (although most of  them probably  will be). Hope this helps; we try to be as practical as possible.  Of course,  we provide no warranty whatsoever.  If you spotted a bad  error or would   like to contribute a part on a topic of your choice, we would like to hear   from you.                &lt;p&gt;&lt;b&gt;General description of this Guide. &lt;/b&gt; A complete reference for     new Linux users who wish to set up and administer their own Linux home  computer,   workstation and/or their home or small office network.  The answers  are meant to be simple, with just sufficient detail, and always supported  with a readily usable example.  The work is still in progress, but we  hope the Guide can be helpful already. We  welcome your corrections,     advice, criticism, links, translations, and CONTRIBUTIONS. Pls note that    there are no ad banners on our pages. &lt;/p&gt;               &lt;p&gt;&lt;b&gt;Conventions:&lt;/b&gt;&lt;br /&gt;       &lt;tt&gt; &lt;&gt;&lt;/tt&gt; = single special or function key on the keyboard.     For example &lt;tt&gt;&lt;ctrl&gt;&lt;/tt&gt; indicates the &quot;control&quot; key.&lt;br /&gt;         &lt;i&gt;italic&lt;/i&gt; = name of a file or variable you probably want  to  substitute  with your own.&lt;br /&gt;         &lt;tt&gt;fixed width&lt;/tt&gt; = commands and filenames. &lt;/p&gt;               &lt;p&gt;&lt;b&gt;Part 0:&lt;/b&gt; &lt;a href=&quot;http://linux-newbie.sunsite.dk/html/lnag.html&quot;&gt;For the Undecided (Linux Benefits)&lt;/a&gt;    &lt;br /&gt;       If you are wondering what the Linux pros and cons are, and whether  Linux    is for you. &lt;/p&gt;               &lt;p&gt;&lt;b&gt;Part 1:&lt;/b&gt; &lt;a href=&quot;http://linux-newbie.sunsite.dk/html/lnag.html&quot;&gt;Before Linux Installation&lt;/a&gt;    &lt;br /&gt;       What distribution should I use, how to obtain it, Linux hardware requirements,     how to partition your hard drive, about dual boot, which packages to install,     which graphical user interface (GUI) to install (gnome or kde?), and how    to login for the very first time. &lt;/p&gt;               &lt;p&gt;&lt;b&gt;Part 2:&lt;/b&gt; &lt;a href=&quot;http://linux-newbie.sunsite.dk/html/lnag.html&quot;&gt;Linux Resources, Help and Some     Links&lt;/a&gt;&lt;br /&gt;       How to access the Linux documentation (from under MS Windows or Linux),    what are Linux help commands, where to find the geek dictionary, + pointers    to some Linux newsgroups and websites. &lt;/p&gt;               &lt;p&gt;&lt;b&gt;Part 3:&lt;/b&gt; &lt;a href=&quot;http://linux-newbie.sunsite.dk/html/lnag.html&quot;&gt;Basic Operations FAQ&lt;/a&gt;&lt;br /&gt;       After you installed Linux, here are answers to some questions that  Linux    newbie users/administrators may have when trying to perform every-day  tasks:    what are the file name conventions, how to run a program, shut down my computer,   set up the path, add users, remove users, make your passwords  and system  more secure, work with file permissions, schedule jobs with &quot;at&quot;  and cron,  change your shell prompt, print symbols in the text mode, use color in the  text mode, redirect input/output, write a simple shell script, install a new program ... &lt;/p&gt;               &lt;p&gt;&lt;b&gt;Part  4.1: &lt;/b&gt; &lt;a href=&quot;http://linux-newbie.sunsite.dk/html/lnag.html&quot;&gt;Boot-time issues&lt;/a&gt;    &lt;br /&gt;       Some info on LILO and GRUB boot managers, how do I choose the operating    system which boots on default, hints on configuration of the boot loaders,    &quot;uninstalling&quot; Linux  ... &lt;/p&gt;               &lt;p&gt;&lt;b&gt;Part  4.2:&lt;/b&gt;  &lt;a href=&quot;http://linux-newbie.sunsite.dk/html/lnag.html&quot;&gt;Drives&lt;/a&gt;&lt;br /&gt;       Where are my drives, how to access them, configure user access, get  the   zip drive recognized, set 32-bit hard drive IO, increase the limit on the   number of opened files, add a new hardrive, manage the swap space ... &lt;/p&gt;               &lt;p&gt;&lt;b&gt;Part  4.3:&lt;/b&gt; &lt;a href=&quot;http://linux-newbie.sunsite.dk/html/lnag.html&quot;&gt;X-windows&lt;/a&gt;&lt;br /&gt;       How to switch between text and graphical consoles, set up my video  card,    monitor and mouse for the X-server, setup a graphical login prompt,      change a default desktop,  have multiple sessions of Xwindows running     at the same time,  use Xwindow remotely, install TrueType fonts from     my MS Windows partition to Linux, how to copy-paste under X and in the  text  mode, how to use VNC. &lt;/p&gt;               &lt;p&gt;&lt;b&gt;Part  4.4:&lt;/b&gt; &lt;a href=&quot;http://linux-newbie.sunsite.dk/html/lnag.html&quot;&gt;Basic Configurations&lt;/a&gt;    &lt;br /&gt;       Real basics on how to configure the printer and soundcard,  bits   about  configuration files, daemons, and device files. &lt;/p&gt;               &lt;p&gt;&lt;b&gt;Part  4.5: &lt;/b&gt; &lt;a href=&quot;http://linux-newbie.sunsite.dk/html/lnag.html&quot;&gt;Networking&lt;/a&gt;    &lt;br /&gt;       Setting up a network, ppp (connection over the phone), remote access   to  your computer, ftp and html server, e-mail, how my computer can get hacked   ...  &lt;/p&gt;               &lt;p&gt;&lt;b&gt;Part 5:&lt;/b&gt; &lt;a href=&quot;http://linux-newbie.sunsite.dk/html/lnag.html&quot;&gt;Linux Shortcuts and Commands&lt;/a&gt;    &lt;br /&gt;       Maybe this should have come first. A practical selection of Linux shortcuts     and commands in a concise form. Perhaps this is everything that a computer-literate     newbie Linuxer really needs. &lt;b&gt;Highly recommended.&lt;/b&gt; &lt;/p&gt;               &lt;p&gt;&lt;b&gt;Part 6:&lt;/b&gt; &lt;a href=&quot;http://linux-newbie.sunsite.dk/html/lnag.html&quot;&gt;Linux applications (proprietary     or not)&lt;/a&gt;&lt;br /&gt;       Essential and/or famous Linux applications with some hint/comments:  word   processing, spreadsheet, database, latex. Extensive info on how to  set up   and use a CD recorder to write data, audio, and mixed mode CDs. &lt;/p&gt;               &lt;p&gt;&lt;b&gt;Part 7:&lt;/b&gt; &lt;a href=&quot;http://linux-newbie.sunsite.dk/html/lnag.html&quot;&gt;Learning with Linux (commands     for more esoteric work or programming)&lt;/a&gt;&lt;br /&gt;       Review of some more advanced or less useful commands/tools to get you   started  with fancier text processing, encryption, digital signatures (gpg),   simple  programming plus some info on the Linux console tools that can help   you learn  about computers. Under development so perhaps not so good:    grep, regular  expressions, sed, gawk, sort, ascii codes, linux built-in  c compiler and tools, perl, python, tcl/tk, &quot;Reverse Polish Notation&quot; (RPN)   calculator, scilab, wine ... working on it. &lt;/p&gt;</description><link>http://mubarakworld.blogspot.com/2008/12/linux-newbie-administrator-guide.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-5925588392558119734</guid><pubDate>Mon, 08 Dec 2008 10:54:00 +0000</pubDate><atom:updated>2008-12-31T02:57:37.811-08:00</atom:updated><title>Making waves with Linux: A few tips for trainers</title><description>Are you teaching Linux? Will you be teaching Linux soon? Are you thinking about catching the Linux wave in the future? If you can say “yes” to at least one of these questions, this article is for you. TechRepublic has published some excellent articles about Linux. We’d like to take this opportunity to highlight some of the Linux articles that trainers might find most useful.&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;subhead1&quot;&gt;Linux jargon&lt;/span&gt;&lt;br /&gt;If you’re new to Linux, you might want to catch up on the terms by reading &lt;a href=&quot;http://www.techrepublic.com/article.jhtml?id=r00119990618maf01.htm&quot;&gt;Jargon Watch: Open-source, kernel, and SMP&lt;/a&gt;&lt;a&gt; &lt;/a&gt;&lt;a&gt; &lt;/a&gt;, by Mary Ann Fitzharris.&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;subhead1&quot;&gt;Linux certification&lt;/span&gt;&lt;br /&gt;Bruce Maples’ article &lt;a href=&quot;http://www.techrepublic.com/article.jhtml?id=r00619991020map35.htm&quot;&gt;The unsettled world of Linux certification&lt;/a&gt;&lt;a&gt; &lt;/a&gt; uncovers a tsunami of information on the availability of Linux certification. If you are considering obtaining Linux certification, this article will serve as a quick reference guide to get you started.&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;subhead1&quot;&gt;Linux tips you can teach&lt;/span&gt;&lt;br /&gt;Looking for some Linux tips or information on the Linux OS? We have several:&lt;br /&gt;&lt;br /&gt;Jack Wallen, Jr.’s tip, titled &lt;a href=&quot;http://www.techrepublic.com/article.jhtml?id=r00219991104eje03.htm&quot;&gt;Access remote Linux hosts with NFS&lt;/a&gt;&lt;a&gt; &lt;/a&gt; discusses the benefits offered by NFS, including centralized data housing.&lt;br /&gt;&lt;br /&gt;Linux systems are stable, but they aren&#39;t bombproof. In the article titled &lt;a href=&quot;http://www.techrepublic.com/article.jhtml?id=r00219991111eje02.htm&quot;&gt;Do yourself a favor—create a Linux boot floppy&lt;/a&gt;&lt;a&gt; &lt;/a&gt;, Wallen tells you how to save yourself from kernel panic by making a boot floppy for Linux.</description><link>http://mubarakworld.blogspot.com/2008/12/making-waves-with-linux-few-tips-for.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-5009184247859899217</guid><pubDate>Tue, 02 Dec 2008 10:47:00 +0000</pubDate><atom:updated>2008-12-31T02:51:25.713-08:00</atom:updated><title>Run Windows applications on Linux, BSD and Mac OS X</title><description>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://wiki.winehq.org/logo.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 230px; height: 99px;&quot; src=&quot;http://wiki.winehq.org/logo.png&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;p style=&quot;text-align: center;&quot; class=&quot;newstitle&quot;&gt;&lt;a href=&quot;http://www.winehq.org/news/2008122001&quot;&gt;Wine 1.1.11 Released&lt;/a&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot; class=&quot;newstitle&quot;&gt;&lt;a href=&quot;http://www.winehq.org/news/2008122001&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style=&quot;text-align: center;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;text-align: center;&quot; class=&quot;newsdate&quot;&gt;December 20, 2008&lt;/p&gt;&lt;div style=&quot;text-align: center;&quot;&gt; &lt;/div&gt;&lt;div class=&quot;newsblock&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;  &lt;/div&gt;&lt;p style=&quot;text-align: center;&quot;&gt; The Wine development release 1.1.11 is now available.&lt;/p&gt;&lt;div style=&quot;text-align: center;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;text-align: center;&quot;&gt; &lt;a href=&quot;http://www.winehq.org/announce/1.1.11&quot;&gt;What&#39;s new&lt;/a&gt; in this release: &lt;/p&gt;&lt;ul style=&quot;text-align: center;&quot;&gt;&lt;li&gt;Numerous fixes for IE7 support.&lt;/li&gt;&lt;li&gt;Support for 64-bit cross-compile using Mingw64.&lt;/li&gt;&lt;li&gt;User interface support for crypto certificates.&lt;/li&gt;&lt;li&gt;Better support for MSI installation patches.&lt;/li&gt;&lt;li&gt;Various Direct3D optimizations.&lt;/li&gt;&lt;li&gt;Various bug fixes.&lt;/li&gt;&lt;/ul&gt;&lt;div style=&quot;text-align: center;&quot;&gt; &lt;/div&gt;&lt;p style=&quot;text-align: center;&quot;&gt;The source is &lt;a href=&quot;http://prdownloads.sourceforge.net/wine/wine-1.1.11.tar.bz2&quot;&gt;available now&lt;/a&gt;. Binary packages are in the process of being built, and will appear soon at their respective &lt;a href=&quot;http://www.winehq.org/download&quot;&gt;download locations&lt;/a&gt;. &lt;/p&gt; &lt;/div&gt;</description><link>http://mubarakworld.blogspot.com/2008/12/run-windows-applications-on-linux-bsd.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4354809881864967742.post-7682883700384036198</guid><pubDate>Sun, 30 Nov 2008 10:40:00 +0000</pubDate><atom:updated>2008-12-31T02:47:15.033-08:00</atom:updated><title>OpenGL programming in Eclipse</title><description>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.ferdychristant.com/blog//resources/Article/$FILE/opengl_logo.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 220px; height: 97px;&quot; src=&quot;http://www.ferdychristant.com/blog//resources/Article/$FILE/opengl_logo.jpg&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;Today I had written my first C++ Socket program with eclipse Ganymede and MinGW under Windows. It’s different to UNIX, for example the WSAStartup, the return types (SOCKET_ERROR, INVALID_SOCKET) and the socket datatype.&lt;/p&gt; &lt;p&gt;The first thing that costs me some minutes, was to configure the C++ Linker.  You need to configure the ws2_32 library besides there will be a build error (undefined reference to `WSAStartup@8′).&lt;/p&gt; &lt;p&gt;The ws2_32 (Winsock Library) will required to perform TCP/IP network communication.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.snakedj.ch/wp-content/mingw_socket.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 718px; height: 544px;&quot; src=&quot;http://www.snakedj.ch/wp-content/mingw_socket.jpg&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;</description><link>http://mubarakworld.blogspot.com/2008/12/opengl-programming-in-eclipse.html</link><author>noreply@blogger.com (Mubarak World)</author><thr:total>0</thr:total></item></channel></rss>