Skip to content

Instantly share code, notes, and snippets.

@timf
timf / hiring.md
Last active January 18, 2020 22:11
Hiring!

See the more recent gist.

Hiring!

The Dell Cloud Manager engineering team is growing. We're looking for seven new software developers at many different experience levels.

In this gist, I want to give you an idea of:

@timf
timf / .inputrc
Created January 23, 2013 15:53
~/.inputrc for OSX up and down arrow bash history completion (enter the beginning of a command and press up to scroll through matches)
"\e[B": history-search-forward
"\e[A": history-search-backward
@timf
timf / gist:4040915
Created November 8, 2012 19:20
vagrant ramdisk (Linux)
cd /home/tim/VirtualBox\ VMs/
mv proxydev2_1351794515 tmp
mkdir proxydev2_1351794515
sudo mount -t tmpfs -o size=10G tmpfs /home/tim/VirtualBox\ VMs/proxydev2_1351794515
cp -a tmp/* proxydev2_1351794515/
# go back to vagrant directory and `vagrant up`
<
%3C
&lt
&lt;
&LT
&LT;
&#60
&#060
&#0060
&#00060
#!/bin/bash
export MYSQL_PASS=
function mysql_search_schema_usage(){
cat << EOF
usage: $0 <terms> [database]
EOF
}
function mysql_search_schema(){
@timf
timf / tiff-to-png.sh
Created June 20, 2013 01:55
Pass an X.tiff file to this --> X.png
#!/bin/bash
echoerr() { echo "$@" 1>&2; }
if [ "X" == "X$1" ]; then
echoerr "error: requires argument: path to .tiff file"
exit 1
fi
exe=`which sips`
curl http://whatismyip.akamai.com
@timf
timf / gist:4696052
Created February 2, 2013 03:55
Pipe or redirect-output from a sh for loop
(~)$ for x in `seq 5`; do echo $x; done | xargs ls
ls: 1: No such file or directory
ls: 2: No such file or directory
ls: 3: No such file or directory
ls: 4: No such file or directory
ls: 5: No such file or directory
(~)$ for x in `seq 5`; do echo $x; done > tmpfile
(~)$ cat tmpfile
1

Orien is correct, it is the fork() system call triggered by ProcessBuilder or Runtime.exec or other means of the JVM executing an external process (e.g. another JVM running ant, a git command, etc.).

There have been some posts on the Jenkins mailing lists about this: Cannot run program "git" ... error=12, Cannot allocate memory

There is a nice description of the issue on the SCons dev list: fork()+exec() vs posix_spawn()

There is a long standing JVM bug report with solutions: Use posix_spawn, not fork, on S10 to avoid swap exhaustion. But I'm not sure if this actually made it into JDK7 as the comments suggest was the plan.

In summary, on Unix-like systems, when one process (e.g. the JVM) needs to launch another process (e.g. git) a system call is made to