1. Examine /boot/grub/grub.cfg to find out the boot order of your multiboot system or just remember the order of your boot options as they appear during boot.l Count which one is windows (counting is 0-based, i.e. the default boot option is 0, next one is 1, etc). 2. Edit /etc/default/grub. You need to be logged […]
how to
Howto remove/enable/disable/use a yum or RPM repo
The yum repos are described in files which are stored in /etc/yum.repos.d/ . So if you want to remove a yum repo you just gotta go to that dir and remove the file in question. It’s more or less obvious why one would want to add a new repo (to get stuff from it!) but […]
How to map enum to strings in C
How can we map the enum values to strings in the C programing language? Often times you need to display a C enum as a string, most often when debugging or handling error conditions. Typical techiques involve usually: a) defining an array of strings (the strings being the enum names of course, and the string […]
How to uninstall the old kernels in Ubuntu (and grub)
How can we remove the unused linux kernels and at the same time have our boot configuration (grub’s entries in the grub cfg menu) updated? First we want to list all the kernel-related packages, like linux-image and linux-headers, linux-generic, etc: $ dpkg -l linux-* On my 10.04 Ubuntu system the above command results in the […]
HowTo: Listing (changed/untracked) files in git
When working with git it may often be convenient to get a (pure) list of files to give to some other command (e.g. astyle). This may be implemented as a trigger on the server but that has its pros and cons. Listing the modified files and processing them locally is the safest way as this […]
How do I add a new RPM/yum repo in Fedora
To enable a new RPM (yum) repository add a new .repo file for it under /etc/yum.repos.d. For example, to add a repository to install google’s Chrome browser add a file (e.g. google.repo) in the /etc/yum.repos.d directory and copy the following into it: [google-chrome] name=google-chrome – 64-bit baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64 enabled=1 gpgcheck=1 gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub You may also append the […]
Embedding resources in netbeans (Java JAR files)
Suppose you want to add some images to your JAR Java application. This has several advantages such as security, portability, conveninece for you and your users (don’t need to copy around several files – everything is nicely packaged and embedded into one JAR file). How can we embed the resources into the app (the .jar)? […]
How to change my terminal prompt (PS1)
On newer distributions you can easily change your terminal prompt, (which is controlled by the PS1 environment variable, btw) by adding a file with the prompt format string to the /etc/profile.d directory. You may name the file whatever you like, e.g. set-prompt.sh, but make sure that inside it there is a line that sets PS1 […]
How to create a brand new git tracking branch (from scratch)?
There’s tons of advice on the web on how to setup a new local branch that tracks and existing remote branch. But what I was looking to do is create a brand new branch (i.e. not yet present neither on hte server nor on your workstation) and have it be a tracking branch. After lots […]
Remove XFCE global shortcuts (e.g. Ctrl-F4)
This was something which I found to be quite annoying on the Xfce Desktop Environment version 4 (4.4.3), it probably is the same for some other Xfce versions too… The XFCE Window Manager defines the so called global Window shortcuts, meaning that when this key-combo shortcut is pressed, no matter where (from which application), the […]