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

Saturday, January 2, 2010

Printer Setup for Windows (SAMBA)

Setting up printers for Windows is really easy. Forget about cups, foomatic, and any filters. Windows wants raw anyway. Here's how: Here are the steps I took:

Install Samba
Add Samba by doing a "pkg_add -r samba-3"

Autorun Samba and LPD
Edit /etc/rc.conf add:
samba_enable="YES"
lpd_enable="YES"
You may also want to run "/etc/rc.d/lpd start" and "/usr/local/etc/rc.d/samba start" to get things running without a reboot

Edit /etc/printcap
the printcap format is
PRINTER NAME: followed by a bunch of options separated by colons. Here are the good optiosn for us:
'sh' -- suppress header
'sf' -- suppress line feed
'mx#0' -- unlimited buffer
'sd' -- spool directory (This should be different for each printer)
'lp' -- printer device probably '/dev/ulpt0' or '/dev/lp0'
'if' -- error log
Note use '\' to go muliline

Here's my line for my HP D5100 (Printer really doesn't matter since this is raw printing)
D5100|hp:\
:sh:sf:mx#0\
:sd=/var/spool/hp:\
:lp=/dev/ulpt0:lf=/var/log/lpd-errs:
Make Sure the spool directory is world readable and writable or lp will fail!

Finally use 'chkprintcap' to check /etc/printcap

Setup /usr/local/etc/smb.conf
smb.conf is pretty much setup. Add ' use client driver = yes' under printers to make windows clients happy otherwise the print queue has a nice "access denied" error.

Use 'testparam' to check smb.conf

Setup Samba User accounts
pdbedit -a -u queenorych

Happy Printing!

Wednesday, December 16, 2009

Time Machine and Freebsd

Getting Apple Time Machine to talk to Freebsd has never been easier. Netatalk 2.0.5 has direct TM support now! Here are the steps I used. Note TM does not need apple talk or avahi.

  1. cd /usr/ports/net/netatalk
  2. make install
  3. Add the following lines to /etc/rc.conf
  4. netatalk_enable="YES"
    afpd_enable="YES"
    cnid_metad_enable="YES"
  5. Make a time machine directory (for example, /home/mike/TimeMachine), make sure it is read/writable by the time machine account you will use
  6. Then the following line in /usr/local/etc/AppleVolumes.default: "/home/mike/TimeMachine TimeMachine allow:mike cnidscheme:cdb options:usedots,upriv,tm"
  7. Connect to your new server through finder using the url "afs://(YOUR SEVER IP)"
  8. Load-up Time machine and it should see your time machine share
  9. Time Machine makes an afs mount, it should work. It was a little flaky for me.
  10. Afterwards TM has backed-up reliably every hour when i am in wifi range or connected to the Ethernet