Thursday Jul 30, 2009

Using Cygwin to manage script Virtual Box tasks

The Virtual Box GUI doesn't do everything one needs and so I have been experimenting with using cygwin, a free to use bash shell library. Having installed CYGWIN the first thing to do is add the Virtual Box program folder to the PATH, in my case,

    export PATH=/cygdrive/c/Program\\ Files/Sun/xVM\\ VirtualBox:${PATH}

I want this placed in the .bashrc so its always invoked, and thus need to test if is already in the path. I use this code,

    type -p VBoxManage.exe > /dev/null
    case $? in
    0)   # Its already there
         : ;;
    1)   # Add Path
         export PATH=/cygdrive/c/Program\\ Files/Sun/xVM\\ VirtualBox:${PATH} ;;
    esac

Now I need to associate a script file type with an execution program. I have tried to use the distributed batch file and binary and neiter of these work, so I have copied cygwin.bat to bash.bat and amended it so that it reads as follows

    @echo off

    :: Dave Levy (c) 2009         Is this GPL?
    :: bash.bat                   Version 1.0

    :: Wrapper to run \*sh scripts from windows explorer/desktop

    c:\\ksh\\bin\\bash --login %\*

I have deleted the -i flag from the bash line, I have made the bash program call absolute, %\* is the DOS batch command file syntax equivilant to $\* i.e. all the command line arguments, so the command line invokes bash.exe in login mode to force the execution of .bash_profile and .bashrc and appends all the other command line parameters including the script file name. :: is a neater comment delimiter than REM. I have associated my batch file with the file type .ksh as the open method using explorer.

Much of CYGWIN is distributed under the GPL and I am unclear if the batch file is included, If so, its GPL since I created the file by copying it.

keywords: howto invoke cygwin scripts from the windows desktop, write a dos batch file to invoke shell

tags:

Wednesday Aug 13, 2008

Laptop Diaries, more Bluetooth

Over the last few weeks I have struggled to create a bluetooth 3G modem on my new Tecra M5. The Bluetooth drivers on this XP build have been provided by Toshiba and the big difference between it and my previous configuration which uses the Microsoft stack is that the special phone number code that the microsoft drivers require is not required when using the Toshiba drivers. It has a specific field for holding the modem configuration parameters and uses the default phone number of \*99#. I should have waited.

You can also ignore the create the modem stage.

tags: should be 'how not to'

Thursday Jun 05, 2008

Laptop Diaries, onto the internet with 3G

I have just moved my laptop forward to an improved build. This proves that this article only works if the bluetooth drivers are the microsoft drivers on XP. I have modified the tags on this article. In fact, this was meant to be a follow me article, I hope it works for you. I have written about the toshiba drivers at Laptop Diaries, more bluetooth on this blog.

My colleague at work Sean Harris, helped me configure my laptop and phone to use the phone's 3G capability to connect the internet. Sean was guided himself by this article at 'crackistan'. While that author writes about Mac OS, and I am using Windows XP, we both use sony erricson phones and vodafone as our service provider.

I really did this for times where I have no internet access, but as 'Bodoggy' points out, it may come in useful in airport lounges or other places where the wi-fi costs are outrageous, or their credit cards systems broken.

So the process is

  1. Create a connection channel between the phone and laptop, and I used blutooth
  2. Create a dial up agent for vodafone and select your new modem

The only tricky bit is that you don't use a phone number to connect to the internet, there is a special code instead.

To find out in more detail what I did, use the [Read More] button below. 

tags:

[Read More]
About

DaveLevy

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today