grep . regular expression _ anchors $ and ^ (meta characters)

commandline session

$ 4.2.20 29 530---> grep -h '^sort' worked
$ 4.2.20 30 531---> grep -h 'sort^' worked
$ 4.2.20 31 532---> grep -h 'sort$' worked
Bubble sort
Selection sort
Insertion sort
Shell sort
Comb sort
Merge sort
Heapsort
Quicksort
Counting sort
 Bucket sort
 Radix sort
 Distribution sort
 Timsort
$ 4.2.20 32 533---> grep -h '$sort' worked
$ 4.2.20 33 534--->

grep . dot meta character

commandline session

$ 4.2.20 37 537---> grep  rt  worked
Bubble sort
Selection sort
Insertion sort
Shell sort
Comb sort
Merge sort
Heapsort
Quicksort
Counting sort
 Bucket sort
 Radix sort
 Distribution sort
 Timsort
$ 4.2.20 38 538---> grep  p.rt  worked
$ 4.2.20 39 539---> grep  ..rt  worked
Bubble sort
Selection sort
Insertion sort
Shell sort
Comb sort
Merge sort
Heapsort
Quicksort
Counting sort
 Bucket sort
 Radix sort
 Distribution sort
 Timsort
$ 4.2.20 40 540---> grep  s.rt  worked
Bubble sort
Selection sort
Insertion sort
Shell sort
Comb sort
Merge sort
Heapsort
Quicksort
Counting sort
 Bucket sort
 Radix sort
 Distribution sort
 Timsort
$ 4.2.20 41 541--->

grep . global regular expression print . (name of file)

commandline session

$ 4.2.20 15 515---> grep -L ar /usr/sbin/*
/usr/sbin/add-shell
/usr/sbin/cracklib-format
/usr/sbin/remove-shell
/usr/sbin/su-to-root
/usr/sbin/tzconfig
/usr/sbin/update-grub
/usr/sbin/update-grub2
/usr/sbin/update-icon-caches
/usr/sbin/update-icon-caches.gtk2
$ 4.2.20 16 516--->


$ 4.2.20 12 512---> ls /usr/sbin/ | grep -l ar
(standard input)
$ 4.2.20 13 513---> grep -l ar /usr/sbin/
$ 4.2.20 14 514---> grep -l ar /usr/sbin/*
/usr/sbin/a2dismod
/usr/sbin/a2dissite
/usr/sbin/a2enmod
/usr/sbin/a2ensite
/usr/sbin/accept
/usr/sbin/accessdb
/usr/sbin/acpid
/usr/sbin/addgroup
/usr/sbin/adduser
/usr/sbin/alsa
/usr/sbin/alsactl
/usr/sbin/anacron
/usr/sbin/apache2
/usr/sbin/apache2ctl
/usr/sbin/apachectl
/usr/sbin/arp
/usr/sbin/arpd
/usr/sbin/aspell-autobuildhash
/usr/sbin/avahi-daemon
/usr/sbin/bccmd
/usr/sbin/biosdecode
/usr/sbin/bluetoothd
/usr/sbin/cf-agent
/usr/sbin/cf-execd
/usr/sbin/cf-key
/usr/sbin/cf-know
/usr/sbin/cf-monitord
/usr/sbin/cf-promises
/usr/sbin/cf-report
/usr/sbin/cf-runagent
/usr/sbin/cf-serverd
/usr/sbin/chat
/usr/sbin/check_forensic
/usr/sbin/checkgid
/usr/sbin/cherryd
/usr/sbin/chgpasswd
/usr/sbin/chpasswd
/usr/sbin/chroot
/usr/sbin/ck-log-system-restart
/usr/sbin/ck-log-system-start
/usr/sbin/ck-log-system-stop
/usr/sbin/console-kit-daemon
/usr/sbin/cpgr
/usr/sbin/cppw
/usr/sbin/cracklib-check
/usr/sbin/cracklib-packer
/usr/sbin/cracklib-unpacker
/usr/sbin/create-cracklib-dict
/usr/sbin/cron
/usr/sbin/cryptdisks_start
/usr/sbin/cryptdisks_stop
/usr/sbin/cryptmount-setup
/usr/sbin/cupsaccept
/usr/sbin/cupsaddsmb
/usr/sbin/cupsctl
/usr/sbin/cupsdisable
/usr/sbin/cupsenable
/usr/sbin/cupsreject
/usr/sbin/cytune
/usr/sbin/debootstrap
/usr/sbin/defoma-reconfigure
/usr/sbin/delgroup
/usr/sbin/deluser
/usr/sbin/dkms
/usr/sbin/dmidecode
/usr/sbin/dnsmasq
/usr/sbin/dpkg-divert
/usr/sbin/dpkg-preconfigure
/usr/sbin/dpkg-reconfigure
/usr/sbin/dpkg-statoverride
/usr/sbin/e2freefrag
/usr/sbin/e4defrag
/usr/sbin/exicyclog
/usr/sbin/exigrep
/usr/sbin/exim
/usr/sbin/exim4
/usr/sbin/exim_checkaccess
/usr/sbin/exim_convert4r4
/usr/sbin/exim_dbmbuild
/usr/sbin/exim_dumpdb
/usr/sbin/exim_fixdb
/usr/sbin/exim_lock
/usr/sbin/eximstats
/usr/sbin/exim_tidydb
/usr/sbin/exinext
/usr/sbin/exipick
/usr/sbin/exiqgrep
/usr/sbin/exiqsumm
/usr/sbin/exiwhat
/usr/sbin/famd
/usr/sbin/fatresize
/usr/sbin/fdformat
/usr/sbin/filefrag
/usr/sbin/gconf-schemas
/usr/sbin/gdm3
/usr/sbin/gnome-menus-blacklist
/usr/sbin/gpm
/usr/sbin/gpm-microtouch-setup
/usr/sbin/gpm-mouse-test
/usr/sbin/groupadd
/usr/sbin/groupdel
/usr/sbin/groupmod
/usr/sbin/grpck
/usr/sbin/grpconv
/usr/sbin/grpunconv
/usr/sbin/grub-install
/usr/sbin/grub-mkconfig
/usr/sbin/grub-mkdevicemap
/usr/sbin/grub-mknetdir
/usr/sbin/grub-probe
/usr/sbin/grub-reboot
/usr/sbin/grub-set-default
/usr/sbin/grub-setup
/usr/sbin/hald
/usr/sbin/hciattach
/usr/sbin/hciconfig
/usr/sbin/hciemu
/usr/sbin/hcitrace
/usr/sbin/htcacheclean
/usr/sbin/httxt2dbm
/usr/sbin/iconvconfig
/usr/sbin/install-docs
/usr/sbin/install-info
/usr/sbin/install-keymap
/usr/sbin/install-menu
/usr/sbin/install-sgmlcatalog
/usr/sbin/invoke-rc.d
/usr/sbin/ip6tables-apply
/usr/sbin/iptables-apply
/usr/sbin/iptraf
/usr/sbin/ispell-autobuildhash
/usr/sbin/ldattach
/usr/sbin/libgvc5-config-update
/usr/sbin/locale-gen
/usr/sbin/logrotate
/usr/sbin/lpadmin
/usr/sbin/lpc
/usr/sbin/lpinfo
/usr/sbin/lpmove
/usr/sbin/luksformat
/usr/sbin/make-ssl-cert
/usr/sbin/minissdpd
/usr/sbin/mkinitramfs
/usr/sbin/mklost+found
/usr/sbin/modem-manager
/usr/sbin/mono-server2-admin
/usr/sbin/mono-server2-update
/usr/sbin/mysqld
/usr/sbin/mysqlmanager
/usr/sbin/NetworkManager
/usr/sbin/newusers
/usr/sbin/nologin
/usr/sbin/ntpdate
/usr/sbin/ntpdate-debian
/usr/sbin/ownership
/usr/sbin/pam-auth-update
/usr/sbin/pam_getenv
/usr/sbin/paperconfig
/usr/sbin/pcscd
/usr/sbin/pm-hibernate
/usr/sbin/pm-powersave
/usr/sbin/pm-suspend
/usr/sbin/pm-suspend-hybrid
/usr/sbin/pmt-ehd
/usr/sbin/pmvarrun
/usr/sbin/pppd
/usr/sbin/pppdump
/usr/sbin/pppoe-discovery
/usr/sbin/pppstats
/usr/sbin/pwck
/usr/sbin/pwconv
/usr/sbin/pwunconv
/usr/sbin/readprofile
/usr/sbin/rebuild-security-providers
/usr/sbin/reject
/usr/sbin/remove-default-ispell
/usr/sbin/remove-default-wordlist
/usr/sbin/rmail
/usr/sbin/rmt
/usr/sbin/rmt-tar
/usr/sbin/rotatelogs
/usr/sbin/rpcinfo
/usr/sbin/rsmtp
/usr/sbin/rtcwake
/usr/sbin/rtkitctl
/usr/sbin/rtmpgw
/usr/sbin/rtmpsrv
/usr/sbin/rtmpsuck
/usr/sbin/runq
/usr/sbin/rvnamed
/usr/sbin/safe_finger
/usr/sbin/select-default-ispell
/usr/sbin/select-default-wordlist
/usr/sbin/sendmail
/usr/sbin/service
/usr/sbin/setvesablank
/usr/sbin/split-logfile
/usr/sbin/squid3
/usr/sbin/sshd
/usr/sbin/synaptic
/usr/sbin/sync-available
/usr/sbin/syslog2eximlog
/usr/sbin/tcpd
/usr/sbin/tcpdchk
/usr/sbin/tcpdmatch
/usr/sbin/tcpdump
/usr/sbin/tcptraceroute
/usr/sbin/tcptraceroute.db
/usr/sbin/traceroute
/usr/sbin/try-from
/usr/sbin/tunelp
/usr/sbin/umount.hal
/usr/sbin/update-alternatives
/usr/sbin/update-apt-xapian-index
/usr/sbin/update-binfmts
/usr/sbin/update-bootsystem-insserv
/usr/sbin/update-ca-certificates
/usr/sbin/update-catalog
/usr/sbin/update-ccache-symlinks
/usr/sbin/update-cracklib
/usr/sbin/update-default-aspell
/usr/sbin/update-default-ispell
/usr/sbin/update-default-wordlist
/usr/sbin/update-dictcommon-aspell
/usr/sbin/update-dictcommon-hunspell
/usr/sbin/update-exim4.conf
/usr/sbin/update-exim4.conf.template
/usr/sbin/update-exim4defaults
/usr/sbin/update-flashplugin-nonfree
/usr/sbin/update-fmtutil
/usr/sbin/update-fonts-alias
/usr/sbin/update-fonts-dir
/usr/sbin/update-fonts-scale
/usr/sbin/update-gsfontmap
/usr/sbin/update-inetd
/usr/sbin/update-info-dir
/usr/sbin/update-initramfs
/usr/sbin/update-java-alternatives
/usr/sbin/update-language
/usr/sbin/update-language-dat
/usr/sbin/update-language-def
/usr/sbin/update-locale
/usr/sbin/update-mime
/usr/sbin/update-passwd
/usr/sbin/update-python-modules
/usr/sbin/update-rc.d
/usr/sbin/update-rc.d-insserv
/usr/sbin/update-texmf
/usr/sbin/update-texmf-config
/usr/sbin/update-updmap
/usr/sbin/update-usbids
/usr/sbin/update-xmlcatalog
/usr/sbin/upgrade-from-grub-legacy
/usr/sbin/usb_modeswitch
/usr/sbin/usb_modeswitch_dispatcher
/usr/sbin/usbmuxd
/usr/sbin/useradd
/usr/sbin/userdel
/usr/sbin/usermod
/usr/sbin/validlocale
/usr/sbin/vbetool
/usr/sbin/vcstime
/usr/sbin/vigr
/usr/sbin/vipw
/usr/sbin/visudo
/usr/sbin/vpddecode
/usr/sbin/zic
$ 4.2.20 15 515---> ~

grep . global regular expression print

commandline session

$ 4.2.20 1 501---> ls /usr/sbin/ | grep kernel
$ 4.2.20 2 502---> ls /usr/sbin/ | grep ker
cracklib-packer
cracklib-unpacker
$ 4.2.20 3 503---> ls /usr/sbin/ | grep linux
$ 4.2.20 4 504---> ls /usr/sbin/ | grep lin
update-ccache-symlinks
$ 4.2.20 5 505---> ls /usr/sbin/ | grep li
cracklib-check
cracklib-format
cracklib-packer
cracklib-unpacker
create-cracklib-dict
gnome-menus-blacklist
libgvc5-config-update
remove-default-wordlist
select-default-wordlist
split-logfile
update-ccache-symlinks
update-cracklib
update-default-wordlist
update-fonts-alias
validlocale
$ 4.2.20 6 506--->


$ 4.2.20 6 506---> ls /usr/sbin/ | grep -cv li
261
$ 4.2.20 7 507---> ls /usr/sbin/ | grep -c li
15
$ 4.2.20 8 508--->

(java) bubble sort testing… 0.00001 Ver — 6 No.'s Related

$ 4.2.20 4 504---> time java BubbleSort

real	0m0.254s
user	0m0.160s
sys	0m0.068s
$ 4.2.20 5 505---> time java BubbleSort

real	0m0.208s
user	0m0.152s
sys	0m0.036s
$ 4.2.20 6 506---> time java BubbleSort

real	0m0.209s
user	0m0.124s
sys	0m0.064s
$ 4.2.20 7 507---> time java BubbleSort

real	0m0.210s
user	0m0.144s
sys	0m0.044s
$ 4.2.20 8 508---> time java BubbleSort

real	0m0.254s
user	0m0.148s
sys	0m0.084s
$ 4.2.20 9 509---> time java BubbleSort

real	0m0.253s
user	0m0.180s
sys	0m0.056s
$ 4.2.20 10 510---> time java BubbleSort

real	0m0.226s
user	0m0.156s
sys	0m0.048s
$ 4.2.20 11 511--->

ant – a Java based make tool.

commandline session

$ 4.2.20 153 1003---> ant compile
Buildfile: /home/jeffrin/java/beautifulprograms/build.xml

copyjars:

compile:
    [javac] /home/jeffrin/java/beautifulprograms/build.xml:36: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 1 source file to /home/jeffrin/java/beautifulprograms/war/WEB-INF/classes

BUILD SUCCESSFUL
Total time: 6 seconds
$ 4.2.20 154 1004--->

bubble sort in java

commandline session

/*
        Java Bubble Sort Example
        This Java bubble sort example shows how to sort an array of int using bubble
        sort algorithm. Bubble sort is the simplest sorting algorithm.
*/

public class BubbleSort {

        public static void main(String[] args) {

                //create an int array we want to sort using bubble sort algorithm
                int intArray[] = new int[]{5,90,35,45,150,3};

                //print array before sorting using bubble sort algorithm
                System.out.println("Array Before Bubble Sort");
                for(int i=0; i < intArray.length; i++){
                        System.out.print(intArray[i] + " ");
                }

                //sort an array using bubble sort algorithm
                bubbleSort(intArray);

                System.out.println("");

                //print array after sorting using bubble sort algorithm
                System.out.println("Array After Bubble Sort");
                for(int i=0; i  array [1] swap it.
                 * 3. Compare array[1] & array[2]
                 * 4. If array[1] > array[2] swap it.
                 * ...
                 * 5. Compare array[n-1] & array[n]
                 * 6. if [n-1] > array[n] then swap it.
                 *
                 * After this step we will have largest element at the last index.
                 *
                 * Repeat the same steps for array[1] to array[n-1]
                 *
                 */

                int n = intArray.length;
                int temp = 0;

                for(int i=0; i < n; i++){
                        for(int j=1; j  intArray[j]){
                                        //swap the elements!
                                        temp = intArray[j-1];
                                        intArray[j-1] = intArray[j];
                                        intArray[j] = temp;
                                }

                        }
                }

        }
}

/*
Output of the Bubble Sort Example would be

Array Before Bubble Sort
5 90 35 45 150 3
Array After Bubble Sort
3 5 35 45 90 150

*/


$ 4.2.20 7 507---> javac BubbleSort.java
$ 4.2.20 8 508---> java BubbleSort
Array Before Bubble Sort
5 90 35 45 150 3
Array After Bubble Sort
3 5 35 45 90 150
 $ 4.2.20 9 509--->

find . GNU version of find

commandline session

$ 4.2.20 11 511---> find ~ |  wc -l
106414
$ 4.2.20 12 512--->

$ 4.2.20 12 512---> find ~ -type d |  wc -l
9537
$ 4.2.20 13 513--->

$ 4.2.20 13 513---> find ~ -type l |  wc -l
115
$ 4.2.20 14 514--->


$ 4.2.20 17 517---> find ~ -type f -name "*.JPG" -size +1M | wc -l
241
$ 4.2.20 18 518---> find ~ -type f -name "*.JPG" -size +2M | wc -l
0
$ 4.2.20 19 519---> find ~ -type f -name "*.JPG" -size +3M | wc -l
0
$ 4.2.20 20 520---> find ~ -type f -name "*.JPG" -size +3k | wc -l
244
$ 4.2.20 21 521---> find ~ -type f -name "*.JPG" -size +1k | wc -l
244
$ 4.2.20 22 522--->


google application engine – screenshot

commandline session

$ 4.2.20 204 704---> ../appengine-java-sdk/bin/appcfg.sh -e ahiliation@beautifulwork.org update war/
Reading application configuration data...
14 Apr, 2012 5:33:13 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed war/WEB-INF/appengine-web.xml
2012-04-14 17:33:13.669:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
14 Apr, 2012 5:33:13 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed war/WEB-INF/web.xml
Beginning server interaction for beautifulprograms...
0% Created staging directory at: '/tmp/appcfg1726254542791009636.tmp'
5% Scanning for jsp files.
20% Scanning files on local disk.
25% Initiating update.
28% Cloning 1 static files.
31% Cloning 14 application files.
40% Uploading 6 files.
52% Uploaded 1 files.
61% Uploaded 2 files.
68% Uploaded 3 files.
73% Uploaded 4 files.
77% Uploaded 5 files.
80% Uploaded 6 files.
82% Initializing precompilation...
84% Sending batch containing 5 file(s) totaling 5KB.
85% Sending batch containing 1 blob(s) totaling 1KB.
90% Deploying new version.
95% Will check again in 1 seconds.
98% Will check again in 2 seconds.
99% Will check again in 4 seconds.
99% Closing update: new version is ready to start serving.
99% Uploading index definitions.

Update completed successfully.
Success.
Cleaning up temporary files...
$ 4.2.20 205 705--->

$ 4.2.20 182 682---> ../appengine-java-sdk/bin/appcfg.sh -e ahiliation@beautifulwork.org update war/
Reading application configuration data...
15 Apr, 2012 2:12:00 AM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed war/WEB-INF/appengine-web.xml
2012-04-15 02:12:00.863:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
15 Apr, 2012 2:12:00 AM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed war/WEB-INF/web.xml
15 Apr, 2012 2:12:00 AM com.google.apphosting.utils.config.IndexesXmlReader readConfigXml
INFO: Successfully processed war/WEB-INF/appengine-generated/datastore-indexes-auto.xml
Beginning server interaction for beautifulprograms...
0% Created staging directory at: '/tmp/appcfg3735990963207941955.tmp'
5% Scanning for jsp files.
8% Compiling jsp files.
15 Apr, 2012 2:12:12 AM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed /tmp/appcfg3735990963207941955.tmp/WEB-INF/web.xml
20% Scanning files on local disk.
25% Initiating update.
28% Cloning 1 static files.
31% Cloning 28 application files.
40% Uploading 0 files.
52% Initializing precompilation...
90% Deploying new version.
95% Will check again in 1 seconds.
98% Will check again in 2 seconds.
99% Will check again in 4 seconds.
99% Will check again in 8 seconds.
99% Closing update: new version is ready to start serving.
99% Uploading index definitions.

Update completed successfully.
Success.
Cleaning up temporary files...

$ 4.2.20 226 726---> ../appengine-java-sdk/bin/appcfg.sh -e ahiliation@beautifulprograms.beautifulwork.org update war/
Reading application configuration data...
15 Apr, 2012 2:22:39 AM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed war/WEB-INF/appengine-web.xml
2012-04-15 02:22:39.629:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
15 Apr, 2012 2:22:39 AM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed war/WEB-INF/web.xml
15 Apr, 2012 2:22:39 AM com.google.apphosting.utils.config.IndexesXmlReader readConfigXml
INFO: Successfully processed war/WEB-INF/appengine-generated/datastore-indexes-auto.xml
Beginning server interaction for beautifulprograms...
Password for ahiliation@beautifulprograms.beautifulwork.org:
Email: ahiliation@beautifulwork.org
Password for ahiliation@beautifulwork.org:
0% Created staging directory at: '/tmp/appcfg4490540921668629906.tmp'
5% Scanning for jsp files.
8% Compiling jsp files.
15 Apr, 2012 2:24:12 AM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed /tmp/appcfg4490540921668629906.tmp/WEB-INF/web.xml
20% Scanning files on local disk.
25% Initiating update.
28% Cloning 1 static files.
31% Cloning 28 application files.
40% Uploading 0 files.
52% Initializing precompilation...
90% Deploying new version.
95% Will check again in 1 seconds.
98% Will check again in 2 seconds.
99% Will check again in 4 seconds.
99% Will check again in 8 seconds.
99% Closing update: new version is ready to start serving.
99% Uploading index definitions.

Update completed successfully.
Success.
Cleaning up temporary files...
$ 4.2.20 227 727--->

google application engine – new domain related

commandline session

$ 4.2.20 121 621---> ../appengine-java-sdk/bin/appcfg.sh -e ahiliation@application.beautifulwork.org update war/
Reading application configuration data...
14 Apr, 2012 3:20:54 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed war/WEB-INF/appengine-web.xml
2012-04-14 15:20:54.244:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
14 Apr, 2012 3:20:54 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed war/WEB-INF/web.xml
Beginning server interaction for beautifulapplication...
Password for ahiliation@application.beautifulwork.org:
0% Created staging directory at: '/tmp/appcfg4867162461331235064.tmp'
5% Scanning for jsp files.
20% Scanning files on local disk.
25% Initiating update.
28% Cloning 13 application files.
40% Uploading 4 files.
52% Uploaded 1 files.
61% Uploaded 2 files.
68% Uploaded 3 files.
73% Uploaded 4 files.
77% Initializing precompilation...
80% Sending batch containing 4 file(s) totaling 4KB.
90% Deploying new version.
95% Will check again in 1 seconds.
98% Will check again in 2 seconds.
99% Will check again in 4 seconds.
99% Closing update: new version is ready to start serving.
99% Uploading index definitions.

Update completed successfully.
Success.
Cleaning up temporary files...
$ 4.2.20 122 622--->