20100828

simplest way to make an application bundle using nothing but notepad.

Create a Application Bundle in 3 easy steps ;)

No Xcode needed, just a filebrowser and a texteditor. While poking around with .app dirs I noticed that as soon as I provided a MacOS folder containing something executable named the same as the app, my tiger box happily starts to run it without needing or checking a .plist or anything....

Sweet :) 
here goes ;) 


* in the terminal:
 bash$ mkdir -p MyShinyShellScriptWrapper.app/MacOS  
 bash$ echo -e "#!/bin/bash\necho \$(date) >  ~/Desktop/proofofexecution.txt" \  >MyShinyShellScriptWrapper.app/MacOS/MyShinyShellScriptWrapper 
 bash$ chmod 755 MyShinyShellScriptWrapper.app/MacOS/MyShinyShellScriptWrapper 



* or in the finder:
Open a finder window and create a new folder.  Open it and in it create a MacOS folder, now decide on a name. Create a new (plain) text document in the newly created folder and name it YourProgramName
 Now type these two lines in the textdocument:
#!/bin/bash
echo $(date) > ~/Desktop/proofofexecution.txt
Right! Close the file and save it as YourProgramName without an extension. (eg no .txt or .html or .whatever)
Right click on the file and  select Get Info.  Here you.... pfff, here you DONT find a set permissions to executable.
Anyway, open up a Terminal and type chmod 755 YourProgramName and close it off/ (is this even neccessary?)
Now go 2 levels up in the folder and rename the folder that you created in the beginning to  YourProgramName.app

Now it should've turned into an application with a broken icon. This is good :) Double click the icon to start it up!

Nothing much happened? The script runs in the background and takes a nanosecond to finish so nothing much should happen, but on your Desktop 
You should now see a new file called proofofexecution containing a timestamp.

Shweeet





How to make a shell script into a apple macintosh app application bundle using nothing but common household tools ;-)



dd
Sweet :)

10.4: Remapping keys in Mac OS X 10.4

10.4: Remapping keys in Mac OS X 10.4 

10.4: Remapping keys in Mac OS X 10.4 System 10.4
The Mac OS X 10.4 Keyboard & Mouse preference pane provides a way to remap certain keys. However, the interface doesn't expose the full functionality -- a common problem with Apple software. Note that this guide assumes you'using the bash shell.

Read on to learn...
  • What keys can be remapped without the use of any third–party software?
  • How do I remap those keys?
  • How do I remap the Caps Lock key to the Escape key?


What keys can be remapped without the use of any third–party software? (The following list shows the key name on the left, and that key's value on the right.)
  • None — –1
  • Caps Lock — 0
  • Shift (Left) — 1
  • Control (Left) — 2
  • Option (Left) — 3
  • Command (Left) — 4
  • Keypad 0 — 5
  • Help — 6
  • Shift (Right) — 9
  • Control (Right) — 10
  • Option (Right) — 11
  • Command (Right) — 12
  • Kernel Panic — 16
Be warned that the code 16, when used as the destination of a mapping, actually causes a kernel panic on keypress -- as I've found out the hard way.

How do I remap those keys?
  1. Remap one of the keys available in the Keyboard & Mouse preference pane in order to make the following steps easier.
  2. Locate the hidden property list file used to store the settings. It's in your user's Library/Preferences/ByHost folder, and is named.GlobalPreferences.000d*. I assume there'll be only one such file; you'll need to verify that. From here on, that file and path are referred to as$FILE.
  3. Duplicate the file and convert it to the XML property list format:
    $ cp $FILE ~/keys-binary.plist
    $ plutil -convert xml1 -o ~/keys-xml.plist ~/keys-binary.plist
  4. Open the resulting XML file and locate thecom.apple.keyboard.modifiermapping key. Its value is an array containing several entries, each in turn containingHIDKeyboardModifierMappingSrc and HIDKeyboardModifierMappingDstkeys. The values of those keys are described in the table above. Make the changes you wish to make, and save your work.
  5. Convert the file back to the binary property list format, and put it back in the correct location:
    $ plutil -convert binary1 -o ~/keys-binary.plist ~/keys-xml.plist
    $ cp ~/keys-binary.plist $FILE
  6. Log out and back in to apply changes.
How do I remap the Caps Lock key to the Escape key?

Unfortunately, this will require the use of a third–party program. I used a free trial version of Keyboard Maestro by Stairways Software. First, remap the Caps Lock key to the Help key, following the instructions above. Then, in Keyboard Maestro:
  • Create a new macro.
  • Add a Simulate Keypress action, with an User Keystroke — the Escape key.
  • Add a Hot Key trigger, set to the Help key.
  • In the Preferences section, enable the Launch Engine at Login option. While you're at it, you might also want to disable all other unnecessary features.
An always up–to–date version of this guide can be found on my blog...

20100827

multitail bus error on osx

I tried to install and use multitail this morning.

sudo port install multitail

everything seems to build/install

multitail /opt/local/apache2/logs/access_log /opt/local/apache2/logs/ 
error_log

gives me a "Bus error" - along with 2 processes running tail...

Installs and runs just fine on Panther (just checking)

I can download and build the source in my home directory. That works  
just fine, and runs.

For entertainment value I created /opt/local/etc/multitail.conf (from  
the /opt/local/etc/multitail.conf.new file)

Bus error stopped happening...

Executed in subshell, trap on exit


#!/bin/bash
# --- subshell_trap.sh -------------------------------------------------
# Example script for handling bash errors.  Exit on error.  Trap exit.
# This script is supposed to run in a subshell.
# See also: http://fvue.nl/wiki/Bash:_Error_handling

    # Let shell functions inherit ERR trap.  Same as `set -E'.
set -o errtrace 
    # Trigger error when expanding unset variables.  Same as `set -u'.
set -o nounset
    #  Trap non-normal exit signals: 1/HUP, 2/INT, 3/QUIT, 15/TERM, ERR
    #  NOTE1: - 9/KILL cannot be trapped.
    #+        - 0/EXIT isn't trapped because:
    #+          - with ERR trap defined, trap would be called twice on error
    #+          - with ERR trap defined, syntax errors exit with status 0, not 2
    #  NOTE2: Setting ERR trap does implicit `set -o errexit' or `set -e'.
trap onexit 1 2 3 15 ERR


#--- onexit() -----------------------------------------------------
#  @param $1 integer  (optional) Exit status.  If not set, use `$?'

function onexit() {
    local exit_status=${1:-$?}
    echo Exiting $0 with $exit_status
    exit $exit_status
}



# myscript



    # Allways call `onexit' at end of script
onexit

http://www.gfxcoder.us/wiki/programming/bash


Handy BASH reference (link)

robust script writing (link)

lockfile
lockfile a.lock
#do stuff hererm -f a.lock

date (link)

Spicing up your shell script (link)

parameters (link)

Tutorials

misc (link, link)
functions (link)

timing commands
/usr/bin/time -o outfile -v command # prints verbose stats into outfile from running command

BASH internal variables (link)

for loops (link)
for i in 1 2 3 4 5
do
  echo "Welcome $i times"
done

for i in {1..5}
do
  echo "Welcome $i times"
done

for i in {0..10..2} # skip by 2s, only BASH 4.0+
do
  echo "Welcome $i times"
done

for (( c=1; c<=5; c++ ))
do
  echo "Welcome $c times"
done

for i in 1 2 3 4 5
do
  echo "Welcome $i times"
  if ( condition )
  then
    break
  fi
done
# continue - jumps to beginning of loop with next iteration

for file in /etc/*
do
  if [ "${file}" == "/etc/resolv.conf" ]
  then
    echo "file ${file} found!"
  fi
done

files="$@"
for f in $files
do
  if [ -f ${f} ]
  then
    echo "{f} is a file"
  else
    echo "${f} is not a file"
  fi
done

pausing with read (link)
$ read -p "Press enter to quit..."                   # reads one line
$ read -n 1 -p "Press any key to start backup..."    # reads only one char
$ read -n 1 -s -t 5                                  # reads one char, no echo, 5sec timeout
$ read -n 1 -s key                                   # reads one char, no echo, stores in ${key}

terminate commands after timeout (link)
#!/bin/bash
# License: BSD License
# As Example we start 3 production processes in the background
# always record PID in PRODPID

sleep 50 &
PRODPID[1]=$!

sleep 20 &
PRODPID[2]=$!

# multiple processes in a subshell as example
(sleep 20 ; sleep 10 ; sleep 5)&
PRODPID[3]=$!

export PRODPID

# record own PID
export PID=$$


# define exit function
exit_timeout() {
  echo "Timeout. These processes are not finished:"
  for i in ${PRODPID[@]} ; do
    ps -p $i |grep -v "PID TTY      TIME CMD"
    if [ $? == 0 ] ; then
      # process still alive
      echo "Sending SIGTERM to process $i"
      kill $i
    fi
  done
  # timeout exit
  exit
}

# Handler for signal USR1 for the timer
trap exit_timeout SIGUSR1

# starting timer in subshell. It sends a SIGUSR1 to the father if it timeouts.
export TIMEOUT=30
(sleep $TIMEOUT ; kill -SIGUSR1 $PID) &

# record PID of timer
TPID=$!

# wait for all production processes to finish
wait ${PRODPID[*]}

# Normal exit
echo "All processes ended normal"

# kill timer
kill $TPID
or (link)
runtime=${1:-1m}
mypid=$
cp /Database/Client_db_200802110231.BAK .&
cpid=$!
sleep $runtime
kill -s SIGTERM $cpid
echo "Both processes are terminated".



catching traps (link)
# trap [commands] [traps]
trap "echo Booh!" SIGINT SIGTERM


aoeu
aoeu

20100824

aomk

maybe a raving loony, and even mentally retarded, BUT i really do Avoid at all costs to upload magic to ungrateful fucks like you, just as i did many times in the past to fuck users who are now on AOM, NEO, MT, EXO, and the rest of the copy magic sites




-- map{ map{tr|10|# |;print} split//,sprintf"%.8b\n",$_} unpack'C*',unpack'u*',"5`#8<3'X`'#8^-@`<-CPP`#8V/C8`"

20100813

Dieter Steffman Fonts

Designers



Due to increasing bandwidth charges Dieter decided to remove his fonts from his website. That's why they are hosted here. Special thanks to those font-enthusiasts who located the missing fonts - it seems the collection has been completed :)





-- map{ map{tr|10|# |;print} split//,sprintf"%.8b\n",$_} unpack'C*',unpack'u*',"5`#8<3'X`'#8^-@`<-CPP`#8V/C8`"

20100812

http://code.google.com/webfonts/preview#font-family=Cantarell

http://code.google.com/webfonts/preview#font-family=Cantarell


webfont previewer

lol, found you :)

 http://l.i2p/?i2paddresshelper=Wpu7frtxXSub11MOI~lbH260SUh~xiodPfQiDXdgJ5fdawCHi2dRZVizSvCtEGa6MfMMlxtUFUYNu9-f9YC5l0BCPe0Fqy31ArJZOegkvIXInRRyc0vLpfNHToDjyVdfSYa-ZqT6w2oZzRzqdXd5cw3jYvYURhuBzfksJpKM91tpSK0jOUFxZAp3NAJCEEANoiaqzUuZi1QNJs5yBn1gAIWDrFoVQv21oFdhYBToY18yupRw-pRQDCJZcDY5N8UhgUsdA611LwhTB6uMcdpjuxwoJeVddKFrQLnkPXuKqD83uMYm~XFS04F0B34L2umUEFGipULpWQbOUrngeyhMpm4FE1gme85wdHr7zz8m5~r-tu5mK3a9mn70pkbjQ0sc4~uBvkItfbxs7~aLOpO6tHuDSr4mUNp0PGvVy3KgTVm71HHVZ5RsnVTRCrlpC~kvFBrdHCPv0GkQhexouKwrD0gQ4dxenIWRBMaXqEBJoC-heI5IAShEzSHIGrFmgJ8BAAAA

 http://uhfunkqudthohkjeqdmgmuisoy3we27eo75h37yksojf6ki3zfua.b32.i2p/


http://stats.i2p/cgi-bin/jump.cgi?a=l.i2p


http://stats.i2p/cgi-bin/hostquery.cgi?a=l.i2p

http://stats.i2p/cgi-bin/newhosts.txt

http://l.i2p





-- map{ map{tr|10|# |;print} split//,sprintf"%.8b\n",$_} unpack'C*',unpack'u*',"5`#8<3'X`'#8^-@`<-CPP`#8V/C8`"

from freenet some ano nets

lliance http://www.alliancep2p.com/








anoNet http://anonet.org/








ANts P2P http://antsp2p.sourceforge.net/ GPL Java


✓ ✗

Entropy









Freenet 0.7 http://freenetproject.org/ GPL2 Java ✓ ✓ ✓ via plugin ✗ ✗ ✓
Galet http://galet.sourceforge.net/ GPL C++


✓


Gazzera http://www.lugato.net/gazzera/ GPL Pascal ✗ ✓
✓


giFT http://gift.sf.net/ GPL C





✓
GNUnet http://gnunet.org/ GPL2 C



✗

I2P http://www.i2p2.de/ Multiple Java





✓
kerjodando http://www.kerjodando.com/
Java






Marabunta http://marabunta.laotracara.com/ GPL2







MUTE http://mute-net.sourceforge.net/ GPL C++


✓


Netsukuku http://netsukuku.freaknet.org/ GPL2 C and Python




✓
Nodezilla http://www.nodezilla.net/ GPL Java

✓ ✓


OFF System http://offsystem.sourceforge.net/ GPL C++






Omemo http://www.omemo.com/








Oneswarm http://oneswarm.cs.washington.edu/








Pastry http://www.freepastry.org/ BSD-like Java






Perfect Dark









Pfyshnet http://sourceforge.net/projects/pfyshnet/ GPL3 Java






Phantom http://code.google.com/p/phantom/






✓
Rodi http://rodi.sourceforge.net/
Java






Stealthnet http://www.stealthnet.de/ GPL C#






SUMI http://sumi.berlios.de/ GPL2







Tor http://www.torproject.org/ BSD




✓

Turtle F2F http://www.turtle4privacy.org/ GPL
✗ ✓




WASTE http://waste.sourceforge.net/ GPL C++






Winny









Wuala http://www.wuala.com/ Proprietary

20100811

Productivity

From The Cipherspace wiki
Welcome to the cipherspace wiki!
This is a free resource. Just click edit to get started. The first time you will get prompted to register a user. Remember, user passwords cannot be recovered! If they're lost you will have to create a new account.
If you dont want to register use this account: Username:anonymoses Password:anonymouses
Instruciton to productivity
1. Don't let bad thoughts in: no worries, only future
2. Don't fall back into the same thoughts every day
3. Seek the positive in everything
4. Imagine a lot: blueprint the future
5. Focus on today, not on the goal
6. Be inspired by a great purpose
7. Use concentration, train your brain
8. Be happy: a) Find what you like, b) direct all your energy toward it

tor ssh client config

SSH needs to be told to use Tor for connectivity, and for DNS lookups (so it knows how to find a .onion addresses.) The connect proxy forwarder can do this really easily. It's available in macports, FreeBSD ports, and Ubuntu's package management. You can also compile it yourself, it doesn't have any funky dependencies.
After it's installed, add this configuration chunk into your ~/.ssh/config file:
Host *.onion
    PubKeyAuthentication no
    VisualHostKey yes
    Compression yes
    ForwardAgent no
    ForwardX11 no
    PreferredAuthentications password
    ProxyCommand /path/to/connect -S 127.0.0.1:9050 %h %p
... and that's it. You'll be able to ssh as normal, and if you're connected to Tor, ssh will know what to do with hosts that end in .onion. Make sure that if you're connecting to a .onion host, that you explicitly pass your username -- otherwise, ssh defaults to using the username of the currently logged in user.
-- map{ map{tr|10|# |;print} split//,sprintf"%.8b\n",$_} unpack'C*',unpack'u*',"5`#8<3'X`'#8^-@`<-CPP`#8V/C8`"

An ErrorDocument for code 200 would cause an infinite loop,

http://www.javascriptkit.com/howto/htaccess2.shtml


Error Documents

This seems to be what people think htaccess was meant for, but it is only part of the general use. We'll be getting into progressively more advanced stuff after this.
Successful Client Requests
200OK
201Created
202Accepted
203Non-Authorative Information
204No Content
205Reset Content
206Partial Content
Client Request Redirected
300Multiple Choices
301Moved Permanently
302Moved Temporarily
303See Other
304Not Modified
305Use Proxy
Client Request Errors
400Bad Request
401Authorization Required
402Payment Required (not used yet)
403Forbidden
404Not Found
405Method Not Allowed
406Not Acceptable (encoding)
407Proxy Authentication Required 
408Request Timed Out
409Conflicting Request
410Gone
411Content Length Required
412Precondition Failed
413Request Entity Too Long
414Request URI Too Long
415Unsupported Media Type
Server Errors
500Internal Server Error
501Not Implemented
502Bad Gateway 
503Service Unavailable 
504Gateway Timeout 
505HTTP Version Not Supported 
In order to specify your own ErrorDocuments, you need to be slightly familiar with the serverreturned error codes. (List to the right). You do not need to specify error pages for all of these, in fact you shouldn't. An ErrorDocument for code 200 would cause an infinite loop, whenever a page was found...this would not be good.You will probably want to create an error document for codes 404 and 500, at the least 404 since this would give you a chance to handle requests for pages not found. 500 would help you out with internal server errors in any scripts you have running. You may also want to consider ErrorDocuments for 401 - Authorization Required (as in when somebody tries to enter a protected area of your site without the proper credentials), 403 - Forbidden (as in when a file with permissions not allowing it to be accessed by the user is requested) and 400 - Bad Request, which is one of those generic kind of errors that people get to by doing some weird stuff with your URL or scripts.
In order to specify your own customized error documents, you simply need to add the following command, on one line, within your htaccess file:
ErrorDocument code /directory/filename.ext
or
ErrorDocument 404 /errors/notfound.html
This would cause any error code resulting in 404 to be forward to yoursite.com/errors/notfound.html

Likewise with:
ErrorDocument 500 /errors/internalerror.html
You can name the pages anything you want (I'd recommend something that would prevent you from forgetting what the page is being used for), and you can place the error pages anywhere you want within your site, so long as they are web-accessible (through a URL). The initial slash in the directory location represents the root directory of your site, that being where your default page for your first-level domain is located. I typically prefer to keep them in a separate directory for maintenance purposes and in order to better control spiders indexing them through a ROBOTS.TXT file, but it is entirely up to you.
If you were to use an error document handler for each of the error codes I mentioned, the htaccess file would look like the following (note each command is on its own line):
ErrorDocument 400 /errors/badrequest.html
ErrorDocument 401 /errors/authreqd.html
ErrorDocument 403 /errors/forbid.html
ErrorDocument 404 /errors/notfound.html
ErrorDocument 500 /errors/serverr.html
You can specify a full URL rather than a virtual URL in the ErrorDocument string (http://yoursite.com/errors/notfound.html vs. /errors/notfound.html). But this is not the preferred method by the server's happiness standards.
You can also specify HTML, believe it or not!
ErrorDocument 401 "

You have to actually BE a member to view this page, Colonel!

The only time I use that HTML option is if I am feeling particularly saucy, since you can have so much more control over the error pages when used in conjunction with xSSI or CGI or both. Also note that the ErrorDocument starts with a " just before the HTML starts, but does not end with one...it shouldn't end with one and if you do use that option, keep it that way. And again, that should all be on one line, no naughty word wrapping!
Next, we are moving on to password protection, that last frontier before I dunk you into the true capabilities of htaccess. If you are familiar with setting up your own password protected directories via htaccess, you may feel like skipping ahead.


-- map{ map{tr|10|# |;print} split//,sprintf"%.8b\n",$_} unpack'C*',unpack'u*',"5`#8<3'X`'#8^-@`<-CPP`#8V/C8`"

20100810

http://5pfxcmkkvfhdowg4.onion/

http://5pfxcmkkvfhdowg4.tor2web.com/

nntime.com proxy list

-- map{ map{tr|10|# |;print} split//,sprintf"%.8b\n",$_} unpack'C*',unpack'u*',"5`#8<3'X`'#8^-@`<-CPP`#8V/C8`"

Using JavaScript to Ping

Using JavaScript to Ping

Have you ever wish to there was a way to ping another site using pure JavaScript? Well there is a way now by using JavaScript and an images. The method I'm going to share with you today isn't something new in fact most of us who're familiar with JavaScript may have come across this method in the past. However the a limitation to this method as we need to image URI as a ping destination for the test.
As usual I'm using a sort of Object notation to organize everything. The function is very much load and go approach so you don't need to scratch your head to understand any of this.
How do you use it? All you need to do is declare the image URI for the function to test and create a callback to ping.init().
Posted on 2007-07-08 23:00

js speedtest

http://speedtest.ipaddressguide.com/test.php?ctype=t1


javascript client bandwidth test
-- map{ map{tr|10|# |;print} split//,sprintf"%.8b\n",$_} unpack'C*',unpack'u*',"5`#8<3'X`'#8^-@`<-CPP`#8V/C8`"

samair

proxies samair.ru
-- map{ map{tr|10|# |;print} split//,sprintf"%.8b\n",$_} unpack'C*',unpack'u*',"5`#8<3'X`'#8^-@`<-CPP`#8V/C8`"

http://bash.cyberciti.biz/security/expect-ssh-login-script/


SSH login expect shell script to supply username and password

by VIVEK GITE · 43 COMMENTS
#!/usr/bin/expect -f
# Expect script to supply root/admin password for remote ssh server
# and execute command.
# This script needs three argument to(s) connect to remote server:
# password = Password of remote UNIX server, for root user.
# ipaddr = IP Addreess of remote UNIX server, no hostname
# scriptname = Path to remote script which will execute on remote server
# For example:
#  ./sshlogin.exp password 192.168.1.11 who
# ------------------------------------------------------------------------
# Copyright (c) 2004 nixCraft project 
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# ----------------------------------------------------------------------
# set Variables
set password [lrange $argv 0 0]
set ipaddr [lrange $argv 1 1]
set scriptname [lrange $argv 2 2]
set arg1 [lrange $argv 3 3]
set timeout -1
# now connect to remote UNIX box (ipaddr) with given script to execute
spawn ssh root@$ipaddr $scriptname $arg1
match_max 100000
# Look for passwod prompt
expect "*?assword:*"
# Send password aka $password
send -- "$password\r"
# send blank line (\r) to make sure we get back to gui
send -- "\r"
expect eof

amazon associates


Amazon Associates is now set up with Blogger!

Your Associates ID is thijstoday-20 and the Amazon Product Finder is now ready for use. You can always change your ID or turn off the Product Finder in your Amazon Associates settings.

Give it a try...