Travel

Categories

Free Mac files backup program

1. get backup : http://www.belightsoft.com/products/getbackup/overview.php

Screen shot 2010-04-14 at 5.19.55 PMScreen shot 2010-04-14 at 5.20.00 PM

Screen shot 2010-04-14 at 5.20.10 PM

disable ipv6 on CentOS

How do I disable IPv6?

  • Edit /etc/sysconfig/network and set “NETWORKING_IPV6” to “no”
  • Add the following to /etc/modprobe.conf :
alias ipv6 off
alias net-pf-10 off
  • Run /sbin/chkconfig ip6tables off to disable the IPv6 firewall
  • Reboot the system

Alternative (which might be easier and works on any release with /etc/modprobe.d):

# touch /etc/modprobe.d/disable-ipv6
# echo "install ipv6 /bin/true" >> /etc/modprobe.d/disable-ipv6
  • With the 5.4 update symbol/ipv6 module dependency capabilities have been introduced; therefore, if IPv6 has been previously disabled as above an upgrade to the bonding driver in 5.4 will result in the bonding kernel module failing to load. For the module to load properly use instead:
# touch /etc/modprobe.d/disable-ipv6
# echo "options ipv6 disable=1" >> /etc/modprobe.d/disable-ipv6

ubuntu X display no title bar

This is because there’s problem btw the nvidia driver and the Compiz Fusio

Add the below options in xorg.conf :

Section "Device"
Identifier     "Device0"
Driver         "nvidia"
VendorName     "NVIDIA Corporation"
BoardName      "Quadro NVS 280 SD"
BusID          "PCI:1:0:0"
Option "RenderAccel" "true"
Option "Allow GLXWithCompostite"
Option "AddARGBGLXVisuals" "True"
Screen          0
EndSection

mount network share and add password in keychain in mac

mount -t smbfs //aoe@samba-srv.ie.cuhk.edu.hk/aoeshare /Volumes/aoeshare

security add-internet-password -a aoe -D “Network Password” -r “smb ” -l “samba-srv.ie.cuhk.edu.hk” -s “samba-srv.ie.cuhk.edu.hk/aoeshare” -w ‘eoa!@#ao’

Add the password to keychain

security add-internet-password -a aoe -D “Network Password” -r “smb ” -l “samba-srv.ie.cuhk.edu.hk” -s “samba-srv.ie.cuhk.edu.hk/aoeshare” -w ‘password’  -T “/System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent”

達寶復活節collection

復活節返廣洲

greylist & gmail outgoing mail servers ip range

Mails sent from gmail.com are problematic if your primiary MX is using greylist as one of the antispam measure. One of the simple method to get around this is to whitelist ip ranges of the gmail outgoing mail servers. The ip ranges of gmail.com can be easily found by using the command :

host -t txt _spf.google.com

host -t txt _spf.google.com

To make a image with colourful subject framed within a black & white scene

IMG_2568

I found there’s two ways to do this :

One is using the extract filter in Photoshop CS3

1. Suppose we have two layers of the image, the bottom will be converted to black & white by using the desaturate option; Image> Adjustments>Desaturate (shortcut Ctrl+Shift+U). The upper layer will use extract filter to extract the object

The other way is to use layer mask

See this http://www.ephotozine.com/article/Using-layer-masks-with-Photoshop-4876

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

Create and set the user’s full name.
dscl / -create /Users/toddharris RealName "Dr. Todd Harris"

Create and set the user’s ID.
dscl / -create /Users/toddharris UniqueID 503

Create and set the user’s group ID property.
dscl / -create /Users/toddharris PrimaryGroupID 1000

Create and set the user home directory.
dscl / -create /Users/toddharris NFSHomeDirectory /Local/Users/toddharris

Set the password.
dscl / -passwd /Users/toddharris PASSWORD

or

passwd toddharris

If you would like Dr. Harris to be able to perform administrative functions:
dscl / -append /Groups/admin GroupMembership toddharris

Read informations about a group, e.g. “_developer”

dscl localhost -read /Local/Default/Groups/_developer

or shorter

dscl . -read /Groups/_developer

If you want to know the groups your user is a member of

id -Gn

Add the user “gustav” to the group “_developer”

sudo dscl . -append /Groups/_developer GroupMembership gustav

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 the Printer_name, tleast from what I can determine. "Printer location" can be anything. An IP address belongs in thex.x.x.x bit, and change lpd: to ipp: if that’s what you use. I’m unsure about other protocols, but perhaps the man page can tell you much more about this command. Last of all is the driver. Before using the command, you’d be best to look in the directory shown and find the filename, and then replicate it in the command line. If you’re lazy you could always just drag the PPD file over to the Terminal window, too!

To remove a printer, it’s a far simpler affair. Simply:

lpadmin -x Printer_Name

Queue Management

Nothing is more annoying than a printer, well, printing things, when people have walked away leaving nothing but a big pile of print jobs behind. And the last thing anyone should have to do is find and clear all printer queues manually. Thankfully, this too is easily resolved. Here are just a couple of commands I’ve found very helpful; I’m sure there are more if you go looking.

To find out what printers are installed — this one is great for finding the names should you need them with the command above — simply use this:

lpstat -p

If you want to see the current jobs on a computer, simply use this command. (Note that this will show the jobs for the specified printer. However, if you do not specify a printer, it will show the jobs for all queues.)

lpstat -o Printer_Name

To clear a queue of all jobs, we use lprm. Note in this example the first hyphen is solo. This forces all jobs to be cleared; more methods to clear individual jobs or those of a particular are explained in the man page.

lprm - -P Printer_Name

Clearing all queues

Unfortunately I could not find a command which removed all jobs from all queues. So I wrote up a small script which does this for you. You could deploy this as a shell script file and then execute it (good for both SSH and ARD), or in the case of Apple Remote Desktop’s “Send UNIX Command” function, simply throw in the whole script and run it as root.

#!/bin/bash

lpstat -p | awk '{print $2}' | while read printer
do
  echo "Clearing Queue for Printer:" $printer
  lprm - -P $printer
done