How to convert and burn a .dmg (Mac OSX) disk image on Linux

Today I wanted to burn a .dmg file, but I didn’t have an Apple computer available. So, running Linux I started to google for a solution, and found one.

You need to download the dmg2img tool from http://vu1tur.eu.org/tools/, and then compile it. I had to install libbz2-dev and libssl-dev packages and of course the compiler suite (I installed the build-essential package). On Ubuntu you can easily install the dmg2img package from repository with sudo apt-get install dmg2img.

Run the dmg2img tool to convert the .dmg file:
dmg2img -i file.dmg -o file.img

Next we want to mount the .img file, but make sure you’ve got hfsplus tools installed.

Let’s mount the .img file on a loopback device: sudo mount -o loop file.img /mnt

The content of the image file is now available, so we can copy/use the files or burn an ISO image. Something like ‘cd /mnt && genisofs -o $HOME/file.iso .‘ should do the trick.

  • Share/Bookmark
Posted in Linux & Unix, OSX | Tagged , , , | Leave a comment

No 64bit flash player for Linux

I’m not sure whether this is good or bad… but Adobe has removed it’s 64bit flash player for Linux (not sure about other platforms). This means no flash-content for me, running Debian Squeeze amd64. The alternatives are .. not existing?  The gnash player (which has a Mozilla plugin) is useless for everything but movies and will crash and hog the system.  I miss the option to watch the occasional funny flash-based movie, but apart form that, I really like missing flash :) Most commercials are gone, websites loads faster, and so on.

  • Share/Bookmark
Posted in Blog, Linux & Unix | Tagged | Leave a comment

LVM Extend HOWTO

Just a quick ‘howto extend an existing logical volume’ on a Linux box.

You will of course start by adding a new disk to the server. If this can be done online, you will need to run scsiadd -s to scan for new devices. Verify that the new disk is seen by the system and write down the device name.

Partition the new disk (/dev/sdc in this example)

fdisk /dev/sdc
# > 0 create a new empty DOS partition table
# > n add a new partition
# > p make it primary
# > 1 first primary partition
# > default use pre-selected value
# > default use pre-selected value
# > t change partition type
# > 8e make it a LVM partition
# > w write changes to disk

Initialize the filesystem for LVM

pvcreate /dev/sdc1

Extend existing volume group (named debian in this example)

We will add the device we just prepared to our existing volume group. You can use the vgdisplay command to display the volumegroups.

vgextend debian /dev/sdc1

Extend the logical volume (/dev/debian/root in this example) with 20G

Running vgdisplay will display allocated and free space of the volumegroup. We are going to use free space to grow the logical volume. To get a list of logical volumes run lvdisplay

lvextend -L+20G /dev/debian/root

Resize the filesystem

The last thing we need is to resize the filesystem. This will work with ext3/ext4/xfs and some other filesystems. You need to check this. Some support online resize, others must be unmounted. We will resize an ext3 filesystem, which can be done online… yearh!

e2resize /dev/debian/root

  • Share/Bookmark
Posted in Linux & Unix | Tagged , , | Leave a comment

Debian Squeeze network-manager offline problem

Today I replaced my Ubuntu 10.04 desktop with Debian Squeeze (frozen testing). Installation went smooth, beside two small problems. I could not select Danish locale. I had to select ‘C’ as locale, and later on select DK keyboard layout. I also ended up with two kernels installed. The first would not boot (called -trunk), but removing it fixed that problem.

All fine from here I started configuring my desktop. This is mostly my email, so no big deal I thought. After adding my email accounts to Evolution it never refreshed the accounts and told me that it was working ‘offline’. Strange.. dropbox was working and I had all the network access I wanted elsewhere. Initially I thought that it could be an Evolution bug until I noticed the same problem with Empathy. Hmmm… The network-manager icon was grayed out and there was no connections configured, which I thought would be okay. But apparently some apps uses the network status from network-manager to determine online/offline mode. I had to comment out the eth0 lines from /etc/network/interfaces and run ‘/etc/init.d/network-manager restart‘ before the connection was detected. And suddenly both apps went online :)

  • Share/Bookmark
Posted in Linux & Unix | Tagged , , , | Leave a comment

Android 2.2 Froyo (DeVillain 1.0 ) på min HTC Desire

Jeg rootede min fine nye HTC Desire i sidste uge, med hjælp fra denne guideandroiden.dk. I dag så jeg, at VillainROM havde frigivet en 2.2 ROM til Desire, så den skulle selvfølgelig testes. Jeg har længe kørt med forskellige uofficielle roms på min HTC Hero og har været meget glad for dem. Selv efter at HTC frigav deres længe ventede 2.1 ROM til Hero, har jeg beholdt Villain’s 2.1 rootede ROM på den.

Indtil videre kører den nye DeVillain ROM fint på Desire’en, og alt ser ud til at virke. Jeg føler dog ikke at den er hutigere end den originale 2.1 ROM fra HTC, men jeg har ikke afprøvet spil og den slags endnu. Måske fordi jeg ikke har vænnet mig til hvor meget hurtigere Desire er i forhold til Hero :)

  • Share/Bookmark
Posted in Android, Teknik | Tagged , , , , , | 5 Comments

Use 3g USB modem for Internet connection with wvdial

My home dsl router broke yesterday, so I had to figure out how to get online again. Luckily I have my free-data 3g modem (from 3.dk), which works great from Ubuntu (network-manager). This is great for one computer at a time, but not for my entire home network. I searched and found exactly what I was looking for at Hanne’s blog post, which describes how to use wvdial to connect with the usb-modem. Everything below is taken from her post;

Content of wvdial.conf

[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
; Phone =
ISDN = 0
; Username =
Init1 = ATZ
; Password =
Modem = /dev/ttyUSB0
Baud = 9600

[Dialer pin]
Modem = /dev/ttyUSB0
Init1 = AT+CPIN=**** <- this is really my pin code

[Dialer hsdpa]
New PPPD = yes
Phone = *99#
Username = irrelevant
Password = irrelevant
Stupid Mode = 1
Dial Command = ATDT
Modem = /dev/ttyUSB0
Baud = 460800
Init2 = ATZ
Init3 = ATE0V1&D2&C1S0=0+IFC=2,2
ISDN = 0
Modem Type = Analog Modem
Init5 = AT+CGDCONT=1,"IP","data.tre.dk"

Options goes to /etc/ppp/options

lock
lcp-max-configure 10
mru 1440
nobsdcomp
nodeflate
nopredictor1
novjccomp
nomppe
usepeerdns

And how to dial

#!/bin/sh
sudo /etc/init.d/network stop
sudo wvdial pin >/dev/null 2>&1
sleep 5
sudo wvdial hsdpa

I have no PIN code setup on my 3g modem, so I just had to execute vwvdial hsdpa.

  • Share/Bookmark
Posted in Linux & Unix | Tagged , , , , , | Leave a comment

OSX Leopard 10.5.6 In VirtualBox On Linux

I have been wanting to do this for a long time; Running OS X emulated on my Linux workstation. Mostly for testing, compiling, trying out things. When someone calls and wants help setting up his Mail.app, it is very useful for me to see how the menus, etc. look. Found an iPC 10.5.6 iso that installed in latest VirtualBox without any problems at all.
OSX inside VirtualBox on Ubuntu iTunes detecting iPhone.

Found the .iso here.

  • Share/Bookmark
Posted in Linux & Unix, OSX | Leave a comment

Ubuntu 10.04 on iBook G4

Just installed the latest Ubuntu (10.04 LTS) on an old iBook G4 (1.4 Ghz, 1Gb Memory) and everything worked out of the box :) It feels alot faster than OSX :) Not sure if I’m gonna keep it running Linux or re-install Leopard.

Ubuntu 1004 on iBook G4

  • Share/Bookmark
Posted in Linux & Unix | Leave a comment

How to save (a little) space on Windows Servers

On our virtual Windows servers, there is really no need for hibernation, so why not disable it. This will free up the space of the hibernation file, which will be the same size as the memory installed. Run in cmd.exe as Administrator:

powercfg -h off

Windows keeps shadow copy and assembly caches in c:\windows\winsxs and the folder will grow to 10Gb and more. To limit this, run the following command as Administror in cmd.exe


vssadmin resize shadowstorage /for=C: /on=C: /maxsize=2GB

  • Share/Bookmark
Posted in Windows | Leave a comment

VirtualBox – Expand VDI

Min virtuelle Windows 7 på 12GB kunne ikke rigtigt være med, når jeg skulle køre iTunes og synke musik. GUI værktøjet understøtter ikke disk-expansion og der er ikke meget hjælp at hente i VirtualBox FAQ’en. Jeg faldt heldigvis over denne artikkel, som beskriver problemet og løsningen :)

Helt basalt går det ud på at lave en ny disk (på den ønskede størrelse),

VBoxManage createhd --filename new_disk.vdi --size 102400 --remember

herefter kloner vi den gamle disk over i den nye,

VBoxManage clonehd old_disk.vdi new_disk.vdi --existing

nu tilføjer vi den nye disk (istedet for den gamle) til den virtuelle maskine og booter en CDROM med f.eks. gparted og udvider partitionen. Husk at ntfsprogs skal være installeret. Herefter er den klar til at boote Windows igen. Jeg måtte starte på Windows 7 CDROM’en og vælge ‘repair’ før jeg kunne boote den nye disk.

Her er lidt yderligere information om emnet.

  • Share/Bookmark
Posted in Windows | Leave a comment