Saturday, June 02, 2012

Galaxy S2 ICS USSD Codes

Some codes which I found useful:

1. *#1234* : View firmware version

2.  *#*#4636#*#* : Shows phone and battery information, usage statistic and Wi-Fi information

3. *#7353# : Quick test

4. *#0228# : Battery status


The code  *#7284# which I mentioned in the previous post no longer works after the upgrade to ICS.

Upgrade Galaxy S2 to ICS

Today I finally upgraded my Samsung Galaxy S2 I9100G from Gingerbread to Ice Cream Sandwich platform. The first thing that rankles me is the fact that I had to use MS Windows to upgrade the firmware due to the fact that Kies cannot be run under Linux! Anyway, here are a few issues that I encountered during the upgrade:

1. Kies could not recognise the phone. This was solved by keying in the dialer *#7284# > USB > select PDA. (If PDA has already been selected, then select MODEM and then PDA again.)

2. During the installation of the firmware, progress bar suddenly became 0%, Kies complained that the phone is disconnected. However there was the warning message "Do not disconnect target" displayed on the phone. All was well again after rebooting the phone and rerunning the firmware upgrade. Weird.

But it was an interesting process. I learned a few dialer codes and some shortcut buttons which I will detail in the next post.

Tuesday, April 14, 2009

Ipod Nano on Gentoo

I recently bought a new 4th generation Ipod Nano from an Apple store and after some fiddling about, managed to get it to work successfully on Gentoo and gtkpod. :) The Ipod is formatted as HFS (Mac partition) AND with journalling enabled. In order for Gentoo to be able read and write into the Ipod, first of all the kernel must be compiled to include support for HFS and journalling must be disabled using a Mac OS.

1. Compile the kernel to include HFS
File systems --->
Miscellaneous filesystems --->
<*> Apple Macintosh file system support (EXPERIMENTAL)
<*> Apple Extended HFS file system support

File systems --->
Partition Types --->
[*] Macintosh partition map support

2. Connect the Ipod to a Mac OS. Go to Disk Utilities. Click on the Ipod Volume. Press 'Option' on the keyboard. Hold it. Go right to the top of the screen. Click on File --> Disable Journalling.

3. Some settings to mount the Ipod.

My udev rule for Ipod in /etc/udev/rules.d/10-local.rules


BUS=="usb", ATTRS{serial}=="00FD29001F03C45A" KERNEL=="sd?2", NAME="%k", SYMLINK="nano", RUN+="/sbin/fsck.hfsplus -r /dev/nano"

a. The serial number in ATTRS{serial}=="00FD29001F03C45A" can be obtained by running udevinfo -a -p 'udevinfo -q path -n /dev/sd?'

NB: udevinfo is already obsolete. Replace with udevadm. 

udevadm info -a -p $(udevadm info -q path -n /dev/sd?)

Replace the question mark with whatever alphabet that the Ipod is mounted on. That can be seen by running dmesg. Leave the question mark as it is though in the udev rules file!

b. RUN+="/sbin/fsck.hfsplus -r /dev/nano" is placed in udev rules in order to prevent this error from popping up in dmesg: hfs: Filesystem was not cleanly unmounted, running fsck.hfsplus is recommended. mounting read-only.

My /etc/fstab entry for Ipod
/dev/nano /mnt/nano hfsplus noauto,rw,user 0 0

3. Now Ipod Nano can be mounted using the command mount /mnt/nano.

4. Next is to configure gtkpod. For the recent Ipods, gtkpod needs to be configure to include the "Firewire ID" or else it won't be able to write into the Ipod database. Use the 16 character serial that was obtained using udevinfo.

Create the file SysInfo in /mnt/ipod/iPod_Control/Device. That means: mkdir /mnt/ipod/iPod_Control/Device/SysInfo. Or if the file already exists, edit it to include the following line in the file:

FirewireGuid: 00FD29001F03C45A (Replace the 16 character with your own Ipod's serial)

After that, we're good to go. :)

Sunday, November 30, 2008

Problems with Compaq Presario V3000

I own a Compaq Presario Notebook V3252AU which I bought in July 2007. 2 or 3 months before the warranty period expired, I started having problems with the wireless chipset. I'm using Gentoo Linux as my main OS and Ubuntu as my secondary OS. I couldn't detect the wireless chipset which is Broadcom Corporation BCM94311MCG wlan mini-PCI (rev 01). I was too lazy to bring it to the HP centre to repair as that would mean that I'd be deprived of my laptop for a while. So I bought a USB wireless adapter and got on with life.

Two weeks later, I started having problems with the display. The screen would suddenly become distorted and the system would freeze and I had to restart the system all over to restore it. This happened twice and then the com died slightly less than a month before the warranty period expired. I sent it to the HP centre and they said that the mainboard was damaged. Got the com back in 5 days.

A week later I started having problems with the wireles chipset again. The wireless connection kept disconnecting. In the end, I just disabled it altogether and prevent the module for the wireless card from loading. I am using the wired ethernet now.

2 weeks ago, a friend of mine who has the same version of laptop as mine told me that her wireless chipset stopped working. Windows couldn't detect it at all. Yesterday, her laptop couldn't be switched on at all. This is around 6 months post 1-year-warranty period.

Oh, and I couldn't update my BIOS at all because HP only provided BIOS updates for Windows and not for Linux-based systems and did not have the courtesy to reply to my enquiry regarding a BIOS update for Linux.

I am never buying HP-Compaq products again and I will think twice before I buy any HP products.

Sunday, February 24, 2008

Volume buttons

How to get on screen display when the volume / mute button is pressed.

1. emerge xosd

2. Create the executable files that will be executed when the buttons are pressed. For me, down.sh (when 'Volume decrease" is pressed), up.sh (Volume increase) and mute.sh (toggle between mute and unmute)
Contents of down.sh

amixer set Master 5%-
killall osd_cat
osd_cat -p middle -A center -f "-adobe-new century schoolbook-medium-i-normal--34-240-100-100-p-182-iso8859-1" -c blue -b percentage -P `amixer sget Master |grep "Front Left: Playback" |cut -c 28-30` -T `amixer sget Master |grep "Front Left: Playback" |cut -c 28-30` -d 2 &
Contents of up.sh

amixer set Master 5%+
killall osd_cat
osd_cat -p middle -A center -c blue -f "-adobe-new century schoolbook-medium-i-normal--34-240-100-100-p-182-iso8859-1" -b percentage -P `amixer sget Master |grep "Front Left: Playback" |cut -c 28-30` -T `amixer sget Master |grep "Front Left: Playback" |cut -c 28-30` -d 2 &
Contents of mute.sh

killall osd_cat
if /usr/bin/amixer sget Master | grep -q "Front Left: Playback 0 \[0%\]"
then
echo "Volume unmuted" | osd_cat -p bottom -A center -f "-adobe-new century schoolbook-medium-i-normal--34-240-100-100-p-182-iso8859-1" -c green -d 2 &
amixer set Master 75%+ on ## the 'on' allows the LED button turn blue
else
echo "Volume muted" | osd_cat -p bottom -A center -f "-adobe-new century schoolbook-medium-i-normal--34-240-100-100-p-182-iso8859-1" -c green -d 2 &
amixer set Master 0 off ## LED button turns orange
fi

3. Map the appropriate keycodes to the volume buttons by using xev into .Xmodmap.

4. Edit ~/.fluxbox/keys so that the respective files (down.sh, up.sh, mute.sh) will be executed when the respective buttons are pressed.

None XF86AudioRaiseVolume :ExecCommand ~/bin/up.sh
None XF86AudioLowerVolume :ExecCommand ~/bin/down.sh
None XF86AudioMute :ExecCommand ~/bin/mute.sh

Monday, February 11, 2008

Starting different window managers

I start up my window manager (Fluxbox) by command line 'startx'. However, sometimes I want to experiment with other managers and it becomes a chore editing the .xinitrc every now and then. Instead, I use 'xinit':

xinit /home/username/bin/fluxbox
xinit /home/username/bin/beryl
Content of ~/bin/fluxbox:
for errfile in "$HOME/.xsession-errors" "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER"
do
if ( cp /dev/null "$errfile" 2> /dev/null )
then
chmod 600 "$errfile"
exec > "$errfile" 2>&1
break
fi
done

exec startfluxbox
Content of ~/bin/beryl:

if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
eval `dbus-launch --sh-syntax --exit-with-session`
fi

emerald &
beryl-manager &

# Start other applications here
#
# Example: set wallpaper + open a terminal
#
#fbsetbg -f /home/username/Personal/Bild/Hintergrund/nix.jpg &
#exec rox -p Default -b Default -S &
exec /usr/local/sbin/rox-session
exec beryl

Saturday, September 29, 2007

WPA Supplicant

My /etc/wpa_supplicant/wpa_supplicant.conf:

#####

ctrl_interface_group=0

ap_scan=2

network={
ssid="My_SSID"
proto=WPA2
key_mgmt=WPA-PSK
pairwise=CCMP
group=CCMP
psk=This_is_a_64-character_PSK_generated_using_wpa-passphrase
}

#####

What I found out only after a very long time:

For example, if:
SSID = home
passphrase (the password you enter in your modem / router) = mypassword

The psk to be entered in wpa_supplicant.conf is generated using:
 

wpa_passphrase home mypassword

I.e: Do not enter your original password in the psk column, instead, use the psk generated using wpa_passphrase

If you want to enter your original password in the psk column, the password must be in quotation marks:

psk="mypassword"

Saturday, September 01, 2007

Download From YouTube

Here's a tool to download video clips from YouTube:

1. Download the python script youtube-dl

2. To use, just chmod 744 youtube-dl and then run the command

youtube-dl http://the-website-of-the-clip-you-want-to-save

3. The file will be saved as an *.flv extension and can be viewed with mplayer or player that has ffmpeg support.

Friday, July 27, 2007

View / Extract files in *.iso

The files in an *.iso file can be viewed without burning the image into a cd / dvd.

Execute as root: mount -o loop -t iso9660 /path-to-iso-file /mnt/cdrom (or wherever the cdrom device is mounted to)

nfg files

Files ending with .nfg can be converted to .iso by using the program nfg2iso

Installation of PC Bibliothek

1. Run ./setup

2. There may be an error regarding gcc. That can be solved by removing
/opt/officebib/libgcc_s.so manually.

3. Run officebib

Sunday, June 17, 2007

Prevent Auto-Loading by Udev

1. To prevent services like net.eth0 from autoloading:

- Edit the file /etc/conf.d/rc
- Look for the line RC_PLUG_SERVICES=""
- Enter the name of the service that you don't want to be autoloaded in front of an exclamation sign: RC_PLUG_SERVICES="!net.eth0 !service2 !service3"

2. To prevent
modules like bcm43xx from autoloading:

- $mkdir /etc/modprobe.d (if the direcotry does not exist)
- create the file /etc/modprobe.d/blacklist
- Enter the name of the module: blacklist bcm43xx

Saturday, June 16, 2007

Information on Kernel Parameters

It can be found in this file:

/usr/src/linux/Documentation/kernel-parameters.txt

lspci: Unknown Device

If lspci shows a list of Unknown Device e.g.:

00:02.2 RAM memory: nVidia Corporation Unknown device 03ba (rev a1)
00:03.0 PCI bridge: nVidia Corporation Unknown device 03b7 (rev a1)


run "update-pciids" without the quotes. This will download a new version of the PCI ID list.

Friday, June 15, 2007

Installation of Wireless Card

After hours of trawling and sorting through the vast amount of information regarding this topic, I've finally managed to install my wireless card and get it working! First of all, some specs:

- lspci dermined the card to be: Broadcom Corporation BCM94311MCG WLAN Mini-PCI (rev 01) It is an 802.11 b/g WLAN
- PCI ID is 14e4:4311
- Laptop is Compaq Presario v3252AU running on AMD Turion 63 X2 and nVidia chipset

Two important things to do. Configure the driver from the kernel AND install the firmware with bcm43xx-fwcutter.

1. Using the driver provided by the kernel. Ndiswrapper is not needed. Configure the kernel to enable Generic IEEE 802.11 Networking Stack and the Software Mac add-on. This is important, because if the Software Mac is not included, the Broadcom driver will not be displayed in the kernel.

Networking --> [*] Networking support
Networking options --->
[ ] Amateur Radio support --->
< > IrDA (infrared) subsystem support --->
< > Bluetooth subsystem support --->
<*> Generic IEEE 802.11 Networking Stack
[ ] Enable full debugging output (NEW)
--- IEEE 802.11 WEP encryption (802.1x)
<*> IEEE 802.11i CCMP support
<*> IEEE 802.11i TKIP encryption
<*> Software MAC add-on to the IEEE 802.11 networking stack
[ ] Enable full debugging output
After that, check the Broadcom driver:

Device Drivers --> Network device support -->
Wireless LAN drivers (non-hamradio) & Wireless Extensions
<M> Broadcom BCM43xx wireless support
[ ] Broadcom BCM43xx debugging (RECOMMENDED)

(I'll update this part later. Not on my AMD com right now. So I am not sure if the display is the correct kernel configuration)
No 1 not finished.

2. After configuring the kernel to get bcm43xx loaded as module, install bcm43xx-fwcutter. We need to install the firmware using bcm43xx-fwcutter to make it work.

$ emerge bcm43xx-fwcutter (have to add net-wireless/bcm43xx-fwcutter ~amd64 to /etc/portage/package.keywords)

3. Installing the firmware
a. Get firmware from http://linuxwireless.org/en/users/Drivers/bcm43xx
The file is called wl_apsta.o
b. mkdir /lib/firmware
c. bcm43xx-fwcutter -w /lib/firmware /path/to/wherever_you_saved_the_firmware

- Either udev or hotplug is needed to load the firmware.

4. modprobe bcm43xx

Note:
1. The wireless toggle button and LED actually work. If I toggle the button to 'on', the LED changes from amber to blue when the module is loaded. If button is 'off', module loaded, card detected, but naturally the interface cannot detect any access point. I can also switch off the wireless using the button AFTER the interface has been detected. The only thing I cannot do, is to toggle the button to 'on' after booting and expect the interface to activate automatically. I have to reload the module again then, I think. Or restart net.eth1. I have to check which.

2. To do: Try to set up the wireless configuration. At the moment, very confused regarding iwconfig and wpa_supplicant.

Get rid of 'clock skew detected' error message

# go to your kernel source directory
cd /usr/src/
# update timestamp of all files
find . -exec touch \{\} \;
# delete old compiled stuff
make clean
# compile from scratch
make bzImage modules_install or whatever

Tuesday, June 05, 2007

Extract and cut audio from avi file

There's this particular clip in an avi file, whose audio I want to extract and convert to mp3.

1. mplayer movie.avi -edlout temp
- I can press 'i' to start to skip the sections that I don't want and 'i' again to 'unskip' the sections that I want.

2. mplayer -vc null -vo null -ao pcm -benchmark -edl temp movie.avi
- This will dump the audio as audiodump.wav according to the sections that I want in the edl file

* If I know the starting and stopping time of the section that I want extracted, I can skip step one and run this: (For example -ss 10 -endpos 26 = Stop at 1 minute 56 second... I think. Haven't tried this yet. Read it somewhere)

mplayer -vc null -vo null -ao pcm -benchmark -ss movie.avi

3. Then encode as mp3:

lame -h -b 128 audiodump.wav audio.mp3

Saturday, June 02, 2007

k3b cdrecord and cdrdao permission

K3b needs cdrecord and cdrdao to be given root permission. This can usually be done by clicking on k3bsetup. However, k3bsetup is only available when k3b is emerged with the kde flag, which will include the installation of kdesu which amounts to more than 23MB. I set the permission manually instead:

chown root:cdrom /usr/bin/cdrdao
chown root:cdrom /usr/bin/cdrecord

chmod 4755 /usr/bin/cdrdao
chmod 4755 /usr/bin/cdrecord

The first digit (4) after chmod selects the set-user-ID. What in the world does that mean? I found this explanation which I think is pretty clear:

SUID stands for Set User ID. This means that if the SUID bit is set for any application then your user ID would be set as that of the owner of application/file rather than the current user, while running that application. That means in case I have an application whose owner is ' root ' and it has its SUID bit set, then when I run this application as a normal user, that application would still run as root. Since the SUID bit tells Linux that the the User ID root is set for this application and whenever this application executes it must execute as if root was executing it (since root owns this file).

Just like SUID, setting the SGID bit for a file sets your group ID to the file's group while the file is executing. IT is really useful in case you have a real multi-user setup where users access each others files. As a single homeuser I haven't really found a lot of use for SGID. But the basic concept is the same as the SUID, the files whose SGID bit are set would be used as if they belong to that group rather than to that user alone.

Wednesday, May 30, 2007

USE Flags

I've just upgraded my profile to 2007.0 and then realised that many USE flags are missing. Then I switched the profile again to default-linux/x86/2007.0/desktop instead of just default-linux/x86/2007.0. (Note: no desktop in the latter). Anyway, to view the USE flags in a profile, just take a look at:

1. /usr/portage/profiles/default-linux/x86/2007.0/desktop/make.defaults

or

2. emerge --info

Here you get to see the configuration for emerging packages including the USE flags

Saturday, May 19, 2007

Encoding

The locale for my system is Unicode. Sometimes, when I use xchat or when I view a text file with xterm, umlauts are not displayed properly because the encoding is ISO-8859-1. So the commands are:

LC_ALL="en_US.ISO-8859-1" xterm

or

LC_ALL="en_US.ISO-8859-1" xchat