Wednesday, April 21, 2010

tcpdump in OpenSolaris

tcpdump -s 0 -w file.pcap -i e1000g0 port 10689

Bluetooth “Access Denied” issue and resolution

Today one of my co-workers have a problem activating her Bluetooth mouse. Here is the solution I found in this place:

  1. Open Services:

    1. To still type things out, start the on-screen keyboard by going to Start > Programs > Accessories > Accessibility > On-Screen Keyboard.  From there, you can then doStart > Run and then type services.msc
    2. To directly access Services, do Start > Control Panel > Administrative Tools > Services
  2. Find & select the Bluetooth Support Service, right click and select Properties.
  3. Click the Stop button on the General tab.
  4. Select the Log On tab, and select the radio button next toLocal System account, then click Apply.
  5. Go back to the General tab and click the Start button.
  6. Click OK to close the Properties dialog.
  7. Restart computer to make sure the change takes and things work.

Tuesday, April 13, 2010

Number of days in current Month in UNIX shell

cal | grep -v '[A-Za-z]' | wc -w

Last Sunday of the Month in UNIX shell

cal | grep '^[23]' | tail -1 | cut -d' ' -f1

Several months later I don't remember why the grep part?

cal | tail -1 | cut -d' ' -f1

AWK version:


cal | awk '
    { last = $1 }
END { print last }'