April 2014
M T W T F S S
« Mar    
 123456
78910111213
14151617181920
21222324252627
282930  
161

Refs

Categories

Archives

profile for slm on Stack Exchange, a network of free, community-driven Q&A sites

[one-liner]: Howto get Firefox 10.x to Launch a BitTorrent Client via a Magnet Link on Linux

Background

If you’ve ever used BitTorrent you’re probably familiar with having to download a .torrent file and then opening it in a BitTorent client such as Vuze (previously known as Azureus). You may not however be that familiar with magnet links, so called trackerless torrents.

The difference? Where a .torrent is a file that includes among other things info about the files you’ll be downloading, a magnet link is just a link that has a hashcode which was generated from the info thats included in the .torrent file.

This excerpt from lifehacker.com explains it a little better:

When you download a .torrent file, you’re essentially downloading a small file that contains information on the larger files you want to download. The torrent file tells your torrent client the names of the files being shared, a URL for the tracker, and more. Your torrent client then calculates a hash code, which is a unique code that only that torrent has-kind of like an ISBN or catalog number. From there, it can use that code to find others uploading those files, so you can download from them.

A magnet link does away with the middleman. A magnet link is essentially a hyperlink containing the hash code for that torrent, which your torrent client can immediately use to start finding people sharing those files. Magnet links don’t require a tracker (since it uses DHT, which you can read more about here), nor does it require you to download a separate file before starting the download, which is convenient.

So now on to the heart of this post. How do you get Firefox 10.x to automatically start the BitTorent client Vuze up when you click on a magnet link? Here’s how.

Solution

Before we get started, a magnet link looks like the following:

1
2
3
magnet:?xt=urn:btih:bd927aef9d957ba4f4402fbbb0b41f9f88f148a4&dn=download+distro+-+linux+\
   fedora&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com\
   %3A80&tr=udp%3A%2F%2Ftracker.ccc.de%3A80

Clicking on a magnet link in Firefox will result in this dialog being displayed.

FF Magnet Alert Dialog

FF Magnet Alert Dialog

To get Firefox to identify links that use the handle magnet: you’ll need to add a new preference to Firefox’s about:config. You can get into about:config by typing it in the URL bar.

FF about:config

FF about:config

In the example above, you can see that the preference, network.protocol-handler.expose.magnet, doesn’t exist, so let’s go ahead and add it. Right click where the results are being shown when you searched for handler.expose, select New -> Boolean, and enter the preference name network.protocol-handler.expose.magnet. Next set its value to false.

With the magnet handler preference in place, you’ll need to browse to a site with a magnet link on it. Here’s an example:

FF Example Magnet Link

FF Example Magnet Link

After clicking on the magnet link you should see Firefox’s Launch Application Choose Dialog. It’ll be blank, meaning there is no application associated to magnet links, so click the Choose button and navigate to your BitTorrent client. In my example, I’m using Azureus/Vuze, so I navigated to /usr/bin/azureus.

Now with an application associated to the magnet handler try clicking on the magnet link again. This time you should see your BitTorrent client startup, if it isn’t already running, and get the magnet link from Firefox, and start downloading the torrent.

Vuze Download Magnet Link

Vuze Download Magnet Link

References

NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.

[one-liner]: Howto Install Firefox 10.x on Fedora 14, CentOS 5.x & 6.x

Background

If you’re like me and still hanging back on Fedora 14, here’s a way to stay on the latest versions of Firefox without having to upgrade Fedora just yet.

Solution

Thanks to this post on the if-not-true-then-false blog (aka. if !1 0), it’s pretty easy to get firefox 10 working just fine on Fedora 14. Here are the steps I took to get it installed in ~2 minutes.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
## setup remirepo 
% rpm -Uvh http://rpms.famillecollet.com/remi-release-14.rpm
 
## list versions of firefox available
% yum --enablerepo=remi list firefox
 
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
Installed Packages
firefox.x86_64                                  10.0.1-1.fc14.remi                              @remi
 
## NOTE: remi repo is disabled by default!
 
## update/install firefox
% yum --enablerepo=remi update firefox
## OR ##
% yum --enablerepo=remi install firefox

Personal thanks to the if-not-true-then-false.com blog as well as Remi Collet for maintaining the Les RPM de Remi YUM Repo and blog.

References

links
local copies

NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.

[one-liner]: Adding the Oracle/Sun Java Plugin to Firefox on Ubuntu 11.04

Background

If you’d like to add the Oracle/Sun Java plugin to Firefox under Ubuntu here’s a quick tip on how to do it.

NOTE: If you need help installing Java see my previous post, Howto Install/Setup Oracle/Sun Java 1.6.X on Ubuntu 10.10.

Solution

Simply run the following command, which creates a link to the Java plugin, thus “installing it” as a Firefox plugin.

1
2
cd /usr/lib/mozilla/plugins
sudo ln -s /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so

Now restart Firefox. You can test if the plugin was installed correctly here.

References

NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.

[one-liner]: Connecting to VMware Server 2.x from Linux without using a Browser

Background

Here’s a quick tip on how to connect to VMware server 2.x remotely from a Linux box. In this case it’s a Fedora 14 system but this approach should work just fine from any Red Hat distro such as RHEL and/or CentOS.

Solution

2 so-so workarounds

One of the annoyances of using VMware Server 2.x, is that it’s completely web based so there isn’t an actual client application that you can connect with. To further frustrate Linux users, the VMware Server Console Plugin doesn’t work with versions of Firefox 3.5 or higher. It only works with Firefox 3.0.x. So you’re left with 2 choices, either downgrade to a version of Firefox 3.0.x, or enable Firefox 3.5+ to use SSLv2.

Downgrading to Firefox 3.0.x seems like a bad idea so I’m not even going to discuss it here, so that leaves the 2nd option. Re-enabling SSLv2 support is also a bad idea IMO but here’s how you can do that:

  1. In the Location bar, type about:config and press Enter.
  2. The about:config “This might void your warranty!” warning page may appear. Click “I’ll be careful, I promise!”
  3. In the Filter: box, type ssl2.
  4. Double-click each preference line to set it to true.

NOTE: One of the improvements of Firefox 3.5 over 3.0 was to disable SSLv2 support, and this is in fact what broke the VMware plugin!

However there is a better albeit less publicized way to which I’m going to discuss next.

a better workaround

By far the best solution I’ve seen is to just call the Firefox plugin vai the command line directly. Until recently I wasn’t even aware that this was a possibility but it does in fact work and I’ve been using it for well over a month now without any issues.

To install this plugin, just connect like you normally would to the VMware server via your Firefox 3.5+ browser. This will actually install the plugin, it just won’t work directly from Firefox.

Then in a shell run it like so:

1
2
3
4
5
6
7
8
9
10
11
# command template
% /home/saml/.mozilla/firefox/[rnd string].default/extensions/VMwareVMRC@vmware.com/plugins/vmware-vmrc \
	-h "[hostname]:8333" -u [user] -p [password]
 
# example #1 with the password (not recommended)
% /home/saml/.mozilla/firefox/8x1be8t4.default/extensions/VMwareVMRC@vmware.com/plugins/vmware-vmrc \
	-h "192.168.1.1:8333" -u someuser -p somepassword
 
# example #2 without the password
% /home/saml/.mozilla/firefox/8x1be8t4.default/extensions/VMwareVMRC@vmware.com/plugins/vmware-vmrc \
	-h "192.168.1.1:8333" -u someuser

Here’s a screenshot of the dialog box you’re presented with once you’ve provided your credentials:

vmware server VMs

vmware server VMs

From here you can double click on a VM to start it up and connect to it. To manage the VMs themselves you can continue to connect to the VMware Server using Firefox!

References

links
local copies

NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.

[one-liner]: Getting Arrow & Page Up/Down Keys Working Properly in Firefox 3.x & 4.x

Background

Have you ever wondered why sometimes in Firefox your navigation keys on your keyboard (i.e. arrow + page up/down) seem to work just fine, allowing you to smoothly scroll through web pages and other times they don’t? This one’s a little embarrassing, given I’ve been using computers for a LONG time, but this problem has driven me nuts for so long I couldn’t resist writing it down in the hopes of helping someone else out too.

Solution

Firefox has what is called caret browsing. Caret browsing allows you browse through a web page with a cursor (aka. a caret) when it’s turned on. The default is suppose to be that caret browse is off. Hitting the F7 key will toggle caret browsing on/off within Firefox.

caret browsing on ex. #1

caret browsing on ex. #1

caret browsing on ex. #2

caret browsing on ex. #2

Useful Links

NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.

[one-liner]: Strange Characters on Google using Firefox on Ubuntu 10.04

Background

Recently upgraded a system to Ubuntu 10.04 and started noticing these strange characters when I’d hit Google.

google with strange characters

If you see something like this it usually has something to do with your computer’s locale (language) not being set correctly. That’s exactly what was wrong in my case with Firefox on Ubuntu 10.04. Not sure if it’s a wide problem, but I have had 2 systems where I’ve upgraded them both to Ubuntu 10.04 recently and they’ve both had this problem.

You can further confirm this by checking what the language is set to in Firefox. Navigate the pull down menus like so, Edit -> Preferences -> Content -> “Choose…” (under Languages).

Firefox's Preference Menu (Content Tab)

Clicking the Choose button will open the Language’s Dialog box.

Firefox Lanuages Dialog


…. Continue reading → [one-liner]: Strange Characters on Google using Firefox on Ubuntu 10.04 »»

Page 1 of 212