Tuesday, July 31, 2012

Set Default Printer.vbs

strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer") For Each objPrinter in colPrinters rem MsgBox objPrinter.Name If not InStr(1,objPrinter.Name, "pdf",vbTextCompare) = 0 Then rem MsgBox "Default Printer set" objPrinter.SetDefaultPrinter end if Next

Friday, July 27, 2012

NGINX Debian Install

Prerequisites apt-get update apt-get upgrade apt-get install build-essential psmisc python-dev libxml2 libxml2-dev python-setuptools Download and Compile uwsgi cd /opt/ wget LATEST_UWSGI tar -zxvf LATEST_UWSGI mv uwsgi-0.9.6.5/ uwsgi/ cd uwsgi/ python setup.py install Download and Compile nginx cd /opt/ wget LATEST NGINS tar -zxvf nginx-1.0.4.tar.gz cd /opt/nginx-1.0.4/ ./configure --prefix=/opt/nginx --user=nginx --group=nginx --with-http_ssl_module --with-ipv6 make make install adduser --system --no-create-home --disabled-login --disabled-password --group nginx wget -O init-deb.sh http://library.linode.com/assets/658-init-deb.sh mv init-deb.sh /etc/init.d/nginx chmod +x /etc/init.d/nginx /usr/sbin/update-rc.d -f nginx defaults