Travel

Categories

How to: Add a user from the OS X command line

Create a new entry in the local (/) domain under the category /users.dscl / -create /Users/toddharris

Create and set the shell property to bash.dscl / -create /Users/toddharris UserShell /bin/bash

March 31st, 2010 | Tags: | Category: 電腦 | Leave a comment

add printer via command line at macosx

Adding and Removing a Printer

This is done via the lpadmin command. To add a printer, use this format:

lpadmin -p Printer_Name -L “Printer Location” -E -v lpd://x.x.x.x -P /Library/Printers/PPDs/Contents/Resources/en.lproj/Printer_Driver.gz

All you have to do to the above is adjust the settings as necessary. Unfortunately, the tradeoff here is that you can’t use spaces in […]

Use photoshop layer to fix overexposure, underexposure and enhance contrast

1. Fix overexposure

Press ctrl-J to duplicate the background image to new layer Choose “Multiply” layer mode

2. Fix underexposure

Choose “Screen” layer mode

3. Enhance contrast

Choose “Soft light” layer mode

How to avoid Backscatter in Sendmail

Taken from http://elqui.dcsc.utfsm.cl/util/email/backscatter.html

Your MX servers should reject email for unknown users at the SMTP initial transaction and NOT forward them to internal SMTP servers without a “user check”.

Step1: In MX SERVER, add these 4 lines to your “.mc” file in the right place.. FEATURE(access_db, hash -T<TMPF> /etc/mail/access)dnl FEATURE(`blacklist_recipients’)dnl define(`VIRTUSER_TABLE’, `hash -o /etc/mail/virtusertable’)dnl […]

Cheap external RAID storage based on eSATA

Sourcing cheap external RAID storage based on eSATA

1. 5 bay 3.5″ SATA external RAID stoarge ($1399)

http://alris.com.hk/?p=427&lang=en

2. Still sourcing a fast SATA RAID controller with RAID5 and eSATA connection

Installation of VMware ESXi 4 on ASUS P6T machine

The steps are easy. Just download the VMware esxi4 update 1 ISO and install on an USB thumb drive attached on the machine. The only stuff need to twist is the detection of the onboard Realtek 8111C NIC which the original esxi4 doesn’t support.

Following the instructions from http://www.vm-help.com/esx40i/customize_oem_tgz.php, I replaced the /bootbank/oem.tgz with the […]

Force duplex printing in Mac Snow leopard

1. Add the duplex printer first

2. edit /private/etc/cups/ppd/hp8150.ppd

3. Search “Duplex None” and replace the fragment from

*Duplex None/Off (1-Sided): ” <</Duplex false>> setpagedevice”

To

*Duplex None/Off (1-Sided): ” <</Duplex true /Tumble false>> setpagedevice”

Crystal disk mark

For My core i7 machine with ASUS P6T deluxe MB(X58+ICH10R) running Win7 64 bits

c:\ drive (single 500GGB SATA DISK)

Sequential Read : 114.117 MB/s Sequential Write : 115.773 MB/s Random Read 512KB : 35.597 MB/s Random Write 512KB : 73.242 MB/s Random Read 4KB : 0.646 MB/s Random Write 4KB : 2.087 MB/s

Test […]

blockdev & PERC 6i RAID controller

Recently I have done some informal disk performance test on my newly arrived workstations. (copy a 1GB text file on the same file system).

On a Dell Precsion T3500 with Linux software RAID1 of 2x500GB SATA disk with AHCI enabled :

[root@gsx42 disk1]# time cp a b real 0m4.499s user 0m0.054s sys 0m1.367s

On our […]

configure mod_auth_mysql on self-compiled Apache 2.2.x

Recently I have a need to configure a web directory to have user authentication to access its content. The simplest way is to use .htaccess + htpasswd. However,the requirement specified that the user should be able to change their assigned password later. This requirement make me can’t use the traditional file based authentication (password hard-coded […]