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
#get absolute path(shell) | |
abspath(){ #{{{ | |
local thePath | |
if [[ ! "$1" =~ ^/ ]];then | |
thePath="$PWD/$1" | |
else | |
thePath="$1" | |
fi | |
IFS=/ parr=($thePath) | |
declare -a outp |
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
addpath() { #{{{ | |
local method path | |
if (($#==0));then | |
cat <<_EOF_ | |
addpath [+|_|-] path [... pathN] | |
+ append path (default) | |
- remove path | |
_ prepend path | |
_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
#!/usr/bin/env python | |
import json, urllib2, sys, os | |
from argparse import ArgumentParser | |
parser = ArgumentParser() | |
parser.add_argument('-c', '--cookie', help='use cookies', type=str, | |
default='', metavar='COOKIES', dest='cookies') | |
parser.add_argument('-o', '--output', help='output name', type=str, | |
default='', metavar='NAME', dest='output') |
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 | |
ver=$(curl -s -L http://www.xnview.com/en/xnviewmp/|sed -n -E '/Version/{s/.*Version ([\.0-9]+).*/\1/;s/\.//;p;q;}') | |
header='http://download.xnview.com/XnViewMP-' | |
files=( | |
win.exe | |
win-x64.exe | |
mac.tgz |
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 | |
[[ ! -f "$1" ]] && exit 1 | |
dmgfile="$1" | |
while read a b c;do | |
eval mp='$c' | |
done < <(hdiutil mount -noautofsck -noverify -noautoopen "$dmgfile"||exit 1) | |
echo Step 1 |
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 | |
# index icon dir file.zim | |
abspath(){ #{{{ | |
local thePath | |
if [[ ! "$1" =~ ^/ ]];then | |
thePath="$PWD/$1" | |
else | |
thePath="$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
#!/usr/bin/env python2.7 | |
from argparse import ArgumentParser | |
import sys | |
def parseArg(): | |
'''parse command line arguments''' | |
parser = ArgumentParser() | |
parser.add_argument('-i', '--input', dest='input', metavar='INPUT',\ | |
type=file, default=sys.stdin, help='Full input file') |
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
#!/usr/bin/env perl -i -n | |
use warnings; | |
use strict; | |
use Encode; | |
my $l=decode_utf8($_); | |
$l=~s/([^[:ascii:]])/"&#".ord($1).";"/ge; | |
print $l; |
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
#!/usr/bin/env python2.7 | |
# coding:utf-8 | |
from PIL import ImageFont | |
from PIL import Image | |
from PIL import ImageDraw | |
import sys | |
import re | |
fontSize = 18 |
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
ver2.gpsoft.com.au | |
ver0.gpsoft.com.au | |
blog.dopus.com | |
www.gpsoft.com.au | |
dns.msftncsi.com |