Friday, June 15, 2012

linux find executable files


find . -type f -perm -+x

Sunday, May 20, 2012

Windows VPN Connection with automatic routes added without default gateway option

type c:\windows\vpn.bat

@echo off
rasdial VPN_CONNECTION_NAME USERNAME PASSWORD
for /f "tokens=15 delims= " %%A in ('ipconfig ^| find "192.168.200"') do @set GW=%%A
route add 192.168.45.0 mask 255.255.255.0 %GW%

Wednesday, May 02, 2012

SRV records for service redudnacy

You can use SRV records just like MX records for other services redundancy for services other than mail

Friday, April 06, 2012

rescue missing vmdk disk

recreate vmdk from *-flat.vmdk file
vmkfstool -c $SIZE -a lsilogic -d thin temp.vmdk
edit the temp file and replace temp-flat with your own flat file name
thanks to http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1002511

Wednesday, March 07, 2012

windows variables

use %%A within batch files and %A outside in the shell

automatic windows VPN/PPP dial using rasdial

rasdial %CONNECTION_NAME% username password

windows awk using for /f command

example:
C:\Documents and Settings\Ali>for /f "tokens=15 delims= " %A in ('ipconfig ^| find "192.168.7"') do @set GW=%A

windows extract ip address from command line

for /f "tokens=15 delims= " %A in ('ipconfig ^| find "192.168.7"') do @set GW=%A

Wednesday, February 29, 2012

Wednesday, February 22, 2012

Windows automatic dial VPN PPTP connection

rasdial CONNECTION_NAME USERNAME PASSWORD

Thursday, January 19, 2012

veeam scp problem windows 64 bit (x64)

download courflags from
http://www.virtualvcp.com/content/view/26/1/
then do a
courflags "C:\Program Files (x86)\Veeam\Veeam Backup and FastSCP\VeeamShell.exe" /32BIT+"

big thanks to
http://www.everything-virtual.com/?p=279

Monday, January 16, 2012

vmware server 2 remote client problem on linux

goto somewhere like the below

cd ~/.mozilla/firefox/r1ejwkml.default/extensions/VMwareVMRC@vmware.com/plugins

and run
./vmware-vmrc -h "localhost:8333"





Saturday, January 14, 2012

dd progress status

while [ `pgrep ^dd` ]; do kill -USR1 `pgrep ^dd`;sleep 1;done

Tuesday, January 10, 2012

ssh disable slow dns

in /etc/ssh/sshd_config
UseDNS no

Friday, December 16, 2011

rsync vs scp

Remember not to try to rsync like scp, DO NOT SPECIFY PATH, instead look at the [] sections in rsyncd.conf called MODULES and use the below syntax

rsync * 192.168.1.1::MODULE_NAME

REMEMBER YOU ASS

Wednesday, November 30, 2011

usb dongle to vmware esx guest

use a network USB hub or a USB server software like kernelpro.com

Sunday, November 06, 2011

MS SQL Server update based on two tables

update r
set pass = x.pass
from InternetUser r inner join InternetUser x
on r.id = x.id
where r.pass = 'kjfkd9wjj2390eds9d';

Friday, November 04, 2011

simple socks server

simple socks server using ssh

ssh -f -N -D 0.0.0.0:1080 localhost