Categories
Linux

LibreOffice 4.0.3 on Debian 7 Wheezy

Debian Wheezy ships with Libreoffice 3.5.4 out of the box. However the newest version 4.0.3 offers numerous improvements over the previous version such as improved start up time etc.
Fortunately wheezy backports offer a way to install version 4.0.3 without “upgrading” your installation from stable to testing or even unstable.

Add the backports repository on Debian Wheezy:

$ sudo su  

# echo 'deb http://ftp.debian.org/debian/ wheezy-backports main contrib non-free' >> /etc/apt/sources.list

# echo 'deb-src http://ftp.debian.org/debian/ wheezy-backports main contrib non-free' >> /etc/apt/sources.list

Update package information:


# apt-get update

Install LibreOffice from backports repository


# apt-get -t wheezy-backports install libreoffice
Categories
Linux

Compile 3.9 Kernel on Debian 7 Wheezy for Lenovo X230

Reason for compiling your own kernel

Debian Wheezy out of the box installs the Linux 3.2 kernel which was released back in January 2012. The 3.2 kernel is marked as longterm by the kernel team and will be supported until 2016. That’s probably the reason why Debian chose to release Wheezy with the 3.2 Kernel. However most newer hardware (released after January 2012) will not properly be supported by this kernel. The Intel HD4000 graphics chip in my Lenovo X230 suffers from lock-ups while using the 3.2 kernel. These problems were fixed in the 3.4 kernel (Intel provided a new graphics chip driver). The following commands will compile and install the latest available kernel from kernel.org (v. 3.9.4 at the time of writing)

Prerequisites

The following packages are needed to compile your kernel

$ sudo apt-get install kernel-package fakeroot build-essential ncurses-dev

Download the new kernel from www.kernel.org

(replace 3.9.4 with current version number)

$ wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.9.4.tar.bz2

Extract the archive and cd into it

$ tar xvf linux-3.9.4.tar.bz2
$ cd linux-3.9.4/

Compile the kernel

Base the kernel config on your current configuration

$ cat /boot/config-`uname -r`>.config
## OR (depending on your current kernel)
$ cat /boot/config-3.2.0-4-amd64 > .config

$ make oldconfig

Remark: you’ll be asked quite a lot of questions (newer kernel contain more options and tweaks). If in doubt, choose the default answer.

Create the kernel related debian packages

$ make-kpkg clean

Compile the kernel

$ sudo time fakeroot make-kpkg -j4 --initrd kernel_image kernel_headers

replace 4 with the amount of available cpu-cores

Install the new kernel

$ sudo dpkg -i ../linux-image-3.9.4_3.9.4-10.00.Custom_amd64.deb ../linux-headers-3.9.4_3.9.4-10.00.Custom_amd64.deb

Reboot and select the new kernel in grub

Categories
Android

Android / WebOS Dualboot on HP Touchpad

A “friend” of mine asked me if I could fix his HP Touchpad. It was stuck in an endless bootloop after he had tried to flash an Android r,om. He didn’t provide me any detalis regarding what he had done and what tools he used to flash android , moboot (bootloader for dual booting webos and android) and various other things. Moboot presented me 5 different options at the first boot-up:

  • Boot Web-OS
  • Boot Android
  • Boot WebOS Recovery
  • Boot TWRP-Recovery

WebOS and TWRP-Recovery were the only working options. Everything else resulted in a bootloop.

In situations where the previously applied procedures are unknown it’s always the best to start from scratch. That meant:

  1. restore the touchpad to its original state (WebOS only)
  2. install twrp-recovery and moboot
  3. flash android

First road-block: restoring the touchpad

Trying to restore the Touchpad with WebOSDoctor always falied at 8%. It turns out that the usb-storage somehow got completely corrupted. Source

In order to restore the usb storage completely (in case the sdcard cannot be mounted as the underlying lvm has been destroyed) the physical volume needs to be recreated

Preqrequisites
  • Novacom
  • Novaterm
  • Recovery image
  • WebOS Doctor v.3.0.0
  • WebOS Doctor v.3.0.5 (optional)
Initial Setup
  1. Install Novacom driver and extract novaterm to novacom’s install folder
  2. Open a command prompt and navigate to your Palm, Inc folder (usually \Program Flies\Palm, Inc)
  3. Move the recovery uImage to the Palm, Inc folder.
  4. Boot your Touchpad into recovery (Power + Volume Up from power off)
  5. In that command prompt, run
    novacom boot mem:// < nova-installer-image-topaz.uImage
  6. Once running, the HP logo will appear on the touchpad. Now you should be able to connect to the touchpad with novaterm
    Touchpad in recovery mode
  7. A prompt starting with:

    root@webOS device

    should appear

  8. Run the following commands in ORDER
    (!Important!: they are case sensitive)
     #completely erase the lvm and recreate the physical volumes

    dd if=/dev/zero of=/dev/mmcblk0p14 bs=1024 count=1000
    lvm.static pvcreate /dev/mmcblk0p14

    #For 32GB Touchpads only

    lvm.static vgscan --ignorelockingfailure
    lvm.static vgchange -ay --ignorelockingfailure
    lvm.static vgremove store
    lvm.static vgscan --ignorelockingfailure
    lvm.static vgchange -ay --ignorelockingfailure
    lvm.static vgcreate -s 8M store /dev/mmcblk0p14
    lvm.static vgscan --ignorelockingfailure
    lvm.static vgchange -ay --ignorelockingfailure
    lvm.static lvcreate -l 71 -i 1 -M y --major 254 --minor 0 -n root store
    lvm.static lvcreate -l 8 -i 1 -M y --major 254 --minor 1 -n var store
    lvm.static lvcreate -l 2 -i 1 -M y --major 254 --minor 2 -n update store
    lvm.static lvcreate -l 3 -i 1 -M y --major 254 --minor 3 -n log store
    lvm.static lvcreate -l 32 -i 1 -M y --major 254 --minor 4 -n mojodb store
    lvm.static lvcreate -l 17 -i 1 -M y --major 254 --minor 5 -n filecache store
    lvm.static lvcreate -l 3523 -i 1 -M y --major 254 --minor 6 -n media store
    lvm.static lvcreate -l 64 -i 1 -M y --major 254 --minor 7 -n swap store
    lvm.static vgscan --ignorelockingfailure
    lvm.static vgchange -ay --ignorelockingfailure
    mkdosfs -f 1 -s 64 /dev/store/media

    #For 16GB Touchpads only

    lvm.static vgscan --ignorelockingfailure
    lvm.static vgchange -ay --ignorelockingfailure
    lvm.static vgremove store
    lvm.static vgscan --ignorelockingfailure
    lvm.static vgchange -ay --ignorelockingfailure
    lvm.static vgcreate -s 8M store /dev/mmcblk0p14
    lvm.static vgscan --ignorelockingfailure
    lvm.static vgchange -ay --ignorelockingfailure
    lvm.static lvcreate -l 71 -i 1 -M y --major 254 --minor 0 -n root store
    lvm.static lvcreate -l 8 -i 1 -M y --major 254 --minor 1 -n var store
    lvm.static lvcreate -l 2 -i 1 -M y --major 254 --minor 2 -n update store
    lvm.static lvcreate -l 3 -i 1 -M y --major 254 --minor 3 -n log store
    lvm.static lvcreate -l 32 -i 1 -M y --major 254 --minor 4 -n mojodb store
    lvm.static lvcreate -l 17 -i 1 -M y --major 254 --minor 5 -n filecache store
    lvm.static lvcreate -l 1618 -i 1 -M y --major 254 --minor 6 -n media store
    lvm.static lvcreate -l 64 -i 1 -M y --major 254 --minor 7 -n swap store
    lvm.static vgscan --ignorelockingfailure
    lvm.static vgchange -ay --ignorelockingfailure
    mkdosfs -f 1 -s 64 /dev/store/media

  9. When done, reboot the Touchpad into recovery (Power + Center/Home until the screen is off, then Power + Volume UP)
  10. Run WebOS Doctor 3.0.0 (this is to ensure a repartioning and no other version will work at this point)
  11. Optional steps to upgrade to WebOS 3.0.5

  12. When WebOS Doctor is complete, hold down Power + Center, and when the screen turns off, immediately hold power and Volume up to reboot into recovery again
  13. As soon as the USB icon appears again, run WebOS Doctor 3.0.5
  14. WebOS Doctor will automatically reboot your Device and after a while the following screen should appear (remark: the first boot-up can take quite a while)

Flashing Multi-Boot Loader & Android

Preparing the files
  1. Download the following CM-10 Package: Cyanogenmod 10 Jelly Bean (CM10-2013/04/18) cminstall package and extract it
  2. Attach the HP Touchpad with your PC with the usb cable and place it into MTP – Mode
  3. Transfer the extracted “cminstall” folder into the internal storage (e.g. /sdcard/cminstall) of your HP Touchpad
    Make sure that the folder is called cminstall
Installation
  1. As soon as the files are on the HP Touchpad, reboot the Touchpad into WebOS Recovery (USB – Mode)
    First disconnect the usb cable from PC (windows: green icon to eject the external drive)
    In WebOS reboot the device:
    –> Settings –> Device Info –> Reset Options –> Restart
  2. As soon as the screen goes dark: Hold down the volume up button until you enter the WebOS Recovery mode (in case you miss it, reboot and try again)
  3. On your PC:
  4. Open a command prompt and change to the “Palm Inc.” directory in “Program Files”
    cd "c:\Program Files\Palm. Inc\"
  5. Start the acmeinstaller to install cm10:
    novacom.exe boot mem:// 
  6. While Cyanogenmod is istalling you will see lines of text scrolling on the HP Touchpad informing you about the current operation the installer is performing.
    Once this is completed the Touchpad will automatically reboot and you will be greeted by the moboot bootloader menu and Cyanogenmod will automatically boot for the first time.

    Remark: to switch between WebOS and Android, reboot the device and press volume up button as soon as the moboot screen appears (to interrupt the automatic timeout) and select the OS you would like to boot.
Categories
OSX

Remove Applications from Location Services in Security & Privacy on OS X 10.8

After removing an application in OSX 10.8 it still showed up in location services under the security and privacy settings in system preferences. (see picture below)
The reason is that it saves the entries in a binary plist file. You could delete the file and OSX will automatically recreate it. However you would have to re-authorize all the apps that you previously had authorized.
The following process shows how to edit the file and just remove the single application.

Preparation

1. Start terminal and then sudo to a root shell

sudo -s

2. Navigate to /var/db/locationd

 cd /var/db/locationd

3. Make a backup of the clients.plist file

cp -p clients.plist clients.plist.save

4. The plist file is in binary format and to make it editable/readable you need to convert it to xml

plutil -convert xml1 clients.plist

Edit the file

5. Use vi (vim) to edit the clients.plist file and remove the application

vi clients.plist

6. The file will likely contain many application entries. Here is the format of a single application entry (Safari in this case). The entire entry needs to be deleted. (dd for deleting complete lines in vi)

com.apple.Safari  

Authorized

BundleId
com.apple.Safari
Executable
/Applications/Safari.app/Contents/MacOS/Safari
LocationTimeStopped
376348187.80421197
Registered
/Applications/Safari.app/Contents/MacOS/Safari
RequirementString
identifier "com.apple.Safari" and anchor apple
Whitelisted


7. Convert the clients.plist file back to binary format

plutil -convert binary1 clients.plist

8. Restart locationd daemon by force-killing it. Launchd will automatically restart the daemon

killall locationd

In case things go badly, then copy back the original file and restart locationd

cp -p clients.plist.save clients.plist
killall locationd

This should remove the invalid entries from the security and privacy tab in system preferences.