Friday, August 23, 2013

Gentoo and Atheros QCA8172 Fast Ethernet

I mentioned in previous posts that wired ethernet was not working on my laptop when I booted the Ubuntu Live DVD and SystemRescueCD. It was working after I installed Ubuntu 12.04 LTS, but was not detected by Gentoo.

The hardware:

lspci -k : 02:00.0 Ethernet controller: Qualcomm Atheros QCA8172 Fast Ethernet (rev 10) Subsystem: Lenovo Device 3804
lspci -n : 02:00.0 0200: 1969:10a0 (rev 10)

According to the linuxfoundation website, the driver needed for this hardware is alx. However this driver is not available in the kernel in Gentoo.

For kernel 3.8.13:

1. Download the compat-driver.
2. Extract the file using tar -xjvf compat-drivers-2013-03-04-u.tar.bz2

Note: This is not the latest stable version available now. I just want to document here that this was the driver that I used when I initially installed it on my system running on kernel 3.8.13.

3. Enter the compat-drivers directory. Run:

./scripts/driver-select alx

make

make install

After I have done this, I encountered errors trying to load this module:
modprobe: ERROR: could not insert 'alx': Unknown symbol in module, or unknown parameter (see dmesg)
alx: Unknown symbol mdio_mii_ioctl (err 0) 

In order to resolve this error, I have to compile the module bnx2x in the kernel. (I cannot explain why that will resolve the matter.  I found the fix somewhere in the net. It does work.)

Device drivers >> Network device support >> Ethernet driver support >> Broadcom devices >>   Broadcom NetXtremeII 10Gb support

I compiled it as a module. Just for curiosity sake, I did try one kernel compile without this module. As a result, besides the modprobe error with alx, I also received this message at the end of the kernel compilation:
depmod: WARNING: /lib/modules/3.10.7-gentoo/updates/drivers/net/ethernet/atheros/alx/alx.ko needs unknown symbol mdio_mii_ioctl
After compiling the bnx2x module, the alx module could be loaded and ethernet was finally working.

After upgrading to kernel 3.10.7 I couldn't install the alx driver with the instructions from linuxfoundation anymore. There was an error during compilation: 

So I downloaded the latest compat-drivers file which has now been renamed to backports. The reason I didn't use the latest backport file in the first place was because I didn't know how to install the alx driver with backports. The instruction on the linuxfoundation website to use ./scripts/driver-select alx didn't work anymore. So I had to dig around for solutions. And here we go:

1. Download backports-3.11-rc3-1.tar.bz2
2. Untar using tar -xjvf backports-3.11-rc3-1.tar.bz2
3. Enter the backports directory. 
4. Do as you would when manually compiling a kernel:

Run make menuconfig

As I only needed the alx driver, I only chose that one and unselected the rest of the drivers.

Ethernet driver support >> Atheros device >>  Qualcomm Atheros AR816x/AR817x support (compiled as module)

Save the configuration.

Run make

and then make modules_install as root. 

Load the module modprobe alx and voila! Ethernet is working. 

Note: I still needed to compile bnx2x in the new kernel to prevent the mdio error.



Tuesday, August 20, 2013

Dual-boot Gentoo with Windows 8

Actually it should be triple-boot because I have installed Ubuntu as well. :) This is the guide which I followed.

1. I installed SystemRescueCD on a USB stick.

2. The USB stick was detected by rEFind without any problems. Once the GUI was up, I opened a terminal to create the partitions necessary for Gentoo. 

As recommended by the guide, I used GPT and created a 200MB ext 2 boot partition. After that I created a 2GB swap partition, a 60GB ext4 root partition and the remainder 700GB for my home partition. I'm not sure if the 60GB is enough for the root partition. My previous root partition on the old Compaq was only 15 GB and it was just enough.

3. Once the partitions were created, I started the installation of Gentoo by following the handbook starting from Step 5: Installing the Gentoo Installation Files.

Just like the Ubuntu Live DVD, my wired ethernet also did not work using SystemRescueCD but wireless was functioning.

4. A note on configuring the kernel. According to the WIKI guide, we need to enable the following:

[*] Built-in kernel command line
(root=PARTUUID=92d3d504-9e7e-4c3d-9e56-15e3bd43511b) Built-in kernel command string EXAMPLE USE CORRECT PARTUUID FOUND WITH BLKID
[*] Built-in command line overrides boot loader arguments 

I've discovered that if the kernel is saved to the boot directory which is on a separate partition from the root partition, the above is needed. But the built-in kernel command line is not needed if you don't have a separate boot partition. rEFind will automatically detect the kernel and load it. 

As for the name of the kernel, I did not have to rename the kernel to .efi extension. As long as I used bzImage-something-something, for example bzImage-3.18.3, the kernel was automatically detected by rEFind.

Rebooted the laptop and rEFind detected all the operating systems. 


Here's a screenshot of the rEFind boot manager on startup. The "orange-reddish circlish" icon is Ubuntu. The Tux icon is Gentoo kernel on the separate boot partition and the Gentoo icon is the kernel in the boot directory on the root partition.

Getting Gentoo to work was however not as easy as Ubuntu. Some problems which I encountered:

1. Black screen after booting up Gentoo with rEFind and X server was not working.
2. Wired ethernet still not working.
3. Bluetooth not working.
4. Some of the Lenovo hotkeys were not working.

I'll go through them one by one in the next few posts.

Dual-boot Ubuntu and Windows 8 on UEFI

I managed to install Ubuntu 12.04 LTS (Precise Pangolin) successfully alongside Windows 8.

1. Disable Secure Boot in UEFI (BIOS).

There are two ways to access the Setup Utility:
a. Press the Novo button when the laptop is switched off. OR
b. Switch on the laptop using the normal On/Off button. Press F2 (Meaning press Fn and the F2 button together.)

Go to Security > Secure Boot


2. Install rEFind boot manager. I installed rEFind using Windows. The author of rEFind provides very good documentation on his website and he also gives out advices at the Gentoo and Ubuntu forums.

3. I downloaded Ubuntu 12.04 amd64 desktop version from the Ubuntu website and made a bootable USB stick using LinuxLive USB Creator.

4. Boot up the USB stick and choose "Try Ubuntu without installing". The reason I chose this option was to be able to install Ubuntu later without installing GRUB.

5. Open a terminal and run ubiquity -b or ubiquity --no-bootloader. This will start the installation of Ubuntu with no bootloader.

6. I created a 2GB Linux swap partition and a 90GB ext4 partition for Ubuntu and then let the installer run its course. Wired ethernet aws not detected on Live DVD but the wireless was working.

7. Installation proceeded smoothly and after rebooting I'm pleased to report that everything works on Ubuntu, even the wired ethernet.

Next: To install Gentoo.


Thursday, August 15, 2013

Shrink hard disk partition on Windows 8

The original partitions on my hard disk are as follows:

Please excuse the poor quality of the picture. For some reasons I didn't think of taking a screenshot but used my Galaxy 2 camera instead. So we have here:

1. Recovery Partition (Windows recovery partition)
2. EFI system (This is the boot partition)
3. OEM partition (I read somewhere that this is where Lenovo saves some important data about the laptop when they set it up)
4. Windows 8_OS C drive
5. Lenovo D drive
6. Recovery partition (This is the Lenovo recovery key partition)

 A few original concerns which I had:

1. Win 8 took up so many partition and I thought that with the limit of 4 primary partitions, I may not have enough partitions for Linux.

There was actually nothing to be worried about. The hard disk was partitioned using GUID Partition Table (GPT) which, unlike MBR, can support more than 4 partitions. (128 according to the Wikipedia)

2. I have read many discussions by Lenovo users that altering the partition table will somehow render the Lenovo recovery key useless.

I decided to give it a go anyway because I have backed up my drive using Clonezilla. Anyway, it turned out that resizing the C: drive didn't kill Lenovo Recovery as long as I left the Recovery partition, which is the last one in the picture with 13GB intact. I just resized C: drive and started Lenovo Recovery to backup the new drive and all was well.

On with the resizing:

1. First of all, I deleted D drive which contained all the drivers file needed for the laptop (after copying the files over to C drive).

2. Then I used Disk Management to resize C drive. The first thing that I noticed was that I could only shrink the partition to half of its original size. When I tried to shrink it further, this message came up:

You cannot shrink a volume beyond the point where any unmovable files are located. 

After reading through some workarounds and articles regarding this problem on the net, the solution which worked for me was found on this page. 3 steps:

i. Disable hibernation
ii. Disable paging
iii. Disable system protection (system restore)

I ran Disk Defrag just for good measure and after that I could shrink C drive as much as I wanted. I shrank it down to about 80GB and was left with nearly 900GB of free space. Perfect, as Windows 8 is just going to be an ornamental system on my laptop. :)

Next up: Install Ubuntu

Reinstalling Windows 8 OEM on Lenovo G400s

One of the first things that I did before altering my system on the brand new Lenovo was to install all the updates for Windows 8. After that I rebooted the system and ran Clonezilla to save an image of my hard disk on to a removable drive so that I can restore the laptop to its original state in case I were to mess up anything. Once that was done, the first thing to do was to try and reinstall Win 8. Why? Oh, just for fun to see whether it is doable. I don't see why I must pay for a new license to get Windows 8 DVD for reinstallation (which was what the salesperson told me) when I have already have a proper legal license to use it on my laptop.

I followed the instructions from mydigitallife forum.

1.  Ran "slmgr.vbs /dlv" in Command Prompt and I found that the SKU for my Windows 8 was CoreSingleLanguage. 

For CoreSingleLanguage you need: 
Win 8 RTM CoreSingleLanguage OEM.iso
SHA1: 8C6345E4AE37BD64911F2B2AA243ED604BBBE922

I won't be providing links to the iso. It can be found at the forum or via Google.

2. Burned the ISO on to a DVD and booted up the DVD.

3. Installed Win 8 and followed the instructions on the screen. 

4. Win 8 was installed successfully.

BUT... yes, there is a but. After the installation of Win 8, I was left with an operating system which allowed me to access the hard disk, the programs on it and to use USB drives. Other than that, no other drivers were detected and installed. Yes, no wired and wireless ethernet, no sound, no sdcard, zilch. I downloaded the ethernet driver from Lenovo website with another laptop and managed to get the internet connection going. The moment the internet connection was up, Windows 8 was activated automatically. That was what I wanted to know - whether Win 8 can be activated using the hardcoded key in my laptop. 

So, after that was done, I booted up Clonezilla and restored the hard disk to the image that I saved. It was too much trouble to search for, download and install all the necessary drivers. 

Target 1 of reinstalling Win 8 and getting it activated was achieved. 

Tuesday, August 13, 2013

New Laptop - Lenovo G400s without Touchscreen

My Compaq V3252AU running on Gentoo has finally croaked on 3rd of August 2013 after 6 years, one month and 3 weeks. A record for a Compaq laptop, huh? The salesman at the computer shop was actually astounded that the laptop lasted 6 years. 

I bought a new laptop - a Lenovo G400s without touchscreen. The specs are as followed:

Colour red
Windows 8 Single Core Language preinstalled 
Intel® Core™ i5-3230M (2.60Ghz, 3MB L3 Cache) 
14" HD WLED
1TB HDD 
Integrated Intel graphics together with Nvidia GT720M 2GB
4 GB (1x4096) RAM

This laptop came with no Windows 8 CD and no recovery disk from the laptop manufacturer. The salesman told me that:
1. Reinstalling Windows 8 afresh is impossible as you don't have the Windows 8 OEM CD.
2. Dual-booting this system with Linux is impossible.
3. Repartitioning the HD is impossible as it will mess up the recovery system.
4. If anything happens to your system, the only way to restore it is to press the Lenovo recovery key and restore the backup from there. 

Naturally I was not pleased with his answers at all. But I knew what I was looking for before I went to buy the laptop. So I went ahead with the purchase and started on my project which is to:

2. Backup the hard disk with Clonezilla.

My preferred OS is naturally Gentoo. But it is not the easiest distro to install. Therefore I choose to install Ubuntu first so that I can have a backup Linux distro to fall back on when/if I encounter any problems with the installation of Gentoo.

My following few posts will detail No. 1  to 5.

EDIT 15 March 2014: I have added links to the posts regarding the above list.

Tuesday, July 16, 2013

Whatsapp on Tab 2 7.0 Wifi (Helium method)

The previous method which I posted last year regarding the installation of Whatsapp is no longer working. There is another method which works using the app Helium. I do not take credit for the instructions. Someone smart on the net discovered it and all credit goes to him or her. I first saw the instructions on the xda-developers forum and this is the link.

I used this method to install Whatsapp on the tablet which is linked to a different telephone number from my smartphone.

1. Install Whatsapp on smartphone through Play Store. SMS verification does not work here as I keyed in a different number (the one that I want to use on the tablet) from the one on my smartphone. Instead I needed to do a call verification. So they rang me up on the other phone and gave me the verification code.

2. Once Whatsapp is up and running, backup the app with Helium (previously known as Carbon). Once the backup is completed, there should be a folder on the smartphone called carbon/com.whatsapp

3. Install Helium on the tablet. Backup up any app on the tablet. This is so that the carbon folder will be created on the tablet.

4. Download Whatsapp from the original website (NOT Play Store) and install it on the tablet. Do not open Whatsapp first.

5. Copy the com.whatsapp folder from the smartphone to the carbon folder on the tablet.

6. Open Helium on the tablet. Restore Whatsapp on the tablet and there you go - Whatsapp is up and running.

Note:
1. Version of Whatsapp installed is 2.10.772
2. This method does work on unrooted phones or tablets. The only difference between rooted and unrooted is that you have to install Helium on your PC as well if your device is not rooted. Follow the instructions on the Helium webiste.

Update 08 Sept 2013
Updated Whatsapp to version 2.11.59. Still working.


Wednesday, November 28, 2012

Applications for Linux

This is a list of applications that I use for my Gentoo laptop. I don't really go for applications with lots of features or with beautiful interfaces and so forth. I prefer lightweight, simple and efficient stuff.

1. Window manager: Fluxbox

2. Office suite: Libreoffice

I used to use OpenOffice. I haven't been keeping myself updated with the latest news. I only found out recently that most systems now come bundled with Libreoffice instead of OpenOffice. I just installed Libreoffice today and have not seen much difference between these two. Is it just my imagination or does Libreoffice loads up faster?

3. Browser: Firefox

4. PDF reader: mupdf 

This is a fantastic lightweight pdf reader. I only regret that I found out about this only this month! I used to use acroread but it takes ages to load up and can render my system unresponsive for a while.

I've installed another pdf reader called Okular (KDE), which I read was one of the best pdf reader for Linux. However mupdf works very well for me. Therefore I have not tried out Okular much. It's just there for backup as I have uninstalled Acroread. I may install Evince (Gnome) later to see how much dependencies it draws in. I use neither KDE nor Gnome, therefore I'd like to reduce as much dependencies as possible that I have to install.

5. Picture viewer: gqview

6. Picture editor: GIMP

7. Comics viewer: comix

8. Music player: Audacious

9. Video player: Mplayer

10. Podcast client: Gpodder

11. Ipod manager: Gtkpod

12. Tag editor: Easytag

13. Terminal: urxvt (rxvt-unicode)

I have been using urxvt for a very long time because it can display Chinese characters nicely. I think I was using xterm previously but it was quite ugly and I had problems with Chinese character.

14. Terminal editor: vim

15. File manager: Thunar

I don't use this often. I often edit my filenames through the terminal. However when you need a GUI file manager, this is a very nice one to have. 

Wednesday, November 21, 2012

Whatsapp on Galaxy Tab 2 7.0 Wifi Only (Appguard method - now defunct)

Update 16 July 2013

This method does not work anymore. Here's the link to another method to install the app. 

I managed to install Whatsapp on a Samsung Galaxy Tab 2 7.0 Wi-fi only using instructions from this page. One or two things from the instructions didn't work for me. So, the following was what I did:

1. Install SRT AppGuard. This is a German app, but for those who do not read German, do not worry. The app itself, other than the license agreement, is in English.

2. Download Whatsapp.apk (2.8.7286) file from Whatsapp official site. The instruction from the Nexus tablet forum advised to have the file downloaded from Play Store using Chrome extension APK Downloader. However the extension did not work for me. Therefore I just downloaded and installed the apk from the official site.

3. Run SRT AppGuard after installation of Whatsapp to secure the app.

4. Change Whatsapp permission through AppGuard by unticking "Phone calls - read phone status and identity".

5. Run Whatsapp. Here I failed to get verification by both the SMS and voice call methods. The workaround was to install Bluestacks on a PC, and then install Whatsapp on the PC through Bluestacks. So, I got the verification code through the Whatsapp on PC and keyed the code into the tab.

6. Back to the Whatsapp on the tab. After the error message regarding failed voice validation pops up, tap on the last icon at the bottom of the screen that looks like three vertical dots/lines. (The red arrow in the picture below) That will bring up the window to enter the verification code. After that, you're good to go. :)


NB: It rankles me that in the end I still needed a Windows PC to get Whatsapp working because Bluestacks is not availabe for Linux!

EDIT:

1. Added the version of Whatsapp which I initially installed.

2. Added a picture of where to find the three vertical dots which you have to tap to bring up the window to enter the verification code.

3. Latest update - 03 February 2013 - I received a message from Whatsapp service to inform me that my current version has expired and I needed to install the latest version. Downloading from Google Play did not work of course. What I did:

a. Uninstall current version from the tab.
b. Downloaded the latest apk (2.9.1587) from Whatsapp website.
c. Installed it as normal.
d. This time I didn't need a 6 digit activation code. I only needed to enter my phone number (which has already been registered during the first time installation) and it was working again.

Tuesday, November 20, 2012

Updatedb

Updatedb tends to run immediately after I've logged in. This usually will cause almost everything to come to a standstill. One of the first thing that I do when I'm logged into my desktop is to open Firefox and OpenOffice and when updatedb runs at the same time, everything will proceed at an excruciating and jerky pace for a few minutes. To prevent this from happening:

1. Edit /etc/mlocate-cron.conf

Inside the file:


# nice value to run at: see -n in nice(1)
NICE="19"

# ionice class to run at: see -c in ionice(1)
# you have to install sys-apps/util-linux manually
IONICE_CLASS="3"

# ionice priority to run at: see -n in ionice(1)
IONICE_PRIORITY="7"

#######

The default value for IONICE_CLASS in this file is 2. I changed it to 3 so that updatedb will only run when the cpu is idle.

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