<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-18428294</id><updated>2012-01-28T02:35:37.196-08:00</updated><category term='nm'/><category term='solaris 10'/><category term='maxpgio'/><category term='mdb'/><title type='text'>Programming - Powerful One liners</title><subtitle type='html'>&lt;b&gt;"What can a one liner do for you?" &lt;/b&gt; - Frankly Speaking</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>27</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-18428294.post-8955218706878632914</id><published>2007-11-05T19:06:00.000-08:00</published><updated>2007-11-05T19:11:42.887-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='solaris 10'/><category scheme='http://www.blogger.com/atom/ns#' term='nm'/><category scheme='http://www.blogger.com/atom/ns#' term='mdb'/><category scheme='http://www.blogger.com/atom/ns#' term='maxpgio'/><title type='text'>mdb display options (64-bit vs 32-bit) [42]</title><summary type='text'>To see whether to use the \D or \E display option in mdb: You can run nm and see  whether the variable is 4 or 8 bytes. If it's 8 bytes (64 bit) then you need to use /E otherwise /D.-bash-3.00$ /usr/ccs/bin/nm /dev/ksyms |grep maxpgio[23962] |      25553712|           8|OBJT |GLOB |0    |ABS    |maxpgioIn the above example the third column tells us that this maxpgio is 8 byte object therefore we</summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/8955218706878632914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=8955218706878632914' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/8955218706878632914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/8955218706878632914'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2007/11/mdb-display-options-64-bit-vs-32-bit.html' title='mdb display options (64-bit vs 32-bit) [42]'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-115507372404622442</id><published>2006-08-08T14:48:00.000-07:00</published><updated>2006-08-08T14:48:44.060-07:00</updated><title type='text'>Check disk space [41]</title><summary type='text'>Check disk space (requires bssh)sudo bssh `cat dbs | tr '\n' ','` 'df -h' &gt; logs/disk_report.080806</summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/115507372404622442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=115507372404622442' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/115507372404622442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/115507372404622442'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2006/08/check-disk-space-41.html' title='Check disk space [41]'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-115368446616518206</id><published>2006-07-23T12:45:00.000-07:00</published><updated>2006-07-23T12:54:26.176-07:00</updated><title type='text'>Managing Foreground and Background Jobs and Processes [32-40]</title><summary type='text'>Unix system administrators often need to switch and move jobs from foreground to background and vice versa. [32] To stop (not kill) a currently running job and return to shell, you can use Ctrl-z. [33] Then to view the stopped jobs during the current sessionjobs[34] To kill a stopped job number 2kill -9 %2[35] Check the status of processes in all sessions running by user franklyps -u frankly[36] </summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/115368446616518206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=115368446616518206' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/115368446616518206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/115368446616518206'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2006/07/managing-foreground-and-background.html' title='Managing Foreground and Background Jobs and Processes [32-40]'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-115309823406247355</id><published>2006-07-16T18:02:00.000-07:00</published><updated>2006-07-16T18:03:54.080-07:00</updated><title type='text'>Copy MySQL tables between different hosts [31]</title><summary type='text'>The following command will allow you to copy MySQL tables between different hosts mysqldump -h ip -uuser -ppass from_db  from_table | mysql -uuser -ppass target_db</summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/115309823406247355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=115309823406247355' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/115309823406247355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/115309823406247355'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2006/07/copy-mysql-tables-between-different.html' title='Copy MySQL tables between different hosts [31]'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-115072748032261772</id><published>2006-06-19T07:27:00.000-07:00</published><updated>2006-06-19T07:33:03.496-07:00</updated><title type='text'>Run a command on multiple MySQL hosts</title><summary type='text'>cat  /lists/dbs | while read i ; do echo $i; /path/to/mysql -h $i -e "SHOW variables like 'old%'";  doneThis programming one liner allows you to run a command on multiple MySQL hosts. To use this command, simply create a file dbs with all the MySQL hosts (one per line). The sample command prints the value of whether the database is using old passwords.</summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/115072748032261772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=115072748032261772' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/115072748032261772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/115072748032261772'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2006/06/run-command-on-multiple-mysql-hosts.html' title='Run a command on multiple MySQL hosts'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-114206250546762826</id><published>2006-03-10T23:33:00.000-08:00</published><updated>2006-03-10T23:35:05.476-08:00</updated><title type='text'>IPCS remove semaphores</title><summary type='text'>If you get an error message saying "HTTPD dead but PID exists", your disk space is either full or all IPCS semaphores have been used up.ipcs -s | awk ' $3 == "apache" {print $2, $3}' | awk '{ print $1}' | while read i; do ipcrm sem $i; doneClean up ipcs semaphores </summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/114206250546762826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=114206250546762826' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/114206250546762826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/114206250546762826'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2006/03/ipcs-remove-semaphores.html' title='IPCS remove semaphores'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-114196845660245057</id><published>2006-03-09T21:27:00.000-08:00</published><updated>2006-03-09T21:27:36.873-08:00</updated><title type='text'>Remove blank / empty lines PHP [29]</title><summary type='text'>I found this great implementation to remove blank (empty lines) from a string at PHP web site.function removeEmptyLines($string){   return preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $string);}</summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/114196845660245057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=114196845660245057' title='19 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/114196845660245057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/114196845660245057'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2006/03/remove-blank-empty-lines-php-29.html' title='Remove blank / empty lines PHP [29]'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>19</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113812839060877795</id><published>2006-01-24T10:46:00.000-08:00</published><updated>2006-01-24T10:46:48.330-08:00</updated><title type='text'>PHP clean filename</title><summary type='text'>Clean a string for filename`echo "$clean" | tr A-Z a-z | tr "[]()&amp;~@#$%^&amp;*()_+=;:,.!' " "-" `;This programming one liner allows you to clean the unwanted characters in  a string. The list of characters is specified as the first parameter to the tr command. Programming "One Liner" lookup terms:str_replace trUSE THIS PROGRAMMING ONE LINER AT OWN RISK AS AUTHOR CLAIMS NO RESPONSIBILITY.If you would </summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113812839060877795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113812839060877795' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113812839060877795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113812839060877795'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2006/01/php-clean-filename.html' title='PHP clean filename'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113217447650547425</id><published>2005-11-16T12:49:00.000-08:00</published><updated>2005-11-16T12:54:36.636-08:00</updated><title type='text'>fr - Find and replace software tool for Linux</title><summary type='text'>fr - find and replace text utility#############################################################            Find and Replace Script by Frank Mash   #############################################################--&gt; Usage: /sbin/fr [filename] [search] [replace] [b] [i]--&gt; ################# EXAMPLES #############################--&gt; EXAMPLE 1: Find 'Apples' and Replace with 'Oranges'. Create a backup </summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113217447650547425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113217447650547425' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113217447650547425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113217447650547425'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/11/fr-find-and-replace-software-tool-for.html' title='fr - Find and replace software tool for Linux'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113189987172074231</id><published>2005-11-13T08:37:00.000-08:00</published><updated>2005-11-13T08:37:51.770-08:00</updated><title type='text'>AWK - Find - Delete Second Field/Column -  One Liner 25 - 26</title><summary type='text'>AWKawk '/PATTERN/ {print "PATTERN FOUND"}' /var/awk_programming_testThis programming one liner allows you to search for PATTERN in awk_programming_test file. Once the pattern is found, the print statement is invoked . AWK - Delete second columnProgramming One Liner 26awk ' BEGIN{FS=",";} { $2= ""; print}' /var/awk_programming_testThis programming one liner allows you to delete the second field in</summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113189987172074231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113189987172074231' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113189987172074231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113189987172074231'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/11/awk-find-delete-second-fieldcolumn-one.html' title='AWK - Find - Delete Second Field/Column -  One Liner 25 - 26'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113189862238853434</id><published>2005-11-13T08:13:00.000-08:00</published><updated>2005-11-13T08:17:02.493-08:00</updated><title type='text'>GCC version - Programming One Liner 24</title><summary type='text'>GCC: Finding the GCC Versiongcc --versionThis programming one liner allows you to find which version of gcc (compiler) is installed on your linux server. Programming "One Liner" lookup terms:gccUSE THIS PROGRAMMING ONE LINER AT OWN RISK AS AUTHOR CLAIMS NO RESPONSIBILITY.If you would like more information on any of the commands, please feel free to contact me with your programming questions.   </summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113189862238853434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113189862238853434' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113189862238853434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113189862238853434'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/11/gcc-version-programming-one-liner-24.html' title='GCC version - Programming One Liner 24'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113189795163645396</id><published>2005-11-13T08:00:00.000-08:00</published><updated>2005-11-13T08:05:51.656-08:00</updated><title type='text'>List signal names - One liner 23</title><summary type='text'>Signal Namesfuser -l This programming one liner allows you to output signal names using fuser. Linux signal names are displayed as follows[root@plain docs]# fuser -lHUP INT QUIT ILL TRAP ABRT IOT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERMSTKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYSUNUSEDProgramming "One Liner" lookup terms:fuserUSE THIS PROGRAMMING ONE LINER AT </summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113189795163645396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113189795163645396' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113189795163645396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113189795163645396'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/11/list-signal-names-one-liner-23.html' title='List signal names - One liner 23'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113093927352977761</id><published>2005-11-02T05:23:00.000-08:00</published><updated>2005-11-02T05:50:17.706-08:00</updated><title type='text'>gunzip multiple files - Programming OneLiner 22</title><summary type='text'>Gunzipgunzip site*.gzThis programming one liner allows you to unzip / gunzip all files beginning with site and ending with .gz within the current directory Programming "One Liner" lookup terms:gunzip gzipUSE THIS PROGRAMMING ONE LINER AT OWN RISK AS AUTHOR CLAIMS NO RESPONSIBILITY.If you would like more information on any of the commands, please feel free to contact me with your programming </summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113093927352977761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113093927352977761' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113093927352977761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113093927352977761'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/11/gunzip-multiple-files-programming.html' title='gunzip multiple files - Programming OneLiner 22'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113073811083825052</id><published>2005-10-30T21:54:00.000-08:00</published><updated>2005-10-30T21:55:10.946-08:00</updated><title type='text'>Investigating all open ports on Linux web server - Programming One Liner 18 -  21</title><summary type='text'>Unneeded open ports can be costly for your business!If you have unneeded and unexplained ports open on your server, you are calling for trouble.nmap -p 1-65535 localhostThis programming one liner allows you to look for all open ports (ports that are currently listening) on your Linux server. Programming "One Liner" lookup terms:nmap fuserOutput of running the above command will produce something </summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113073811083825052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113073811083825052' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113073811083825052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113073811083825052'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/10/investigating-all-open-ports-on-linux.html' title='Investigating all open ports on Linux web server - Programming One Liner 18 -  21'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113070610697071822</id><published>2005-10-30T12:57:00.000-08:00</published><updated>2005-10-30T13:13:15.973-08:00</updated><title type='text'>Watch /var/log/messages for SSH intruders - Programming One Liner 17</title><summary type='text'>Monitoring /var/log/messages date &gt;&gt; /user/security/ssh-intruders.log ; cat /var/log/messages* | grep -i "sshd.*authentication failure" |  sort |  awk '{FS="rhost="; print $2}'  | awk '{FS="user="; print $1}' | grep ".*\..*\." | grep -v "knownhost.com" | grep -v "knownhost2.com" |  sort | uniq | while read i; do  counter=`grep -i "$i" /var/log/messages* | wc -l` ; echo "$counter attempts by $i"; </summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113070610697071822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113070610697071822' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113070610697071822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113070610697071822'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/10/watch-varlogmessages-for-ssh-intruders.html' title='Watch /var/log/messages for SSH intruders - Programming One Liner 17'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113064781731147037</id><published>2005-10-29T21:49:00.000-07:00</published><updated>2005-10-29T21:50:17.363-07:00</updated><title type='text'>Query RPM packages for information - Programming One Liner 16</title><summary type='text'>Get information about a RPM[root@plain home]# rpm -qip gnome-desktop-2.2.2-2.2E.src.rpmName        : gnome-desktop                Relocations: (not relocatable)Version     : 2.2.2                             Vendor: Red Hat, Inc.Release     : 2.2E                          Build Date: Wed 20 Jul 2005 04:12:27 PM CDTInstall Date: (not installed)               Build Host: crowe.devel.redhat.comGroup</summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113064781731147037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113064781731147037' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113064781731147037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113064781731147037'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/10/query-rpm-packages-for-information.html' title='Query RPM packages for information - Programming One Liner 16'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113064755356549990</id><published>2005-10-29T21:43:00.000-07:00</published><updated>2005-10-29T21:45:53.566-07:00</updated><title type='text'>Send a message to all users - Programming One Liner 15</title><summary type='text'>Broadcasting a messagewallThis programming one liner allows you to everyone connected to a terminal. Simply type wall, enter the message and press Ctrl-d to send it. [root@plain user]# wallfixedBroadcast message from root (pts/0) (Sat Oct 29 22:52:36 2005):fixedProgramming "One Liner" lookup terms:wallUSE THIS PROGRAMMING ONE LINER AT OWN RISK AS AUTHOR CLAIMS NO RESPONSIBILITY.If you would like </summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113064755356549990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113064755356549990' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113064755356549990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113064755356549990'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/10/send-message-to-all-users-programming.html' title='Send a message to all users - Programming One Liner 15'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113061518181905399</id><published>2005-10-29T12:43:00.000-07:00</published><updated>2005-10-29T12:47:35.506-07:00</updated><title type='text'>Create and verify a tarball for a directory -  Programming One Liner 14</title><summary type='text'>tar  - working with tarballstar -Wcvf /user/backups/site6-fst.tar etc home var &gt;/designerz/backups/log.site6.fst.bkThis programming one liner allows you to create a verified archive. The command generates all files processed to the screen. Programming "One Liner" lookup terms:tar USE THIS PROGRAMMING ONE LINER AT OWN RISK AS AUTHOR CLAIMS NO RESPONSIBILITY.If you would like more information on </summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113061518181905399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113061518181905399' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113061518181905399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113061518181905399'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/10/create-and-verify-tarball-for.html' title='Create and verify a tarball for a directory -  Programming One Liner 14'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113061477989089671</id><published>2005-10-29T12:33:00.000-07:00</published><updated>2005-10-29T12:40:05.486-07:00</updated><title type='text'>Process Information - Programming One Liner 12 - 13</title><summary type='text'>ps - process informationps 316For a currently running process, you can use ps with the process id (pid) to see information about the process and to verify that its still running.   Programming "One Liner" lookup terms:psProgramming One Liner 13 See all processing currently running (started by you)[root@plain html]# ps  PID TTY          TIME CMD20056 pts/5    00:00:05 bash  316 pts/5    00:07:53 </summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113061477989089671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113061477989089671' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113061477989089671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113061477989089671'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/10/process-information-programming-one.html' title='Process Information - Programming One Liner 12 - 13'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113061305362383983</id><published>2005-10-29T12:06:00.000-07:00</published><updated>2005-10-29T12:14:14.890-07:00</updated><title type='text'>Restoring files from an old hard drive to new drive -  Programming One Liner 11</title><summary type='text'>Using rsync to restoring directories between two drivesrsync -vrplogDtH /olda/dir /home/dirThis programming one liner allows you to restore / copy files from one hard drive to another. This can be useful in cases when you have a hacked hard drive as slave attached to your web server and now you want to restore files. Programming "One Liner" lookup terms:rsync rcpBrief explanation of options used </summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113061305362383983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113061305362383983' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113061305362383983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113061305362383983'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/10/restoring-files-from-old-hard-drive-to.html' title='Restoring files from an old hard drive to new drive -  Programming One Liner 11'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113060343998065349</id><published>2005-10-29T09:11:00.000-07:00</published><updated>2005-10-29T09:30:40.196-07:00</updated><title type='text'>Files and folders in a directory  with ls and dir - Programming One Liner 5 - 10</title><summary type='text'>Contents of a directoryThis programming one liner allows you to see what files and directories are available within a folder on your Linux web server. Upon invocation of this one liner, the contents of your current directory (pwd) will be displayed. lsIf you believe your ls binary is corrupt (due to a server hack) or just to use an alternate command, you can use the following command on Linux </summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113060343998065349/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113060343998065349' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113060343998065349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113060343998065349'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/10/files-and-folders-in-directory-with-ls.html' title='Files and folders in a directory  with ls and dir - Programming One Liner 5 - 10'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113060222107393068</id><published>2005-10-29T09:06:00.000-07:00</published><updated>2005-10-29T09:10:26.140-07:00</updated><title type='text'>Total Disk used by a file or directory server -  Programming One Liner 4</title><summary type='text'>Directory Disk Usagedu -h -s site6-www.tar.defunctThis programming one liner allows you to view total disk used by a folder or file on a server in a summarized and readable format. Programming "One Liner" lookup terms:df duUSE THIS PROGRAMMING ONE LINER AT OWN RISK AS AUTHOR CLAIMS NO RESPONSIBILITY.If you would like more information on any of the commands, please feel free to contact me with </summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113060222107393068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113060222107393068' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113060222107393068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113060222107393068'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/10/total-disk-used-by-file-or-directory.html' title='Total Disk used by a file or directory server -  Programming One Liner 4'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113059873807370273</id><published>2005-10-29T08:09:00.000-07:00</published><updated>2005-10-29T08:24:16.010-07:00</updated><title type='text'>Remove Server Directory - Programming One Liner 3</title><summary type='text'>Removing a directory on serverrm -r -f /tmp/directoryThis programming one liner allows you to recursively, completely and forcefully  remove the directory.Programming "One Liner" lookup terms: rm unlink USE THIS PROGRAMMING ONE LINER AT OWN RISK AS AUTHOR CLAIMS NO RESPONSIBILITY.If you would like more information on any of the commands, please feel free to contact me with your programming </summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113059873807370273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113059873807370273' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113059873807370273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113059873807370273'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/10/remove-server-directory-programming.html' title='Remove Server Directory - Programming One Liner 3'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113059802781146279</id><published>2005-10-29T07:53:00.000-07:00</published><updated>2005-10-29T08:00:27.833-07:00</updated><title type='text'>Things not making sense? Want to improve your productivity? Let me help you with your programming projects</title><summary type='text'>Dear reader,If you would like more information on any of the programming commands on this site, or need help with your programming projects, please feel free to contact me by posting a comment on any of these post. I will help you understand any one liner in complete detail to help increase your productivity and programming knowledge for a very economical fee. In addition, if you have any general</summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113059802781146279/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113059802781146279' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113059802781146279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113059802781146279'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/10/things-not-making-sense-want-to.html' title='Things not making sense? Want to improve your productivity? Let me help you with your programming projects'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113059692771426862</id><published>2005-10-29T07:34:00.000-07:00</published><updated>2005-10-29T08:03:50.106-07:00</updated><title type='text'>Server Backup - Programming One Liner 2</title><summary type='text'>Server directory backupcd /user/backups; ls -1 /oldb2/home/virtual/ | grep site | grep -v '-' | while read i; do bkdir=/oldb2/home/virtual/$i; echo $i; echo $bkdir;   tar -cf $i-www.tar $bkdir/fst/var/www; echo "Gunzip $i"; gzip $i-www.tar;  ls -l $i-www.tar.gz;  doneThis programming one liner allows you to backup directories. First it makes a tarball of a directory and then uses gzip to compress</summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113059692771426862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113059692771426862' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113059692771426862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113059692771426862'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/10/server-backup-programming-one-liner-2.html' title='Server Backup - Programming One Liner 2'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113059567584080647</id><published>2005-10-29T07:17:00.000-07:00</published><updated>2005-10-29T07:29:11.530-07:00</updated><title type='text'>Disk usage human readable - Programming One Liner 1 - Linux</title><summary type='text'>df -hThis programming one liner allows you to view disk usage in human readable formatProgramming "One Liner" lookup terms:man dfUSE THIS PROGRAMMING ONE LINER AT OWN RISK AS AUTHOR CLAIMS NO RESPONSIBILITY.For more information on this one liner programming  code, lookup the programming terms displayed above, visit my Linux and network security blog, external programming blogs on Technorati, or </summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113059567584080647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113059567584080647' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113059567584080647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113059567584080647'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/10/disk-usage-human-readable-programming.html' title='Disk usage human readable - Programming One Liner 1 - Linux'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18428294.post-113059155930832248</id><published>2005-10-29T06:06:00.000-07:00</published><updated>2005-10-29T06:12:39.316-07:00</updated><title type='text'>Programming one liners - Sophisticated, Productive, Time Saving -  Programming at the Extreme</title><summary type='text'>I have  been addicted to programming one liners ever since I first discovered them. Sometimes I find myself writing more than 200 one liners in a day. To keep a record of these one liners I started this blog. If you are passionate about one liners, I invite you to join my blog. Simply post a comment to any post on this programming one liners blog and I will respond promptly. Please provide a </summary><link rel='replies' type='application/atom+xml' href='http://programming-oneliners.blogspot.com/feeds/113059155930832248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18428294&amp;postID=113059155930832248' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113059155930832248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18428294/posts/default/113059155930832248'/><link rel='alternate' type='text/html' href='http://programming-oneliners.blogspot.com/2005/10/programming-one-liners-sophisticated.html' title='Programming one liners - Sophisticated, Productive, Time Saving -  Programming at the Extreme'/><author><name>Frank</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
