Computer Tips

Computer Tips

Mac OS X (command line)

Handy command-line network traffic utility:  nettop 

ASCII dump of system info:   system_profiler

ASCII dump of applications:  system_profiler SPApplicationsDataType

Open app from command line with args
    open foo.app --args bar baz qux

Make ISO image



    hdiutil makehybrid -iso -joliet -o ~/Desktop/MyISODisk.iso /Volumes/MyISODisk

Mac OS X


open a hidden file, in the open dialog press command+shift+. and the hidden files will appear

Finder dialog box is active type G to bring up the 'Go To File direct entry dialog. You can enter the path to the file in the dialog using the Unix-type path expressions


Linux / *nix / Ubuntu / RedHat / maybe OS X

Setting default printer:
    lpstat -v           # list all printers
    sudo lpadmin -d dev # set default dev


See info for buttons when pressed on mouse
    xev | grep -A 2 ButtonPress

Force fsck on boot using /forcefsck
    sudo touch /forcefsck
 
enscript the way I like it
    enscript --pretty-print --color --landscape --columns=1 --fancy-header file

df my way
    df -BG | sed -e '1p' -e '/^\/dev/!d'

copy pl files with "cxd" to ~/foo directory
    fgrep -l cxd *.pl | xargs cp -vp -t ~/foo

search for "step" or "walk" in header and C++ files (ignore case)
    egrep -i "step|walk" *.@(h|cpp)

mirror web site
    wget -m -p http://www.site.com/

    Also create a .wgetrc file in your home directory. In it include:

             robots = off


Miscellaneous

http://tomato.es/  -- Pomodoro Timer


OSX Tools

trueprint gnu utility building hint  9/18/2014

  1. get/build/install gettext
  2. get/configure trueprint
  3. edit src/Makefile
  4. Add to makefile
  5. LDFLAGS = -L /usr/local/lib
  6. LIBS = -lintl 
  7. make check trueprint
  8. install

Vim / gvim

To open a new gvim window from an existing gvim window use

    :silent !gvim

regex reference

    http://vimregex.com/

Open files w/ each in a new tab
   
    alias gvim='gvim -p --remote-tab-silent'

View a list of recent documents in Vim

   
Don't use a plugin, unless you want a nice menu.  From Vim Documentation: Starting (or :help old):

:ol[dfiles]
List the files that have marks stored in the viminfo file.

:bro[wse] ol[dfiles][!]
List file names as with :oldfiles, and then prompt for a number. When the number is valid that file from the list is edited. Use ! to abandon a modified buffer.

No comments: