Grub timeout doesn’t work sometimes

Problem
In the Grub menu you can use a countdown mechanism. However, sometimes it doesn’t work and you have to press Enter manually.

I figured out that this happens when my machine was not shut down normally. Sometimes my machine doesn’t halt and I need to press the power button manually. At the next boot the timeout is gone in my grub menu.

Solution
When the machine was stopped abnormally, a “recordfail timeout” will be used. So simply add the following line to “/etc/default/grub“:

GRUB_RECORDFAIL_TIMEOUT=7

My “grub” file looks like this:

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=7
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="acpi=noirq splash"
GRUB_CMDLINE_LINUX=""

GRUB_RECORDFAIL_TIMEOUT=7

After editing don’t forget to run “update-grub“.

Tip from here.

Categories: ubuntu Tags: , , ,

Make sudo ask for your password every time

Problem
When you use “sudo“, it remembers your password for some minutes, thus if you call “sudo” within this time frame again, it won’t ask your password.

However, I want “sudo” to ask my password every time I call it.

Solution
Execute the command “sudo visudo” and add the following line to the end of the “Defaults” block:

Defaults    timestamp_timeout=0

The value “0” means it won’t cache your password.

Tip from here.

Categories: ubuntu Tags: ,

fartscroll.js: funniest JavaScript code ever

Everyone farts. And now your web pages can too.

Check out fartscroll.js in action.

Categories: fun, web Tags: , ,

Seven Languages in Seven Weeks

naIf you are a programmer and you want to expand your horizon, the book “Seven Languages in Seven Weeks” by Bruce Tate can be an interesting read.

Languages covered in the book: Ruby, Io, Prolog, Scala, Erlang, Clojure and Haskell.

Links

Categories: programming, book Tags: , , , , , ,

Become a Reddit power user

Goal
You want to become a Reddit power user.

Tip
Install the Reddit Enhancement Suite Firefox add-on. The result will be a Reddit on steroids :)

Links

Categories: firefox Tags: , ,

Force XMind to use Java 7

April 30, 2013 Leave a comment

XMind is the world’s coolest mind mapping software, the best way to brainstorm, the most efficient solution for saving your time, and powering your company.” (source)

Maybe it’s not the best but I like it :) And it has a free version, which is perfect for my needs.

Problem
I prefer to use the official Java version that I download directly from Oracle. However, I noticed that XMind tends to use some older versions of Java (OpenJDK, etc.). How to tell XMind which Java to use?

After starting XMind, you can verify which Java it uses. Go to: Help -> About XMind, and click on the button Installation Details. Finally choose the tab Configuration. Here find the line “-vm” and check its value in the next line. This is the virtual machine XMind has found.

Solution
Edit xmind.ini and add this line to the top:

-vm
/opt/java/bin/java

In my case “/opt/java/bin/java -version” produces the following output:

java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
Categories: java Tags:

After waking up from suspend, the keyboard doesn’t work properly

April 29, 2013 4 comments

Problem
This is not specific to Ubuntu 13.04; I had this problem before too. That is, after waking up the machine from a suspend, the keyboard doesn’t work properly. Not all key presses are accepted, only about 70% of them. Hitting the keys stronger helps but I don’t want to break the keyboard :)

Solution
I’ve found a stupid workaround but it works :) It’s a USB keyboard and pulling out the cable and reconnecting it fixes the issue. If someone has a more elegant solution, please tell me.

Follow

Get every new post delivered to your Inbox.

Join 42 other followers