This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -e "data.txt" ]; then | |
cat > data.txt <<EOF | |
************************** | |
*S* * * | |
* * * * ************* * | |
* * * ************ * | |
* * * | |
************** *********** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# zsh script to show how long a command took to run | |
# put in your .zshrc | |
# | |
BG_BLUE='\e[0;44m' | |
OCOLOR='\e[0m' | |
BOLD='\e[1;39m' | |
prompt_command_start=0 | |
show_time_threash=5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkcdir(){ | |
mkdir "$@" | |
if [ "$1" = "-p" ]; then | |
cd "$2" | |
else | |
cd "$1" | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
interval=2 | |
file_ignore='\.(swp|orig|old[0-9]*|bak[0-9]*)$|^core$|.*~$' | |
dir_ignore='(\.git|\.hg)' | |
make='make' | |
##################################################### | |
progname='maked' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i=0 | |
while :;do echo $((i++)); sleep .3; done | bash -c 'while read L1; do echo L1=$L1; while read -t 0 L2; do echo L2=$L2; break; done; sleep .5; done' | |
# わかりやすくインデントすると | |
while :; | |
do | |
echo $((i++)) | |
sleep .3 | |
done | bash -c 'while read L1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ diff -u ./Distribution/Client/HttpUtils.hs.orig ./Distribution/Client/HttpUtils.hs | |
--- ./Distribution/Client/HttpUtils.hs.orig 2011-09-26 15:59:04.368889933 +0900 | |
+++ ./Distribution/Client/HttpUtils.hs 2011-09-26 16:31:17.142379016 +0900 | |
@@ -12,6 +12,7 @@ | |
import Network.HTTP | |
( Request (..), Response (..), RequestMethod (..) | |
, Header(..), HeaderName(..) ) | |
+import qualified Network.HTTP.Base | |
import Network.URI | |
( URI (..), URIAuth (..), parseAbsoluteURI ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .bash_profile | |
pwd_prompt () { | |
maxlen=50 | |
if (( ${#PWD} > maxlen )) | |
then | |
(( offset = ${#PWD} - maxlen )) | |
echo "...${PWD:offset}" | |
else | |
echo "${PWD}" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Linux/MacOSX Version of "Easy rooting toolkit (v2.0)" script. | |
# http://forum.xda-developers.com/showthread.php?t=1320350 | |
# You need Linux/MacOSX version of 'adb' binary copied into 'files' | |
# directory | |
# | |
alias adb='./files/adb' | |
cat<<EOF | |
--------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkcdir(){ | |
mkdir -p "$@" | |
if [ "$1" = "-p" ]; then | |
cd "$2" | |
else | |
cd "$1" | |
fi | |
} | |
mvcd () { | |
err () { echo "mvcd: ERROR: $*" >&2 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'base64' | |
require 'digest/md5' | |
ssh_pubkey='AAAAB3NzaC1yc2EAAAABIwAAAQEAxCw2nrIcdQ+7/tKy+6fk1qmICpl2qa8jxCLoG3pnGniDUUIOtRdEfnpHNHYWfwBVYIdGD5bmcFnXEfoxRjR2VpLXNeY/8PlCG5lARuQqkc720ZfoxsEQo3m+ixV4ylbuQfo8eDrELrn+MWiPluh699lWyvgZ/6oTW1nf2gsKabG+nV8uLvr7Znr230S8o8vhgo6O3cmfLGcfApUnG9kce1YOlz1D9F2x6vzDSO2W3s5/UTBmDvLj3Cza+yzmLp2fzAw97FL6LLwS2cLaVUayc6pZKqN+4Gu9LDPXFl4jkD2xzPTp7cuKdrJFaDsIa0OHzG+yVlDvWi8FkdU9O+xiuw==' | |
fingerprint = Digest::MD5.hexdigest(Base64.decode64(ssh_pubkey)).scan(/../).join(':') | |
puts fingerprint |
OlderNewer