Showing all posts tagged #ubuntu:


iwatch

Posted on August 28th, 2014

[Reference]
  1. iwatch - run a command when a file changes: http://arkanis.de/weblog/2014-02-16-iwatch-run-a-command-when-a-file-changes
[help]
iWatch 0.2.2, a realtime filesystem monitor.
Cahya Wirawan , Vienna 2006.

In the daemon mode, iWatch has following options:
Usage: iwatch [-d] [-f ] [-v] [-p ]
-d Execute the application as daemon.
-f
Specify an alternate xml configuration file.
-p
Specify an alternate pid file (default: /var/run/iwatch.pid)
-v Verbose mode.

And in the command line mode:
Usage: iwatch [-c command] [-C charset] [-e event[,event[,..]]] [-h|--help] [-m ]
[-r] [-s ] [-t ] [-v] [--version] [-x exception]
[-X ]

Target is the directory or file you want to monitor.
-c command
Specify a command to be executed if an event occurs. And you can use
following special string format in the command:
%c Event cookie number
%e Event name
%f Full path of the filename that gets an event.
%F The old filename in case moved_to event.
%p Program name (iWatch)
%v Version number
-C charset
Specify the charset (default is utf-8)
-e event[,event[,..]]
Specify a list of events you want to watch. Following are the possible events you can use:
access : file was accessed
modify : file was modified
attrib : file attributes changed
close_write : file closed, after being opened in writeable mode
close_nowrite : file closed, after being opened in read-only mode
close : file closed, regardless of read/write mode
open : file was opened
moved_from : File was moved away from.
moved_to : File was moved to.
move : a file/dir within watched directory was moved
create : a file was created within watched directory
delete : a file was deleted within watched directory
delete_self : the watched file was deleted
unmount : file system on which watched file exists was unmounted
q_overflow : Event queued overflowed
ignored : File was ignored
isdir : event occurred against dir
oneshot : only send event once
all_events : All events
default : close_write, create, delete, move, delete_self and move_self.
-h, --help
Print this help.
-m
Specify the contact point's email address.
-r Recursivity of the watched directory.
-s
Enable or disable reports to the syslog (default is off/disabled)
-t
Specify a filter string (regex) to compare with the filename or directory name.
-v verbose mode.
--version
Print the version number.
-x exception
Specify the file or directory which should not be watched.
-X
Specify a regex string as exception

[Usage]
  1. root@a40jr:/mnt/sda/Temp/git/iwatch# iwatch -c "ls -l %f" -r /mnt/sda/Temp/git/iwatch &
    [5] 8935
    [4] Killed iwatch -c ls -r /mnt/sda/Temp/git/iwatch
    root@a40jr:/mnt/sda/Temp/git/iwatch# [28/ 8月/2014 13:52:27] IN_CREATE /mnt/sda/Temp/git/iwatch/subdir/2.txt
    [28/ 8月/2014 13:52:27] * Command: ls -l /mnt/sda/Temp/git/iwatch/subdir/2.txt
    -rw-r--r-- 1 root root 0 8月 28 13:52 /mnt/sda/Temp/git/iwatch/subdir/2.txt

  2. Since the .git folder issue, use the iwatch to monitor the new branch/tag.
    iwatch -r -c "chmod -R 777 %f" -e create $sDir/$f"
  3. http://manpages.ubuntu.com/manpages/hardy/man1/iwatch.1.html


Ubuntu

Posted on February 9th, 2014

[Package]
  1. Version : http://blog.longwin.com.tw/2010/06/debian-ubuntu-version-2010/
    lsb_release -a
  2. upgrade 12.10->14.04 :http://askubuntu.com/questions/453596/how-to-upgrade-from-ubuntu-12-10-to-14-04
    sudo apt-get update
    sudo apt-get dist-upgrade
    sudo do-release-upgrade
  3. adb : http://bernaerts.dyndns.org/linux/74-ubuntu/245-ubuntu-precise-install-android-sdk
[Driver install]
  1. Can I install extra drivers via the command prompt?: http://askubuntu.com/questions/22118/can-i-install-extra-drivers-via-the-command-prompt
  2. http://askubuntu.com/questions/265531/under-system-settings-details-graphics-shown-as-unknown