cue/flac file splitting

i received a lossless CD that was encoded in FLAC with a cue file. which means it’s one big file and since my old MP3 player does understand FLAC i still wasn’t able to play one song out of many because cue files aren’t supported.

here’s how you can split them into seperate files

install shntool and flac cli tools

sudo apt-get install shntool flac

then just use cat and shnsplit to split the file and create correct file names:

cat file.cue | shnsplit -o flac -t "%n-%t" file.flac

this will output the tracks as “tracknumber-trackname.flac”

if you also install vorbis-tools you can easily create ogg files almost the same way

cat file.cue | shnsplit -o "cust ext=ogg oggenc -q 6 -o %f -" -t "%n-%t" file.flac

(using a quality setting of 6)

and at last create the tags for the files like this

cuetag file.cue *.flac

or

cuetag file.cue *.ogg

respectively

multilang MIUI 6 Special Edition 4.4 for Xiaomi Mi 2/2S Flashing via Linux

for everybody that owns a Xiaomi Mi2S and doesn’t have access to a windows box and the MiPhone flash tool, flashing the kitkat miui v6 rom through fastboot is quite easy.

first install fastboot either through the android sdk or if you’re running a debian based distro:

sudo apt-get install android-tools-fastboot

power off you’re phone and enter fastboot mode with volume down + power

i preferred running the next steps with root so i just used

sudo -i

so i wouldn’t always have to run everything with sudo.

now check if your phone is visible with

fastboot devices

if you see a device and number you’re ready to go.

download the new rom from here and unpack the archive. here’s a link to the thread containing more information.

in there you’ve got some batch files, shell scripts and a folder with all the images.

make sure the flash_all_except_storage.sh is executable and just run it. it does all the work for you.

here’s what you should see:

./flash_all_except_storage.sh
soc-id: 109
sending 'tz' (196 KB)...
OKAY [  0.017s]
writing 'tz'...
OKAY [  0.013s]
finished. total time: 0.030s
sending 'sbl1' (82 KB)...
OKAY [  0.008s]
writing 'sbl1'...
OKAY [  0.007s]
finished. total time: 0.016s
sending 'sbl2' (128 KB)...
OKAY [  0.012s]
writing 'sbl2'...
OKAY [  0.010s]
finished. total time: 0.022s
sending 'sbl3' (296 KB)...
OKAY [  0.024s]
writing 'sbl3'...
OKAY [  0.017s]
finished. total time: 0.042s
sending 'rpm' (136 KB)...
OKAY [  0.012s]
writing 'rpm'...
OKAY [  0.027s]
finished. total time: 0.039s
sending 'aboot' (1020 KB)...
OKAY [  0.081s]
writing 'aboot'...
OKAY [  0.049s]
finished. total time: 0.130s
erasing 'boot'...
OKAY [  0.011s]
finished. total time: 0.011s
sending 'misc' (8 KB)...
OKAY [  0.004s]
writing 'misc'...
OKAY [  0.003s]
finished. total time: 0.007s
sending 'modem+modem1' (51910 KB)...
OKAY [  4.067s]
writing 'modem+modem1'...
OKAY [  4.542s]
finished. total time: 8.609s
sending 'system+system1' (420865 KB)...
OKAY [ 32.988s]
writing 'system+system1'...
OKAY [ 60.549s]
finished. total time: 93.538s
sending 'cache' (32768 KB)...
OKAY [  2.578s]
writing 'cache'...
OKAY [  2.275s]
finished. total time: 4.853s
sending 'userdata' (204332 KB)...
OKAY [ 16.001s]
writing 'userdata'...
OKAY [ 11.741s]
finished. total time: 27.742s
sending 'recovery' (6640 KB)...
OKAY [  0.524s]
writing 'recovery'...
OKAY [  0.378s]
finished. total time: 0.902s
sending 'boot+boot1' (4764 KB)...
OKAY [  0.376s]
writing 'boot+boot1'...
OKAY [  1.239s]
finished. total time: 1.615s
rebooting...
 
finished. total time: 0.001s

your phone should now boot into the brand spanking new beta version of miui.
your sd card storage will not get wiped but it’s always a good idea to create a backup first.

as soon as your phone has booted you can go and locate the updater app and flash the weekly multilang rom releases from here the way you are used to.

have fun!

connect to local computer from android emulator (hosts file)

connecting to something running on your local computer from you android emulator device is something which makes debugging alot easier.

since you can’t connect to localhost or 127.0.0.1 since that is the android emulator itself we need to make sure that the hosts file contains what we need.

to make this possible you need to start your AVD with the -partition-size parameter so we can actually change the system stuff (maybe try 512 if that still doesn’t work):

emulator -avd myAVDName -partition-size 256

afterwords we need to remount the system partition to make it writable:

adb remount

since the computer running the AVD can be called through IP 10.0.2.2 we’ll create a hosts file locally for example:

127.0.0.1	localhost  
10.0.2.2	myawesomewebsite
10.0.2.2	andanothervirtualhost

now we need to push this file onto the AVD:

adb push /path/to/hosts /system/etc

and open a browser and check if http://myawesomewebsite works

woohoo!

installing steam on linux mint debian

make sure you’ve added the debian testing repositories to your /etc/apt/sources.list
deb http://ftp.debian.org/debian/ testing main contrib non-free
deb-src http://ftp.debian.org/debian/ testing main contrib non-free

update the package list
sudo apt-get update

then install equivs (this is used to create a fake jockey-common package) and realpath
sudo apt-get install equivs realpath

download the steam debian installer from here.

install the installer
sudo dpkg -i steam-debian_1.0.0.39-9-2_all.deb

then run steam-debian and then steam

it’ll update itself and you should be up and running…

android: using puk code to reset pin

well somehow after i received my new micro sim the pin code wasn’t working and i always had to block my sim (3 wrong pin inputs) and unblock it with my puk. since i didn’t know the pin i couldn’t change it either.

i found out how to change your pin using your puk, just dial this number (works in emergency call or unlocked mode):
**05*<PUK Code>*<enter a new PIN>*<confirm the new PIN>#

you should receive confirmation that the pin has been changed.

firefox crash when showing general preferences, downloads or downloading a file

had a problem recenty that downloading a file, showing the default preferences or showing the downloads dialog made firefox quit unexpectedly.
don’t know what happened or why exactly but it seems to be a problem with gnome-vfs.

my solution (so far with no side effects) is to comment this line

#file: file

ind the /etc/gnome-vfs-2.0/modules/default-modules.conf file.

bios flashing without a floppy/cd-rom/usb-stick

well i posted this in our development blog in my company and have noticed that this can be usefull for other people, but i am not responsible for anybody messing up their bios due to not knowing what they are doing!

here’s how you can flash your bios without needing a boot disk. the easy way is to use flashrom and i’ve also written a short how-to on how to boot dos from grub further below.

well installing flashrom (on ubuntu linux) is pretty unproblematic:

sudo apt-get install flashrom

just for safety create a backup of your current bios:

sudo flashrom -r bios_20101014.bin

output is something like this:

flashrom v0.9.3-r1211 on Linux 2.6.35-22-generic (i686), built with libpci 3.1.7, GCC 4.4.5, little endian
flashrom is free software, get the source code at http://www.flashrom.org
 
Calibrating delay loop... OK.
No coreboot table found.
Found chipset "Intel ICH9", enabling flash write... OK.
This chipset supports the following protocols: FWH,SPI.
Found chip "Winbond W25x80" (1024 KB, SPI) at physical address 0xfff00000.
===
Reading flash... done.

my mainboard seems to be currently untested and so i also receive this message in my output:

This flash part has status UNTESTED for operations: WRITE
The test status of this chip may have been updated in the latest development
version of flashrom. If you are running the latest development version,
please email a report to flashrom@flashrom.org if any of the above operations
work correctly for you with this flash part. Please include the flashrom output  with the additional -V option for all operations you tested (-V, -Vr,
-Vw, -VE), and mention which mainboard or programmer you tested.
Please mention your board in the subject line. Thanks for your help!

well since i’m only making a backup in this step this really is irrelevant (because i’m only reading) but i also ignored this later on and it worked perfectly.

download the bios file from the manufacturers website and then flash it:

sudo flashrom -w mynewbios.rom

here’s the output:

flashrom v0.9.3-r1211 on Linux 2.6.35-22-generic (i686), built with libpci 3.1.7, GCC 4.4.5, little endian
flashrom is free software, get the source code at http://www.flashrom.org
 
Calibrating delay loop... OK.
No coreboot table found.
Found chipset "Intel ICH9", enabling flash write... OK.
This chipset supports the following protocols: FWH,SPI.
Found chip "Winbond W25x80" (1024 KB, SPI) at physical address 0xfff00000.
===
This flash part has status UNTESTED for operations: WRITE
The test status of this chip may have been updated in the latest development
version of flashrom. If you are running the latest development version,
please email a report to flashrom@flashrom.org if any of the above operations
work correctly for you with this flash part. Please include the flashrom
output with the additional -V option for all operations you tested (-V, -Vr,
-Vw, -VE), and mention which mainboard or programmer you tested.
Please mention your board in the subject line. Thanks for your help!
Flash image seems to be a legacy BIOS. Disabling checks.
Erasing flash chip... SUCCESS.
Writing flash chip... COMPLETE.
Verifying flash... VERIFIED.

like i said i ignored the UNTESTED warning and was able to cross-flash my asus p5k-se mainboard to the asus p5kr bios (to receive ahci support for the p5k-se motherboard) without any problems.

reboot your ubuntu and set your settings in your new bios.

since i wanted ahci support i quickly checked if ahci loads properly after booting back into ubuntu linux:

lsmod | grep ahci

 

[alternate method]
for everybody that wants to flash using the manufacturers tool that usually only runs in DOS go for this method:

download and mount a freedos image (for example balder or freedos oem used in this example):

sudo mkdir /media/floppy
sudo mount -t vfat -o loop,quiet,umask=000 FDOEM.144 /media/floppy

now copy the bios files and your flashtool to the mounted /media/floppy (as root or with sudo).
then unmount:

sudo umount /media/floppy

move or copy the floppy image into your /boot folder

sudo mv FDOEM.144 /boot/biosupdate.img

copy memdisk to /boot (first command makes sure you have syslinux installed):

sudo apt-get install syslinux
sudo cp /usr/lib/syslinux/memdisk /boot/

now add the floppy image to your /boot/grub/menu.lst

title       bios upgrade
kernel      /boot/memdisk
initrd      /boot/biosupdate.img

then choose to boot the bios upgrade in grub while starting up (you might need to press escape to fall into the grub menu) as soon as dos is up and running use your manufacturers command in dos to flash your bios…

other methods and related topic:
http://ubuntuforums.org/showthread.php?t=318789

updating sony ericsson x10 (mini/mini pro) to android 2.1 in linux

well for all of you who like to upgrade their SE phone from a linux machine here’s a way to get it done using virtualbox… (i’m using ubuntu maverick meerkat)

first download virtualbox and install the correct version from here or for ubuntu just do a:
sudo apt-get install virtualbox-ose-qt

then you need to add yourself to the “vboxusers” group, this can be done using the colorful clicky menu in ubuntu by clicking System -> Administration -> Users and Groups -> Manage Groups

in older version of ubuntu and other linux distros you might need to add persmissions to usbfs for the virtualbox users. check and see if your distro has a “/proc/bus/usb” if not, ignore this next step.
edit the fstab to get the correct permission for the usb device in virtualbox

sudo gedit /etc/fstab

add this at the end (make sure you replace the XXX with the “vboxusers” group ID)

none /proc/bus/usb usbfs devgid=XXX,devmode=664 0 0

best thing to do now is a reboot ;)

so now you need to create a new virtualbox and install windows… this shouldn’t be a problem if you still have an old windows cd lying around.

after that you need to configure that virtual machine with 2 usb filters for your phone. plug in your phone and in the virtualbox settings dialog add it to the usb filters. unplug your phone, turn it off and reboot into flash mode (hold the back key while plugin in the usb cable). now you should see a different device popup in the usb settings. add it also:

start-up your virtual machine and install pc companion or whatever and you are ready to update…

lirc and LCDproc for Soundgraph iMON changes

well… after an update quite a while ago my lirc and lcdproc stopped working. starting lirc on the default ubuntu install would always result in:

unable to load LIRC kernel modules. Verify your selected kernel modules in /etc/lirc/hardware.conf

so trying to add the modules manually would tell me a bit more:

root@augustiner:~$ modprobe lirc_imon
FATAL: Error inserting lirc_imon (/lib/modules/2.6.31-21-generic/updates/dkms/lirc_imon.ko): Unknown symbol in module, or unknown parameter (see dmesg)
root@augustiner:~$ dmesg | grep lirc_imon | tail -n1
[  420.742877] lirc_imon: Unknown parameter `islcd'

i noticed a line in the options that was wrong and removed it:

options lirc_imon islcd=0

lirc was back up and running but not my LCD screen. the logs showed:

[  492.637968] lirc_imon: lcd_write: invalid payload size: 32 (expecting 8)
[  492.762951] lirc_imon: lcd_write: invalid payload size: 32 (expecting 8)
[  492.887947] lirc_imon: lcd_write: invalid payload size: 32 (expecting 8)
[  493.012940] lirc_imon: lcd_write: invalid payload size: 32 (expecting 8)
[  493.137946] lirc_imon: lcd_write: invalid payload size: 32 (expecting 8)
[  493.262958] lirc_imon: lcd_write: invalid payload size: 32 (expecting 8)
[  493.387957] lirc_imon: lcd_write: invalid payload size: 32 (expecting 8)
...

some further googling and i found out that the options line has changed from release to release. to get it back working use:

options lirc_imon display_type=1

to get the write type just look into lirc_imon.c

enum {
   IMON_DISPLAY_TYPE_AUTO,
   IMON_DISPLAY_TYPE_VFD,
   IMON_DISPLAY_TYPE_LCD,
   IMON_DISPLAY_TYPE_NONE,
};