Auto Key press fill forms through simulating key presses | Linux.com

2010-07-31 2 min read Bash Linux

This script can be used to repeatedly press <a class="zem_slink" title="Electronic keyboard" rel="wikipedia" href="http://en.wikipedia.org/wiki/Electronic_keyboard">keys on the <a class="zem_slink" title="Keyboard (computing)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Keyboard_%28computing%29">keyboard, it was used to fill out 100 odd entries on a <a class="zem_slink" title="Web page" rel="wikipedia" href="http://en.wikipedia.org/wiki/Web_page">web page while testing without having to physically enter the data.

Save the code below some where like <a class="zem_slink" title="Filesystem Hierarchy Standard" rel="wikipedia" href="http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard">/usr/bin/ with what ever file name you like, set the file to be <a class="zem_slink" title="Executable" rel="wikipedia" href="http://en.wikipedia.org/wiki/Executable">executable with <a class="zem_slink" title="Chmod" rel="wikipedia" href="http://en.wikipedia.org/wiki/Chmod">chmod +x /usr/bin/keyrepeat

Continue reading

List of commands you use most often

2010-07-25 1 min read Bash Linux

$ history | <a class="zem_slink" title="AWK" rel="homepage" href="http://cm.bell-labs.com/cm/cs/awkbook/index.html">awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head > /tmp/cmds | <a class="zem_slink" title="Gnuplot" rel="homepage" href="http://www.gnuplot.info/">gnuplot -persist <(echo 'plot "/tmp/cmds" using 1:xticlabels(2) with boxes') Plot your most used commands with gnuplot.

  • <a href="http://www.commandlinefu.com/commands/view/5845/list-of-commands-you-use-most-often">View this command to comment, vote or add to favourites
  • <a href="http://feeds2.feedburner.com/commands/by/sthrs">View all commands by <a href="http://feeds2.feedburner.com/commands/by/sthrs">sthrs

<a href="http://www.commandlinefu.com">

by David Winterbottom (<a href="http://codeinthehole.com">codeinthehole.com)

<a href="http://feedads.g.doubleclick.net/~a/qns5iNy–6jXLRCLFY_jGnkB68s/0/da">
<a href="http://feedads.g.doubleclick.net/~a/qns5iNy–6jXLRCLFY_jGnkB68s/1/da">

Continue reading

List of commands you use most often

2010-06-16 1 min read Bash Learning

<span style="font-size: x-large;"><a href="http://feedproxy.google.com/~r/Command-line-fu/~3/6MxHiSiINdo/list-of-commands-you-use-most-often">List of commands you use most often

$ history | <a class="zem_slink freebase/en/awk" title="AWK" rel="homepage" href="http://cm.bell-labs.com/cm/cs/awkbook/index.html">awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head > /tmp/cmds | gnuplot -persist <(echo 'plot "/tmp/cmds" using 1:xticlabels(2) with boxes') Plot your most used commands with gnuplot.

  • <a href="http://www.commandlinefu.com/commands/view/5845/list-of-commands-you-use-most-often">View this command to comment, vote or add to favourites
  • <a href="http://feeds2.feedburner.com/commands/by/sthrs">View all commands by <a href="http://feeds2.feedburner.com/commands/by/sthrs">sthrs

<a href="http://www.commandlinefu.com"><img src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/header-logo.jpg" alt="commandlinefu.com" align="bottom" />

Continue reading

colors in bash -- script to display all the possible colors.

2010-06-06 3 min read Bash Fedora Linux

If you wanted to have colors in the bash output (including the colors in PS1-4), don&#8217;t you keep wondering how the color code would look on the terminal. So, I wrote this small script to show the complete color codes. This is how the output would look:

\"Bash

And here is the script:

  <td>
    <div class="text codecolorer">
      #!/bin/bash -<br /> #===============================================================================<br /> #<br /> # &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FILE: &nbsp;colors.sh<br /> #<br /> # &nbsp; &nbsp; &nbsp; &nbsp; USAGE: &nbsp;./colors.sh<br /> #<br /> # &nbsp; DESCRIPTION: &nbsp;Bash colors<br /> #<br /> # &nbsp; &nbsp; &nbsp; OPTIONS: &nbsp;---<br /> # &nbsp;REQUIREMENTS: &nbsp;---<br /> # &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BUGS: &nbsp;---<br /> # &nbsp; &nbsp; &nbsp; &nbsp; NOTES: &nbsp;---<br /> # &nbsp; &nbsp; &nbsp; &nbsp;AUTHOR: &nbsp;Amit Agarwal (AKA), amit.agarwal@amit-agarwal.co.in<br /> # &nbsp; &nbsp; &nbsp; COMPANY: &nbsp;Individual<br /> # &nbsp; &nbsp; &nbsp; VERSION: &nbsp;1.0<br /> # &nbsp; &nbsp; &nbsp; CREATED: &nbsp;09/21/2009 06:12:07 PM IST<br /> # &nbsp; &nbsp; &nbsp;REVISION: &nbsp;---<br /> #===============================================================================<br /> <br /> for c in `seq 0 255`;<br /> do<br /> t=5;<br /> [[ $c -lt 108 ]]&&t=0;<br /> for i in `seq $t 5`;<br /> do<br /> #Display the codes also for easier lookup in terminal<br /> <!--loginview start-->echo $i;${c}<!--loginview end--><br /> echo -e "<a class="zem_slink" title="Path (computing)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Path_%28computing%29">\\</a>\e[0;48;$i;${c}m|| $i:$c `seq -s+0 $(($COLUMNS/2))|tr -d \'[0-9]\'`\\e[0m";<br /> done;<br /> done<br /> <br /> # setup_colors - Adds colors to array CC for global use<br /> # 30 - Black, 31 - Red, 32 - Green, 33 - Yellow, 34 - Blue,<br /> # 35 - Magenta, 36 - Blue/Green, 37 - White,<br /> # 30/42 - Black on Green \'30\\;42\'<br /> <!--loginview start-->function setup_colors(){<br /> declare -a CC;<br /> for i in `seq 0 7`;<br /> do<br /> ii=$(($i+7));<br /> CC[$i]="\\033[1;3${i}m";<br /> CC[$ii]="\\033[0;3${i}m";<br /> done;<br /> CC[15]="\\033[30;42m";<br /> R=$\'\\033[0;00m\';<br /> X=$\'\\033[1;37m\';<br /> export R X;<br /> }<br /> function display_colors(){<br /> for i in $(seq 0 $((${#CC[@]} - 1))); do echo -e "${CC[$i]}[$i]\\n$R"; done<br /> }
    </div>
  </td>
</tr>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
\"Reblog
Enhanced by Zemanta

Checking the links to your site (from affiliates) using cron and bash script.

2010-05-27 2 min read Fedora Learning Linux Uncategorized

If you have some affiliate links and are concerned about their presence then you can setup <a class="zem_slink freebase/guid/9202a8c04000641f80000000045c9c5b" title="Cron" rel="wikipedia" href="http://en.wikipedia.org/wiki/Cron">cron to check the links for you regularly. For this you need a very simple script (as below) and a cron entry (example further down).

#!/bin/bash –
#===============================================================================

#          FILE:  checklinks.sh

#         USAGE:  ./checklinks.sh

#   DESCRIPTION:  Check if the links exists on affiliate sites

#       OPTIONS:  —
#  REQUIREMENTS:  —
#          BUGS:  —
#         NOTES:  —
#        AUTHOR:  <a class="zem_slink" title="Amit Agarwal" rel="homepage" href="http://amit-agarwal.co.in">Amit Agarwal (AKA), amit.agarwal@amit-agarwal.co.in
#       COMPANY:  Individual
#       VERSION:  1.0
#       CREATED:  04/07/2010 08:19:29 AM IST
#      REVISION:  —
#===============================================================================

Continue reading

Startup animation and theme for Fedora 12 onwards.

2010-05-20 1 min read Fedora Learning Linux

Since the release of <a class="zem_slink freebase/en/fedora" title="Fedora" rel="homepage" href="http://fedoraproject.org/">Fedora 12, fedora is using plymouth. Plymouth kicks in just after grub and before the Xserver starts.

Description:

Plymouth provides an attractive graphical <a class="zem_slink freebase/en/bootsplash" title="Bootsplash" rel="wikipedia" href="http://en.wikipedia.org/wiki/Bootsplash">boot animation in
place of the <a class="zem_slink freebase/en/text_messaging" title="Text messaging" rel="wikipedia" href="http://en.wikipedia.org/wiki/Text_messaging">text messages that normally get shown.  Text
messages are instead redirected to a <a class="zem_slink freebase/en/data_logger" title="Data logger" rel="wikipedia" href="http://en.wikipedia.org/wiki/Data_logger">log file for viewing
after boot.

Continue reading

Mirror or download a website with a tool much better than wget

2010-05-19 1 min read Bash Fedora Linux

If you want to mirror a <a class="zem_slink freebase/en/website" title="Website" rel="wikipedia" href="http://en.wikipedia.org/wiki/Website">website, the simplest tool I know if is <a class="zem_slink freebase/en/wget" title="Wget" rel="homepage" href="http://www.gnu.org/software/wget/">wget. Once you have used wget, you know the troubles associated with it. You also get added couple of files as search html files, which are useless and wastage of bandwidth for you as well as the <a class="zem_slink freebase/en/web_server" title="Web server" rel="wikipedia" href="http://en.wikipedia.org/wiki/Web_server">webserver.

lftp -e &#8221;mirror -c&#8221; 

Continue reading
Older posts