Saturday, October 29, 2011

Holy Crap !!!

Thursday, October 20, 2011

[warning] /usr/bin/fop: Unable to locate servlet-api in /usr/share/java

If you get  ...

[warning] /usr/bin/fop: Unable to locate servlet-api in /usr/share/java

... when you execute ...

/usr/bin/fop -c ./fop.xconf -fo the_prince.fo -pdf the_prince.pdf

... on an ubuntu system, execute ...

sudo apt-get install libservlet2.4-java

Thursday, October 13, 2011

SSH Tunnel example

The steps below are intended to be used in a scenario where the user has an account on all three systems.  The systems are: mysystem, host-not-blocked and host-behind-firewall.  The user can ssh from mysystem to host-not-blocked and the user can ssh from host-not-blocked to host-behind-firewall, but not from mysystem to host-behind-firewall because of a firewall of some sort.   The example show how a ssh tunnel can be used to allow the user to ssh from mysystem to host-behind-firewall. Enjoy!!!

Step 1) Screen (optional but recommended)

Log on to mysystem and execute screen

Step 2) Create Tunnel

On mysystem execute :

redcricket@mysystem:~$ ssh -L 2022:host-behind-firewall:22 host-not-blocked
Password:
...
redcricket@host-not-blocked:~$

Now detach ^A^D (if you are using screen.  If not you will need to start up a terminal.)
Why port 2022? Well if I had used port 22 I would have gotten an error message about how that port number is reserved for the 'root' user, so I pick 2000 + 22 = 2022.
Step 3) Use the tunnel

On mysystem execute:
redcricket@mysystem:~$ ssh -p 2022 localhost
...
redcricket@host-behind-firewall:~$

TIP For getting files matching *.uniq off of host-behind-firewall I have this cronjob.

*/15 * * * * scp -P 2022 localhost:"*.uniq" /users/redcricket/tasks/LOGS/host-behind-firewall && ssh -p 2022 localhost "rm *.uniq" > /dev/null 2>&1

practical way to setup ssh tunnel

scp & sftp only accounts


  •  restricting a user to just sftp (i.e. no ssh access)
# useradd lame
# passwd lame
# usermod -s /usr/libexec/openssh/sftp-server lame
  • Setting up scponly
Download scponly tarball from here https://github.com/scponly/scponly/wiki/Download
$ tar -zxvf scponly-20110526.tgz 
$ cd scponly-20110526
$ ./configure --enable-scp-compat
$ make
$ make install
$ sudo make install
Add /usr/local/bin/scponly to the /etc/shells file
$ vim /etc/shells
...
$ cat /etc/shells
...
/usr/local/bin/scponly
Add a user and give set its shell to /usr/local/bin/scponly

# useradd lame
# passwd lame
# usermod -s /usr/local/bin/scponly lame
http://sublimation.org/scponly/wiki/index.php/FAQ#What_does_.22lost_connection.22_mean.3F

Sunday, October 02, 2011

Changing MAC address on wireless interface windows 7

Run "getmac" in a command prompt window and note the output.  You should do this so you can verify that this procedure actually changes the MAC address of your wireless interface.

Next Open "Control Panel > Network and Internet"
You should see a window that looks like this :






Next click on the "Network and Sharing Center" link.  It might take a while for the window to appear.  When it does appear click on the "Change adapter settings" on the left side of the window.  Then you should see a window like this:


Next right click the "Wireless Network Connection" and choose "Properties" then click the "Configure" button.  Then click on the "Advanced" tab and then highlight the "Network Address" property.  Next click on the 'Value' radio button and enter a value into the text field.  Just type numbers (e.g. 123456789012).

Now back in your command window run the getmac command again and verify that MAC address has in deed changed.  If it didn't change try entering another value for the MAC address.