<?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>code(alpha) &#187; Tips</title>
	<atom:link href="http://www.codealpha.net/category/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codealpha.net</link>
	<description>Tips &#38; Tutorials for Linux</description>
	<lastBuildDate>Sat, 25 Jun 2011 21:50:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>CSS3 box-shadow on left and right sides only</title>
		<link>http://www.codealpha.net/840/css3-box-shadow-on-left-and-right-sides-only/</link>
		<comments>http://www.codealpha.net/840/css3-box-shadow-on-left-and-right-sides-only/#comments</comments>
		<pubDate>Sat, 25 Jun 2011 21:50:14 +0000</pubDate>
		<dc:creator>Arnaud Soyez</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[shadow]]></category>

		<guid isPermaLink="false">http://www.codealpha.net/?p=840</guid>
		<description><![CDATA[It is possible to have inset shadows on both left and right sides of a block. It is a matter of showing only one side of the box-shadow at a time, and so you need two box-shadows (one for each side of the block you wish to have shadows, and we can put both CSS [...]]]></description>
			<content:encoded><![CDATA[<p>It is possible to have inset shadows on both left and right sides of a block. It is a matter of <strong>showing only one side of the box-shadow at a time</strong>, and so you need two box-shadows (one for each side of the block you wish to have shadows, and we can put both CSS codes in the same property).</p>
<p>Here is an example that should be compatible with Firefox, Chrome and Opera.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">box <span style="color: #00AA00;">&#123;</span>
    -moz-box-shadow<span style="color: #00AA00;">:</span>
        <span style="color: #993333;">inset</span> <span style="color: #933;">5px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">5px</span> <span style="color: #933;">-5px</span> <span style="color: #cc00cc;">#333</span><span style="color: #00AA00;">,</span>
        <span style="color: #993333;">inset</span> <span style="color: #933;">-5px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">5px</span> <span style="color: #933;">-5px</span> <span style="color: #cc00cc;">#333</span><span style="color: #00AA00;">;</span>
    -webkit-box-shadow<span style="color: #00AA00;">:</span>
        <span style="color: #993333;">inset</span> <span style="color: #933;">5px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">5px</span> <span style="color: #933;">-5px</span> <span style="color: #cc00cc;">#333</span><span style="color: #00AA00;">,</span>
        <span style="color: #993333;">inset</span> <span style="color: #933;">-5px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">5px</span> <span style="color: #933;">-5px</span> <span style="color: #cc00cc;">#333</span><span style="color: #00AA00;">;</span>
    box-shadow<span style="color: #00AA00;">:</span>
        <span style="color: #993333;">inset</span> <span style="color: #933;">5px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">5px</span> <span style="color: #933;">-5px</span> <span style="color: #cc00cc;">#333</span><span style="color: #00AA00;">,</span>
        <span style="color: #993333;">inset</span> <span style="color: #933;">-5px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">5px</span> <span style="color: #933;">-5px</span> <span style="color: #cc00cc;">#333</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Here is the result:</p>
<div style="background-color:#ccc;padding:4em;width:40%;-moz-box-shadow:inset 5px 0 5px -5px #333,inset -5px 0 5px -5px #333;-webkit-box-shadow:inset 5px 0 5px -5px #333,   inset -5px 0 5px -5px #333;    box-shadow:        inset 5px 0 5px -5px #333,        inset -5px 0 5px -5px #333;">Lorem ipsum...</div>
<p>Inspired from <a href="http://demente-design.com/component/content/article/68-playing-with-css3-box-shadow.html">Playing with CSS3 box shadow [demente-design.com]</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codealpha.net/840/css3-box-shadow-on-left-and-right-sides-only/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to optimize all tables from all databases</title>
		<link>http://www.codealpha.net/728/how-to-optimize-all-tables-from-all-databases/</link>
		<comments>http://www.codealpha.net/728/how-to-optimize-all-tables-from-all-databases/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 00:43:42 +0000</pubDate>
		<dc:creator>Arnaud Soyez</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[optimization]]></category>

		<guid isPermaLink="false">http://www.codealpha.net/?p=728</guid>
		<description><![CDATA[The following command will optimize all of your databases' tables within MySQL. It is important to optimize tables to reduce data fragmentation. mysqlcheck -Aop -uroot If you are not using root replace it with your username. -A : Check all tables in all databases. This is the same as using the --databases option and naming [...]]]></description>
			<content:encoded><![CDATA[<p>The following command will optimize all of your databases' tables within MySQL.<br />
It is important to optimize tables to reduce data fragmentation.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysqlcheck <span style="color: #660033;">-Aop</span> <span style="color: #660033;">-uroot</span></pre></div></div>

<p>If you are not using <strong>root</strong> replace it with your username.</p>
<p><strong>-A</strong> : Check all tables in all databases. This is the same as using the --databases option and naming all the databases on the command line.<br />
<strong>-o</strong> : optimize the tables.<br />
<strong>-p</strong> : Prompts for a password to use when connecting to the MySQL server.<br />
<strong>-u</strong> : The MySQL user name to use when connecting to the server.</p>
<p>Inspired by <a href="http://i.justrealized.com/2009/how-to-optimize-mysql-database-with-a-command/">this article</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codealpha.net/728/how-to-optimize-all-tables-from-all-databases/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Putty and tree - how to avoid weird characters (squares)</title>
		<link>http://www.codealpha.net/696/putty-and-tree-how-to-avoid-weird-characters-squares/</link>
		<comments>http://www.codealpha.net/696/putty-and-tree-how-to-avoid-weird-characters-squares/#comments</comments>
		<pubDate>Wed, 15 Sep 2010 10:57:11 +0000</pubDate>
		<dc:creator>Arnaud Soyez</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[ASCII]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[putty]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tree]]></category>

		<guid isPermaLink="false">http://www.codealpha.net/?p=696</guid>
		<description><![CDATA[Character encoding is always a problem when communicating between Windows and Linux. And using the "tree" command is affected by this problem if you are connected to a Linux box using Putty on a Windows box. You will certainly get weird characters, probably squares. For those who are not sure about what tree is. It [...]]]></description>
			<content:encoded><![CDATA[<p>Character encoding is always a problem when communicating between Windows and Linux. And using the "<strong>tree</strong>" command is affected by this problem if you are connected to a Linux box using Putty on a Windows box. You will certainly get weird characters, probably squares.</p>
<p>For those who are not sure about what <strong>tree</strong> is. It is a <strong>command-line tool to list contents of directories in a tree-like format.</strong></p>
<p>A solution to this problem is to force using plain <strong>ASCII</strong> characters:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tree</span> <span style="color: #660033;">--charset</span>=ASCII</pre></div></div>

<p>You can also have an <strong>alias</strong> for this command, so that every time you type "<strong>tree</strong>", it will force tree to use the <strong>ASCII</strong> charset automatically.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">tree</span>=<span style="color: #ff0000;">'tree --charset=ASCII'</span></pre></div></div>

<p>And this is an example of what you will get as an output:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">/tmp
|-- claws-mail-1000
|-- keyring-x803mg
|   |-- control
|   |-- pkcs11
|   `-- ssh
|-- orbit-gdm [error opening dir]
`-- virtual-user</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.codealpha.net/696/putty-and-tree-how-to-avoid-weird-characters-squares/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to work around &quot;prerequisite RT 0 not found&quot; on Ubuntu</title>
		<link>http://www.codealpha.net/691/how-to-work-around-prerequisite-rt-0-not-found-on-ubuntu/</link>
		<comments>http://www.codealpha.net/691/how-to-work-around-prerequisite-rt-0-not-found-on-ubuntu/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 14:19:16 +0000</pubDate>
		<dc:creator>Arnaud Soyez</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[cpan]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[request tracker]]></category>
		<category><![CDATA[rt]]></category>

		<guid isPermaLink="false">http://www.codealpha.net/?p=691</guid>
		<description><![CDATA[You installed Request Tracker 3.8 on Ubuntu 10.04 using apt-get, aptitude, or synaptic, and then you needed RT::Authen::ExternalAuth. What you naturally did is: sudo cpan -i RT::Authen::ExternalAuth But you will get the following error: prerequisite RT 0 not found This is because you did not install request-tracker through CPAN. An easy solution for this is [...]]]></description>
			<content:encoded><![CDATA[<p>You installed <strong><a href="http://bestpractical.com/rt/">Request Tracker</a></strong> 3.8 on Ubuntu 10.04 using <strong>apt-get</strong>, <strong>aptitude</strong>, or <strong>synaptic</strong>, and then you needed <strong>RT::Authen::ExternalAuth</strong>.</p>
<p>What you naturally did is:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> cpan <span style="color: #660033;">-i</span> RT::Authen::ExternalAuth</pre></div></div>

<p>But you will get the following error:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">prerequisite RT 0 not found</pre></div></div>

<p>This is because you did not install request-tracker through CPAN.</p>
<p>An easy <strong>solution</strong> for this is to force the installation using the "<strong>-f</strong>" flag:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> cpan <span style="color: #660033;">-fi</span> RT::Authen::ExternalAuth</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.codealpha.net/691/how-to-work-around-prerequisite-rt-0-not-found-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to backup MySQL users except root on Ubuntu</title>
		<link>http://www.codealpha.net/624/how-to-backup-mysql-users-on-ubuntu/</link>
		<comments>http://www.codealpha.net/624/how-to-backup-mysql-users-on-ubuntu/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 18:24:11 +0000</pubDate>
		<dc:creator>Arnaud Soyez</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqldump]]></category>
		<category><![CDATA[privileges]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[users]]></category>

		<guid isPermaLink="false">http://www.codealpha.net/?p=624</guid>
		<description><![CDATA[When you want to backup your mysql databases, you usually do mysqldump ... --all-databases or mysqldump ... --databases mysql ... but you end up with the whole mysql table which is a pain to insert back when you need it because it can mess up the root password or the debian-sys-maint user... If you wish [...]]]></description>
			<content:encoded><![CDATA[<p>When you want to backup your mysql databases, you usually do <em>mysqldump ... --all-databases</em> or <em>mysqldump ... --databases mysql ...</em> but you end up with the whole <em>mysql</em> table which is a pain to insert back when you need it because it can mess up the root password or the debian-sys-maint user...</p>
<p>If you wish to just backup all the users and privileges other than root and debian-sys-maint, you can use this command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysqldump <span style="color: #660033;">-nt</span> <span style="color: #660033;">-uroot</span> <span style="color: #660033;">-p</span> <span style="color: #660033;">-w</span><span style="color: #ff0000;">&quot;User NOT LIKE 'root' AND User NOT LIKE 'debian%'&quot;</span> mysql user db <span style="color: #000000; font-weight: bold;">&gt;</span> users_privs.sql</pre></div></div>

<p>Here's an explanation of each of the options:</p>
<ul>
<li><strong>-nt</strong>: Do not add "drop table" and "create table".</li>
<li><strong>-uroot -p</strong>: Connect as root and ask for a password</li>
<li><strong>-w...</strong>: Add a "WHERE" condition to each query. We exclude everything related to root and debian-sys-maint.</li>
<li><strong>mysql user db</strong>: Dump the <em>user</em> and <em>db</em> tables from the <em>mysql</em> database.</li>
<li><strong>&gt; users_privs.sql</strong>: Store the sql dump into the <em>users_privs.sql</em> file.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.codealpha.net/624/how-to-backup-mysql-users-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

