Extend the activation time for evaluation version of Windows

For Microsoft 20-410~412 Windows Server 2012 R2 class, we download the evaluation version of Windows to try
things out and do our class projects. But some of you may find that the evaluation license only valid for 90 days.
So to solve this problem the simplest way is to use slmgr.vbs

Open Administrator CMD or Powershell and type:

slmgr /rearm 

It should works on Windows 8, 10, 2012, 2012 R2 and 2016.
After you done it the system should extend the activation time so you can keep doing your project :).

If you want to get more detail about the Windows machines’ activation, license and expiration date info your could try:

slmgr /dlv
slmgr /xpr

Ubuntu LTS Linux connect to UBC VPN with OpenConnect

For Windows users, you can follow the UBC VPN setup guild.
Basically just download and run Cisco AnyConnect Secure Mobility Client on your Windows box. It works on both my Win7 and Win10 machines.

For Ubuntu LTS Linux (OSX will work):

Step 1 : Install OpenConnect

sudo apt-get install openconnect

Step 2 : Connect to UBC VPN

sudo openconnect -u username myvpn.ubc.ca

It has to run on privilege.
After you run this command, the vpn server will prompt you for asking your password.

After all it should work 🙂

For OSX just install port and use port command instead of apt-get

sudo port install openconnect

[Script] Back up log files on Linux

script for backing up log files on Linux
can setup with cron job

NOWDATE=`date +%Y-%m-%d`
YEAR=`date +%Y`
MONTH=`date +%m`
DAY=`date +%d`
HOUR=`date +%H`
MIN=`date +%M`

#create folder if not exist
mkdir -p /root/log/"$YEAR"/"$MONTH"/"$DAY"

#backup httpd logs
tar -cvf /root/log/"$YEAR"/"$MONTH"/"$DAY"/log_"$NOWDATE"_"$HOUR"_"$MIN".tar /var/log/