Skip to main content

Posts

Showing posts from 2007

Windows XP optimization

These are some of the tweaks that I do to speed up my Windoze:

- Display Properties > Themes > Windows Classic Theme

- System Properties > Advanced > Performance > Adjust for best performance

- System Properties > System Restore > Turn off

- Disable File Indexing: From My Computer > right-click on the C: Drive > select Properties. Uncheck "Allow Indexing Service to index this disk for fast file searching." Apply changes to "C: sub folders and files," and click OK.

- Clean Up Prefetch, temp, and cache files: Download CleanUp!

- If VM, turn off Screen Saver. If VMWare, install VMWare Tools.

- Defrag disks.

Resources
http://www.blifaloo.com/info/winxp_speed.php

SSH reverse tunnel

# ssh -nNT -R 10.36.1.6:14344:10.36.1.5:80 10.36.1.6
The "-n" option prevents reading from STDIN. Redirection from /dev/null to STDIN.
"-N" tells ssh that the tunnel is not for executing remote commands.
"-T" tells ssh not to allocate a pseudo-tty on the remote system.
"-T" disables pseudo-tty allocation.

Rough diagram:
10.36.1.5:80 <--- 10.36.1.6:14344

To avoid timeout:

In /etc/ssh/sshd_config on the server:
TCPKeepAlive yes
ClientAliveInterval 30
ClientAliveCountMax 99999
To enable binding address in ssh -R:
GatewayPorts yes

Man page docu for -R switch:
-R [bind_address:]port:host:hostport

Specifies that the given port on the remote (server) host is to be forwarded to the given host and port on the local side. This works by allocating a socket to listen to port on the remote side, and whenever a connection is made to this port, the connection is forwarded over the secure channel, and a connection is made to host port hostport from the local machine.

P…

Debian apt GPG keys and repos

# wget http://ftp-master.debian.org/ziyi_key_2005.asc -O - | sudo apt-key add -# wget http://ftp-master.debian.org/ziyi_key_2006.asc -O - | sudo apt-key add -(replace 2006 with current year)
deb ftp://sunsite.cnlab-switch.ch/mirror/debian/ unstable main contrib non-freeOther keys:
mdebian:~# gpg --keyserver wwwkeys.eu.pgp.net --recv-keys A70DAF536070D3A1
mdebian:~# gpg --keyserver wwwkeys.eu.pgp.net --recv-keys B5D0C804ADB11277
mdebian:~# gpg --armor --export A70DAF536070D3A1 | apt-key add -
mdebian:~# gpg --armor --export B5D0C804ADB11277 | apt-key add -

Motorola MOTOKRZR K3 and Smart 3G

Word of Warning: I am a Linux user and very keen in buying a Motorola Razr (specifically v3xx) because it is known to work in Linux. But for some stupid reason I bought a newer model and it is NOT based on this chipset anymore:

# lsusb
Bus 001 Device 002: ID 22b8:6402 Motorola PCS# dmesg
[30549.844000] cdc_acm 1-1:1.0: ttyACM0: USB ACM device
[30549.844000] usbcore: registered new interface driver cdc_acm
[30549.844000] drivers/usb/class/cdc-acm.c: v0.25:USB Abstract Control
Model driver for USB modems and ISDN adaptersI have not tried yet making it work in Linux but might write a dev driver for this if time permits.

For Smart 3G Internet on the phone, I first sent the following message to 211:
SET MOTOK3You will receive a browser message. This is a bit noob but only after some fiddling I manage to figure out that I need to see the Options of that message and Install. This message essentially contains the Smart 3G-related browser settings. I previously used a Globe SIM so the default set We…

Acer Aspire 4310, Acer CrystalEye webcam (064e:a101) on Ubuntu Linux

The Ubuntu Linux version is:
$ cat /etc/issue.net
Ubuntu 7.04
The Linux kernel version is:
$ uname -a
Linux xxx-laptop 2.6.20-15-generic #2 SMP Sun Apr 15 07:36:31 UTC 2007 i686 GNU/Linux
The fresh install will detect the webcam:
dmesg | grep Crystal
[ 22.116000] uvcvideo: Found UVC 1.00 device Acer CrystalEye webcam (064e:a101)
Camorama and other applications that do not support v4l2 will not work. The webcam driver uvcvideo (linux-uvc) supports v4l2 only. v4l1 is officially deprecated.

To test, you can use Ekiga softphone or to take webcam snapshots use luvcview.
Source code: http://mxhaard.free.fr/spca50x/Investigation/uvc/luvcview-20070512.tar.gz

You will also need libsdl1.2-dev (for SDL libraries) and build-essential (for building tools like gcc and make utility).
$ sudo aptitude install build-essential libsdl1.2-dev
$ wget http://mxhaard.free.fr/spca50x/Investigation/uvc/luvcview-20070512.tar.gz
$ tar zxvf luvcview-20070512.tar.gz
$ cd luvcview-20070512
$ make
$ make install

To make it user-frie…

Acer Aspire 4310, Broadcom (bcm43xx) chipset on Ubuntu Linux

The Ubuntu Linux version is:
$ cat /etc/issue.net
Ubuntu 7.04
The Linux kernel version is:
$ uname -a
Linux xxx-laptop 2.6.20-15-generic #2 SMP Sun Apr 15 07:36:31 UTC 2007 i686 GNU/Linux

The fresh install will detect the WLAN hardware but will fail on initialization (use dmesg to see kernel messages):
$ dmesg
bcm43xx: Error: Microcode "bcm43xx_microcode5.fw" not available or load failed.
atkbd.c: Unknown key pressed (translated set 2, code 0xd4 on isa0060/serio0).
atkbd.c: Use 'setkeycodes e054 ' to make it known.
The first line looks for the Broadcom firmware. The second and third lines is a response to pressing the Bluetooth key.

Update: This forum [*] reports that there is a Bluetooth key for turning it on/off, but there is no Bluetooth chip!

[*] http://forums.whirlpool.net.au/forum-replies-archive.cfm/797583.html

The following is the output of lspci:
$ lspci
00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS/940GML and 945GT Express Memory Controller Hub (rev 03)
00:02.0…

freenx on Debian etch, IBM Power5 ppc64

There is still no package in the repos for freenx unlike OpenSUSE. You can retrieve the sources from here (thanks to Fabian Franz for the pointer!):

http://kern.nl/freenx/nx_2.1.0dol1.tar.gz
http://kern.nl/freenx/freenx_0.6.0dol1.tar.gz

You can download additional packages (source code) (e.g. for nxagent, nxauth) not included in the previous tgz from here:

http://www.nomachine.com/sources.php

For consistency's sake, I packaged all sources (sans Fabian's) that I have downloaded but I cannot assure you that they are the latest stable (as of this time). I've done a lot of minor tweaks. It will be cumbersome to document them. Post your questions here if you encounter a problem.

After the installation and configuration, I got this error in the client (version 2.x):
NX> 1000 NXNODE - Version 1.5.0-60 OS (GPL)
NX> 1004 Error: NX Agent exited with exit status 1.
NX> 105 NX> 596 Session startup failed.
NX> 1006 Session status: closed

The possible fixes are documented in this wi…

IE's Unknown Runtime Error in prototype.js Line: 697 Char: 9

IE sucks again! Without a decent debugger (like Firebug), I have to read prototype.js (version: 1.4.0_pre11) and spend hours trying to pinpoint the fault. This alien error appears to be this block:

if (receiver) {
if (this.options.insertion) {
new this.options.insertion(receiver, response);
} else {
receiver.innerHTML = response;
}
}

Particularly this line:

receiver.innerHTML = response;

I am trying to rewrite a tbody of a table but IE does not like that. This link is insightful (RobG):

...don't use innerHTML to modify tbody, tr, th or td elements, use DOM (they actually refer to a 'table object model', but DOM is a better bet).

If you are going to use innerHTML near a table, write the entire table or just cell content, no in between.

Debian 4.0 r0 (Etch) installation on IBM System p5 510 inside LPAR

For some reason, the usual CD/DVD installation does not work in LPAR. I tried both Debian 4.0r0 (netinst and complete cd-1) and OpenSUSE 10.2 (dvd). The errors are known. I reported the OpenSUSE bug here [1], and the Debian bug has been reported here [2]. Update: This workaround should also work in OpenSUSE. Select the logical volume where the installer was disk dumped (dd) as the installer media. This can be done in the Main Menu (4>1>3).

There is a workaround documented by Gottfried Scheckenbach in debian-boot list [3]:

Of interest for users of VIO (via HMC or IVM):
I have found a way around burning a new disc (because I'm not physical near to the machine): I downloded the iso onto the VIO server and putted it via dd into a newly created virtual disc aka LV on the VIO. I attached this virtual disc as secondary hard disc to the LPAR and booted the LPAR using the defictive cdrom. After running into the missing files problem on initializaton of the installer I remounted /cdrom f…

Resetting admin password in IBM System p5 510 Express ASMI

These are the steps in resetting the admin password:

0. Re-route stored static in your body via an ESD wrist strap to a
metallic element.

1. Look for the 2 toggle switches and service processor batt. The batt
should be in front of the Power Supply 1 and Power Supply 2 (codes: E1
and E2, see Rear Location Codes on the cover plate). The "very tiny"
toggle switches should be in the area of P1-C14 slot.

I forgot the exact sequence but it should be a combination of the ff. step (2):

2. Remove the battery, toggle the switches to the opposite direction.
Allows some time for the caps to discharge.

3. Move back the toggle switches and put back the batt in its place.

4. Assign your PC to Class C subnet (i.e. masked 255.255.255.0):
IPaddr: 192.168.2.x for HMC1 or
IPaddr: 192.168.3.x for HMC2

5. Ping HMC1 or HMC2. Access the web interface using the default address:
http://192.168.2.147 (for HMC1) or
http://192.168.3.147 (for HMC2)
Note: Sometimes you have to force the https protocol:
Example: https://192…

ld: unrecognized option '--hash-style=both'

gcc -Wl,-Map=contiki.map,-export-dynamic testv6.co obj_linux-native/socketdev_listener.o \
contiki-linux-native.a -o testv6.linux-native
/usr/local/bin/ld: unrecognized option '--hash-style=both'
/usr/local/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status


If you look closely, the error is something related to the local gcc not using the host's linker (ld).

$ which gcc
/usr/bin/gcc

$ which ld
/usr/local/bin/ld

For some reason, I messed my compiler path. To synchronized gcc to use the host's dynamic linker (i.e. /usr/bin/ld), set the environment variable COMPILER_PATH to /usr/bin.

$ export COMPILER_PATH=/usr/bin
$ echo $COMPILER_PATH
/usr/bin

$ gcc -print-prog-name=ld
/usr/bin/ld

Upgrade: Ubuntu Edgy (6.10) to Feisty (7.04)

I broke my rule of using the Ubuntu version one step backward from the current development release. My main interest is the stable ntfs driver with write capability. The upgrade went smooth except for a minor issue related to shared-mime-info package and a custom package (freemind). I reported the fix here.

Upgrade woes

I am sharing some of the notes that I've jotted down. This might be helpful to people who are upgrading from the long-term supported (LTS) Ubuntu Linux Dapper Drake (6.06.1) to Edgy Eft (6.10). My own cycle in upgrading is one step backward from the current development release. The current release is Feisty Fawn (Ubuntu 7.04). I use the command update-manager -c -d to dist-upgrade. This must be run as a privileged user.

Error 1:
Could not fetch the package liboobs. This is something related to our Internet filter in the university. So, I have to manually download the liboobs (edgy eft version) and place it in /var/cache/apt/archives/.


Error 2:
Could not install /var/cache/apt/archives/samba_3.0.22-1ubuntu4.1_i386.deb. The error log is: subprocess new pre-removal script returned error exit status 102. At first, I ignored the error but this will come up again later.

Error 3:
The upgrade aborts now. Your system could be in unusable state. A recovery was run (dpkg --configure -a). installAr…

Default AllowOverride directive in Ubuntu 6.06

This might help people who are having problems with the rewrite module in Apache 2. The AllowOverride directive is actually set to None by default in Ubuntu 6.06.1. To allow the reading of rewrite directives in a .htaccess, AllowOverride must be set to All. This statements explains it well:

When this directive is set to None, then .htaccess files are completely ignored. In this case, the server will not even attempt to read .htaccess files in the filesystem.Reference: http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride

Replacing xscreensaver with gnome-screensaver in Xfce

By default, xfce screensaver requires xscreensaver. You have the _option_ to remove xscreensaver using the following command (as privileged):

apt-get remove xscreensaver


To install the gnome-screensaver use the following command (as privileged):

apt-get install gnome-screensaver


To auto-start the gnome-screensaver, add it as an Autostarted Application:

Xfce menu > Settings > Autostarted Applications

The command for starting the gnome-screensaver daemon is:

gnome-screensaver


To be able to use the action button "Lock screen" to start gnome-screensaver immediately and lock your screen, modify the file /usr/bin/xflock4:

#xscreensaver-command -lock || xlock $*
gnome-screensaver-command --lock exit 0


Note that the original xscreensaver command is now commented. Backup the original copy of xflock4 (as privileged):

cp /usr/bin/xflock4 /usr/bin/xflock4.orig


Hope that helps.

If you have questions, post them at:
http://www.linuxquestions.org/questions/showthread.php?t=458516
and leave a comment.

File renaming in BASH via string handling

#!/bin/bash

#remove spaces
for i in *.wma; do
mv "$i" `echo $i | tr ' ' '_'`;
done

#remove uppercase
for i in *.[Ww][Mm][Aa]; do
mv "$i" `echo $i | tr '[A-Z]' '[a-z]'`;
done

#convert file names
for i in *.wma; do
mv "$i" "`basename "$i" .wma`.mp3";
done

#rename test1a, test2a, test3a
#to t1a, t2a, t3a
for i in test*a; do
substring1=${i:0:1}
substring2=${i:4:1}
mv $i $substring1$substring2'a'
done;