Archive

Archive for the ‘ubuntu’ Category

Launch gedit in the background

September 11, 2014 1 comment

Problem
Sometimes I use gedit but it is launched in the foreground, blocking my terminal. There are two ways to put it in the background: (1) Press CTRL+Z in the terminal, then send the job to the background with the command bg, or (2) launch gedit directly in the background with the “&” sign.

Neither of them is convenient. I often forget about it and I always end up in a blocked terminal. I just simply want to write “gedit” or “gedit ehh.txt“, and I want it to start in the background.

Solution
Create a script called “gedit” in your $HOME/bin directory with the following content:

/usr/bin/gedit "$@" &

Make it executable and make sure the directory $HOME/bin is in your PATH.

Categories: ubuntu, bash Tags: ,

Windows 8.1 with Linux

September 4, 2014 Leave a comment

I got a new laptop at my workplace, a Toshiba Satellite C55. I decided to put Windows 8.1 and Ubuntu 14.04 LTS on it.

Installation
I had a Windows 8.1 ISO but I didn’t want to burn it on a DVD. Instead, I put it on a USB stick. I found an excellent tool called Rufus that allows you to create a bootable USB stick from an ISO file. Here is a youtube video tutorial too.

When Windows 8.1 was installed, the next step was to install Ubuntu. Restarting Windows is tricky if you want to change the boot order: hold down the SHIFT key and select reboot while pressing the SHIFT. Upon reboot I had to press F12 to get to the boot order menu.

Installation of Ubuntu went flawlessly.

NTFS partitions cannot be mounted
Once I had a strange problem. Ubuntu started to complain that it cannot mount the Windows partitions. It turned out that Windows was hibernated and thus the NTFS paprtitions cannot be mounted in read/write mode. But why is it hibernated when I restarted Windows?

Well, another “cool feature” of Windows 8.1 is that you can power it off / restart it in two different ways! Option 1: right click on the Windows button in the bottom left corner and select halt / restart. This will do some hibernation, thus the next boot will be faster. Option 2: move the mouse to the bottom right corner, wait for the tiles to show up and halt / restart the machine there. It is a normal power off / reboot without any hidden hibernation.

So, if you use Linux with Windows 8.1 in dual boot, you’d better stop / restart Windows using Option 2 (on the right side).

my current Ubuntu wallpaper

July 11, 2014 Leave a comment

broken_windows-wallpaper-1920x1080

Categories: fun, ubuntu, windows Tags:

machine shuts down, then restarts in a few seconds

July 11, 2014 Leave a comment

Problem
My new desktop machine has a strange behaviour. It shuts down normally, but after a few seconds it restarts automatically.

Solution
I found the solution here. In short:

Edit the file “/etc/default/grub” and modify this line:

GRUB_CMDLINE_LINUX_DEFAULT="acpi=noirq quiet splash"

The new thing is the “acpi=noirq” part. Don’t forget to run “sudo update-grub” at the end.

It solved the problem but when I hit the SPACE button on the keyboard, the machine wakes up as if I had pressed the power button. Strange, but maybe it’s normal for new machines.

Categories: ubuntu Tags: , ,

open links in okular with Firefox

July 10, 2014 Leave a comment

Problem
You have a PDF that contains links. You click on a link but it opens in a strange browser (Konqueror?). How to open links with Firefox?

Solution

  1. Run the command “kcmshell4 filetypes“. File Associations – KDE Control Module will open.
  2. Search for html and select the file type text/html.
  3. Move the application name you want to be a default for html in the “Application Preference Order” to the top.

I copied this solution from here. Credits go to djhurio.

Categories: ubuntu Tags: , , ,

installing new fonts

Problem
You have a new font that you want to install system-wide. For instance, you copy some *.ttf fonts from a Windows machine (from C:\Windows\Fonts\) and you want to use them.

Solution
Install font-manager:

sudo apt-get install font-manager

With this software you can also browse your fonts. To install a new font, click on the Manage fonts icon in the bottom left corner next to the Save icon.

Tip from here.

Categories: ubuntu Tags: , ,

Remove Windows 8.1, then install Windows 7 and Ubuntu 14.04 in UEFI mode

Problem
I got a new desktop machine but it had Windows 8.1 preinstalled on it. What’s worse, it was a 32-bit version (on a 64-bit machine). I poked around a bit but I didn’t like it so I decided to put a good old Windows 7 on it with Ubuntu 14.04. It was afternoon…

Solution
It’s almost midnight and I got ready just a few minutes ago. Man, this UEFI thing made me suffer…

What I learned: if you install Windows 7 in UEFI mode, then install Ubuntu 14.04 in UEFI mode too! If you try to install Ubuntu in normal mode, you will have conflicts.

But what does it mean to start the installation in UEFI mode? It took me a while to figure out.

When you start the machine, you can press a button to enter the boot menu where you can select the device you want to boot from. In my case I got this info on my screen (green emphasis by me):

boot-menu

After pressing F11 (it may be a different button in your case), I got this screen:

boot-device

I had my Windows 7 on DVD and Ubuntu 14.04 on USB. Now, if you select option 1 (see the green numbers), then Windows 7 is started normally, while option 2 starts Windows 7 in UEFI mode. Similarly, option 3 starts Ubuntu normally, while option 4 starts it in UEFI mode. Once the installation is started, it cannot be changed later.

I had another problem. After several retries, I couldn’t install Windows 7. I got an error message that the selected disk is of GPT partition style. I found the fix for this problem here: http://www.youtube.com/watch?v=DQf9YqbD8WI. But be careful! This “fix” removes every partition from your hard drive. Do it only if you want to start with a clean sheet.

The fix above in short: when the screen with the “Start install” button appears, press Shift+F10 to open a terminal. Here start the command “diskpart”. Inside diskpart, run these commands:

list disk
select disk 0
clean

It will remove the GPT flag but it will also remove all the partitions!

Now, as I had a clean HDD, I installed Windows 7 first in UEFI mode (option 2 in the figure above).

After this I started the Ubuntu installation in UEFI mode too (option 4). This time I didn’t have any problem and I didn’t have to do any fancy settings with the disk partitioning. I created a swap partition and a root partition, then “start install”.

After a reboot I had a GRUB menu where I could start either Windows or Ubuntu.

Follow

Get every new post delivered to your Inbox.

Join 72 other followers