<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>Jamie Le Souef&#187; All posts filed under Apache, Linux, osx</title> <atom:link href="http://jamielesouef.com/category/linux/feed/" rel="self" type="application/rss+xml" /><link>http://jamielesouef.com</link> <description>website . blog . graphic design</description> <lastBuildDate>Sat, 31 Jul 2010 17:48:00 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.2</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Linux, OSX or any BSD/Unix Premission explained in amazing detail</title><link>http://jamielesouef.com/linux/linux-osx-or-any-bsdunix-premission-explained-in-amazing-detail/</link> <comments>http://jamielesouef.com/linux/linux-osx-or-any-bsdunix-premission-explained-in-amazing-detail/#comments</comments> <pubDate>Wed, 19 Nov 2008 23:29:33 +0000</pubDate> <dc:creator>Jamie Le Souef</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[osx]]></category><guid isPermaLink="false">http://jamielesouef.com/?p=466</guid> <description><![CDATA[ Over at AskApache they have an amazing article on nix permissions. The article goes into quite a bit of detail, but is defiantly worth the read in order to grasp one of the best features of any nix system. Header over to AskApache to check it out ]]></description> <content:encoded><![CDATA[<div class="tweetmeme_button" style="margin-right: 10px; margin-top:10px; margin-bottom:10px;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2Flinux-osx-or-any-bsdunix-premission-explained-in-amazing-detail%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2Flinux-osx-or-any-bsdunix-premission-explained-in-amazing-detail%2F&amp;style=normal" height="61" width="50" /><br /> </a></div><p>Over at <a href="http://www.askapache.com/">AskApache</a> they have an amazing article on nix permissions. The article goes into quite a bit of detail, but is defiantly worth the read in order to grasp one of the best features of any nix system.</p><p>Header <a href="http://www.askapache.com/security/chmod-umask-fileperms-stat-tricks.html">over</a> to AskApache to check it out</p> ]]></content:encoded> <wfw:commentRss>http://jamielesouef.com/linux/linux-osx-or-any-bsdunix-premission-explained-in-amazing-detail/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Linux Tip : Sorry, sudo must be setuid root</title><link>http://jamielesouef.com/linux/linux-tip-sorry-sudo-must-be-setuid-root/</link> <comments>http://jamielesouef.com/linux/linux-tip-sorry-sudo-must-be-setuid-root/#comments</comments> <pubDate>Fri, 19 Sep 2008 01:11:37 +0000</pubDate> <dc:creator>Jamie Le Souef</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Root]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[SSH]]></category> <category><![CDATA[sudo]]></category> <category><![CDATA[Tips]]></category><guid isPermaLink="false">http://jamielesouef.com/?p=411</guid> <description><![CDATA[ This was driving me batty. I had an issue with one of my linux webservers and it needed to be restored from a backup. Upon restoring the linux server I found my account that I had setup for sudo access no longer would accept the &#8217;sudo su&#8217; command or any sudo command for that matter. [...]]]></description> <content:encoded><![CDATA[<div class="tweetmeme_button" style="margin-right: 10px; margin-top:10px; margin-bottom:10px;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2Flinux-tip-sorry-sudo-must-be-setuid-root%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2Flinux-tip-sorry-sudo-must-be-setuid-root%2F&amp;style=normal" height="61" width="50" /><br /> </a></div><p>This was driving me batty. I had an issue with one of my linux webservers and it needed to be restored from a backup. Upon restoring the linux server I found my account that I had setup for sudo access no longer would accept the &#8217;sudo su&#8217; command or any sudo command for that matter. I was getting and error that read &#8220;<strong>Sorry, sudo must be setuid root</strong>&#8220;.</p><p>As I had <a title="Linux Security : Can you SSH as root?" href="http://jamielesouef.com/linux/linux-security-can-you-ssh-as-root/">removed the root account from accessing ssh</a> I had to log into the physical server (lucky it&#8217;s just next to me!)</p><p>It turns out for some reason after the restore sudo had the wrong permissions.</p><p>To fix it was quite simple but took me ages to track down! (Helps if you know exactly what to search for)</p><p>I logged in as root and entered the following</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">4111</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sudo</span></pre></div></div><p>All was fine in the land of oz after that!</p> ]]></content:encoded> <wfw:commentRss>http://jamielesouef.com/linux/linux-tip-sorry-sudo-must-be-setuid-root/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Tip : Backing up a large MySQL Database (errno: 24)</title><link>http://jamielesouef.com/linux/tip-backing-up-a-large-mysql-database-errno-24/</link> <comments>http://jamielesouef.com/linux/tip-backing-up-a-large-mysql-database-errno-24/#comments</comments> <pubDate>Mon, 15 Sep 2008 01:02:23 +0000</pubDate> <dc:creator>Jamie Le Souef</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[command]]></category> <category><![CDATA[Database]]></category> <category><![CDATA[export table]]></category> <category><![CDATA[merry way]]></category> <category><![CDATA[mydatabase]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[mysql databases]]></category> <category><![CDATA[mysqldump]]></category> <category><![CDATA[SSH]]></category> <category><![CDATA[table feature]]></category> <category><![CDATA[Tips]]></category> <category><![CDATA[way]]></category><guid isPermaLink="false">http://jamielesouef.com/?p=402</guid> <description><![CDATA[(errno: 24) when using LOCK TABLE. How to dump a large MySQL database via SSH. ]]></description> <content:encoded><![CDATA[<div class="tweetmeme_button" style="margin-right: 10px; margin-top:10px; margin-bottom:10px;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2Ftip-backing-up-a-large-mysql-database-errno-24%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2Ftip-backing-up-a-large-mysql-database-errno-24%2F&amp;style=normal" height="61" width="50" /><br /> </a></div><p>Today I&#8217;ve run into a bit of an issue with one of the MySQL databases from one of the sites that I manage. I&#8217;m used to going about my merry way with phpMyAdmin and it&#8217;s trusty (?) export table feature but that is no longer an option with this Database.</p><p>It&#8217;s a Wordpress Mu (Multi-user) site that has well over 5,000 MySQL Database tables in it. PhpMyAdmin just could not handle an export of that size and timed out on me over and over again.</p><p><strong>It&#8217;s time for some command line action!</strong></p><p>So I loged into my server via SSH and entered in the mysqldump command only to be greeted by</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysqldump: Got error: <span style="color: #000000;">1016</span>: Can<span style="color: #ff0000;">'t open file: '</span>.<span style="color: #000000; font-weight: bold;">/</span>databasename<span style="color: #000000; font-weight: bold;">/</span>table.frm<span style="color: #ff0000;">' (errno: 24) when using LOCK TABLES</span></pre></div></div><p>Great!</p><p>So after some searching I found that this is a bug in MySQL and to get around it and dump (not Drop!) a large database I needed to use the following in my mysqldump command : &#8211;lock-tables=false.</p><p>So my final MySQL command looked like this</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># mysqldump --add-drop-table -h 127.0.0.1 -u MyUsername -pMyPassword MyDatabase --lock-tables=false | gzip &gt; backup.bak.sql.gz</span></pre></div></div><p>I hope this helps someone else.</p><p>If there is a problem with the way I&#8217;m going about this please let me know of a better solution!</p> ]]></content:encoded> <wfw:commentRss>http://jamielesouef.com/linux/tip-backing-up-a-large-mysql-database-errno-24/feed/</wfw:commentRss> <slash:comments>10</slash:comments> </item> <item><title>Vim Editor : 100 commands every admin should know</title><link>http://jamielesouef.com/linux/vim-editor-100-commands-every-admin-should-know/</link> <comments>http://jamielesouef.com/linux/vim-editor-100-commands-every-admin-should-know/#comments</comments> <pubDate>Sat, 30 Aug 2008 22:30:41 +0000</pubDate> <dc:creator>Jamie Le Souef</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Code]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[Vim Editor]]></category><guid isPermaLink="false">http://jamielesouef.com/linux/vim-editor-100-commands-every-admin-should-know/</guid> <description><![CDATA[First I must say that I do not like the Vi editor - I'm a Nano man myself. I might not be hardcore Linux enough (yet) to really appreciate it. One of the things that drives me nuts about it is that its not intuitive or like any other editor- but i guess that's what makes it so powerful!.I came accors this fanastic article by jbj over at Cats Who Code that details 100 Vi commands to help you get the most out of the editor and with there permission i've re produced it here.]]></description> <content:encoded><![CDATA[<div class="tweetmeme_button" style="margin-right: 10px; margin-top:10px; margin-bottom:10px;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2Fvim-editor-100-commands-every-admin-should-know%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2Fvim-editor-100-commands-every-admin-should-know%2F&amp;style=normal" height="61" width="50" /><br /> </a></div><p>First I must say that I do not like the Vi editor &#8211; I&#8217;m a Nano man myself. I might not be hardcore Linux enough (yet) to really appreciate it. One of the things that drives me nuts about it is that its not intuitive or like any other editor- but i guess that&#8217;s what makes it so powerful!.</p><p>I came across this fanatic article by <a title="100 Vim commands every programmer should know" href="http://www.catswhocode.com/blog/web-development/100-vim-commands-every-programmer-should-know-11" target="_top">jbj</a> over at <a title="Cats Who Code" href="http://www.catswhocode.com/blog/web-development/100-vim-commands-every-programmer-should-know-11" target="_top">Cats Who Code</a> that details 100 Vi commands to help you get the most out of the editor and with there permission I&#8217;ve re produced it here.</p><p>Enjoy</p><h3>Search</h3><ul><li><strong>/word</strong> Search “word” from top to bottom</li><li><strong>?word</strong> Search “word” from bottom to top</li><li><strong>/jo[ha]n</strong> Search “john” or “joan”</li><li><strong>/\&lt;the</strong>Search “the”, “theatre” or “then”</li><li><strong>/the\&gt;</strong> Search “the” or “breathe”</li><li><strong>/\&lt; the\&gt;</strong> Search “the”</li><li><strong>/\&lt; ….\&gt;</strong> Search all words of 4 letters</li><li><strong>/\/</strong> Search “fred” but not “alfred” or “frederick”</li><li><strong>/fred\|joe</strong> Search “fred” or “joe”</li><li><strong>/\&lt;\d\d\d\d\&gt;</strong> Search exactly 4 digits</li><li><strong>/^\n\{3}</strong> Find 3 empty lines</li><li><strong>:bufdo /searchstr/</strong> Search in all open files</li></ul><h3>Replace</h3><ul><li><strong>:%s/old/new/g</strong> Replace all occurences of “old” by “new” in file</li><li><strong>:%s/old/new/</strong>gw Replace all occurences with confirmation</li><li><strong>:2,35s/old/new/g</strong> Replace all occurences between lines 2 and 35</li><li><strong>:5,$s/old/new/g</strong> Replace all occurences from line 5 to EOF</li><li><strong>:%s/^/hello/g</strong> Replace the begining of each line by “hello”</li><li><strong>:%s/$/Harry/g</strong> Replace the end of each line by “Harry”</li><li><strong>:%s/onward/forward/gi</strong> Replace “onward” by “forward” , case unsensitive</li><li><strong>:%s/ *$//g</strong> Delete all white spaces</li><li><strong>:g/string/d</strong> Delete all lines containing “string”</li><li><strong>:v/string/d</strong> Delete all lines containing which didn’t contain “string”</li><li><strong>:s/Bill/Steve/</strong> Replace the first occurence of “Bill” by “Steve” in current line</li><li><strong>:s/Bill/Steve/g</strong> Replace “Bill” by “Steve” in current line</li><li><strong>:%s/Bill/Steve/g</strong> Replace “Bill” by “Steve” in all the file</li><li><strong>:%s/\r//g</strong> Delete DOS carriage returns (^M)</li><li><strong>:%s/\r/\r/g</strong> Transform DOS carriage returns in returns</li><li><strong>:%s#&lt;[^&gt;]\+&gt;##g</strong> Delete HTML tags but keeps text</li><li><strong>:%s/^\(.*\)\n\1$/\1/</strong> Delete lines which appears twice</li><li><strong>Ctrl+a</strong> Increment number under the cursor</li><li><strong>Ctrl+x</strong> Decrement number under cursor</li><li><strong>ggVGg</strong>? Change text to Rot13</li></ul><h3>Case</h3><ul><li><strong>Vu</strong> Lowercase line</li><li><strong>VU</strong> Uppercase line</li><li><strong>g~~</strong> Invert case</li><li><strong>vEU</strong> Switch word to uppercase</li><li><strong>vE~</strong> Modify word case</li><li><strong>ggguG</strong> Set all text to lowercase</li><li><strong>:set ignorecase</strong> Ignore case in searches</li><li><strong>:set smartcase</strong> Ignore case in searches excepted if an uppercase letter is used</li><li><strong>:%s/\&lt;./\u&amp;/g</strong> Sets first letter of each word to uppercase</li><li><strong>:%s/\&lt;./\l&amp;/g</strong> Sets first letter of each word to lowercase</li><li><strong>:%s/.*/\u&amp;</strong> Sets first letter of each line to uppercase</li><li><strong>:%s/.*/\l&amp;</strong> Sets first letter of each line to lowercase</li></ul><h3>Read/Write files</h3><ul><li><strong>:1,10 w outfile</strong> Saves lines 1 to 10 in outfile</li><li><strong>:1,10 w &gt;&gt; outfile</strong> Appends lines 1 to 10 to outfile</li><li><strong>:r infile</strong> Insert the content of infile</li><li><strong>:23r infile</strong> Insert the content of infile under line 23</li></ul><h3>File explorer</h3><ul><li><strong>:e .</strong> Open integrated file explorer</li><li><strong>:Sex</strong> Split window and open integrated file explorer</li><li><strong>:browse e</strong> Graphical file explorer</li><li><strong>:ls</strong> List buffers</li><li><strong>:cd ..</strong> Move to parent directory</li><li><strong>:args</strong> List files</li><li><strong>:args *.php</strong> Open file list</li><li><strong>:grep expression *.php</strong> Returns a list of .php files contening expression</li><li><strong>gf</strong> Open file name under cursor</li></ul><h3>Interact with Unix</h3><ul><li><strong>:!pwd</strong> Execute the “pwd” unix command, then returns to Vi</li><li><strong>!!pwd</strong> Execute the “pwd” unix command and insert output in file</li><li><strong>:sh</strong> Temporary returns to Unix</li><li><strong>$exit</strong> Retourns to Vi</li></ul><h3>Alignment</h3><ul><li><strong>:%!fmt</strong> Align all lines</li><li><strong>!}fmt</strong> Align all lines at the current position</li><li><strong>5!!fmt</strong> Align the next 5 lines</li></ul><h3>Tabs</h3><ul><li><strong>:tabnew</strong> Creates a new tab</li><li><strong>gt</strong> Show next tab</li><li><strong>:tabfirst</strong> Show first tab</li><li><strong>:tablast</strong> Show last tab</li><li><strong>:tabm n(position)</strong> Rearrange tabs</li><li><strong>:tabdo %s/foo/bar/g</strong> Execute a command in all tabs</li><li><strong>:tab ball</strong> Puts all open files in tabs</li></ul><h3>Window spliting</h3><ul><li><strong>:e</strong> filename Edit filename in current window</li><li><strong>:split</strong> filename Split the window and open filename</li><li><strong>ctrl-w up arrow</strong> Puts cursor in top window</li><li><strong>ctrl-w ctrl-w</strong> Puts cursor in next window</li><li><strong>ctrl-w_</strong> Maximise current window</li><li><strong>ctrl-w=</strong> Gives the same size to all windows</li><li><strong>10 ctrl-w+</strong> Add 10 lines to current window</li><li><strong>:vsplit</strong> file Split window vertically</li><li><strong>:sview</strong> file Same as :split in readonly mode</li><li><strong>:hide</strong> Close current window</li><li><strong>:only</strong> Close all windows, excepted current</li><li><strong>:b 2</strong> Open #2 in this window</li></ul><h3>Auto-completion</h3><ul><li><strong>Ctrl+n Ctrl+p</strong> (in insert mode) Complete word</li><li><strong>Ctrl+x Ctrl+l</strong> Complete line</li><li><strong>:</strong><strong>set dictionary=dict</strong> Define dict as a dictionnary</li><li><strong>Ctrl+x Ctrl+k</strong> Complete with dictionnary</li></ul><h3>Marks</h3><ul><li><strong>mk</strong> Marks current position as k</li><li><strong>‘k</strong> Moves cursor to mark k</li><li><strong>d’k</strong> Delete all until mark k</li></ul><h3>Abbreviations</h3><ul><li><strong>:ab</strong> mail mail@provider.org Define mail as abbreviation of mail@provider.org</li></ul><h3>Text indent</h3><ul><li><strong>:set</strong> autoindent Turn on auto-indent</li><li><strong>:se</strong>t smartindent Turn on intelligent auto-indent</li><li><strong>:set</strong> shiftwidth=4 Defines 4 spaces as indent size</li><li><strong>ctrl-t, ctrl-d</strong> Indent/un-indent in insert mode</li><li><strong>&gt;&gt;</strong> Indent</li><li><strong>&lt;&lt;</strong> Un-indent</li></ul><h3>Syntax highlighting</h3><ul><li><strong>:syntax</strong> on Turn on syntax highlighting</li><li><strong>:syntax</strong> off Turn off syntax highlighting</li><li><strong>:set syntax=perl</strong> Force syntax highlighting</li></ul> ]]></content:encoded> <wfw:commentRss>http://jamielesouef.com/linux/vim-editor-100-commands-every-admin-should-know/feed/</wfw:commentRss> <slash:comments>12</slash:comments> </item> <item><title>Linux : Creating &amp; Managing Users Accounts Part 1</title><link>http://jamielesouef.com/linux/linux-creating-managing-users-accounts-part-1/</link> <comments>http://jamielesouef.com/linux/linux-creating-managing-users-accounts-part-1/#comments</comments> <pubDate>Fri, 22 Aug 2008 07:14:21 +0000</pubDate> <dc:creator>Jamie Le Souef</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[passwords]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Tutorial]]></category> <category><![CDATA[Ubuntu]]></category><guid isPermaLink="false">http://jamielesouef.com/?p=247</guid> <description><![CDATA[ I&#8217;ve been asked here on my blog about creating user accounts and giving them access to folders such as /var/www or creating ftp users that link to a single folder. That was quite a while ago. Since then i have picked up quite a bit about user management and thought that i would let you [...]]]></description> <content:encoded><![CDATA[<div class="tweetmeme_button" style="margin-right: 10px; margin-top:10px; margin-bottom:10px;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2Flinux-creating-managing-users-accounts-part-1%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2Flinux-creating-managing-users-accounts-part-1%2F&amp;style=normal" height="61" width="50" /><br /> </a></div><p>I&#8217;ve been <a title="Installing a GNU/Linux LAMP Server using Ubuntu Server" href="http://jamielesouef.com/linux/installing-ubuntu-server-lampsshftpwebmin-and-phpmyadmin-for-a-newbie/">asked</a> here on my blog about creating user accounts and giving them access to folders such as /var/www or creating ftp users that link to a single folder. That was quite a while ago. Since then i have picked up quite a bit about user management and thought that i would let you in on my findings.</p><p>In Part 1 I&#8217;m going to show you how to add and manage user accounts. Learning these features has been a critical part of efficiently managing the 10+ Linux servers.</p><p>In order to create new logins, modify or delete users, you must already be logged in as sudo user. The sudo user login is the highest level (assuming you have the <a href="http://jamielesouef.com/linux/linux-security-can-you-ssh-as-root/">root account disabled</a>) and only certain individuals should have access to a sudo account.</p><h2>useradd &#8211; Adding a new user</h2><p>Each user must belong to a primary group and for security or access purposes can belong to several secondary groups.</p><p><strong>Options</strong>:</p><ul><li>-d home directory</li><li>-s starting program (shell)</li><li>-p password</li><li>-g (primary group assigned to the users eg -gwww-data (note no space between the -g and www-data)</li><li>-G (Other groups the user belongs to eg -Gusers (note no space between the -g and users)</li><li>-m (Create the user&#8217;s home directory</li></ul><h2>usermod &#8211; Modifying existing user</h2><p><strong>Options:</strong></p><ul><li>-d home directory</li><li>-s starting program (shell)</li><li>-p password</li><li>-g (primary group assigned to the users)</li><li>-G (Other groups the user belongs to)</li></ul><h2>userdel &#8211; Deleting a user</h2><p><strong>Options:</strong></p><ul><li>-r (remove home directory)</li></ul><p>Example: To remove the user &#8216;rebecca&#8217; and his home directory</p><p>userdel -r rebecca</p><h2>passwd &#8211; User&#8217;s Password</h2><p><strong>Options:</strong></p><ul><li>user&#8217;s name (Only required if you are root and want to change another user&#8217;s password)</li></ul><p>Example: To change the password for the account you are currently logged in as&#8230;</p><ol><li>passwd</li><li>Enter existing password</li><li>Enter new password</li><li>Enter new password again (to validate)</li></ol><p>Example: To change the password for the user &#8216;mark&#8217; (only you are logged in as a sudo user)&#8230;</p><ol><li>passwd mark</li><li>Enter existing password (can be either marks&#8217;s password or sudoer&#8217;s password)</li><li>Enter new password</li><li>Enter new password again (to validate)</li></ol><h2>Where user and group information stored</h2><p>User names and primary groups are stored in /etc/passwd. This file can be directly edited using the &#8216;vi&#8217; editor, although this is not recommended. Format of the file is&#8230;</p><ul><li>User name (normally all lower case)</li><li>Password (encrypted &#8211; only contains the letter &#8216;x&#8217;)</li><li>User ID (a unique number of each user)</li><li>Primary Group ID</li><li>Comment (Normally the person&#8217;s full name)</li><li>Home directory (normally /home/</li><li>Default shell (normally /bin/bash)</li></ul><p>Each field is separated by a colon.</p><p>Passwords for each user are stored in /etc/shadow. This file should only be changed using the passwd command.</p><p>Group information is stored in /etc/group. This file can be directly edited using the &#8216;vi&#8217; editor. Format of the file is&#8230;</p><ul><li>Group name</li><li>Group password (hardly ever used)</li><li>Group ID</li><li>User names (separated by commas)</li></ul><p>Each field is separated by a colon.</p><h2>Default files</h2><p>When a new user is created, the default files and directories that are created are stored in /etc/skel.</p><p>This directory can be modified to fit your needs. Modifications only effect new users and does not change anything for existing users.</p><h2>su &#8211; Switch User</h2><p>To switch to another user, use the su command. This is most commonly used to switch to the root account.</p><p>Example: To switch to root account&#8230;</p><ol><li>su</li><li>Enter root&#8217;s passwd</li></ol><p>Example: To switch to the user &#8216;rebecca&#8217;&#8230;</p><p>su rebecca</p><p>Enter Rebecca&#8217;s or the sudoer&#8217;s passwd</p><p>To return to original user, enter exit</p><p>Well there you go. In Part 2 I&#8217;m going to go over how to add users for the web folders including FTP users that are limited to their home folder.</p> ]]></content:encoded> <wfw:commentRss>http://jamielesouef.com/linux/linux-creating-managing-users-accounts-part-1/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Linux Security : Can you SSH as root?</title><link>http://jamielesouef.com/linux/linux-security-can-you-ssh-as-root/</link> <comments>http://jamielesouef.com/linux/linux-security-can-you-ssh-as-root/#comments</comments> <pubDate>Fri, 22 Aug 2008 04:13:04 +0000</pubDate> <dc:creator>Jamie Le Souef</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[SSH]]></category> <category><![CDATA[Tutorial]]></category> <category><![CDATA[Ubuntu]]></category><guid isPermaLink="false">http://jamielesouef.com/?p=238</guid> <description><![CDATA[ On my quest of knowledge of GNU/Linux, most specifically Ubuntu Server one of the things I&#8217;m contently look at is security. I&#8217;ve known for some time that Linux is by far a more secure platform than Windows or OS X but a system is only as secure as the user using it. What i want to [...]]]></description> <content:encoded><![CDATA[<div class="tweetmeme_button" style="margin-right: 10px; margin-top:10px; margin-bottom:10px;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2Flinux-security-can-you-ssh-as-root%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2Flinux-security-can-you-ssh-as-root%2F&amp;style=normal" height="61" width="50" /><br /> </a></div><p>On my quest of knowledge of GNU/Linux, most specifically Ubuntu Server one of the things I&#8217;m contently look at is security. I&#8217;ve known for some time that Linux is by far a more secure platform than Windows or OS X but a system is only as secure as the user using it.</p><p>What i want to cover in this post is the ability to gain entry to your server via SSH and the default root account. As i said, Linux is very secure but if you have a password such as your dogs name &#8220;Fluffy&#8221; it&#8217;s not going to be at all hard for a would be attacker to gain entry via brute force &#8211; especially if they already know the user name (root)</p><p>So what do we do. We&#8217;ll we disable root from being able to log into the server via SSH.</p><p>So let&#8217;s get started.</p><p>Login to your server (presumably you&#8217;ll be using your root account or you won&#8217;t be reading this article)</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-l</span> root host.name</pre></div></div><p>next, we want to edit the SSH config file so fire up nano (or vi) so we can edit the file</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #660033;">-w</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>sshd_config</pre></div></div><p>Find the following section</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># PermitRootLogin yes</span></pre></div></div><p>and change it to</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">PermitRootLogin no</pre></div></div><p>(note that we&#8217;ve removed the hash &#8216;#&#8217; and also added &#8216;no&#8217; at the end)</p><p>Hit Ctrl+X and save the file as you exit. So now root can&#8217;t login via SSH. Great you say but now how to I get myself in there to edit stuff? We need to add a new user who&#8217;ll have sudo privleges thats what.</p><p>So, to add a new user enter the following</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">useradd UserName <span style="color: #660033;">-g</span> wheel</pre></div></div><p>This will add a new user to the wheel usergroup. Remember to change UserName for your new user name (duh)</p><p>Now set a password for the new account</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">passwd</span> UserName</pre></div></div><p>This is really important. Make sure that you chose a strong password. Fluffy is not considered strong by any stretch of the imagination. Click this <a href="http://www.pctools.com/guides/password/?length=10&amp;alpha=on&amp;mixedcase=on&amp;numeric=on&amp;punctuation=on&amp;nosimilar=on&amp;quantity=50&amp;generate=true" target="_blank">URL</a> for a list of random generated strong passwords (there will never be the same password twice. Refresh it and see!)</p><p>Now we need to adjust the sudoers file so that users on the wheel account can access su features.</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #660033;">-w</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sudoers</pre></div></div><p>Find the line</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Uncomment to allow people in group wheel to run all commands</span>
<span style="color: #666666; font-style: italic;"># %wheel  ALL=(ALL)       ALL</span></pre></div></div><p>And uncomment the last line so it reads</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Uncomment to allow people in group wheel to run all commands</span>
<span style="color: #000000; font-weight: bold;">%</span>wheel  <span style="color: #007800;">ALL</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span>ALL<span style="color: #7a0874; font-weight: bold;">&#41;</span>       ALL</pre></div></div><p>Hit Ctrl+x to exit and save the file. And then at the prompt enter</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">service sshd restart</pre></div></div><p>If you&#8217;ve done it all correctly, the next time you try and log in as root you should receive an error message like this &#8220;Permission denied, please try again.&#8221; You should now be able to log in with your new user name and password.</p><p>So now your in, you want to preform something that requires root access all you need to do is enter</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">su</span></pre></div></div><p>You&#8217;ll then be asked for you password and once entered in correctly you&#8217;ll be logged in with root privileges until you end the session or type exit.</p><p>How good is that!</p><p>Have fun</p> ]]></content:encoded> <wfw:commentRss>http://jamielesouef.com/linux/linux-security-can-you-ssh-as-root/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Updating MySQL Privilege Tables</title><link>http://jamielesouef.com/linux/updating-mysql-privilege-tables/</link> <comments>http://jamielesouef.com/linux/updating-mysql-privilege-tables/#comments</comments> <pubDate>Tue, 22 Jul 2008 00:57:40 +0000</pubDate> <dc:creator>Jamie Le Souef</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Tutorial]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[MySQL]]></category><guid isPermaLink="false">http://jamielesouef.com/linux/updating-mysql-privilege-tables/</guid> <description><![CDATA[ I also had this problem with Plesk servers. Upgrading the default MySQL4 instal to version 5 always gave me issues with the Privilege Tables and i could never get the command, mysql_fix_privilege_tables, to run &#8211; it would never accept my password. I little bit of searching and i came across a page entitles &#8216;Upgrade to PHP5 [...]]]></description> <content:encoded><![CDATA[<div class="tweetmeme_button" style="margin-right: 10px; margin-top:10px; margin-bottom:10px;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2Fupdating-mysql-privilege-tables%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2Fupdating-mysql-privilege-tables%2F&amp;style=normal" height="61" width="50" /><br /> </a></div><p>I also had this problem with Plesk servers. Upgrading the default MySQL4 instal to version 5 always gave me issues with the Privilege Tables and i could never get the command, mysql_fix_privilege_tables, to run &#8211; it would never accept my password.</p><p>I little bit of searching and i came across a page entitles &#8216;<a href="http://kb.mediatemple.net/questions/127/Upgrade+to+PHP5+and+MySQL+4.1x+on+(dv)+2.0+Dedicated+Virtual+Servers">Upgrade to PHP5 and MySQL 4.1x on (dv) 2.0 Dedicated Virtual Servers</a>&#8216; and it worked like a charm for me!</p><p>Here is the bit i needed</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mysql_fix_privilege_tables <span style="color: #660033;">--user</span>=admin <span style="color: #660033;">--password</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>psa<span style="color: #000000; font-weight: bold;">/</span>.psa.shadow<span style="color: #000000; font-weight: bold;">`</span></pre></div></div><p>All done :)<a href="http://kb.mediatemple.net/questions/127/Upgrade+to+PHP5+and+MySQL+4.1x+on+(dv)+2.0+Dedicated+Virtual+Servers"><br /> </a></p> ]]></content:encoded> <wfw:commentRss>http://jamielesouef.com/linux/updating-mysql-privilege-tables/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>What&#8217;s that? Your Mac is more secure then windows?</title><link>http://jamielesouef.com/linux/whats-that-your-mac-is-more-secure-then-windows/</link> <comments>http://jamielesouef.com/linux/whats-that-your-mac-is-more-secure-then-windows/#comments</comments> <pubDate>Tue, 01 Apr 2008 01:47:08 +0000</pubDate> <dc:creator>Jamie Le Souef</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Technology]]></category> <category><![CDATA[osx]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Windows]]></category> <category><![CDATA[Windows Vista]]></category><guid isPermaLink="false">http://www.jamielesouef.com/windows-vista/whats-that-your-mac-is-the-most-secure-then-windows/</guid> <description><![CDATA[I must admit that I do have a soft spot for OSX and Apple in general. I&#8217;m a designer after all. But what I can&#8217;t stand is the ignorant, narrow minded, soulless, bad jumper wearing, Steve Jobs loving, Mac Book Air F*&#38;^ tools that believe that there over priced white box is the greatest thing [...]]]></description> <content:encoded><![CDATA[<div class="tweetmeme_button" style="margin-right: 10px; margin-top:10px; margin-bottom:10px;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2Fwhats-that-your-mac-is-more-secure-then-windows%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2Fwhats-that-your-mac-is-more-secure-then-windows%2F&amp;style=normal" height="61" width="50" /><br /> </a></div><p><a href="http://jamielesouef.com/linux/whats-that-your-mac-is-more-secure-then-windows/attachment/176/" rel="attachment wp-att-176" title="applems.jpg"></a><a href="http://jamielesouef.com/linux/whats-that-your-mac-is-more-secure-then-windows/attachment/177/" rel="attachment wp-att-177" title="apple-ms.jpg"></a></p><p style="text-align: center"><a href="http://jamielesouef.com/linux/whats-that-your-mac-is-more-secure-then-windows/attachment/177/" rel="attachment wp-att-177" title="apple-ms.jpg"><img src="http://www.jamielesouef.com/wp-content/uploads/apple-ms.jpg" alt="apple-ms.jpg" /></a></p><p>I must admit that I do have a soft spot for OSX and Apple in general. I&#8217;m a designer after all. But what I can&#8217;t stand is the ignorant, narrow minded, soulless, bad jumper wearing, Steve Jobs loving, Mac Book Air F*&amp;^ tools that believe that there over priced white box is the greatest thing since sliced bread and that just buy owning one they are above all others.</p><p>Well, an article on <a href="http://www.allheadlinenews.com/articles/7010483023">allheadlinenews </a>defaintly made me chuckle;</p><blockquote><p>Vancouver, British Columbia (AHN)&#8211; The Linux running on a Sony Vaio remained undefeated at the end of a three-way computer hacking challenge Friday at the CanSecWest conference.Sponsors had wagered three laptops to anyone who could hack into one of the systems and run their own software. A $20,000 cash prize sweetened the deal.</p><p>The MacBook Air went first; Independent Security Evaluators&#8217; Charlie Miller took the Mac after about two minutes work on Thursday. Miller took home $10,000, courtesy of 3Com&#8217;s TippingPoint division, in addition to the new laptop.</p><p>After two days of work, Shane Macaulay finally cracked the tiny Fujitsu laptop running Vista on Friday, with a little help from his friends.</p></blockquote><p>Two minutes I tells ya! Two MINUTES!Do you know why you believe that the MAC is more secure? Because why would anyone in their right mind try to attack something that has only <a href="http://www.w3schools.com/browsers/browsers_os.asp">4.3%</a> of the market! Even Vista has a bigger market share (7.6%) then OSX and it&#8217;s a dog of an OS.</p><p>Put that in your white, incredibly aesthetic pipe and smoke it! :)</p><blockquote><p>Writing <a href="http://www.actual-exams.com/642-436-practice-exam.htm">642-436</a> or <a href="http://www.actual-exams.com/70-293-practice-exam.htm">70-293</a> should not be complicated for a <a href="http://www.actual-exams.com/70-294-practice-exam.htm">70-294</a> student who has done neither <a href="http://www.actual-exams.com/70-536-practice-exam.htm">70-536</a> nor <a href="http://www.actual-exams.com/650-393-practice-exam.htm">650-393</a>.</p></blockquote> ]]></content:encoded> <wfw:commentRss>http://jamielesouef.com/linux/whats-that-your-mac-is-more-secure-then-windows/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>301 How to Redirect a Web Page in ASP, ASP.NET or PHP</title><link>http://jamielesouef.com/linux/301-how-to-redirect-a-web-page-in-asp-asp-net-or-php/</link> <comments>http://jamielesouef.com/linux/301-how-to-redirect-a-web-page-in-asp-asp-net-or-php/#comments</comments> <pubDate>Mon, 03 Mar 2008 04:38:03 +0000</pubDate> <dc:creator>Jamie Le Souef</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Tutorial]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[ASP]]></category> <category><![CDATA[Code]]></category> <category><![CDATA[com]]></category> <category><![CDATA[domain]]></category> <category><![CDATA[file]]></category> <category><![CDATA[htaccess method]]></category> <category><![CDATA[linux servers]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[redirect]]></category> <category><![CDATA[redirection works]]></category> <category><![CDATA[response status]]></category> <category><![CDATA[search engine rankings]]></category> <category><![CDATA[SEO]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[Web]]></category><guid isPermaLink="false">http://www.jamielesouef.com/linux/301-how-to-redirect-a-web-page-in-asp-asp.net-or-php/</guid> <description><![CDATA[ 301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It&#8217;s not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it&#8217;s the safest option. The code &#8220;301&#8243; is interpreted as &#8220;moved permanently&#8221;. [...]]]></description> <content:encoded><![CDATA[<div class="tweetmeme_button" style="margin-right: 10px; margin-top:10px; margin-bottom:10px;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2F301-how-to-redirect-a-web-page-in-asp-asp-net-or-php%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2F301-how-to-redirect-a-web-page-in-asp-asp-net-or-php%2F&amp;style=normal" height="61" width="50" /><br /> </a></div><p><a href="http://jamielesouef.com/linux/301-how-to-redirect-a-web-page-in-asp-asp-net-or-php/attachment/164/" rel="attachment wp-att-164" title="50200735006880.jpg"><img src="http://www.jamielesouef.com/wp-content/uploads/50200735006880.thumbnail.jpg" style="margin: 10px; width: 128px; height: 80px" alt="50200735006880.jpg" align="left" height="80" hspace="10" vspace="10" width="128" /></a>301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It&#8217;s not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it&#8217;s the safest option. The code &#8220;301&#8243; is interpreted as &#8220;moved permanently&#8221;.  If  been looking around for the ways on how to do this. So this is what i&#8217;ve found:</p><h3>ASP.NET</h3><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="asp" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">&lt;</span>script runat<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;server&quot;</span><span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #990099; font-weight: bold;">private</span> void Page_Load<span style="color: #006600; font-weight:bold;">&#40;</span>object sender, System.<span style="color: #9900cc;">EventArgs</span> e<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#123;</span>
<span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #330066;">Status</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #cc0000;">&quot;301 Moved Permanently&quot;</span><span style="color: #006600; font-weight: bold;">;</span>
<span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #330066;">AddHeader</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;Location&quot;</span>,<span style="color: #cc0000;">&quot;http://www.new-url.com&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
<span style="color: #006600; font-weight:bold;">&#125;</span>
<span style="color: #006600; font-weight: bold;">&lt;/</span>script<span style="color: #006600; font-weight: bold;">&gt;</span></pre></td></tr></table></div><h3>Classic ASP (ASP3.0)</h3><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="asp" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;%</span><span style="color: #006600; font-weight: bold;">@</span> Language<span style="color: #006600; font-weight: bold;">=</span>VBScript<span style="color: #000000; font-weight: bold;">%&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;%</span>
<span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #330066;">Status</span><span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;301 Moved Permanently&quot;</span>
<span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #330066;">AddHeader</span> <span style="color: #cc0000;">&quot;Location&quot;</span>,<span style="color: #cc0000;">&quot;http://www.new-url.com/&quot;</span>
<span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #990099; font-weight: bold;">End</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span></pre></td></tr></table></div><h3>PHP Redirect</h3><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">Header</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;HTTP/1.1 301 Moved Permanently&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">Header</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;Location: http://www.new-url.com&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div><h3>Redirect Old domain to New domain (htaccess redirect)</h3><p class="defaultfont" align="justify">The code belew, which you place into a file called .htaccess in the root folder of your <strong>old </strong>domain, will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain.</p><p class="defaultfont" align="justify">The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">Options +FollowSymLinks
RewriteEngine on
RewriteRule <span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.new-domain-name.com<span style="color: #000000; font-weight: bold;">/</span>$<span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">R</span>=<span style="color: #000000;">301</span>,L<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></td></tr></table></div><p class="defaultfont" align="justify"><strong>NOTE</strong>: REPLACE www.new-domain-name.com in the above code with your actual domain name.</p><p class="defaultfont" align="justify"> <strong>NOTE</strong>: This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.</p><h3>Redirect to www (htaccess redirect)</h3><p class="defaultfont" align="justify"> Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com</p><p class="defaultfont" align="justify">As with the last example, the .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">Options +FollowSymlinks
RewriteEngine on
rewritecond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>http_host<span style="color: #7a0874; font-weight: bold;">&#125;</span> ^domain.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>nc<span style="color: #7a0874; font-weight: bold;">&#93;</span>
rewriterule ^<span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>$ http:<span style="color: #000000; font-weight: bold;">//</span>www.domain.com<span style="color: #000000; font-weight: bold;">/</span>$<span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">r</span>=<span style="color: #000000;">301</span>,nc<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></td></tr></table></div><p class="defaultfont" align="justify"><strong>NOTE</strong>: Replace domain.com with your domain name</p><p class="defaultfont" align="justify"> <strong>NOTE</strong>: Both of these last examples ONLY works on Linux servers having the Apache Mod-Rewrite moduled enabled.</p><p class="defaultfont" align="justify"> And there you have it. You can Test your redirection with <a href="http://www.webconfs.com/redirect-check.php">Search Engine Friendly Redirect Checker</a></p> ]]></content:encoded> <wfw:commentRss>http://jamielesouef.com/linux/301-how-to-redirect-a-web-page-in-asp-asp-net-or-php/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Install RAR support in Ubuntu</title><link>http://jamielesouef.com/linux/install-rar-support-in-ubuntu/</link> <comments>http://jamielesouef.com/linux/install-rar-support-in-ubuntu/#comments</comments> <pubDate>Fri, 08 Feb 2008 01:46:35 +0000</pubDate> <dc:creator>Jamie Le Souef</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Tutorial]]></category> <category><![CDATA[rar]]></category> <category><![CDATA[Ubuntu]]></category><guid isPermaLink="false">http://www.jamielesouef.com/2008/linux/install-rar-support-in-ubuntu/</guid> <description><![CDATA[ I&#8217;ve been using windows for a long time now. And I&#8217;ve been using winRAR for almost the same length of time. But to my absolute horror I found that Ubuntu doesn&#8217;t nativly support extracting rar files. SHOCK HORROR! But alas, in my journey to gain a better understanding of Ubuntu and GNU/Linux in general (trying CentOS [...]]]></description> <content:encoded><![CDATA[<div class="tweetmeme_button" style="margin-right: 10px; margin-top:10px; margin-bottom:10px;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2Finstall-rar-support-in-ubuntu%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjamielesouef.com%2Flinux%2Finstall-rar-support-in-ubuntu%2F&amp;style=normal" height="61" width="50" /><br /> </a></div><p>I&#8217;ve been using windows for a long time now. And I&#8217;ve been using <a href="http://www.rarlabs.com">winRAR </a>for almost the same length of time. But to my absolute horror I found that Ubuntu doesn&#8217;t nativly support extracting rar files. SHOCK HORROR!</p><p>But alas, in my journey to gain a better understanding of <a href="http://www.ubuntu.com">Ubuntu </a>and <a href="http://www.gnu.org/">GNU/Linux</a> in general (trying <a href="http://www.centos.com">CentOS</a> 5 out now in a virtual enviroment) I found the answer.</p><p><span name="intelliTxt" id="intelliTXT">Open a terminal window and type in:</span></p><blockquote><ol><li><span name="intelliTxt" id="intelliTXT"><code>sudo apt-get install rar</code></span><span name="intelliTxt" id="intelliTXT"><code> </code></span></li><li><span name="intelliTxt" id="intelliTXT"><code>sudo ln -fs /usr/bin/rar /usr/bin/unrar</code></span></li></ol></blockquote><p>Once installed Gnome&#8217;s Archive Managmer will recognise rar files.</p><p>Yay!</p> ]]></content:encoded> <wfw:commentRss>http://jamielesouef.com/linux/install-rar-support-in-ubuntu/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching using disk

Served from: jamielesouef.com @ 2010-08-01 05:26:54 -->