Tuesday, January 30, 2007

Selecting java alternatives

As root, run the following to see which alternatives are out there, and which one is selected as default:

update-alternatives --display java

As root, use the following to select default.

update-alternatives --config java

Monday, January 29, 2007

Research performed trying to get wireless card working on a laptop

"bcm4306 linux" search:
Dossy's Blog: Linksys WMP54GS with Broadcom chipset under Linux
How to Get One 802.11g Wireless Card to Work on Linux

"wmp54gs driver" search:
WinDrivers Computer Tech Support Forums - Linksys WMP54GS Wireless with Linux
HARDWARE wmp54gs - Gentoo Linux Wiki

"'no version of ndiswrapper found'"
Ndiswrapper Package Broken? [Archive] - Ubuntu Forums Conclusion: use 1.18 version of ndiswrapper in ubuntu.

"BCM43xx_IRQ_XMIT_ERROR" search
Problems with wlan bcm43xx - Ubuntu forums

Need to look into Linuxant:
Driverloader http://www.linuxant.com/driverloader/

1) Move wpa_supplicant binary to /usr/sbin/ and rename to "dldr_wpa_supplicant"
2) Move wpa_supplicant.conf to /etc/driverloader/ and rename to dldr_wpa_supplicant..conf, where interface is your interface name (mine was eth1)
3) Reboot

Tried adding pci=routeirq to boot parameters in /boot/grub/menu.lst

Monday, January 22, 2007

I never learned this in school.

Actually, I haven't had to format a Linux partition manually since (maybe) I experimented with Slackware in 1995. So, when I had a nice little 400 GB USB HD with three partitions (two NTFS, one Linux), I was somewhat at a loss as to how to proceed.

I found this handy guide to partitioning and formatting mkfs.ext3.

Ahhh... I have access now.

Labels:

Tuesday, January 16, 2007

Quick ascii table in hex.

The Linux Quick Hacks page inspired on this one:

perl -e 'foreach $x (32..126) { printf(":: %c %x ::", $x, $x) } print "\n"'

Output:
:: 20 :::: ! 21 :::: " 22 :::: # 23 :::: $ 24 :::: % 25 :::: & 26 :::: ' 27 ::
:: ( 28 :::: ) 29 :::: * 2a :::: + 2b :::: , 2c :::: - 2d :::: . 2e :::: / 2f ::
:: 0 30 :::: 1 31 :::: 2 32 :::: 3 33 :::: 4 34 :::: 5 35 :::: 6 36 :::: 7 37 ::
:: 8 38 :::: 9 39 :::: : 3a :::: ; 3b :::: < 3c :::: = 3d :::: > 3e :::: ? 3f ::
:: @ 40 :::: A 41 :::: B 42 :::: C 43 :::: D 44 :::: E 45 :::: F 46 :::: G 47 ::
:: H 48 :::: I 49 :::: J 4a :::: K 4b :::: L 4c :::: M 4d :::: N 4e :::: O 4f ::
:: P 50 :::: Q 51 :::: R 52 :::: S 53 :::: T 54 :::: U 55 :::: V 56 :::: W 57 ::
:: X 58 :::: Y 59 :::: Z 5a :::: [ 5b :::: \ 5c :::: ] 5d :::: ^ 5e :::: _ 5f ::
:: ` 60 :::: a 61 :::: b 62 :::: c 63 :::: d 64 :::: e 65 :::: f 66 :::: g 67 ::
:: h 68 :::: i 69 :::: j 6a :::: k 6b :::: l 6c :::: m 6d :::: n 6e :::: o 6f ::
:: p 70 :::: q 71 :::: r 72 :::: s 73 :::: t 74 :::: u 75 :::: v 76 :::: w 77 ::
:: x 78 :::: y 79 :::: z 7a :::: { 7b :::: | 7c :::: } 7d :::: ~ 7e ::

Saturday, January 13, 2007

sed guides.

I'm using sed (along with awk and shell scripts) to extract data from my website files.

Frequently Asked Questions about sed, the stream editor

sed one-liners

Colorized list_urls.sed

Wednesday, January 10, 2007

sed/sh/awk removing a section in multiple files

All of my scripts are in ~/bin, I'm replacing a marked section with my google adsense code, contained in a separate file.

remove_topstart.sh:
#!/bin/sh
find . -name '*.html' | while read x
do
   cat $x | awk -f ~/bin/remove_topstart.awk >> $x.$$
   cp $x.$ $x
   rm $x.$
done


remove_topstart.awk:
BEGIN { outsideTop = 1 }
/<!--TOPSTART-->/ { outsideTop = 0 }
/<!--TOPEND-->/ { outsideTop = 1 }
outsideTop {
   if( $0 !~ "<!--TOPEND-->" )
   {
      print $0
   }
}

insert_adsense.sh:
#!/bin/sh
#my.adsense.txt contains as its first line and as
#its last line.


#insert after tag, regardless of case.
#change index.html in current directory
cat index.html | sed '/<[Bb][Oo][Dd][Yy]>/r /home/thomas/my.adsense.txt' > index.html.$$
cp index.html.$ index.html
rm index.html.$

#change all *.html files in selected subdirectories
find . -name '*.html' | egrep "SubDir1|SubDir2|SubDir3|SubDir4|SubDir5" | while read x
do
   cat $x | sed '/<[Bb][Oo][Dd][Yy]>/r /home/thomas/my.adsense.txt' > $x.$$
   cp $x.$$ $x
   rm $x.$$
done

Labels:

Tuesday, January 09, 2007

IE 4 Linux

Internet Explorer on Linux
http://webexpose.org/2007/01/07/internet-explorer-7-on-linux/

http://www.tatanka.com.br/ies4linux/page/Installation
IEs 4 Linux needs two packages: cabextract and Wine. You can install them using your Linux package manager (synaptic, apt-get, yum, emerge etc) or go to their sites.
wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-latest.tar.gz
tar zxvf ies4linux-latest.tar.gz
cd ies4linux-*
./ies4linux

Monday, January 08, 2007

Research on adding a wireless card using WPA in Ubuntu

I've just begun to research WPA + PCI wireless card in Ubuntu.

Follow installation instructions for ndiswrapper:
http://ndiswrapper.sourceforge.net/mediawiki/index.php/Installation

Using a ZyXEL card:
http://ndiswrapper.sourceforge.net/mediawiki/index.php/List#Z

Tools to use:
  • iwconfig - to configure wireless network interface.
  • iwlist wlan0 scan - scan for access points using wlan0 interface
WPA with ndiswrapper:
http://ndiswrapper.sourceforge.net/mediawiki/index.php/WPA