George Opritescu

Developer from somewhere

restart chrome

Opening a tab to chrome://restart will do it.

Read More

yaml escape quote

A single quote

1
'
can be escaped by writing it as
1
''
:)

Read More

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"
Read More

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

Read More

sublime log commands

Press ctrl-` to open the console, and write:

sublime.log_commands(True)
Read More

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
Read More

nautilus custom context menu actions

Install nautilus-actions, and then uncheck Create a root Nautilus Actions menu from the options.

Read More

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
}
Read More

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
Read More

git worktree is already checked out at

I received errors like

1
fatal: 'devel' is already checked out at some_location
. This went away after removing the folder:

rm -rvf .git/worktrees/some_location
Read More
git