Friday, September 23, 2011

Getting error box in vbscript

In vbscripting if there are errors on code we can see the errors on runtime through error box.

If the error on your machine is not popping on executing the vbscript through error box then you can follow below approach to enable it.

Generally issue comes if windows is taking cscript as a default engine to execute script. To change the default engine from cscript to wscript. you can do the following:

1. Right Click on Vb script file(the file you create with .vbs extension) ---> select "Open With" ---> select "Choose Program"
2. Click "Browse" button.
3. Navigate to "C:\Windows\System32\wscript.exe"
4. Click OK.

Done....You should see error box if there are any errors in the scripting file from now onwards....

Friday, September 2, 2011

rdesktop on linux

rdesktop on fedora 14 clippboard copy was not working. With the following approach I see it's working.


yum install tritonus-esd.x86_64
yum install arts.x86_64
yum install arts-devel.x86_64

Now try the following command:
rdesktop -r sound:local -r clipboard:PRIMARYCLIPBOARD -r disk:anyname=/home/username -f [remote-machine-address]

CTRL + ALT + Enter: for toggling Full screen mode in rdesktop

Reference:
http://blog.offenders.org/?p=85

how to write a linux command wrapper

In case if you want to extend the command functionality we can write a wrapper over standard linux command. We can achieve this through bash script and it is simpler.

Here is the example for it:

rdesktop is an linux command which is used to connect windows machine.

rdesktop -f [remote-machine-address] is the basic command to connect to windows machine.

Now if you want to enhance it to support extra options we can use the following options:
rdesktop -r sound:local -r clipboard:PRIMARYCLIPBOARD -r disk:root=/

sound:local -- to enable sound redirection.
clipboard:PRIMARYCLIPBOARD -- To allow copy/paste between rdesktop & host machine.
disk:root=/ -- To share my root directory with remote machine.

mv /usr/bin/rdesktop /usr/bin/rdesktop.bin

Create a file called /usr/bin/rdesktop.wrapper and add this to the file.

#!/bin/bash

/usr/bin/rdesktop.bin -r sound:local -r clipboard -r disk:root=/ $*
## EOF

Make the file executable.
chmod +x /usr/bin/rdesktop.wrapper

Then create a symbolic link to the wrapper.
ln -s /usr/bin/rdesktop.wrapper /usr/bin/rdesktop


You can achieve the same effect through "alias" option in bash but we(I) can use the example as starting point for shell scripting :-)


Reference:
http://blog.offenders.org/?p=85

Thursday, September 1, 2011

Things to update in blog

N-T-P: Need to update

Below are the list that I came across and waiting to update in my blog:

  1. select vs poll vs epoll ----- select can be used as server listening for client
  2. How does xinetd works
  3. Connecting to a Linux desktop through VNC.
  4. Need to discuss on how to handle when linux is stuck(we can use ctrl-alt-f2 to go to the terminal prompt and the see the process which stuck and kill it) and ctrl-alt-f1(in fedora) ctrl-alt-f7(in ubuntu) to switch back to gui prompt.
  5. on linux firewalls, iptables -L -n will list the firewalls and "service iptables stop" will stop the firewalls and "service iptables start" will start the firewall and "service iptables status" will give the status of the firewall
  6. UDP server is different from TCP server, it doesn't need to listen & accept
  7. When the TCP server establishes the connection with the client through accept, a new connection will be created with new fd, does this fd will be having different TCP port??
  8. Write fds in select is used to avoid blocking writes.
  9. "module is unknown" error on ubuntu.. solution for this...a) Open /etc/pam.d/login b) Search for pam_limits.so in the file c) replace /lib/security/pam_limits.so to /lib/i386-linux-gnu/security/pam_limits.so....Now the error shouldn't come and you should be able to login :-).... or for the last try doing "sudo pam-auth-update --force" 
  10. http://www.iovene.com/34/ -- need to update this in the blog 
  11. http://www.cisco.com/en/US/docs/switches/lan/catalyst4500/12.2/50sg/configuration/guide/dot1x.html#wp1240472 -- Dynamic vlan assignment