assorted-commits Mailing List for Assorted projects (Page 9)
Brought to you by:
yangzhang
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(9) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(86) |
Feb
(265) |
Mar
(96) |
Apr
(47) |
May
(136) |
Jun
(28) |
Jul
(57) |
Aug
(42) |
Sep
(20) |
Oct
(67) |
Nov
(37) |
Dec
(34) |
2009 |
Jan
(39) |
Feb
(85) |
Mar
(96) |
Apr
(24) |
May
(82) |
Jun
(13) |
Jul
(10) |
Aug
(8) |
Sep
(2) |
Oct
(20) |
Nov
(31) |
Dec
(17) |
2010 |
Jan
(16) |
Feb
(11) |
Mar
(17) |
Apr
(53) |
May
(31) |
Jun
(13) |
Jul
(3) |
Aug
(6) |
Sep
(11) |
Oct
(4) |
Nov
(17) |
Dec
(17) |
2011 |
Jan
(3) |
Feb
(19) |
Mar
(5) |
Apr
(17) |
May
(3) |
Jun
(4) |
Jul
(14) |
Aug
(3) |
Sep
(2) |
Oct
(1) |
Nov
(3) |
Dec
(2) |
2012 |
Jan
(3) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
(4) |
Aug
(5) |
Sep
(2) |
Oct
(3) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
(9) |
Apr
(5) |
May
|
Jun
(2) |
Jul
(1) |
Aug
(10) |
Sep
(1) |
Oct
(2) |
Nov
|
Dec
|
2014 |
Jan
(1) |
Feb
(3) |
Mar
(3) |
Apr
(1) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2016 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <yan...@us...> - 2010-09-17 08:37:23
|
Revision: 1702 http://assorted.svn.sourceforge.net/assorted/?rev=1702&view=rev Author: yangzhang Date: 2010-09-17 08:37:17 +0000 (Fri, 17 Sep 2010) Log Message: ----------- Added gccrun Modified Paths: -------------- shell-tools/trunk/README Added Paths: ----------- shell-tools/trunk/src/gccrun.sh Modified: shell-tools/trunk/README =================================================================== --- shell-tools/trunk/README 2010-09-15 18:43:48 UTC (rev 1701) +++ shell-tools/trunk/README 2010-09-17 08:37:17 UTC (rev 1702) @@ -112,12 +112,17 @@ `peakmem` Run a process and get its peak memory usage. bash `local-rsync` Local rsync accelerator without checksum sh - overhead. By Joey Hess. + overhead. By Joey Hess. [Home][lrsync] + +`gccrun` Quickly run C snippets from command line. sh + By Geoff Thomas. [Home][gccrun] -------------------------------------------------------------------------------- [HSH]: http://software.complete.org/hsh/ [Python Commons]: http://assorted.sf.net/python-commons/ [Pexpect]: http://pexpect.sf.net/ +[lrsync]: http://kitenet.net/~joey/blog/entry/local_rsync_accelerator/ +[gccrun]: http://geofft.mit.edu/blog/sipb/132 Usage ----- Added: shell-tools/trunk/src/gccrun.sh =================================================================== --- shell-tools/trunk/src/gccrun.sh (rev 0) +++ shell-tools/trunk/src/gccrun.sh 2010-09-17 08:37:17 UTC (rev 1702) @@ -0,0 +1,45 @@ +#!/bin/sh + +if [ "$#" = 0 ]; then + echo "usage: $0 [-w wrapper] <C code...>" >&2 + exit 1 +fi + +if [ "$1" = -w ]; then + wrapper="$2" + shift 2 +fi + +f=$(mktemp -d -t gccrun.XXXXXXXX) || exit 1 +cat > "$f/command.c" << EOF +#define _GNU_SOURCE +#include <sys/types.h> +#include <sys/stat.h> +#include <sys/mman.h> +#include <sys/ptrace.h> +#include <sys/syscall.h> +#include <fcntl.h> +#include <signal.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +int +main(int argc, char *argv[], char *envp[]) +{ + $@; + return 0; +} +EOF +if ! gcc -o "$f/command" "$f/command.c"; then + exit 1 +fi +if [ -n "$wrapper" ]; then + "$wrapper" "$f/command" +else + "$f/command" +fi +r=$? +rm -r "$f" +exit $r Property changes on: shell-tools/trunk/src/gccrun.sh ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-09-15 18:43:57
|
Revision: 1701 http://assorted.svn.sourceforge.net/assorted/?rev=1701&view=rev Author: yangzhang Date: 2010-09-15 18:43:48 +0000 (Wed, 15 Sep 2010) Log Message: ----------- Added local-rsync Modified Paths: -------------- shell-tools/trunk/README Added Paths: ----------- shell-tools/trunk/src/local-rsync.sh Modified: shell-tools/trunk/README =================================================================== --- shell-tools/trunk/README 2010-09-11 04:44:11 UTC (rev 1700) +++ shell-tools/trunk/README 2010-09-15 18:43:48 UTC (rev 1701) @@ -110,6 +110,9 @@ up. `peakmem` Run a process and get its peak memory usage. bash + +`local-rsync` Local rsync accelerator without checksum sh + overhead. By Joey Hess. -------------------------------------------------------------------------------- [HSH]: http://software.complete.org/hsh/ Added: shell-tools/trunk/src/local-rsync.sh =================================================================== --- shell-tools/trunk/src/local-rsync.sh (rev 0) +++ shell-tools/trunk/src/local-rsync.sh 2010-09-15 18:43:48 UTC (rev 1701) @@ -0,0 +1,60 @@ +#!/bin/sh +# local rsync accellerator w/o the checksum overhead +# GPL copyright 2010 by Joey Hess <jo...@ki...> + +# From <http://git.kitenet.net/?p=joey/home.git;a=blob_plain;f=bin/local-rsync> + +usage () { + echo "usage: local-rsync src dest [rsync options]" >&2 + exit 1 +} + +# The src and dest are required to come first to simplify option parsing. +src="$1" +dest="$2" +if [ -z "$src" ] || [ -z "$dest" ] || [ ! -e "$src" ]; then + usage +fi + +# Detect if rsync was asked to be verbose, and we'll be verbose. too. +shift 2 +verbose= +for o in "$@"; do + if [ "x$o" = "x-v" ] || [ "x$o" = "x--verbose" ]; then + verbose=-v + fi +done + +# Ask rsync to do a dry run and print out what it would do. +# Then look for files being sent, and manually cp them. +# This will be faster than letting rsync do it, for large files, +# because rsync calculates checksums when copying files, which +# can use a lot of CPU. +IFS=' +' +for line in $(rsync "$src/" "$dest/" "$@" --dry-run --log-format " do %o %n" | + grep "^ do " | sed -e 's/^ do //') +do + IFS=' ' + command="${line%% *}" + file="${line#* }" + case "$command" in + send) + if [ -f "$src/$file" ]; then + rm -rf "$dest/$file" + mkdir -p "$dest/$(dirname "$file")" + cp $verbose -a "$src/$file" "$dest/$file" + fi + ;; + del.) + # not implemented; cleanup rsync will handle deletion + ;; + *) + echo "unknown line: $line" >&2 + exit 1 + ;; + esac +done + +# Now allow rsync to run, to clean up things not handled above. +rsync "$src" "$dest" "$@" Property changes on: shell-tools/trunk/src/local-rsync.sh ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-09-11 04:44:17
|
Revision: 1700 http://assorted.svn.sourceforge.net/assorted/?rev=1700&view=rev Author: yangzhang Date: 2010-09-11 04:44:11 +0000 (Sat, 11 Sep 2010) Log Message: ----------- NLTK demo Added Paths: ----------- sandbox/trunk/src/py/nltkdemo.py Added: sandbox/trunk/src/py/nltkdemo.py =================================================================== --- sandbox/trunk/src/py/nltkdemo.py (rev 0) +++ sandbox/trunk/src/py/nltkdemo.py 2010-09-11 04:44:11 UTC (rev 1700) @@ -0,0 +1,19 @@ +from commons.startup import run_main +from nltk import * + +def main(argv): + #txt = 'The process of classifying words into their parts of speech and labeling them accordingly is known as part-of-speech tagging, POS-tagging, or simply tagging. Parts of speech are also known as word classes or lexical categories. The collection of tags used for a particular task is known as a tagset. Our emphasis in this chapter is on exploiting tags, and tagging text automatically.' + #txt = """For any given question, it's likely that someone has written the answer down somewhere. The amount of natural language text that is available in electronic form is truly staggering, and is increasing every day. However, the complexity of natural language can make it very difficult to access the information in that text. The state of the art in NLP is still a long way from being able to build general-purpose representations of meaning from unrestricted text. If we instead focus our efforts on a limited set of questions or "entity relations," such as "where are different facilities located," or "who is employed by what company," we can make significant progress. The goal of this chapter is to answer the following questions:""" + #txt = """Roy of the Rovers is a British comic strip about the life and exploits of a fictional footballer named Roy Race, who played for Melchester Rovers. The strip first appeared in the Tiger in 1954, before giving its name to a weekly (and later monthly) comic magazine, published by IPC and Fleetway from 1976 until 1995, in which it was the main feature. The weekly strip ran until 1993, following Roy's playing career until its conclusion after he lost his left foot in a helicopter crash. When the monthly comic was launched later that year, the focus switched to Roy's son, Rocky, who also played for Melchester. This publication folded after only 19 issues. The adventures of the Race family were subsequently featured from 1997 until May 2001 in the monthly Match of the Day football magazine, in which father and son were reunited as manager and player respectively. Football-themed stories were a staple of British comics from the 1950s onwards, and Roy of the Rovers was one of the most popular. To keep the strip exciting, Melchester was almost every year either competing for major honours or struggling against relegation to a lower division. The strip followed the structure of the football season, thus there were several months each year when there was no football.""" + txt = sys.stdin.read() + tokens = word_tokenize(txt) + + # POS-tagging + tags = pos_tag(tokens) + print tags + + # NER + chunks = ne_chunk(tags) + print chunks + +run_main() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-09-09 19:20:58
|
Revision: 1699 http://assorted.svn.sourceforge.net/assorted/?rev=1699&view=rev Author: yangzhang Date: 2010-09-09 19:20:50 +0000 (Thu, 09 Sep 2010) Log Message: ----------- Tweak author list on RelCloud paper Modified Paths: -------------- personal-site/trunk/src/index.txt Modified: personal-site/trunk/src/index.txt =================================================================== --- personal-site/trunk/src/index.txt 2010-09-09 19:19:03 UTC (rev 1698) +++ personal-site/trunk/src/index.txt 2010-09-09 19:20:50 UTC (rev 1699) @@ -167,7 +167,7 @@ Workload-Driven Approach to Database Replication and Partitioning_. VLDB 2010. [PDF](http://db.csail.mit.edu/pubs/schism-vldb2010.pdf) -- Carlo Curino, Evan Jones, Eugene Wu, Yang Zhang, Samuel Madden. _Relational +- Carlo Curino, Evan Jones, Yang Zhang, Eugene Wu, Samuel Madden. _Relational Cloud: The Case for a Database Service_. NEDB 2010. [PDF](http://www.mit.edu/~eugenewu/files/papers/caseforrelationalcloud.pdf) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-09-09 19:19:09
|
Revision: 1698 http://assorted.svn.sourceforge.net/assorted/?rev=1698&view=rev Author: yangzhang Date: 2010-09-09 19:19:03 +0000 (Thu, 09 Sep 2010) Log Message: ----------- Added Relational Cloud paper link Modified Paths: -------------- personal-site/trunk/src/index.txt Modified: personal-site/trunk/src/index.txt =================================================================== --- personal-site/trunk/src/index.txt 2010-09-06 23:23:16 UTC (rev 1697) +++ personal-site/trunk/src/index.txt 2010-09-09 19:19:03 UTC (rev 1698) @@ -167,6 +167,10 @@ Workload-Driven Approach to Database Replication and Partitioning_. VLDB 2010. [PDF](http://db.csail.mit.edu/pubs/schism-vldb2010.pdf) +- Carlo Curino, Evan Jones, Eugene Wu, Yang Zhang, Samuel Madden. _Relational + Cloud: The Case for a Database Service_. NEDB 2010. + [PDF](http://www.mit.edu/~eugenewu/files/papers/caseforrelationalcloud.pdf) + - David Sontag (MIT), Yang Zhang (MIT), Amar Phanishayee (CMU), David Andersen (CMU), David Karger (MIT). _Scaling all-pairs overlay routing_. CoNEXT 2009. [PDF](http://people.csail.mit.edu/dsontag/papers/sontag_conext09.pdf) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-09-06 23:23:23
|
Revision: 1697 http://assorted.svn.sourceforge.net/assorted/?rev=1697&view=rev Author: yangzhang Date: 2010-09-06 23:23:16 +0000 (Mon, 06 Sep 2010) Log Message: ----------- Added Quora profile Modified Paths: -------------- personal-site/trunk/src/index.txt Modified: personal-site/trunk/src/index.txt =================================================================== --- personal-site/trunk/src/index.txt 2010-09-03 08:50:35 UTC (rev 1696) +++ personal-site/trunk/src/index.txt 2010-09-06 23:23:16 UTC (rev 1697) @@ -41,6 +41,7 @@ - [Facebook](http://www.facebook.com/yaaang) - [LinkedIn](http://www.linkedin.com/in/yzhang) - [GitHub](http://github.com/yang/) +- [Quora](http://www.quora.com/Yang-Zhang) - [GPG Key] ([MIT PKS entry]) [Google (Buzz) profile]: http://www.google.com/profiles/yaaang This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-09-03 08:50:41
|
Revision: 1696 http://assorted.svn.sourceforge.net/assorted/?rev=1696&view=rev Author: yangzhang Date: 2010-09-03 08:50:35 +0000 (Fri, 03 Sep 2010) Log Message: ----------- Tweaks Modified Paths: -------------- personal-site/trunk/src/index.txt Modified: personal-site/trunk/src/index.txt =================================================================== --- personal-site/trunk/src/index.txt 2010-09-03 08:45:15 UTC (rev 1695) +++ personal-site/trunk/src/index.txt 2010-09-03 08:50:35 UTC (rev 1696) @@ -163,12 +163,12 @@ ------ - Carlo Curino, Evan Jones, Yang Zhang, Samuel Madden. _Schism: A - Workload-Driven Approach to Database Replication and Partitioning_. VLDB - 2010. [PDF](http://db.csail.mit.edu/pubs/schism-vldb2010.pdf) + Workload-Driven Approach to Database Replication and Partitioning_. + VLDB 2010. [PDF](http://db.csail.mit.edu/pubs/schism-vldb2010.pdf) - David Sontag (MIT), Yang Zhang (MIT), Amar Phanishayee (CMU), David Andersen - (CMU), David Karger (MIT). _Scaling all-pairs overlay routing to the - thousands_. CoNEXT 2009. + (CMU), David Karger (MIT). _Scaling all-pairs overlay routing_. + CoNEXT 2009. [PDF](http://people.csail.mit.edu/dsontag/papers/sontag_conext09.pdf) - Silas Boyd-Wickizer (MIT), Haibo Chen (Fudan University), Rong Chen (Fudan University), Yandong Mao (Fudan University), Frans Kaashoek (MIT), Robert This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-09-03 08:45:21
|
Revision: 1695 http://assorted.svn.sourceforge.net/assorted/?rev=1695&view=rev Author: yangzhang Date: 2010-09-03 08:45:15 +0000 (Fri, 03 Sep 2010) Log Message: ----------- Link to Schism paper Modified Paths: -------------- personal-site/trunk/src/index.txt Modified: personal-site/trunk/src/index.txt =================================================================== --- personal-site/trunk/src/index.txt 2010-09-01 06:34:11 UTC (rev 1694) +++ personal-site/trunk/src/index.txt 2010-09-03 08:45:15 UTC (rev 1695) @@ -162,6 +162,10 @@ Papers ------ +- Carlo Curino, Evan Jones, Yang Zhang, Samuel Madden. _Schism: A + Workload-Driven Approach to Database Replication and Partitioning_. VLDB + 2010. [PDF](http://db.csail.mit.edu/pubs/schism-vldb2010.pdf) + - David Sontag (MIT), Yang Zhang (MIT), Amar Phanishayee (CMU), David Andersen (CMU), David Karger (MIT). _Scaling all-pairs overlay routing to the thousands_. CoNEXT 2009. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-09-01 06:34:17
|
Revision: 1694 http://assorted.svn.sourceforge.net/assorted/?rev=1694&view=rev Author: yangzhang Date: 2010-09-01 06:34:11 +0000 (Wed, 01 Sep 2010) Log Message: ----------- Link to other utility packages Modified Paths: -------------- shell-tools/trunk/README Modified: shell-tools/trunk/README =================================================================== --- shell-tools/trunk/README 2010-09-01 06:03:16 UTC (rev 1693) +++ shell-tools/trunk/README 2010-09-01 06:34:11 UTC (rev 1694) @@ -151,5 +151,11 @@ Links ----- -- [Advanced Bash Scripting](http://www.faqs.org/docs/abs/HTML/): huge guide to - the beautiful montrosity that is bash. +- [Advanced Bash Scripting](http://www.faqs.org/docs/abs/HTML/): expansive + guide to the beautiful montrosity that is bash. +- [moreutils](http://joey.kitenet.net/code/moreutils/): some general-purpose + shell utilities; site also has links to more tools. +- [h4sh](http://www.cse.unsw.edu.au/~dons/h4sh.html): Haskell list functions as + shell commands. +- [num-utils](http://suso.suso.org/programs/num-utils/): for dealing with + numbers from the Unix command line. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-09-01 06:03:22
|
Revision: 1693 http://assorted.svn.sourceforge.net/assorted/?rev=1693&view=rev Author: yangzhang Date: 2010-09-01 06:03:16 +0000 (Wed, 01 Sep 2010) Log Message: ----------- buffer-to deprecated; use sponge Modified Paths: -------------- shell-tools/trunk/src/bash-commons/common.bash Modified: shell-tools/trunk/src/bash-commons/common.bash =================================================================== --- shell-tools/trunk/src/bash-commons/common.bash 2010-08-31 03:53:03 UTC (rev 1692) +++ shell-tools/trunk/src/bash-commons/common.bash 2010-09-01 06:03:16 UTC (rev 1693) @@ -648,12 +648,6 @@ done } -# Don't prematurely clobber files. E.g. `cat a b | buffer-to a` -buffer-to() { - local buf="$(cat)" out="$1" - echo "$buf" > "$out" -} - # Quickly fill up free space with randomness (insecure) by writing to specified # output file clobber-freespace() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-08-31 03:53:09
|
Revision: 1692 http://assorted.svn.sourceforge.net/assorted/?rev=1692&view=rev Author: yangzhang Date: 2010-08-31 03:53:03 +0000 (Tue, 31 Aug 2010) Log Message: ----------- Added clobber-freespace Modified Paths: -------------- shell-tools/trunk/src/bash-commons/common.bash Modified: shell-tools/trunk/src/bash-commons/common.bash =================================================================== --- shell-tools/trunk/src/bash-commons/common.bash 2010-08-31 03:52:38 UTC (rev 1691) +++ shell-tools/trunk/src/bash-commons/common.bash 2010-08-31 03:53:03 UTC (rev 1692) @@ -654,6 +654,13 @@ echo "$buf" > "$out" } +# Quickly fill up free space with randomness (insecure) by writing to specified +# output file +clobber-freespace() { + dd if=/dev/random bs=1k count=1 | + openssl enc -kfile /dev/fd/0 -in /dev/zero -aes-128-cbc > "$@" +} + #if ! is_declared indent ; then # noindent #else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-08-31 03:52:45
|
Revision: 1691 http://assorted.svn.sourceforge.net/assorted/?rev=1691&view=rev Author: yangzhang Date: 2010-08-31 03:52:38 +0000 (Tue, 31 Aug 2010) Log Message: ----------- Utility to mass-rename classes in html Added Paths: ----------- sandbox/trunk/src/one-off-scripts/html-class-regex/ sandbox/trunk/src/one-off-scripts/html-class-regex/replace.py Added: sandbox/trunk/src/one-off-scripts/html-class-regex/replace.py =================================================================== --- sandbox/trunk/src/one-off-scripts/html-class-regex/replace.py (rev 0) +++ sandbox/trunk/src/one-off-scripts/html-class-regex/replace.py 2010-08-31 03:52:38 UTC (rev 1691) @@ -0,0 +1,28 @@ +import re, os, sys + +s=set(open('/tmp/syms3').read().split()) +subpat = r'''(?:"((?:[^"\\]|\\.)*)"|'((?:[^'\\]|\\.)*)')''' +pat = re.compile(r''' + \b (?:add|remove)Class \s* \( %(pat)s \) | + \b class_? \s*=\s* %(pat)s''' % dict(pat=subpat), re.VERBOSE) + +for dirpath, dirnames, filenames in os.walk(sys.argv[1]): + for fname in filenames: + if os.path.splitext(fname)[1] in ['.py','.html','.js']: + path = os.path.join(dirpath, fname) + with open(path) as f: cnt = f.read() + def fn(m): + [gg] = [g for g in m.groups() if g is not None] + if '_' not in gg: + return m.group() + else: + if '${' in gg: + for cls in re.finditer('\w+', gg): + if '_' in cls.group(): + print path, m.group(), cls.group() + return m.group() + else: + # print re.sub(subpat, lambda n: n.group().replace('_','-'), m.group()) + return re.sub(subpat, lambda n: n.group().replace('_','-'), m.group()) + newcnt = pat.sub(fn, cnt) + with open(path,'w') as f: f.write(newcnt) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-08-31 03:27:37
|
Revision: 1690 http://assorted.svn.sourceforge.net/assorted/?rev=1690&view=rev Author: yangzhang Date: 2010-08-31 03:27:31 +0000 (Tue, 31 Aug 2010) Log Message: ----------- swap, encrypt Modified Paths: -------------- shell-tools/trunk/src/bash-commons/bashrc.bash Modified: shell-tools/trunk/src/bash-commons/bashrc.bash =================================================================== --- shell-tools/trunk/src/bash-commons/bashrc.bash 2010-08-27 17:04:30 UTC (rev 1689) +++ shell-tools/trunk/src/bash-commons/bashrc.bash 2010-08-31 03:27:31 UTC (rev 1690) @@ -734,6 +734,20 @@ sudo su - -c "toast $(quote "$@")" } +# swap two files +swap() { + local t="$(mktemp "$(dirname "$1")/XXXXXX")" && + mv -n "$1" "$t" && + mv -n "$2" "$1" && + mv -n "$t" "$2" +} + +# TODO +encrypt() { + chmod -R go= "$dir" + #sudo mount -t ecryptfs "$dir" "$dir" -o key=passphrase,ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_passthrough=n,ecryptfs_enable_filename_crypto=y,ecryptfs_fnek_sig=WHATEVER_SIGN_RETURNED +} + # From <http://chris-lamb.co.uk/2008/01/24/can-you-get-cp-to-give-a-progress-bar-like-wget/> cp-p() { strace -q -ewrite cp -- "${1}" "${2}" 2>&1 | This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-08-27 17:04:36
|
Revision: 1689 http://assorted.svn.sourceforge.net/assorted/?rev=1689&view=rev Author: yangzhang Date: 2010-08-27 17:04:30 +0000 (Fri, 27 Aug 2010) Log Message: ----------- Added buffer-to Modified Paths: -------------- shell-tools/trunk/src/bash-commons/common.bash Modified: shell-tools/trunk/src/bash-commons/common.bash =================================================================== --- shell-tools/trunk/src/bash-commons/common.bash 2010-08-13 03:26:19 UTC (rev 1688) +++ shell-tools/trunk/src/bash-commons/common.bash 2010-08-27 17:04:30 UTC (rev 1689) @@ -648,6 +648,12 @@ done } +# Don't prematurely clobber files. E.g. `cat a b | buffer-to a` +buffer-to() { + local buf="$(cat)" out="$1" + echo "$buf" > "$out" +} + #if ! is_declared indent ; then # noindent #else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-08-13 03:26:25
|
Revision: 1688 http://assorted.svn.sourceforge.net/assorted/?rev=1688&view=rev Author: yangzhang Date: 2010-08-13 03:26:19 +0000 (Fri, 13 Aug 2010) Log Message: ----------- Metaclass demo Added Paths: ----------- sandbox/trunk/src/py/metaclass.py Added: sandbox/trunk/src/py/metaclass.py =================================================================== --- sandbox/trunk/src/py/metaclass.py (rev 0) +++ sandbox/trunk/src/py/metaclass.py 2010-08-13 03:26:19 UTC (rev 1688) @@ -0,0 +1,20 @@ +def manip(name, bases, attrs): return lambda: 3 +class t1(object): __metaclass__ = manip +print t1() + +def manip(name, bases, attrs): + print (name, bases, attrs) + return type.__new__(type, name, bases, attrs) +class t2(object): + __metaclass__ = manip + def m(self, x): return 3 +print t2().m(4) + +# fails, can't assign +def dec(cls): cls.__dict__['m'] = lambda x: -1 +try: + @dec + class t3(object): + def m(self, x): return 3 +except Exception as ex: + print ex This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-08-10 03:27:38
|
Revision: 1687 http://assorted.svn.sourceforge.net/assorted/?rev=1687&view=rev Author: yangzhang Date: 2010-08-10 03:27:31 +0000 (Tue, 10 Aug 2010) Log Message: ----------- git pull --rebase by default Modified Paths: -------------- configs/trunk/src/gitconfig Modified: configs/trunk/src/gitconfig =================================================================== --- configs/trunk/src/gitconfig 2010-07-30 01:17:24 UTC (rev 1686) +++ configs/trunk/src/gitconfig 2010-08-10 03:27:31 UTC (rev 1687) @@ -15,6 +15,8 @@ k = log --decorate --oneline --graph # colorful 1-line log summary slog = log --pretty=format:'%Creset%C(red bold)[%ad] %C(blue bold)%h %Creset%C(magenta bold)%d %Creset%s %C(green bold)(%an)%Creset' --abbrev-commit --date=short +[branch] + autosetuprebase = always [core] excludesfile = /home/yang/.gitignore [user] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-07-30 01:17:30
|
Revision: 1686 http://assorted.svn.sourceforge.net/assorted/?rev=1686&view=rev Author: yangzhang Date: 2010-07-30 01:17:24 +0000 (Fri, 30 Jul 2010) Log Message: ----------- zlog, color Modified Paths: -------------- configs/trunk/src/gitconfig Modified: configs/trunk/src/gitconfig =================================================================== --- configs/trunk/src/gitconfig 2010-07-30 01:14:25 UTC (rev 1685) +++ configs/trunk/src/gitconfig 2010-07-30 01:17:24 UTC (rev 1686) @@ -7,6 +7,7 @@ dc = diff --cached h = help llog = log --date=local + zlog = log --pretty=format:'%h %ad %Cgreen%an%Creset %s' --date=short pr = pull --rebase st = status sta = stash @@ -21,3 +22,5 @@ email = ya...@gm... [merge] conflictstyle = diff3 +[color] + ui = auto This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-07-30 01:14:32
|
Revision: 1685 http://assorted.svn.sourceforge.net/assorted/?rev=1685&view=rev Author: yangzhang Date: 2010-07-30 01:14:25 +0000 (Fri, 30 Jul 2010) Log Message: ----------- continuous-make Modified Paths: -------------- shell-tools/trunk/src/bash-commons/common.bash Modified: shell-tools/trunk/src/bash-commons/common.bash =================================================================== --- shell-tools/trunk/src/bash-commons/common.bash 2010-07-16 01:36:50 UTC (rev 1684) +++ shell-tools/trunk/src/bash-commons/common.bash 2010-07-30 01:14:25 UTC (rev 1685) @@ -641,6 +641,13 @@ "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" } +continuous-make() { + while true ; do + make -s "$@" + sleep 1 + done +} + #if ! is_declared indent ; then # noindent #else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-07-16 01:36:56
|
Revision: 1684 http://assorted.svn.sourceforge.net/assorted/?rev=1684&view=rev Author: yangzhang Date: 2010-07-16 01:36:50 +0000 (Fri, 16 Jul 2010) Log Message: ----------- Updated RUBYVERSION autodetection Modified Paths: -------------- shell-tools/trunk/src/bash-commons/bashrc.bash Modified: shell-tools/trunk/src/bash-commons/bashrc.bash =================================================================== --- shell-tools/trunk/src/bash-commons/bashrc.bash 2010-06-25 01:39:19 UTC (rev 1683) +++ shell-tools/trunk/src/bash-commons/bashrc.bash 2010-07-16 01:36:50 UTC (rev 1684) @@ -104,6 +104,10 @@ else RUBYVERSION=1.8 fi fi +shortver=${RUBYVERSION:0:$(( ${#RUBYVERSION} - 2 ))} +if [[ ! -d /var/lib/gems/$RUBYVERSION && -d /var/lib/gems/$shortver ]] +then RUBYVERSION=$shortver +fi # general This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-06-25 01:39:25
|
Revision: 1683 http://assorted.svn.sourceforge.net/assorted/?rev=1683&view=rev Author: yangzhang Date: 2010-06-25 01:39:19 +0000 (Fri, 25 Jun 2010) Log Message: ----------- Documented; separated CA and server configs Modified Paths: -------------- sandbox/trunk/src/java/ssl/go.bash Modified: sandbox/trunk/src/java/ssl/go.bash =================================================================== --- sandbox/trunk/src/java/ssl/go.bash 2010-06-24 21:16:17 UTC (rev 1682) +++ sandbox/trunk/src/java/ssl/go.bash 2010-06-25 01:39:19 UTC (rev 1683) @@ -1,27 +1,61 @@ #!/usr/bin/env bash +# +# Example of generating SSL certificates (and then using them from Java). +# +# You can use the same .cfg for both CA and server, but browsers won't like +# that (e.g., sec_error_bad_signature in Firefox, same treatment as self-signed +# certs). +# +# To deploy into nginx, for instance: +# +# sudo cp server.key /etc/nginx/cert.key +# sudo cp server.crt /etc/nginx/cert.pem +# +# For more info than you could care: +# +# - <http://www.davidpashley.com/articles/cert-authority.html> +# - <http://www.g-loaded.eu/2005/11/10/be-your-own-ca/> +# - <http://www.mozilla.org/projects/security/pki/nss/ref/ssl/sslerr.html> set -o errexit -o nounset +shopt -s extglob +if (( $# > 0 )) && [[ $1 == clean ]] +then rm -f !(go.bash) ; exit +fi + if [[ ! -f ca.pass || ! -f server.pass || ! -f p12.pass ]] ; then echo 'Supply ca.pass, server.pass, p12.pass (careful with permissions)' 1>&2 exit 1 fi -cat > ssl.cfg << EOF +cat > ca.cfg << EOF [ req ] prompt = no distinguished_name = req_distinguished_name [ req_distinguished_name ] C = US +O = My CA +CN = ca.my.com EOF +cat > server.cfg << EOF +[ req ] +prompt = no +distinguished_name = req_distinguished_name +[ req_distinguished_name ] +C = US +O = My Company +CN = my.com +EOF + # CA openssl genrsa -des3 -out ca.key -passout file:ca.pass 4096 -openssl req -new -x509 -days 365 -key ca.key -out ca.crt -passin file:ca.pass -config ssl.cfg +openssl req -new -x509 -days 365 -key ca.key -out ca.crt -passin file:ca.pass -config ca.cfg # cert openssl genrsa -des3 -out server.key -passout file:server.pass 4096 -openssl req -new -key server.key -out server.csr -passin file:server.pass -config ssl.cfg +openssl req -new -key server.key -out server.csr -passin file:server.pass -config server.cfg # sign openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt -passin file:ca.pass This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-06-24 21:16:24
|
Revision: 1682 http://assorted.svn.sourceforge.net/assorted/?rev=1682&view=rev Author: yangzhang Date: 2010-06-24 21:16:17 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Typos Modified Paths: -------------- sandbox/trunk/src/java/ssl/go.bash Modified: sandbox/trunk/src/java/ssl/go.bash =================================================================== --- sandbox/trunk/src/java/ssl/go.bash 2010-06-12 06:03:07 UTC (rev 1681) +++ sandbox/trunk/src/java/ssl/go.bash 2010-06-24 21:16:17 UTC (rev 1682) @@ -17,11 +17,11 @@ # CA openssl genrsa -des3 -out ca.key -passout file:ca.pass 4096 -openssl req -new -x509 -days 365 -key ca.key -out ca.crt -passin file:ca.pass -config ca.cfg +openssl req -new -x509 -days 365 -key ca.key -out ca.crt -passin file:ca.pass -config ssl.cfg # cert openssl genrsa -des3 -out server.key -passout file:server.pass 4096 -openssl req -new -key server.key -out server.csr -passin file:server.pass -config server.cfg +openssl req -new -key server.key -out server.csr -passin file:server.pass -config ssl.cfg # sign openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt -passin file:ca.pass This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-06-12 06:03:17
|
Revision: 1681 http://assorted.svn.sourceforge.net/assorted/?rev=1681&view=rev Author: yangzhang Date: 2010-06-12 06:03:07 +0000 (Sat, 12 Jun 2010) Log Message: ----------- Added protobuf Python RPC demo Added Paths: ----------- sandbox/trunk/src/misc/protobuf/ sandbox/trunk/src/misc/protobuf/Makefile sandbox/trunk/src/misc/protobuf/README sandbox/trunk/src/misc/protobuf/clisrv.py sandbox/trunk/src/misc/protobuf/simple.proto Added: sandbox/trunk/src/misc/protobuf/Makefile =================================================================== --- sandbox/trunk/src/misc/protobuf/Makefile (rev 0) +++ sandbox/trunk/src/misc/protobuf/Makefile 2010-06-12 06:03:07 UTC (rev 1681) @@ -0,0 +1,5 @@ +simple_pb2.py: simple.proto + protoc --python_out=. simple.proto +.PHONY: clean +clean: + rm -f simple_pb2.py Added: sandbox/trunk/src/misc/protobuf/README =================================================================== --- sandbox/trunk/src/misc/protobuf/README (rev 0) +++ sandbox/trunk/src/misc/protobuf/README 2010-06-12 06:03:07 UTC (rev 1681) @@ -0,0 +1 @@ +Demo of PB RPC implementation <http://code.google.com/p/protobuf-socket-rpc/> Added: sandbox/trunk/src/misc/protobuf/clisrv.py =================================================================== --- sandbox/trunk/src/misc/protobuf/clisrv.py (rev 0) +++ sandbox/trunk/src/misc/protobuf/clisrv.py 2010-06-12 06:03:07 UTC (rev 1681) @@ -0,0 +1,38 @@ +#!/usr/bin/env python + +from simple_pb2 import * +import protobuf.server, protobuf, sys, time + +class QAImpl(QA): + def Ask(self, controller, query, done): + time.sleep(1) + done.run(Answer(text='hello!')) + +if sys.argv[1:] == ['server']: + + # Start server + server = protobuf.server.SocketRpcServer(9876) + server.registerService(QAImpl()) + server.run() + +else: + + # Define callback + class Callback: + def run(self,response): + print "Received Response: %s" % response + + # Create channel + channel = protobuf.channel.SocketRpcChannel('localhost',9876) + controller = channel.newController() + + # Call service + service = QA_Stub(channel) + request = Question(text = 'hello?') + service.Ask(controller,request,Callback()) # blocks + + # Check success + if controller.failed(): + print "Rpc failed %s : %s" % (controller.error,controller.reason) + +# vim: et sw=2 ts=2 Added: sandbox/trunk/src/misc/protobuf/simple.proto =================================================================== --- sandbox/trunk/src/misc/protobuf/simple.proto (rev 0) +++ sandbox/trunk/src/misc/protobuf/simple.proto 2010-06-12 06:03:07 UTC (rev 1681) @@ -0,0 +1,11 @@ +message Question { + optional string text = 1; +} + +message Answer { + optional string text = 1; +} + +service QA { + rpc Ask (Question) returns (Answer); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-06-05 01:25:52
|
Revision: 1680 http://assorted.svn.sourceforge.net/assorted/?rev=1680&view=rev Author: yangzhang Date: 2010-06-05 01:25:46 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Added camelcase.vim Added Paths: ----------- configs/trunk/src/vim/plugin/camelcase.vim Added: configs/trunk/src/vim/plugin/camelcase.vim =================================================================== --- configs/trunk/src/vim/plugin/camelcase.vim (rev 0) +++ configs/trunk/src/vim/plugin/camelcase.vim 2010-06-05 01:25:46 UTC (rev 1680) @@ -0,0 +1,11 @@ +function! ChangeCase() + python << endpython +import vim, re +vim.current.line = re.sub( + '([a-z0-9])([A-Z])', + lambda m: m.group(1) + '_' + m.group(2).lower(), + vim.current.line) +endpython +endfunction + +command! ChangeCase call ChangeCase() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-06-05 01:25:25
|
Revision: 1679 http://assorted.svn.sourceforge.net/assorted/?rev=1679&view=rev Author: yangzhang Date: 2010-06-05 01:25:18 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Added update-redmine Added Paths: ----------- sandbox/trunk/src/one-off-scripts/update-redmine/ sandbox/trunk/src/one-off-scripts/update-redmine/README sandbox/trunk/src/one-off-scripts/update-redmine/update.c Added: sandbox/trunk/src/one-off-scripts/update-redmine/README =================================================================== --- sandbox/trunk/src/one-off-scripts/update-redmine/README (rev 0) +++ sandbox/trunk/src/one-off-scripts/update-redmine/README 2010-06-05 01:25:18 UTC (rev 1679) @@ -0,0 +1 @@ +Wrote this so that I could run the rake command as suid. Intended for use from git post-receive hook, to replace root's cron job running this rake task. Didn't work out since ruby has anti-suid protection; not bothering with this for now. Added: sandbox/trunk/src/one-off-scripts/update-redmine/update.c =================================================================== --- sandbox/trunk/src/one-off-scripts/update-redmine/update.c (rev 0) +++ sandbox/trunk/src/one-off-scripts/update-redmine/update.c 2010-06-05 01:25:18 UTC (rev 1679) @@ -0,0 +1,4 @@ +#include <stdlib.h> +int main() { + return system("rake --trace -f /usr/share/redmine/Rakefile redmine:fetch_changesets RAILS_ENV=production"); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-06-04 02:16:50
|
Revision: 1678 http://assorted.svn.sourceforge.net/assorted/?rev=1678&view=rev Author: yangzhang Date: 2010-06-04 02:16:44 +0000 (Fri, 04 Jun 2010) Log Message: ----------- Added camelcase Added Paths: ----------- shell-tools/trunk/src/camelcase.py Added: shell-tools/trunk/src/camelcase.py =================================================================== --- shell-tools/trunk/src/camelcase.py (rev 0) +++ shell-tools/trunk/src/camelcase.py 2010-06-04 02:16:44 UTC (rev 1678) @@ -0,0 +1,7 @@ +#!/usr/bin/env python + +import re, sys + +pat = re.compile('([a-z0-9])([A-Z])') +for line in sys.stdin: + sys.stdout.write(pat.sub(lambda m: m.group(1) + '_' + m.group(2).lower(), line)) Property changes on: shell-tools/trunk/src/camelcase.py ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |