GNU/Linux

You are currently browsing the archive for the GNU/Linux category.

To compile a C++ application using gtkmm in Code::Blocks, do the following steps:

  1. Open Project > Build Options…
  2. Select your project.
  3. On the Compiler settings tab, select Other options and add this to the field:
    `pkg-config gtkmm-3.0 --cflags`
  4. Select the Linker settings tab and type the following line in the Other linker options text area:
    `pkg-config gtkmm-3.0 --libs`

Tags: , , , , , ,

I have installed Ubuntu 11.10 on my laptop but I noticed that it drained a lot more of the battery than it should do. Apparently there are a couple of fixes to this:

To add pcie_aspm=force, i915.i915_enable_rc6=1, i915.i915_enable_fbc=1 and i915.lvds_downclock=1 to GRUB, do the following steps:

  1. Open the terminal and run: sudo gedit /etc/default/grub
  2. Add:
    pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1
    to
    GRUB_CMDLINE_LINUX_DEFAULT=”",
    so it should look somewhat like:
    GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1″
  3. Close gedit and save the document.
  4. Now run the following line in the terminal to update GRUB:
    sudo grub-mkconfig -o /boot/grub/grub.cfg
  5. After a restart of your computer the new settings should get activated.

Tags: , , ,

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.

Tags: , , , , , , , ,

There is a really nice lightweight music player to Linux called DeaDBeeF, which can be found on the following link:

The appearance is in many ways very similar to the Windows music player Foobar2000. So if you like Foobar2000 on Windows, give DeaDBeeF a try. It also has many (preinstalled) plugins and features.

One of the features it has is the ability to show album art right in the playlist. To do this, do the following steps:

  1. Right click the bar right over the playlist and add Album Art from the Add Column window.
  2. Right click the bar again and choose Artist/Date/Album under Group by.
  3. Done!
  4. If you don’t want it to separate the playlist by artist. Choose Custom under the Group by menu instead, and type [%y] %b in the Format field.

Tags: , , , , ,

On my laptop where I run Linux Mint 11 I have been using the window manager XMonad for a while. It’s a tiling window manager, and it’s the first time I’m using one of those. If you don’t know what a tiling window manager is, you can check out Wikipedia’s page on the subject:

Or this video of somebody fiddling around with XMonad:

XMonad works very well with Gnome 2, and it doesn’t conflict with the Gnome 2 panel at the top of the monitor. Here is a screenshot of my dekstop (click on it to show it in full-size):

XMonadI like that you open, resize and change active window, and move windows between workspaces with only the keyboard. This means that you don’t have to use the trackpad for those tasks. :)

I think that using a tiling window manager works surprisingly well, considering that it’s not a commonly used type of window manager. Sometimes do windows look a bit strange when they are forced to fill the whole screen tho, but that’s not often.

I recommend you to check out XMonad if it sound interesting. On Mint it’s really easy to change back to regular Gnome if you don’t like it, just pick regular Gnome on the login screen.

Links:

Tags: , , ,

Yesterday (around 3-4 AM) I installed Linux Mint on my laptop (Toshiba R830). So now it has Windows 7, Arch and Mint. To enhance the awesomeness, I downloaded a Ghost in the Shell wallpaper and added a Linux Mint logo to it which I edited with a brush. All work was done in GIMP.

Ghost in the Shell Linux Mint Wallpaper 1920x1200

Ghost in the Shell - Linux Mint Wallpaper - 1920x1200

Ghost in the Shell Linux Mint Wallpaper 1920x1080

Ghost in the Shell - Linux Mint Wallpaper - 1920x1080

Linux Mint Laptop Screenshot Prev

My Desktop

Tags: , , , ,

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.

Tags: , , , , ,

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

Tags: , ,

There is a pretty cool command-line based application that can execute keystrokes, mouse movement and mouse clicks, called Xautomation. It’s kinda useless if you are sitting at the computer with the terminal in the foreground. But it’s really awesome if you are coding an application that runs in the background and responds to signals from a remote control or similar. I have coded a little command-line based Python 3 program that does just that. It reads USB signals from my Arduino board which is connected to a IR receiver, and executes hotkeys that fits in Totem Media Player.

As an Arch Linux user it was a piece of cake to get Xautomation by downloading it from the AUR:

To use it, open a terminal and print:

xte --help

Then you will get a list of stuff that you can do with this piece of software, like:

xte "key a"
xte "str aAa"
xte "keydown Shift_L" "key a" "keyup Shift_L"
xte "mousermove 100 100"

To execute these commands from a Python 3 application, use this code:

import subprocess
subprocess.call(["xte", "key a"])

Tags: , , , , , , ,

Effektivare LinuxOn my local library I stumbled over a really nice book called Effektivare Linux – Kom Igång Med Kommandoraden (its Swedish title), which essentially is a printed and translated version of GNU/Linux Command-Line Tools Summary. I don’t know if it’s available as a book in English, but it’s at least readable on their website since it’s licensed under GNU GPL.

I think it’s an excellent book for everybody who wants to learn how to use the command-line/terminal. Because it goes through 250 (170 in my revision from 2008) useful and common commands that will bring joy to your life. I have only read half the book so far, but I have already learn a lot of commands that may be useful in the future. I don’t think that I will remember every command mentioned in the book, but I think it’s good to at least know what is available, so can I look it up (on Internet) when I need it.

Links:

Tags: , , , , , , ,

« Older entries