This file contains hidden or 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
| private[this] def peakNested(fid:Int, pbs:CodedInputStream):Option[CodedInputStream] = { | |
| val (_, res) = Iterator.continually(pbs.readTag()).span{tag => | |
| (tag != 0) && (WireFormat.getTagFieldNumber(tag) != fid) && pbs.skipField(tag) | |
| } | |
| val lastid = WireFormat.getTagFieldNumber(res.next) | |
| if (lastid == fid) Some(pbs) | |
| else None | |
| } | |
| def recursivePeek[T](ids:Seq[Int], extract: (CodedInputStream=>T), pbs:CodedInputStream):Option[T] = { | |
| ids match { |
This file contains hidden or 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
| object jgitenv { | |
| def setup() { | |
| val jschConfigSessionFactory = new JschConfigSessionFactory() { | |
| override def createDefaultJSch(fs:FS) = { | |
| val jsch = new JSch(); | |
| try { | |
| jsch.addIdentity("..\\id_rsa"); //_.pub must exist | |
| jsch.setKnownHosts("..\\known_hosts"); | |
| } catch { |
This file contains hidden or 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
| PGHOST=root@remotehost | |
| eval "ssh ${PGHOST} pg_dump -Fc webdb" > webdb-`date +%F.%H%M`.dump |
This file contains hidden or 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 | |
| GITHOST=scm@192.168.100.221 | |
| GITPATH=gitroot | |
| cd ~/${GITPATH}_backup | |
| ls -F . | grep / > /tmp/.gitmissing1 | |
| eval ssh -n $GITHOST ls -F ${GITPATH}/. | grep / > /tmp/.gitmissing2 | |
| diff /tmp/.gitmissing1 /tmp/.gitmissing2 | egrep '^>' | | |
| while read x f; do | |
| git clone --bare --mirror ${GITHOST}:${GITPATH}/$f $f |
This file contains hidden or 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
| dpkg --add-architecture i386 | |
| apt-get update | |
| apt-get install libstdc++6:i386 |
This file contains hidden or 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
| (funcall | |
| (lambda (fn n) | |
| (funcall fn n fn)) | |
| (lambda (n this) | |
| (cond ((> n 0) | |
| (* n (funcall this (- n 1) this))) | |
| (t 1))) | |
| 10) |
NewerOlder