Aside

Things to do on a linux machine

There are several things that I need to do on a monthly or yearly basis on my laptop in order to fix some problems. So far, I googled the problem and tried the solutions one by one, until I reached the one that worked. Imagining it could be a year till I faced that problem again, I wouldn’t remember which one finally worked. So, I started making a log of these problems and the solutions that worked for me. The problem is, if I keep them offline, I’ll eventually loose them, or I won’t be able to find them among all the files. If I keep them online, I won’t remember what online note-taking tool I’ve used, and under what user. So I decided to make a draft file in my email and log each of them there. The gives me the benefit of searching it easily, and having them all online in one place. But then I need to log into my email each time to do so. So, I decided to make things easier for myself, and also for some other people that might end up in my blog searching for the same thing, to post them here. Here are a few for now:

  1. Installing sagemath has just got easier in ubuntu and fedora. Directly install it from the repositories. To open the notebook, in the terminal enter sage -notebook. To open it in a specific folder, for example in the dropbox, do this:
    sage -notebook -- directory=~/Dropbox/Math/Scripts/sage

    The weird thing is that there is a blank space between -- and directory! What this does is to create a folder called sage.sagenb in the folder Scripts, and then creates the home folder in there. If you have other folders that you want the worksheets from it, just copy the admin folder from the other home to the admin folder to this home. I think it has a problem with the access of reading and writing that it doesn’t let old folder to be used directly.
    I have to figure out how to open it in terminal in a specific folder. I used to do it before, but I can’t get the syntax right, now. Here are a couple of icons that I use for the launchers. The black one for the terminal, and the blue one for the notebook. I should change them to png files and clean out the corners!
    sageBsage

  2. There is this annoying bridge network that some app starts in my fedora, and I can’t figure out how to completely get rid of it. The bridge is called virbr0. To delete it first take it down then delete it:
    sudo ifconfig virbr0 down && brctl delbr virbr0
  3. Firefox has this problem with the outdated flash plugin. To solve it:
    1) exit Firefox
    2) delete this file: ~/.mozilla/firefox/*.default/pluginreg.dat
    3) restart Firefox and go to the Tools -> Add-ons -> PluginsUse this to locate all versions and delete all the mozilla ones and replace them by the original one: rpm -q flash-plugin
  4. To convert images to a multi-page pdf:
    convert -adjoin -page A4 *.jpeg multipage.pdf
  5. To cut a part of a video:
    ffmpeg -vcodec copy -acodec copy -i orginalfile -ss 00:01:30 -t 0:0:20 newfile

    Where 00:01:30 is the start time and 0:0:20 is the length of the video you want to cut out.

  6. Create a nifty overview of the hardware in your computer:
    lshw -html > hardware.html
  7. To find the 20 largest folders in hard drive:
    sudo du -xk | sort -n | tail -20
  8. And an easy to work with PDF annotator is okular. Unlike xournal it doesn’t rasterize the file.
  9. In order to write an iso file to a usb flash drive you can do it directly by running
    sudo dd if=ADDRESS_TO_THE_FILE.iso of=/dev/sdX bs=8M

    where sdX is the address of the mount point of the flash drive. You can get a list of all the drives by

    sudo fddisk -l

    There are several apps that do it for you, but I generally find this the easiest.

  10. And of course gnome shell is as annoying as osx and windows. So, here is how to add something to startup:
    create a file ~/.config/autostart/MYAPP.desktop and add the followings to it:

    [Desktop Entry]
    Version=1.0
    Name=NAME
    GenericName=NAME
    Comment=COMMENT
    Exec=THE_COMMAND_TO_RUN
    Terminal=true/false
    Type=Application
    

    That Version=1.0 is apparently very important! Alternatively, you could install gnome-tweak-tool and then use the options there.

  11. Fedy tool is a handy one.
  12. I can’t handle gnome shell, and gnome classic isn’t really classic. So to go back to good ol’ gnome I install mate desktop:
    sudo dnf install @mate-desktop
  13. And here is to get more familiar with dnf: http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management
  14. Once in mate, you can’t resist but to install the lovely friendly docky. Install it from the repositories. If you have tons of resources and like eye-candies, give cairo-dock a try:
    sudo rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
    sudo yum install cairo-dock*

    And yes, still yum since I don’t know how dnf installs a downloaded rpm package!

  15. An app for painting that sometimes comes handy is called mypaint.
  16. A nice dictionary app with on the fly word look up and offline database is artha.
  17. To take notes using a pen or to annotate pdf files using a pen I use xournal.
  18. To see the number of a key pressed use
    sudo showkey


I’ll add references as I find them later.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s