понеділок, 10 грудня 2012 р.

Handly shell programming using MySQL

A very handy options to use MySQL queries results in your shell scripts:

       ·   --batch, -B
           Print results using tab as the column separator, with each row on a
           new line. With this option, mysql does not use the history file.

           Batch mode results in nontabular output format and escaping of
           special characters. Escaping may be disabled by using raw mode; see
           the description for the --raw option.

       ·   --skip-column-names, -N
           Do not write column names in results.

Feel the difference!
> mysql -h localhost -e 'show status like "uptime"'
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Uptime        | 2612  |
+---------------+-------+

> mysql -h localhost  -B -N -e 'show status like "uptime"'
Uptime 2619

Refrerences:

понеділок, 3 грудня 2012 р.

Find all external IPv4-addresses (*nix shell)

/sbin/ifconfig | awk '/inet addr/ {print $2}' | awk -F: '{print $2}' | grep -v "^127.0." | grep -v "^192.168." | grep -v "^172.16." | grep -v "^10."

To consider all possible reserved IPv4 subnets you may refer to the following reference: Reserved IPv4 addresses.

UPD: Just found much easier and faster way

hostname --all-ip-addresses | grep -v "^192.168." | grep -v "^172.16." | grep -v "^10.

понеділок, 7 травня 2012 р.

Acer A500 ICS: Rooted!

Just rooted my Acer A500 ICS by following the article: http://forum.xda-developers.com/showthread.php?t=1546593. ICS rooted in few minutes, pretty well!