bash sort integer
Monday, 17. August 2009, 07:27:46
ls | sort -g
*sigh* busadm == Windows-World...
This is not my Zettelkasten but a durable .bash_history
Monday, 17. August 2009, 07:27:46
Sunday, 16. August 2009, 16:10:06
Friday, 27. March 2009, 13:46:22
while (true); do clear; pause=6;divisibleBy=1; max=999; min=11; rnumber1=$(((RANDOM%(max-min+divisibleBy))/divisibleBy*divisibleBy+min)); echo $rnumber1; max=$[${rnumber1}-1]; rnumber2=$(((RANDOM%(max-min+divisibleBy))/divisibleBy*divisibleBy+min)); echo $rnumber2; echo $rnumber1 "minus" $rnumber2 | festival --tts; sleep $pause; result=$[$rnumber1-$rnumber2]; echo "-------"; echo $result; echo "======="; echo $result | festival --tts; echo ""; done
Tuesday, 23. December 2008, 09:01:16
Tuesday, 9. September 2008, 04:59:08
Wednesday, 13. September 2006, 18:07:25
Wednesday, 3. May 2006, 09:38:23
for f in `ls *JPG`; do echo $f; convert -resize 800x800 $f $f; done
for f in `ls *.JPG`; do echo $f; create_date=""; create_date=`exiftime "$f" 2>&1 | grep -i image\ created | cut -d" " -f3 | sed -e 's/:/-/g'`;if [ "$create_date" != "" ];then echo $create_date;fi;done
Saturday, 15. April 2006, 14:38:12
$ for f in `ls *gif`;do echo $f; convert.exe $f ${f%.gif}.png;done
first_basic_admin.gif
first_comments_under_post.gif
first_congrats.gif
first_crud.gif
first_crud_layout.gif
first_custom_admin.gif
first_form_validation.gif
first_login.gif
first_routing.gif
first_welcome.gif
bash-3.00$ ls
first_basic_admin.gif first_crud.png first_login.gif
first_basic_admin.png first_crud_layout.gif first_login.png
first_comments_under_post.gif first_crud_layout.png first_routing.gif
first_comments_under_post.png first_custom_admin.gif first_routing.png
first_congrats.gif first_custom_admin.png first_welcome.gif
first_congrats.png first_form_validation.gif first_welcome.png
first_crud.gif first_form_validation.png symfony_favicon.png
$ for p in `ls *png`; do echo \\pgfdeclareimage\{${p%.png}\}{pictures/${p%.png}};done
IMG_0020.JPG 020.JPG IMG_x020.JPG
IMG_0021.JPG 021.JPG IMG_x021.JPG
IMG_0022.JPG 022.JPG IMG_x022.JPG
IMG_0023.JPG 023.JPG IMG_x023.JPG
bash-3.1$ for f in `ls *JPG`; do mv $f IMG_x${f#IMG_0}; done
Sunday, 2. April 2006, 10:49:53
~ $ mysql espressopunkt --exec "SHOW TABLES;" > tables.txt #CAVEAT: Rremove additional line at top. THere's probably an automated way for that but this post already tales longer than the task, so why bother...
~ $ for t in `cat tables.txt`;do echo $t;_t=${t#kaffeeweb_};echo $_t;mysql espressopunkt_dev --exec "ALTER TABLE $t RENAME $_t";done
Sunday, 26. February 2006, 10:48:39
#!/bin/bash
awk -F"\t" '
function makeEasyAccess()
{
system("mv " $1 "/cgi.ebay.de/ws/*html " $1 "/cgi.ebay.de/ws/index.html")
system("sed s~##path##~cgi.ebay.de/ws/index.html~ index.html.tpl > " $1 "/index.html")
}
function conditionalFetch()
{
#http://www.unix.org.ua/orelly/unix/sedawk/ch10_03.htm
if (system("test -r " $1 )) {
print "\t not mirrored, fetching..."
system(command)
makeEasyAccess()
}
else print "\t already mirrored"
}
{
URL="cgi.ebay.de%2Fws%2FeBayISAPI.dll%3FViewItem%26item" "=" $1
command = ("/usr/bin/wget --quiet -P " $1 " -F -E -H -k -K -p http://" URL)
if ( $2 !~ /^shop$/ ) {
ebayEndtime = mktime ( 20 substr($2,7,2) " " substr($2,4,2) " " substr($2,1,2) " " substr($2,10,2) " " substr($2,13,2) " " substr($2,16,2) )
if ( ebayEndtime < systime()) {
print $1 ": ebayEndtime is in past"
conditionalFetch()
}
else print $1 ": ebayEndtime is in future"
}
else {
print $1 ": is a shop offer"
conditionalFetch()
}
}' Id_Endtime.txt
7392197359 26.02.06 23:51:14 MEZ 7391483206 27.02.06 07:46:37 MEZ 7391548097 27.02.06 20:03:00 MEZ 7387433771 28.02.06 21:30:00 MEZ 6607816962 01.03.06 20:45:00 MEZ 7392366671 02.03.06 16:06:06 MEZ 6608401423 06.03.06 20:35:00 MEZ 7326030533 shop 7351499282 shop 7393652292 07.03.06 19:15:00 MEZ
Wednesday, 18. January 2006, 21:54:04