bash run at exit
#!/bin/bash -e
echo "do work here"
start_some_binary_in_background &
jobpid=$!
function cleanup {
echo
echo "Killing $jobpid"
kill $jobpid
}
echo "do more work"
trap cleanup EXIT
echo "also more work"
tracing ruby method calls
The following allowed me to identify the cause of an infinite loop:
tp = TracePoint.new(:call) do |x|
puts x.inspect
end
tp.enable
# add your own code here
tp.disable
When running this, you’ll see all method calls in between enable/disable of the tracepoint
sublime log commands
Press ctrl-` to open the console, and write:
sublime.log_commands(True)
upgrade pg client to 9.4 in trusty
su
add-apt-repository "deb https://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main"
wget --quiet -O - https://postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
apt-get update
apt-get install postgresql-client-9.4
nautilus custom context menu actions
Install nautilus-actions, and then uncheck Create a root Nautilus Actions menu from the options.
sublime custom build system with login shell
Needed to run a node-cli tool. Build that enabled me to do so:
{
"cmd": "/bin/zsh -c 'source ~/.zshrc; resume export resume.html; sensible-browser resume.html'",
"shell": true
}
monit status/stop/start
Obtaining a list of monitorings:
monit status
Stopping a monitor:
monit stop name_of_monitor
Starting a monitor:
monit start name_of_monitor
git worktree is already checked out at
I received errors like
.
This went away after removing the folder:1
fatal: 'devel' is already checked out at some_location
rm -rvf .git/worktrees/some_location