Wednesday, November 05, 2014

Add a Status line to gnuscreen

Add a Status line to gnuscreen
Add this to your .screnrc file in your home dir:

akl0mg211.airnz.co.nz /home/styled> cat .screenrc
# don't display the copyright page
startup_message off

# increase scrollback buffer size
defscrollback 100000
#Display Status
caption always "%{= kw}%-w%{= BW}%n %t%{-}%+w %-= @%H - %LD %d %LM - %c"

#More goodness
shell /bin/bash
termcapinfo xterm ti@:te@

# create windows
screen -t 901 ssh aklss901
screen -t 901 ssh aklss901
screen -t 901 ssh aklss901
screen -t 901 ssh aklss901
screen -t 904 ssh aklss901
screen -t 905 ssh aklss901
screen -t 961 ssh aklss901
screen -t 960 ssh aklss901
screen -t 839 ssh aklss901
screen -t 840 ssh aklss901
screen -t 610 ssh aklss901
screen -t ICO ssh aklss901
screen -t 901m ssh aklss901
screen -t 891 ssh aklss901
screen -t 938 ssh aklss901
screen -t 211 aklss901

Execute across all windows in gnu screen

see:
http://thegreatblogsite.blogspot.co.nz/2007/03/execute-across-all-windows-in-gnu.html


Press Ctrl-A :
The screen command window should be highlighted at the bottom.
At the ":" prompt, type
at "#" stuff "export DISPLAY=localhost:0.0\015"

the \015 enters the enter command :)

Wednesday, February 06, 2013

Vodafone Huawei 3G and Linux

Vodafone Huawei 3G and Linux


  1. Tested on Crunchbang Linux 
  2. sakis3g was working after connecting the vodem in a Virtualbox windows machine.  This was a pain so I finally got the fix to auto switch when inserted.  here it is....
  3. check usb_modeswitch and usb_modeswitch_data is installed
    1. cd /usr/share/usb_modeswitch/
    2. sudo gunzip configPack.tar.gz
    3. sudo tar xf configPack.tar
    4. sudo cp 12d1:1523 12d1:1526
    5. edit 12d1:1526 to reflect 
  4. Insert the stick and run lsusb to get the product and vendor details...
  5. /etc/udev/rules.d/15-huawei-e1550.rules file (any filename is OK)
    1. SUBSYSTEM=="usb",
    2. SYSFS{idProduct}=="1526",
    3. SYSFS{idVendor}=="12d1",
    4. RUN+="/usr/sbin/usb_modeswitch  --default-vendor 0x12d1 --default-product 0x1526 -W -I -c /usr/share/usb_modeswitch/12d1:1526"
  6. edit connections
    1. Mobile Broadband
    2. add
      1. Name: Vodem
      2. Number *99#
      3. apn www.vodafone.net.nz
  7. insert device
  8. check lsusb is switched
    1. initially lsusb will report unswitched device
      1. Bus 002 Device 014: ID 12d1:1526 Huawei Technologies Co., Ltd.
    2. then the rules will kick in and switch after about 10 seconds:
      1. Bus 002 Device 013: ID 12d1:14cf Huawei Technologies Co., Ltd.
  9. connect via network connect icon
  10. remove device when finished
  11. Script to perform the connection
    1. ###To automatically repeat result of last action, use following command line:
      while true;do
        if lsusb |grep Huawei >/dev/null;then
          echo found Huawei
          break
        fi
        echo Waiting for device Huawei
        sleep 1
      done

      ##SUBSYSTEM=="usb",
      ##SYSFS{idProduct}=="1526",
      ##SYSFS{idVendor}=="12d1",
      id
      echo Performing switch
      /usr/sbin/usb_modeswitch  --default-vendor 0x12d1 --default-product 0x1526 -W -I -c /usr/share/usb_modeswitch/12d1:1526
      lsusb |grep Huawei

      while true;do
        if lsusb |grep 12d1:14cf >/dev/null;then
          echo switch complete
          break
        fi
        echo Waiting for device switch
        sleep 1
      done


      echo Connecting....
      /home/dunc3/sakis3g  \
              connect \
              --nostorage \
              APN="www.vodafone.net.nz" \
              APN_USER="user" \
              APN_PASS="pass" \
              USBINTERFACE="0" \
              USBDRIVER="option" \
              USBMODEM="12d1:14cf" \
              OTHER="USBMODEM" \
              MODEM="OTHER" \
              DISPLAY=":0"
       

Monday, December 29, 2008

No puller required here!!

Needs No Puller

One promising development is the crankset which needs no puller. Shimano introduced the first such crankset several years ago with its One-Key-Release system. More recently, Excel and Sugino began offering similar units. All work the same way.

Instead of the customary 15-mm bolt, these cranksets use a bolt with a 6-mm Allen head. [Newer ones use 8 mm or, occasionally, 7 mm] This has two advantages: the necessary tool is small and practically weightless, and the Allen head can be exposed through a small hole in the dustcap.

The steel dustcap functions as the "nut" in a standard crank puller, and when you're removing the crank, the fixing bolt functions as the crank puller's "bolt." As you loosen the fixing bolt, the head of the bolt pushes against the inside of the dustcap, pulling the crank from the spindle.

This system is particularly well-suited for touring and for air travel when you need to remove either the pedals or the cranks to put your bicycle into a box. You can adapt other brands of cranks to this system by replacing the dustcaps and fixing bolts. Shimano, Excel, and Sugino all offer retrofit kits. They will work with all Type I cranks (that use a bolt to hold the crank to the spindle) with Campagnolo size (22-mm) dustcap threads.


Borrowed from SheldonBrown

http://www.sheldonbrown.com/tooltips/cotterless.html

Monday, November 24, 2008


We just swapped to Orcon unbundled, home phone and dsl. Great service and painless swap. Speedy too

A download in progress

Tuesday, November 18, 2008

Black Belt Grading

We're all grading for our Black Belt on December 6 and 7. Public is invited on the Sunday afternoon.

Part of the fitness test is a 2.4km run on the Saturday afternoon. The course is on mapmyrun.

Tuesday, October 07, 2008

Deleting Duplicate Files using md5sum

I finally found the ultimate script to delete duplicate files. It uses md5sum so we are deleting files that have the same content, not just the same file name. It deletes the 2nd and 3rd duplicates as well. It only prints the command to delete the file. Its up to you to run it!!!! Have fun.

find . -type f -print0 | \
xargs -0 md5sum| \
sort| \
awk 'dup[$1]++{print $0}'| \
sed -r 's/^[0-9a-f]*( )*//;s/([^a-zA-Z0-9./_-])/\\\1/g;s/(.+)/rm \1/'

you can redirect output to a script file:
Add '> rmfilename' to the end of the 5th line

change its permissions after reviewing it:
chmod u+x rmfilename

and run it:
./rmfilename