postIt

        Post-It sticky notes with PasteBin sense

  • 6:39 am on January 10, 2012 | 0 | # |
    Tags: ,

    Checking whether /dev/video0 or /dev/ttyUSB0 exists or not (module is installed & probed). They're recognized as "character special file" in bash

    [ -b /dev/ttyUSB0 ] && echo "char special file found" || echo "char special file not found"

    Compare the above to "block special file"

    [ -b /dev/sda ] && echo "block special file found" || echo "block special file not found"
     
  • 8:03 am on August 10, 2011 | 0 | # |
    Tags: , , ,

    Socket monitoring by watching receive and send queue every 5 seconds

    $ while true; do netstat -tn; sleep 5; clear; done

    Result:

     
    Active Internet connections (w/o servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State
    tcp        0      0 10.238.133.152:43941    98.136.48.103:5050      ESTABLISHED
    tcp        1      0 10.238.133.152:42541    8.27.254.249:80         CLOSE_WAIT
    tcp        1      0 10.238.133.152:34355    184.73.222.16:80        CLOSE_WAIT
    tcp        0      0 10.238.133.152:43210    199.59.148.87:443       ESTABLISHED
    tcp        0    229 10.238.133.152:43209    199.59.148.87:443       ESTABLISHED

    This is to emulate combination of watch and ss in Solaris, more or less same result

    $ watch -n 5 ss -t
    State      Recv-Q Send-Q      Local Address:Port          Peer Address:Port
    ESTAB      0      0          10.238.133.152:36045       74.125.224.250:https
    ESTAB      0      0          10.238.133.152:36044       74.125.224.250:https
    CLOSE-WAIT 1      0          10.238.133.152:59622      174.129.233.179:www
    ESTAB      0      0          10.238.133.152:43941        98.136.48.103:mmcc
    CLOSE-WAIT 38     0          10.238.133.152:49300        199.59.148.87:https
    ESTAB      0      0          10.238.133.152:33626       74.125.224.191:https
    CLOSE-WAIT 1      0          10.238.133.152:37621        208.46.163.81:www
     
  • 4:30 am on July 12, 2011 | 0 | # |
    Tags: ,

    Krusader crash giving signal 11:
    1. replace .kde/share/config/krusaderrc with original one from initial installation
    2. remove other files under it

    When installing new, we only need to copy :

    $ ls .kde/share/apps/krusader/
    krusaderui.rc    useractions.xml
     
  • 4:57 am on June 15, 2011 | 0 | # |
    Tags: ,

    tcpdump default truncate to 68 bytes snapshot length (snaplen). Use -s 0 to capture all packet length

    tcpdump -s 0 -w /tmp/my240.dump -i eth1 port 2000
     
  • 1:52 pm on February 12, 2011 | 0 | # |
    Tags: , ,

    Unix time conversion

    $ EPOCH=1297515579843
    $ echo $EPOCH | cut -c1-10
    1297515579
     
    $ echo $EPOCH | cut -c1-10 | awk '{print strftime("%c",$1)}'
    Sat 12 Feb 2011 07:59:39 PM WIT
     
  • 4:26 am on January 4, 2011 | 0 | # |
    Tags:

    Read CSS padding clockwise:

    padding:25px 50px 75px 100px;
    shorthand property for:

      top padding is 25px
      right padding is 50px
      bottom padding is 75px
      left padding is 100px

    padding:25px 50px 75px;

      top padding is 25px
      right and left paddings are 50px
      bottom padding is 75px

    padding:25px 50px;

      top and bottom paddings are 25px
      right and left paddings are 50px

    padding:25px;
    all four paddings are 25px

     
  • 7:50 am on December 27, 2010 | 0 | # |
    Tags: , , ,

    WordPress shortcode-escape trick:

    [ to replace "["
    ] to replace "]"

    Remember not to switch from html editor when using it

     
  • 3:55 am on December 16, 2010 | 0 | # |
    Tags: ,

    Remove OpenOffice recovery file


    /home/username/.openoffice.org2/user/registry/data/org/openoffice/Office/Recovery.xcu

    Delete the above

     
  • 8:47 pm on October 21, 2010 | 0 | # |
    Tags: ,

    Check Solaris package source:

    # /usr/sbin/pkgchk-l -p /usr/ucb/ps
    Pathname: /usr/ucb/ps
    Type: linked file
    Source of link: ../../usr/lib/isaexec
    Referenced by the following packages:
            SUNWscpu
    Current status: installed
     
  • 1:00 pm on October 21, 2010 | 0 | # |
    Tags: , ,

    Solaris MD5 checksum
    digest -a md5 -v /path/to/file
    Referenced to the following package: SUNWcsu
    This is an alternative to md5sum that is available in the Solaris 10 companion CD