<?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>conjure code</title>
	<atom:link href="http://conjurecode.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://conjurecode.com</link>
	<description>Information, tutorials, and code examples for linux, python, php and more</description>
	<lastBuildDate>Thu, 12 Jul 2012 16:14:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Restore Dropbox Shell Extension in Nautilus for Gnome3</title>
		<link>http://conjurecode.com/restore-dropbox-shell-extension-in-nautilus-for-gnome3/</link>
		<comments>http://conjurecode.com/restore-dropbox-shell-extension-in-nautilus-for-gnome3/#comments</comments>
		<pubDate>Thu, 12 Jul 2012 16:14:24 +0000</pubDate>
		<dc:creator>atrus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Dropbox]]></category>

		<guid isPermaLink="false">http://conjurecode.com/?p=205</guid>
		<description><![CDATA[Dropbox works great on linux, but at some point the shell extension stopped working for me. The shell extension provides little icons over all the files in your dropbox folder indicating their status, and (more importantly in my opinion) the dropbox context menu which lets you link to files, especially those in your Public folder. [...]]]></description>
				<content:encoded><![CDATA[<p>Dropbox works great on linux, but at some point the shell extension stopped working for me. The shell extension provides little icons over all the files in your dropbox folder indicating their status, and (more importantly in my opinion) the dropbox context menu which lets you link to files, especially those in your Public folder. Here is how you can manually install the very latest version of dropbox-nautilus for your version of Ubuntu.</p>
<p>Add the dropbox linus repository</p>
<div class="codesnip-container" >echo "deb http://linux.dropbox.com/ubuntu $(lsb_release -cs) main" | sudo tee "/etc/apt/sources.list.d/dropbox.list" > /dev/null</div>
<p>Add the dropbox public key</p>
<div class="codesnip-container" >sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 5044912E</div>
<p>Get an updated repository list</p>
<div class="codesnip-container" >sudo apt-get update</div>
<p>Get the latest source code for nautilus-dropbox</p>
<div class="codesnip-container" >sudo apt-get source nautilus-dropbox</div>
<p>Install of the of the necessary dependencies</p>
<div class="codesnip-container" >sudo apt-get build-dep nautilus-dropbox</div>
<p>Install some packages necessary for compiling software in general</p>
<div class="codesnip-container" >sudo apt-get install build-essential dpkg-dev</div>
<p>Change directory into the directory created for your source code, mine was labelled "dropbox-1.4.0"</p>
<div class="codesnip-container" >cd nautilus-dropbox-0.6.7/</div>
<p>The README and INSTALL files are good to review at this point, they go over the basics and details of installation this package.</p>
<p>Following the README, we'll first configure the package.</p>
<div class="codesnip-container" >sudo ./configure</div>
<p>Next we'll compile it with make.</p>
<div class="codesnip-container" >sudo make</div>
<p>And finally we'll install.</p>
<div class="codesnip-container" >sudo make install</div>
<p>At this point we have installed the latest version of nautilus-dropbox from source. We'll have to stop all running instances of nautilus and then reopen it to see our changes.</p>
<div class="codesnip-container" >killall nautilus</div>
<p>That's it! Just run nautilus, or open your file browser as you normally would and you should have the latest version of dropbox's shell extension up and running.</p>
]]></content:encoded>
			<wfw:commentRss>http://conjurecode.com/restore-dropbox-shell-extension-in-nautilus-for-gnome3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting m4a to mp3 with ffmpeg on linux</title>
		<link>http://conjurecode.com/converting-m4a-to-mp3-with-ffmpeg-on-linux/</link>
		<comments>http://conjurecode.com/converting-m4a-to-mp3-with-ffmpeg-on-linux/#comments</comments>
		<pubDate>Fri, 22 Jun 2012 18:59:30 +0000</pubDate>
		<dc:creator>atrus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://conjurecode.com/?p=200</guid>
		<description><![CDATA[We're going to write a quick script that will convert m4a files to mp3 files. FFMPEG is actually quite flexible though so if you have different file formats that need to be converted you can probably just swap them in without any other modifications. First things first, install some dependencies sudo apt-get install ffmpeg libavcodec-extra-53 [...]]]></description>
				<content:encoded><![CDATA[<p>We're going to write a quick script that will convert m4a files to mp3 files. FFMPEG is actually quite flexible though so if you have different file formats that need to be converted you can probably just swap them in without any other modifications. First things first, install some dependencies</p>
<div class="codesnip-container" >sudo apt-get install ffmpeg libavcodec-extra-53</div>
<p>This installs ffmpeg and the libraries which allow you to work with mp3 files, among other codecs. It should be noted that libavcodec-extra may change or get updated after the time this article was written, so it'd be best to type "libavcodec-extra" and then hit tab to have the appopriate library name autocompleted for you.</p>
<p>Next we're going to write a quick shell script which runs "ffmpeg -i input_filename.m4a -ab 256k output_filename.mp3" for each .m4a file in the current directory. I'm entering mine into a file called m4a2mp3.sh and placing that file into the same directory as the .m4a files that I want to convert.</p>
<div class="codesnip-container" >#!/bin/bash<br />
for i in *.m4a<br />
do<br />
    ffmpeg -i "$i" -ab 256k "${i%m4a}mp3"<br />
done</div>
<p>The -ab argument stands for audio bitrate and controls the quality of the output file. You can specify any number of the common bitrates, from 64k all the way up to 128k, 256k, 192k, 320k, etc. Check the man page for specifics as needed.</p>
<p>Give the file execute permissions and run it to convert all files in the directory.</p>
<div class="codesnip-container" >chmod +x m4a2mp3.sh</div>
<div class="codesnip-container" >./m4a2mp3.sh</div>
<p>After you've gotten this script working, if you'd like to have it remove the original files as it converts, you can ammend the script like so:</p>
<div class="codesnip-container" >#!/bin/bash<br />
for i in *.m4a<br />
do<br />
    ffmpeg -i "$i" -ab 256k "${i%m4a}mp3" &#038;& rm "$i"<br />
done</div>
<p>Careful though, if the conversion fails or doesn't turn out as you expected, you may lose your originals. Always keep backups!</p>
]]></content:encoded>
			<wfw:commentRss>http://conjurecode.com/converting-m4a-to-mp3-with-ffmpeg-on-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Download all files from directory listing with wget</title>
		<link>http://conjurecode.com/download-all-files-from-directory-listing-with-wget/</link>
		<comments>http://conjurecode.com/download-all-files-from-directory-listing-with-wget/#comments</comments>
		<pubDate>Fri, 22 Jun 2012 17:55:34 +0000</pubDate>
		<dc:creator>atrus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[One Liners]]></category>

		<guid isPermaLink="false">http://conjurecode.com/?p=197</guid>
		<description><![CDATA[If you run across a directory listing of files that you'd like to download all at once, you can use a couple wget arguments to help you. Use -m to enable mirroring (equivalent to -r -N -l info --no-remove-listing) and --no-parent to prevent wget from recursing up directories. This command will download everything in the [...]]]></description>
				<content:encoded><![CDATA[<p>If you run across a directory listing of files that you'd like to download all at once, you can use a couple wget arguments to help you. Use -m to enable mirroring (equivalent to -r -N -l info --no-remove-listing) and --no-parent to prevent wget from recursing up directories. This command will download everything in the current directory and all directories below it.</p>
<div class="codesnip-container" >wget -m --no-parent http://example.com/path/to/files/</div>
<p>As usual, run <a href="http://www.gnu.org/software/wget/manual/wget.html">man wget</a> for more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://conjurecode.com/download-all-files-from-directory-listing-with-wget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Send text to clipboard in linux terminal</title>
		<link>http://conjurecode.com/send-text-to-clipboard-in-linux-terminal/</link>
		<comments>http://conjurecode.com/send-text-to-clipboard-in-linux-terminal/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 16:30:31 +0000</pubDate>
		<dc:creator>atrus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Environment]]></category>

		<guid isPermaLink="false">http://conjurecode.com/?p=191</guid>
		<description><![CDATA[What we'd like to do is have a quick way of sending text to the clipboard from terminal in linux. We can accomplish this with pipes and xclip. We'll install and configure xclip and then review the proper usage. First we install xclip: sudo apt-get install xclip Next we want to configure an alias for [...]]]></description>
				<content:encoded><![CDATA[<p>What we'd like to do is have a quick way of sending text to the clipboard from terminal in linux. We can accomplish this with pipes and xclip. We'll install and configure xclip and then review the proper usage.</p>
<p>First we install xclip:</p>
<div class="codesnip-container" >sudo apt-get install xclip</div>
<p>Next we want to configure an alias for xclip so that the arguments "-selection c" are used every time we call xclip. This ensures that the text is piped (copied) into the correct clipboard. This command will place the alias specification into the .bashrc file in our home directory.</p>
<div class="codesnip-container" >echo "alias xclip=\"xclip -selection c\"" >> ~/.bashrc</div>
<p>Now we need to load our new .bashrc settings into the current window or open a new window.</p>
<div class="codesnip-container" >source ~/.bashrc</div>
<p>Now we can use xclip as follows:</p>
<div class="codesnip-container" >uptime | xclip</div>
<p>In my case I like being able to copy my public keys directly from file into github, so I use it like so:</p>
<div class="codesnip-container" >cat ~/.ssh/id_rsa.pub | xclip</div>
]]></content:encoded>
			<wfw:commentRss>http://conjurecode.com/send-text-to-clipboard-in-linux-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux and sharing, so awesome it just might be illegal</title>
		<link>http://conjurecode.com/linux-and-sharing-so-awesome-it-just-might-be-illegal/</link>
		<comments>http://conjurecode.com/linux-and-sharing-so-awesome-it-just-might-be-illegal/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 00:05:04 +0000</pubDate>
		<dc:creator>atrus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Culture]]></category>

		<guid isPermaLink="false">http://conjurecode.com/?p=165</guid>
		<description><![CDATA[I'm a huge GNU/Linux fan and I like to think of myself as a FOSS advocate. So I chose an image of Tux to emblazon on my new credit card. There is some opaque process for determining which images can be used and which cannot, due to licensing issues. Unfortunately my image was flagged and [...]]]></description>
				<content:encoded><![CDATA[<p>I'm a huge GNU/Linux fan and I like to think of myself as a FOSS advocate. So I chose an <a href="http://www.isc.tamu.edu/~lewing/linux/">image of Tux</a> to emblazon on my new credit card. There is some opaque process for determining which images can be used and which cannot, due to licensing issues. Unfortunately my image was flagged and denied, falling under "Celebrities such as actors, musicians, athletes, or cartoons." Now certainly Tux may be a celebrity, but that doesn't mean I can't use his glorious image! I mean, look at that mug!</p>
<p><img src="http://www.conjurecode.com/tuxcard.jpg" alt="Tux Credit Card" /></p>
<p>So not wanting to give up, I call in to appeal the decision. That's when things got funny:</p>
<blockquote><p>
<b>Me:</b> The image on the card is a cartoon penguin named Tux. Not like a cartoon you'd see on television though. He is the Linux mascot. Are you familiar with Linux?</p>
<p><b>Capital One CS:</b> No response.</p>
<p><b>Me:</b> Linux is a free, open source operating system for your computer. It is free to use, modify, share or sell. The image is free to use. I know it can be a funny concept for some people.</p>
<p><b>Capital One CS:</b> Ok, and the organization is?</p>
<p><b>Me:</b> ... There is no organization, Linux can be freely downloaded, used and modified by anyone, no one necessarily owns or controls it.</p>
<p><b>Capital One CS:</b> And this is legal?</p>
<p><b>Me:</b> *chuckles* Yes, it certainly is.
</p></blockquote>
<p>How about that? I've heard of people receiving this exact response before, but it is absolutely stunning to hear it myself. What does that say about our culture? Especially the culture in technology and software. It is certainly disappointing, but I will admit, there is a part of me that feels a glowing pride, knowing that Linux is so awesome, so mind bending to the common person, that hell, it might not even be legal. These days, let's ensure that it remains that way.</p>
]]></content:encoded>
			<wfw:commentRss>http://conjurecode.com/linux-and-sharing-so-awesome-it-just-might-be-illegal/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>UDev rules for Android Development on Motorola Triumph</title>
		<link>http://conjurecode.com/udev-rules-for-android-development-on-motorola-triumph/</link>
		<comments>http://conjurecode.com/udev-rules-for-android-development-on-motorola-triumph/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 20:28:37 +0000</pubDate>
		<dc:creator>atrus</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://conjurecode.com/?p=160</guid>
		<description><![CDATA[In short, the published Vendor ID for Motorola is not correct for the Motorola Triumph. Instead of 22b8, use 0489. When we connect our android device to the computer via USB for development purposes, we have to set a UDev rule which specifies how the system should be allowed to access that device. For this [...]]]></description>
				<content:encoded><![CDATA[<p>In short, the published Vendor ID for Motorola is not correct for the Motorola Triumph. Instead of 22b8, use 0489. When we connect our android device to the computer via USB for development purposes, we have to set a UDev rule which specifies how the system should be allowed to access that device. For this purpose we can refer to the <a href="http://developer.android.com/guide/developing/device.html#setting-up">Android Developer Docs</a>. These docs give instructions for Ubuntu users. You need to make sure you're using the correct location for the rules file for your distribution. You can can see at the <a href="https://wiki.archlinux.org/index.php/Udev#About_udev_rules">arch wiki</a>, the location for udev rules is /etc/udev/rules.d/.</p>
<p>So to enable our Motorola Triumph android phone for development we must add the following to /etc/udev/rules.d/51-android.rules (again, check for your distribution's docs for the correct udev rules location)</p>
<div class="codesnip-container" >SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666", GROUP="plugdev"</div>
<p>Once you save this file UDev should automatically load in your new rule, but you will have to unplug and reconnect your phone in order for the new rule to take effect.</p>
<p>Now browse to the platform tools folder of your sdk (In my case /opt/android-sdk/platform-tools/) and run adb to ensure your device is properly recognized, like so:</p>
<div class="codesnip-container" >$ ./adb devices<br />
List of devices attached<br />
FD1M1019202100	device</div>
<p>Without the proper UDev rule, your Triumph will not be mounted with the correct permissions and neither your nor your Eclipse SDK will be able to access your phone properly. Running adb without the proper UDev rule will yield something like this:</p>
<div class="codesnip-container" >$ ./adb devices<br />
List of devices attached<br />
????????????	no permissions</div>
<p>In order to determine the vendor id and product id of a phone, connect it to your computer (the previously mentioned UDev rules do not have to be in place), and run lsusb and find your phone amongst the devices listed.</p>
<div class="codesnip-container" >$ lsusb<br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 002 Device 002: ID 0bda:0158 Realtek Semiconductor Corp. USB 2.0 multicard reader<br />
Bus 002 Device 003: ID 5986:01a6 Acer, Inc Lenovo Integrated Webcam<br />
Bus 001 Device 016: ID 0489:c001 Foxconn / Hon Hai</div>
<p>In this case we're interested in the last one, named "Foxconn / Hon Hai". The Vendor ID and Product ID directly precede the name and are separated by a colon. For example, in the case of this particular Motorola Triumph, the Vendor ID is 0489, and the Product ID is c001. To save yourself time and frustration, take a moment to run this command when you're creating your UDev rules to ensure you have the proper ID's for your particular device.</p>
]]></content:encoded>
			<wfw:commentRss>http://conjurecode.com/udev-rules-for-android-development-on-motorola-triumph/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fix Spotify playlist URL&#8217;s in Ubuntu / Linux / Gnome 3</title>
		<link>http://conjurecode.com/fix-spotify-playlist-urls-in-linux/</link>
		<comments>http://conjurecode.com/fix-spotify-playlist-urls-in-linux/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 14:14:21 +0000</pubDate>
		<dc:creator>atrus</dc:creator>
				<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Spotify]]></category>

		<guid isPermaLink="false">http://conjurecode.com/?p=143</guid>
		<description><![CDATA[Spotify has a great linux client but I had trouble getting Spotify playlist URLs to load properly. When you a click a spotify URL in your browser it utilizes xdg-open to determine which application should be launched. I'm running Ubuntu 11.04 with Gnome 3, and the following solution worked well for me and is quite [...]]]></description>
				<content:encoded><![CDATA[<p>Spotify has a great linux client but I had trouble getting Spotify playlist URLs to load properly. When you a click a spotify URL in your browser it utilizes xdg-open to determine which application should be launched. I'm running Ubuntu 11.04 with Gnome 3, and the following solution worked well for me and is quite elegant.</p>
<p>Enter the following into the file /usr/share/applications/spotify-url.desktop</p>
<div class="codesnip-container" >
<div class="ini codesnip" style="font-family:monospace;"><span class="re0"><span class="br0">&#91;</span>Desktop Entry<span class="br0">&#93;</span></span><br />
<span class="re1">Name</span><span class="sy0">=</span><span class="re2">Spotify</span><br />
<span class="re1">GenericName</span><span class="sy0">=</span><span class="re2">Spotify</span><br />
<span class="re1">Comment</span><span class="sy0">=</span><span class="re2">Listen to music using Spotify</span><br />
<span class="re1">Icon</span><span class="sy0">=</span><span class="re2">spotify-linux-512x512</span><br />
<span class="re1">TryExec</span><span class="sy0">=</span><span class="re2">spotify</span><br />
<span class="re1">Exec</span><span class="sy0">=</span><span class="re2">spotify -uri %u</span><br />
<span class="re1">Terminal</span><span class="sy0">=</span><span class="re2">false</span><br />
<span class="re1">Type</span><span class="sy0">=</span><span class="re2">Application</span><br />
<span class="re1">Categories</span><span class="sy0">=</span><span class="re2">Qt</span><span class="co0">;AudioVideo</span><br />
<span class="re1">MimeType</span><span class="sy0">=</span><span class="re2">x-scheme-handler/spotify</span><br />
<span class="re1">NoDisplay</span><span class="sy0">=</span><span class="re2">true</span></div>
</div>
<p>Then run the following command to update your desktop database to enable the new command. If successful this command will return silently, without any error or success message.</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;"><span class="kw2">sudo</span> update-desktop-database</div>
</div>
<p>Spotify links should now work! Have a better solution? Having trouble finding a solution for your particular setup, let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://conjurecode.com/fix-spotify-playlist-urls-in-linux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Disable the Universal Access accessibility menu in Gnome 3</title>
		<link>http://conjurecode.com/disable-the-universal-access-accessibility-menu-in-gnome-3/</link>
		<comments>http://conjurecode.com/disable-the-universal-access-accessibility-menu-in-gnome-3/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 15:17:54 +0000</pubDate>
		<dc:creator>atrus</dc:creator>
				<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://conjurecode.com/?p=135</guid>
		<description><![CDATA[sudo add-apt-repository ppa:webupd8team/gnome3 sudo apt-get update sudo apt-get install gnome-shell-extensions-noa11y In the new gnome-shell, otherwise known as Gnome 3, there is an accessibility menu called "Universal Access" that cannot be removed by any apparent means. Fortunately it can easily be removed, hidden, or disabled by editing a file and restarting the shell. This method works [...]]]></description>
				<content:encoded><![CDATA[<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;"><span class="kw2">sudo</span> add-apt-repository ppa:webupd8team<span class="sy0">/</span>gnome3<br />
<span class="kw2">sudo</span> <span class="kw2">apt-get</span> update<br />
<span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> gnome-shell-extensions-noa11y</div>
</div>
<p>In the new gnome-shell, otherwise known as Gnome 3, there is an accessibility menu called "Universal Access" that cannot be removed by any apparent means. Fortunately it can easily be removed, hidden, or disabled by editing a file and restarting the shell. This method works for gnome-shell version 3.0 (this reportedly works in Gnome 3.2 as well), it may or may not work in future versions.</p>
<p>Edit the file /usr/share/gnome-shell/js/ui/panel.js</p>
<p>Look for the following line, (line 38 in my case):</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;"><span class="st0">'a11y'</span><span class="sy0">:</span> imports.<span class="me1">ui</span>.<span class="kw3">status</span>.<span class="me1">accessibility</span>.<span class="me1">ATIndicator</span><span class="sy0">,</span></div>
</div>
<p>Comment out this line like so:</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;"><span class="co1">//'a11y': imports.ui.status.accessibility.ATIndicator,</span></div>
</div>
<p>Then restart gnome-shell by typing Alt-F2 to run command, enter "r" without the quotes, and hit enter. This will quickly restart the shell and you should find that the Universal Access menu no longer appears. If you should find a use for it in the future, simply un-comment the lines found in /usr/share/gnome-shell/js/ui/panel.js</p>
<p>Thanks to the endlessly helpful folks who maintain <a href="https://wiki.archlinux.org/index.php/GNOME#Hide_accessibility_icon">ArchWiki</a> for this tip.</p>
]]></content:encoded>
			<wfw:commentRss>http://conjurecode.com/disable-the-universal-access-accessibility-menu-in-gnome-3/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Disable the Ctrl-Q quit shortcut in firefox with keyconfig!</title>
		<link>http://conjurecode.com/disable-the-ctrl-q-quit-shortcut-in-firefox-with-keyconfig/</link>
		<comments>http://conjurecode.com/disable-the-ctrl-q-quit-shortcut-in-firefox-with-keyconfig/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 17:28:56 +0000</pubDate>
		<dc:creator>atrus</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://conjurecode.com/?p=129</guid>
		<description><![CDATA[This is a firefox extension which allows you to add, modify, remove and disable keyboard shortcuts for Firefox. We're going to use this to disable the pesky shortcut for quitting firefox which is Ctrl-Q. Ctrl-Q is right next to Ctrl-W which is the handy shortcut for closing tabs, and if you hit it by mistake [...]]]></description>
				<content:encoded><![CDATA[<p>This is a firefox extension which allows you to add, modify, remove and <strong>disable</strong> keyboard shortcuts for Firefox. We're going to use this to disable the pesky shortcut for quitting firefox which is Ctrl-Q. Ctrl-Q is right next to Ctrl-W which is the handy shortcut for closing tabs, and if you hit it by mistake your entire session will be lost; sometimes it vanishes so quickly you don't even know what hit you.</p>
<p>Simply install the extension, restart Firefox, and then open Preferences for keyconfig in the Add-ons section. Then scroll down and highlight the shortcut for Quit and click disable. Voila, no more Ctrl-Q rage.</p>
<p>This extension was created by dorando, and can be found here: <a href="http://forums.mozillazine.org/viewtopic.php?t=72994">http://forums.mozillazine.org/viewtopic.php?t=72994</a> and here: <a href="http://mozilla.dorando.at">http://mozilla.dorando.at</a></p>
<p>According to the forum post linked above, you can support the creator of this extension by donating something towards his hosting bill here: <a href="http://www.dreamhost.com/donate.cgi?id=3048">http://www.dreamhost.com/donate.cgi?id=3048</a></p>
<p>Since this extensions works so well for many people and the only trace of it seems to be a forum post, I've decided to host a mirror of it on my server, just in case. You can find that here: <a href="http://conjurecode.com/keyconfig.xpi">http://conjurecode.com/keyconfig.xpi</a></p>
]]></content:encoded>
			<wfw:commentRss>http://conjurecode.com/disable-the-ctrl-q-quit-shortcut-in-firefox-with-keyconfig/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SSH Tunnel for MySQL (or anything else) via Port Forwarding</title>
		<link>http://conjurecode.com/ssh-tunnel-for-mysql-or-anything-else-via-port-forwarding/</link>
		<comments>http://conjurecode.com/ssh-tunnel-for-mysql-or-anything-else-via-port-forwarding/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 16:36:29 +0000</pubDate>
		<dc:creator>atrus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[One Liners]]></category>

		<guid isPermaLink="false">http://conjurecode.com/?p=122</guid>
		<description><![CDATA[Let's using SSH port forwarding to tunnel a service from a remote server to our local machine. For example, many servers restrict mysql connections to localhost only. Using this technique we can tunnel our mysql connection through the remote machine transparently and securely. Let's set up our example. We have an instance of MySQL running [...]]]></description>
				<content:encoded><![CDATA[<p>Let's using SSH port forwarding to tunnel a service from a remote server to our local machine. For example, many servers restrict mysql connections to localhost only. Using this technique we can tunnel our mysql connection through the remote machine transparently and securely. Let's set up our example. We have an instance of MySQL running at mysql.remoteserver.com on the default port of 3306. To make things interesting (and perhaps easier to follow), we're going to assume that you're also running an instance of MySQL on your local machine on the same port. So, let's tunnel the mysql connection from the remote server to our local machine on port 3307 so there are no conflicts.</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;"><span class="kw2">ssh</span> <span class="re5">-L</span> 3307:127.0.0.1:3306 user<span class="sy0">@</span>mysql.remoteserver.com <span class="re5">-N</span></div>
</div>
<p>If you're not using public key authentication, you will be prompted for a password. By specifying the -N option, we suppress opening a shell session and your command prompt will merely hang after you've entered your password. This can be safely omitted if you like, and a shell session will be opened for you. You can read more about the ssh command at it's <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?ssh+1">man page</a>.</p>
<p>To connect to our MySQL server, we need to specify our local address and port (Note: Using "localhost" will NOT work in this case, make sure to 127.0.0.1), and the login information for the instance of MySQL on our remote server. In Python you might use the following:</p>
<div class="codesnip-container" >
<div class="python codesnip" style="font-family:monospace;">db = MySQLdb.<span class="me1">connect</span><span class="br0">&#40;</span>host=<span class="st0">'127.0.0.1'</span>, port=3307, <span class="kw3">user</span>=<span class="st0">'myusername'</span>, passwd=<span class="st0">'mypassword'</span>, db=<span class="st0">'databasename'</span><span class="br0">&#41;</span></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://conjurecode.com/ssh-tunnel-for-mysql-or-anything-else-via-port-forwarding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
