Showing all posts tagged #linux:


crontab

Posted on September 15th, 2014

  1. crontab -l : list user's crontab
[Reference]

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


ssh

Posted on August 28th, 2014

[Ubuntu 11.04]
  1. service restart : sudo service ssh restart

GPT/MBR

Posted on May 19th, 2014

[Linux]
  1. Remove GPT - Default back to MBR: http://unix.stackexchange.com/questions/61142/remove-gpt-default-back-to-mbr
    parted /dev/sda
    mklabel msdos
    quit
  2. How to Convert GPT to MBR on Linux: http://www.ehow.com/how_12119053_convert-gpt-mbr-linux.html
    apt-get install gdisk
  3. Create and format exFAT partition from Linux : http://unix.stackexchange.com/questions/61209/create-and-format-exfat-partition-from-linux
    mkfs.exfat /dev/sdX1 , mkfs.exfat /dev/sdX2..... for the rest of partitions
  4. 9 Linux Parted Command Examples : http://www.thegeekstuff.com/2011/09/parted-command-examples/

[Articles]
  1. Booting from GPT : http://www.rodsbooks.com/gdisk/booting.html
  2. Intel Mac can't have more than 4 partitions? : http://superuser.com/questions/160224/intel-mac-cant-have-more-than-4-partitions
  3. Using GPT Drives : http://msdn.microsoft.com/en-us/library/windows/hardware/dn653580(v=vs.85).aspx
  4. MacBook Pro bootcamp Windows cant see GPT partitions : http://www.insanelymac.com/forum/topic/294367-macbook-pro-bootcamp-windows-cant-see-gpt-partitions/
  5. What is the maximum number of partitions that can be made on a hard drive? : http://superuser.com/questions/368173/what-is-the-maximum-number-of-partitions-that-can-be-made-on-a-hard-drive
  6. Windows and GPT FAQ : http://msdn.microsoft.com/en-us/library/windows/hardware/dn640535(v=vs.85).aspx
  7. Using the New GUID Partition Table in Linux (Goodbye Ancient MBR): http://www.linux.com/learn/tutorials/730440-using-the-new-guid-partition-table-in-linux-good-bye-ancient-mbr-
  8. GPT and MBR: http://www.doc88.com/p-4671617917182.html
  9. http://unix.stackexchange.com/questions/114485/fdisk-l-shows-ext3-file-system-as-hpfs-ntfs
[Windows]
  1. https://blogs.aalto.fi/ltuuri/2011/03/10/diskpart-format-exfat/


Samba

Posted on February 21st, 2014


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