Setup GitHub in Linux


I should have done this earlier - to use GitHub to manage my scripts/configs/documentations. So I can have them managed and tracked. Later better than never, I got them setup Today in my Ubuntu box. Here is the how to:1) Go to the GitHub.com to create an account.2) Install git client.jchen@mylaptop:~$ sudo apt-get install git … Continue reading Setup GitHub in Linux

IIS Log Archive Script


@ECHO OFF set script_dir=C:\scripts\w3c set iislog_dir=C:\WINDOWS\system32\LogFiles\W3SVC1 set backup_dir=%Date:~-4,4%-%Date:~-10,2%-%Date:~-7,2%-%Time:~-11,2%'%Time:~-8,2%'%Time:~-5,2% set archive_dir=\\File_Server\Log_Archive\%COMPUTERNAME%\W3SVC1 C: cd %iislog_dir% REM ====Create a backup folder named after Today's date========================== mkdir %backup_dir% echo Subject: %COMPUTERNAME% W3C Log Archive Report > %script_dir%\log.txt echo.>> %script_dir%\log.txt date /t >> %script_dir%\log.txt echo. >> %script_dir%\log.txt REM ====Move logs that older than 30 days to the backup folder=================== echo … Continue reading IIS Log Archive Script

Bash Special Variables


To better understand the bash special variables, I wrote a script to help myself. #!/bin/bash #Usage of $#echo ------------------------------------------------------------echo -e You have entered $# arguments. #Usage of $*echo ------------------------------------------------------------export IFS='-'echo -e The arguments are: "$*" \(seperated by -\) #Usage of $@echo ------------------------------------------------------------n=1for arg in "$@"do        echo -e The $n argument is: "$arg"        let n+=1done #Usage … Continue reading Bash Special Variables

Create_User.bat


@ECHO OFF REM Get username and password from user's input set var1=%1 set var2=%2 REM Don't allow user to change password NET USER %var1% %var2% /add /expires:never /passwordchg:no REM User's password never expire wmic useraccount where "Name='%var1%'" set Passwordexpires=false REM Add user to remote desktop group NET localgroup "Remote Desktop Users" %var1% /add REM Create … Continue reading Create_User.bat