Category Archives: Uncategorized

How to install Ubuntu 14.04 on an old Macbook 2.1 EFI.

UPDATE on 13/3/2015: this instruction method is no longer valid for newer Ubuntu versions > 14.04 (e.g. 14.10)! I will write a follow up soon on this you can find here. There are lots of instructions and tutorials out there on how to install Ubuntu on Mac computers. Most dont work as stated (mostly because it is not easy to make a bootable ubuntu usb boot stick with a mac), so I wrote this tutorial which I think is the most easy one out there!

This post is basically just a short reminder for myself on how to install Ubuntu 14.04 on Macbook 2.1 EFI. Maybe it is useful for other people as well.

Requirement/Prequesites:

Macbook with Mac Os X >=10.6, the full harddisk is occupied by Mac Os X.

1. start Mac Os X, open Disk utility, shrink Mac Os X partition so much that you can create another two partitions, one for Linux root with at least 30 gb and another one for swap, rule of thumb: available RAM memory equals two. For me it was 2 gb * 2 = 4 gb. Choose Mac Os X journaling as filesystem for the new two partitions.
2. After partitioning you should now have three partitions, my setup was 65 gb total (SSD): 30 gb for Mac Os X, 30 gb for Linux (root paritions), 4 gb for the swap partition
3. Install rEFIt, power off computer (do not just restart) to see if rEFIt logo is booting up, if not try again powering off.
4. Boot back into Mac Os X and download Ubuntu 14.04 64 bit AMD for Mac ISO
5. download ISO2USB-Efi-Loader and prepare an USB stick with the ISO from step 3 (details here: here (in german) use the boot64bit efi file on the stick. Use google translate if you cannot understand German.
6. reboot and use the Mac ´ALT´ key during startup and choose the usb-efi stick
7. install ubuntu, choose ´something else´ as the installation type, then use the linux root partition from step 1. (mine is called /dev/sda4) and format it as ext4 and select root (/). Also define the swap partition from step 1. Most importantly in this step is to select the root parititon for the boot loader (e.g. /dev/sda4) but never NEVER use the whole disk for installation of it!!! (never use the full disk e.g. /dev/sda use a partition e.g. /dev/sda4)
8. at the end of the installation the installer says it cant install the bootloader at /dev/sda4, click on ´ignore this and continue installation´ (dont install on /dev/sda – the full disk etc.)
9. after successfully install ubuntu, click on ´test live system´
10. prepare a boot-repair-disk on your usb stick, install boot-repair as stated here (on a usb stick!, you can download the iso and use it similar to step 5 here), reboot and start the stick than click on ´Recommended repair´
11. done! reboot. now a tux symbol will appear at the rEFIt boot menue. Click on it to start ubuntu!

How to debug Linux Init Scripts (in Ubuntu) which fail at bootime

How to debug Linux Init Scripts (Ubuntu).

Often you have the problem that you hacked an init script or have to modify an existing one which will work whenever you manually start it but the process seems not be there after rebooting.

The problem is that your system is not in normal “user mode” during bootime but uses a slim version of your system. For example in most cases for me it is always that my script relies on environment variables such those I usally set in /etc/environment which are loaded after executing the init scripts.

But here is my actual troubleshooting for init scripts which dont work at bootime (manually executing often works):

1) you havent set up any runlevels for your script (solution: update-rc.d)

2) you havent made them executable (solution: chmod +x)

3) your script relies on environment variables which are not set at this stage of bootime

4) your script also does not work at manually running – this meens you have general problems with it – script ERRORS -use bashdb tool

So what to do if it does not run at bootime but runs manually?

Answer: simulate a bootime environment. You can do this by using the env command [1]



cd /

env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" /etc/init.d/daemon start



this simulates the absolut exact situation which are at boottime!!!!

But often if you run modern scripts it does not output anything also you run it in a bootime-like environment.

So what I usally do I use the bashdebugger bashdb tool [2]. In Ubuntu it is easy to install because it is in the repository under “bashdb”.

So now I run the full thing like



cd /

env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" bashdb /etc/init.d/daemon start



and it works like a charme to see whats going on.

Often now I can trace down errors but in some cases it was not possible to get the errornous output. Often this is because the error lies in lines which contain the “start-stop-daemon” program which often modern init scripts rely on. But a solution is near [3]. Just single step to the line in bashdb which contains the start-stop-daemon execution and print it out in the shell e.g. the line is called:



"start-stop-daemon -S -p/var/run/jetty.pid -cjetty -d/path/to/solr -b -m -a /usr/bin/java -- -Dsolr.solr.home=/path/to/solr/solr -Djetty.logs=/path/to/solr/logs -Djetty.home=/path/to/solr -Djava.io.tmpdir=/tmp -jar /path/to/solr/start.jar --daemon"



so in bashdb i hop to the line, hold on at there and use the command “x” :



x start-stop-daemon -S -p"$JETTY_PID" $CH_USER -d"$JETTY_HOME" -b -m -a "$JAVA" -- "${RUN_ARGS[@]}" --daemon



and it will print me out the translated string code:



sudo start-stop-daemon -S -p/var/run/jetty.pid -cjetty -d/path/to/solr -v -b -m -a /usr/bin/java -- -Dsolr.solr.home=/path/to/solr/solr -Djetty.logs=/path/to/solr/logs -Djetty.home=/path/to/solr -Djava.io.tmpdir=/tmp -jar /path/to/solr/start.jar --daemon



so I usally just execut this line then in the shell but often I cannot see any output again:-(. But using this blogpost here [3] I see that I have to get rid of the -b parameter in order to see the output.



sudo start-stop-daemon -S -p/var/run/jetty.pid -cjetty -d/path/to/solr -v -m -a /usr/bin/java -- -Dsolr.solr.home=/path/to/solr/solr -Djetty.logs=/path/to/solr/logs -Djetty.home=/path/to/solr -Djava.io.tmpdir=/tmp -jar /path/to/solr/start.jar --daemon



So in my case the JAVA_HOME was set in /etc/environment but could not be seen by this script so it did not know where JAVA_HOME was. So I putted the JAVA_HOME path in the top of the init script and everything worked fine then.

[1] http://stackoverflow.com/questions/1421607/erlang-daemon-init-d-script-fails-to-start

[2] http://bashdb.sourceforge.net/

[3] http://greenash.net.au/thoughts/2011/02/solr-jetty-and-daemons-debugging-jettysh/

Using Joomla and the Strato website provider

Today I had the problem that I had to alter my php.ini because the joomla pony gallery plugin needed extra memory when generating thumbnails and the strato memory size was too low for processing.

So I did some research and found out that Strato allows own php.ini files which can overwrite their values. Problem was only that I could not get my own php.ini to work with the website or backend, I got a lot of internal server failures. So I did some research again and here are the correct settings to use own customized .htaccess and php.ini:

create a .htaccess in your root dir :

Directoryindex index.php , index.htm, index.html
AddType application/x-httpd-php5 .php .php4 .php3 .php5

next create a php.ini in your root dir and in your administrator dir where you now do what you like and it actually will work:

register_globals = Off
safe_mode = Off
memory_limit = 16M
upload_max_filesize = 10M
max_execution_time = 30
max_input_time = 60

so have phun with this!!

Using VPN in Ubuntu 7.10

Today I tried to get a VPN connection to my university to work.

So first I tried to make the connection over ubuntu’s network manager using the vpn-plugins.
Therefore I installed the plugins described in the ubuntuusers wiki:

  • network-manager-pptp

  • network-manager-openvpn

  • network-manager-vpnc

After I installed and configured everything and loading my universities config file the whole network manager crashed when I tried to connect to the vpn-network. Looking into /var/log/syslog I recognised something:

Jan 27 14:29:36 xxx NetworkManager: file nm-vpn-service.c: line 475 (nm_vpn_service_stage3_connect_cb): assertion failed: (service != NULL)

O.k. googling some time I find out this is a unresolved bug.

So okay then what next??

Next thing I did was trying to install cisco-vpn-client. Trying to compile it failed with a lot of compile errors
/xxx/vpnclient/linuxcniapi.c: In Funktion »CniInjectReceive«:

Fehler: »struct sk_buff« hat kein Element namens »nh«


Ok, after searching the internet again I found out that Cisco doesn’t update this package with every kernel release.
There are some sites out there which offering patches but I thought to myself that I would not install bugfixes to vpn software out of security reasons from private non-offical sites.

So, okay what then.
Then I found out about vpnc terminal client.
So I installed it via apt and ran it.
After playing around some times I found out that I need to convert my universities pcf file to a fileformat (.conf) which can be read by vpnc.
This can be made with a conversation tool provided by the vpnc packet under:
/usr/share/vpnc/pcf2conf

So after I converted this everything works fine. So forget about other solutions vpnc works perfectly.

have a great time
Oli

Ubuntu 7.10 (Gutsy Gibbon) Live CD Intel Pro/Wireless 2200 Acer Travelmate 292 radio off problem

Hi everybody,

Yesterday a friend of mine asked me if I could look over his problems with the
new Ubuntu Gutsy Gibbon Live CD (7.10) release regarding the not working
Intel Pro/Wireless 2200 wlan card.
His laptop is an Acer Travelmate 292 and I think it is a notebook specific problem but after I saw that a lot of other people with other laptop brands have the same problems I think this could be interesting for those too.

After booting the Ubuntu live cd could detect and install the modules for this wlan network adapter correctly
and everything under “dmesg | grep ipw2200 ” looked fine but I couldn’t see any access points although we were in the near of one.

When I looked under “iwlist scan” I saw an interesting
eth1 radio off ESSID:””
line.

So what did this meant? After searching mainly english sites I became aware that this was an common problem without any real solution.
But then I found the solution under the second german hit on google click
so I will explain it in english that hopefully a lot of people can profit from it.

radio” is the status of your laptops’ wireless radio switches, a lot of laptops have those hardware switches to power the wlan card on / off manually. This Acer Laptop model we worked one had an hardware switch on the left side but neither on nor off position changed the situation so it isn’t supported it by default.

In the case of the Intel Pro/Wireless 2200 we have a hardware switch which isn’t supported by the Live CD’s kernel automatically although the correct driver module “ipw2200” was loaded.

So what we have to do is to trigger the card on by software instead of really triggering on by hardware. This is done with the kernel module “Acer Hotkeys” (acerhk kernel module) which means this module can trigger the wlans hardware state on or off.

To do this there is this site CLICK where you can get special parameter settings for the acerhk module for a lot of different acer laptop models:

for our acer model (Travelmate 292) it is :

modprobe acerhk force_series=290 usedritek=1 verbose=1   (loads the kernel module)
echo 1 > /proc/driver/acerhk/wirelessled (powers the hardware really on)

there are a lot of other laptop brands on that site too: Acer,Asus,BenQ,Dell, HP,Samsung, Sony so have a look.

So after doing this “iwlist scan” showed all near access points correctly and could be connected too.

So with this little fix you have a real good Live CD linux with full wlan support on Acer Travelmate 292.

Loading the acerhk (Acer Hotkey) kernel module as shown above is only needed
if you power off your laptop so if you just reboot while the lapton is on you have not to make this again unless you power it manually off with:

echo 0 > /proc/driver/acerhk/wirelessled (switches it on)

have phun