Daniel 'MaTachi' Jonsson

Category Archives: Arch Linux

Guide to Make Your Computer Automatically Start and Download Torrents on Linux

Today I managed to install and configure software to make my computer automatically start and download torrents. So now my computer will by itself download episodes from series I have specified as soon as they are released. What you basically need (for my solution) is the torrent client Deluge, the application FlexGet and a RSS feed where the torrents are indexed.

Hereunder follow descriptions of what you have to do to get this working (on Arch Linux with Gnome, but most of the steps should work on any distribution. However some commands may differ and such).

Deluge

  1. First, download Deluge from your Linux distribution’s repository, if you don’t already have it installed. On Arch Linux, type the following in the terminal: sudo pacman -Sy deluge
  2. Open the Preferences window under the Edit menu in Deluge. Then navigate to the Interface tab and make sure that Classic Mode isn’t enabled, which I think it’s by default. You have to disable Classic Mode to be able to run the Deluge daemon, which is Deluge without the GUI, in the background.
  3. Next time you start Deluge (I think) it will ask you to start the daemon to make Deluge able to run. Under Edit > Connection Manager in Deluge you can reopen this window.
  4. Then you have to reopen the Preferences window, and under the Downloads tab choose where the torrents (the downloaded content) should be downloaded to.
  5. You can also start the daemon by typing deluged in the terminal. More information about the daemon can be found here: http://dev.deluge-torrent.org/wiki/Faq#Daemon. To see if it’s running, type ps -A | grep deluged in the terminal.

FlexGet

  1. Download and install FlexGet. There are installation instructions in their Wiki: http://flexget.com/wiki. However, if you are on Arch and have a wrapper for pacman and the AUR installed, like Yaourt, type the following in the terminal: yaourt -Sy flexget. (On Arch you probably will need to do some button smashing to install all dependences, since many of them can be found in the AUR too.)
  2. When you have installed FlexGet, create the folder .flexget in your home folder and in it create a file called config.yml. Now you should read a bit on FlexGet’s wiki to learn how you should construct the config file. Especially read the Configuration page. Here is how (a part of) my config file looks like:
    feeds:
      tokyotosho:
        rss: http://www.tokyotosho.info/rss.php?filter=1&entries=450
        series:
          - Fate/Zero
        deluge: yes

    Note the last line: deluge: yes. It’s necessary for making Deluge start the torrents. Also note that you have to specify a RSS-feed where FlexGet should look for new torrents to download.

  3. Now FlexGet should be able to check the RSS feed(s), find the series/content you want to download and make Deluge download them. To test run FlexGet, run flexget –test in the terminal. Of course you can run flexget –help to find more possible commands. But to do a regular check in the RSS feeds, download, and all that stuff, just run flexget. Note that you don’t have to be running Deluge to download the torrents, only deluged is needed.

Start deluged with Gnome

  1. Open a terminal and run gnome-session-properties if you are on Gnome. In the window that pops up you should add an additional startup program – in this case deluged. Just type that in both the Name field and the Command field. If you are using another desktop environment you sadly have to figure out this step by yourself (Google).

Make FlexGet run once every hour automatically

FlexGet only checks the RSS feeds when you run flexget in the terminal. So what we want to do is to schedule the computer to run it once every hour.

  1. Start with adding the following two lines to the .bashrc file in your home folder:
    EDITOR=nano
    export EDITOR

    This will make the next terminal application use the text editor nano instead of whatever alien editor it uses by default. :)

  2. Close all terminal windows and open a new one to apply the change.
  3. Run crontab -e in the terminal.
  4. Add 0 * * * * flexget to the file, and then save and close it with Ctrl + Shift + X. You can find more schedule options here: https://wiki.archlinux.org/index.php/Crontab. Please don’t make it run once every minute or something crazy like that, since that would use a lot of the server’s bandwidth where your RSS feed is hosted.
  5. To see everything you have scheduled, type crontab -l.

Done!

Now your computer should be able to automatically download torrents for you. I hope you found this guide helpful. If you have any wonders or problems, please leave a comment below, and maybe I can help you get it sorted out.

No eth0/wlan0 in Arch Linux

Almost a week ago I ordered my first laptop, which I’m mainly going to use in the school. It’s a 13,3″ Toshiba R830 and it arrived last Friday. I have already installed Arch Linux and Gnome 3 on it and I’m currently tweaking power saving settings.

Anyway, when I first tried to install the operating system I did it with the netinstall image, version 2010.05, from their website. However, it didn’t work since eth0 wasn’t found during the installation. (ifconfig found wlan0, but I don’t have wireless Internet at home.) Instead I downloaded the core image, chose during the installation to install from the CD (USB memory in my case) and ended up with a working OS – but still no Internet.

I did some searching on the Internet (on my phone) and found the suggestion to download a more recent image of Arch Linux, from this site:

I downloaded the netinstall image with version number 2011.06.10 and that worked out great. :) Since my laptop is fairly new I suppose the hardware wasn’t fully supported in the earlier image. Maybe the kernel has been updated since then or something.

So if Arch Linux doesn’t find Internet, try to reinstall it with a more recent image from the link above.

Arch Linux Review

Arch Linux LogoIt was about one month ago that I distro hopped from Linux Mint to Arch Linux. I still like Linux Mint – it’s easy to install, it’s stable and since it’s based on Ubuntu, which has a large user base, is it easy to get help and there are many applications available.

But I realised that it wasn’t a distribution that really fitted me. For every application that I wanted to install I had to open my browser and search for a repository containing the latest version available. And this eventually became a bit tedious. However, the official repository in Linux Mint (and Ubuntu) is awesome if you want stable and tested software. But if you are like me and want the latest and greatest right when it’s released, then it doesn’t really work. I suppose this is the disadvantage with a non-rolling distro, or the advantage depending of what kind of user you are.

So, I really like that Arch Linux is a rolling distro that adds updates to the repository as soon as they are available. If a software can’t be found in the official repository, maybe because it’s too niched or it’s only in alpha or beta version, it can in almost all cases be found in the AUR (Arch User Repository). In the AUR can everybody add softwares, that then become available for the rest of the community to download and install in a really easy way. It becomes extra easy with the application Yaourt, which you can read more about in the ArchWiki. And I find it really cool that Arch Linux provides this service (the AUR) right on their own website.

Speaking of the ArchWiki. It must be one of the best documentations that I have ever seen. During my first days with Arch, I tried to find help and instructions by searching the Internet with Google or similar, which I’m used to. But soon I realised that it wasn’t the best approach, because the ArchWiki is overfilled with help, instructions and tips. Therefore I find it better to start looking there instead.

Some may find the lack of pre-installed packages scary and/or troublesome. Because when you are finished with an installation of Arch Linux you will boot up into the command-line. But I really like it, since it makes it easier to customize the system. You can from the command-line freely download and install a desktop environment that you like, and there isn’t an official Arch Linux desktop environment. Like Gnome on Ubuntu and and KDE on openSUSE. Since I’m really used to Gnome 2, I chose to install the smoking fresh Gnome 3. :)

I don’t think I have much more to say about Arch. It’s a great distro that really fits me, and I think I will stay with Arch for a long time, assuming there aren’t major changes for the worse in the future. If you have used Linux for a while and are looking for a customizable rolling-distro, then I highly recommend you to try out Arch Linux.

Haruhi Thumb Up

Customize Your Bash/Terminal Prompt

I suppose many already know this, but at least I didn’t until I browsed around the Arch Linux forums. Anyway, it’s possible in Linux to freely customize your bash prompt (PS1). :) Doesn’t that sound awesome?

In the Arch Linux Wiki they have a great page about this:

And in this forum thread you can find loads of nice looking prompts:

This is how my PS1 looks like:

ArchTerminalBashPromptAnd the code behind this prompt is:

PS1="\[\e[2;37m\][\A] \[\e[0;33m\]\u\[\e[0m\]@\[\e[34m\]\h \[\e[32m\]\w\[\e[35m\] \[\e[31m\]\$\[\e[0m\] "

I’m pretty sure that customizing the terminal prompt should work on every Linux-distro.

Serial Monitor In Arduino Not Working On Arch Linux – Solution

Arduino Mega (ATmega1280)One week ago I ordered an Arduino kit from Ebay with an Arduino Mega (ATmega1280) board and some other stuff included, like a breadboard, some LED lights and a LCD display. It costed me only 62 $, so it was a really great price compared to what it would cost here in a Swedish store.

I installed the Arduino software from the AUR (Arch User Repository), but the version of avr-gcc that was included was 4.6.0. If I have understood it correctly, is avr-gcc a compiler that is designed for AVR microcontrollers. However, apparently there is a bug in the versions 4.4 – 4.6.0 of the compiler, which makes programs on the Arduino Mega board unable to send and receive signals through the USB cable. So the Serial Monitor in the Arduino software won’t work.

On Arduino’s website they recommend that you use version 4.3.x of avr-gcc instead, therefore I thought it would be a good idea to install it. And that have I been messing with since Friday. But I finally got it to work just a moment ago, thanks to madworm on the Arduino forums. I’m not here going to describe every step that I took, but if you are having the same problem that I described above, check out the thread and see if you can get it sorted out:

Got A Blank Root Password In Arch Linux? Here’s How You Set One

When I installed Arch Linux on my computer I forgot to set a root password, so it was left blank. This became a problem for me in Gnome 3 when it said that authentication was required to modify the user accounts, and apparently it won’t accept a blank password. So I was forced to set one. If you are having the same problem, do the following steps to set a root password:

  1. Press Ctrl + Alt + F1. (Press Ctrl + Alt + F7 to come back to the graphical interface.)
  2. Log in as root.
  3. Type:
    passwd
  4. Now set your new root password.
  5. Return to the graphical interface by pressing Ctrl + Alt + F7.
  6. Mission complete!

EDIT 2011-08-07: I had typed 1 and 7, when it should have been F1 and F7. The post has been updated.

Kantoku Arch Linux Wallpapers

Today I downloaded some pictures drawn by somebody called Kantoku. Sadly I can’t find anything about him/her in English. Anyway, I have resized the pictures to 1920×1200 (HD) and added Arch Linux logos to them. Nothing advance, but I think that they look really good on the desktop. :)

Shizuku Kantoku

Shizuku, Kantoku - Arch Linux

Kogamura, Kantoku - Arch Linux

Kogamura, Kantoku - Arch Linux

Kurumi, Kantoku - Arch Linux

Kurumi, Kantoku - Arch Linux

Kurumi 2, Kantoku - Arch Linux

Kurumi 2, Kantoku - Arch Linux

Kurumi Shizuku - Arch Linux

Kurumi Shizuku - Arch Linux

Kurumi Shizuku 2 - Arch Linux

Kurumi Shizuku 2 - Arch Linux

And here is a screenshot of my current desktop:

My Desktop - June 8, 2011

My Desktop - June 8, 2011

Not long ago did I also create some Linux Mint wallpapers with Sayonara Zetsubou Sensei characters which can be found here: