Skip to content

Instantly share code, notes, and snippets.

Not actually a bear

Arnaud Berthomier oz

Not actually a bear
View GitHub Profile
View mailmux
tmux has-session -t $SESSIONNAME > /dev/null
if [ $? != 0 ]; then
tmux new-session -s $SESSIONNAME -n mail -d
# Start mutt
tmux send-keys -t $SESSIONNAME "sleep 1" C-m
tmux send-keys -t $SESSIONNAME "TERM=screen-256color-bce neomutt" C-m
onchange () {
while inotifywait --exclude .swp -e modify -r .
oz / octokit-wat.rb
Created May 19, 2016
Not sure if... ¬¬
View octokit-wat.rb
client =
repo = client.repo('oz/osdb')
repo[:owner].class # => Sawyer::Resource
repo.to_h[:owner].class # => Sawyer::Resource
repo.to_hash[:owner].class # => Sawyer::Resource
repo.to_attrs[:owner].class # => Hash

Keybase proof

I hereby claim:

  • I am oz on github.
  • I am ephoz ( on keybase.
  • I have a public key whose fingerprint is 2CC4 C75E 9AB8 2328 D7E9 7144 92CC 3FC3 57F0 D893

To claim this, I am signing this object:

oz / backup
Last active Aug 29, 2015 — forked from substack/backup
View backup
tar -cjf- ~/.crypt/passwd ~/.ssh ~/.bashrc ~/.profile ~/.vimrc ~/.gitconfig \
~/.config/chromium ~/.mozilla \
| openssl enc -aes-256-cbc \
| ssh $SERVER 'cat>~/www/backup/`date +%F.%T`'
ssh $SERVER 'ls -1 ~/www/backup | grep ^[0-9] | sort > ~/www/backup/list.txt'
oz /
Created Dec 19, 2014
Upgading from PG 9.3 to PG 9.4 on Mac OS X, with Homebrew

Brew upgrade...

Run the usual brew update, and brew upgrade to get the latest 9.4 version of PostgreSQL.

After upgrading PG from 9.3 to 9.4 with brew, the server will not start as is. If you value your database contents, and configuration, pg_upgrade is here to migrate those.

Do not delete the old binaries at once: do not run brew cleanup, because you need 9.3 binaries to migrate.


oz / macro-reformat
Created Oct 1, 2013
A mutt macro to reformat e-mail message bodies. This is especially useful when you receive e-mails with very long lines of text, and you'd rather read a neatly formatted text. Simply press `Esc-f` to toggle between original message body, and reformatted with `par`.
View macro-reformat
# Add a macro on Esc-f to toggle message body filtering with par (reformat).
macro pager ,@fmton \
"<enter-command>set display_filter=/usr/bin/par<enter> \
<enter-command>macro pager \\ef ,@fmtoff 'Unformat message body'<enter> \
<exit><display-message><enter>" \
"Unformat message body"
macro pager ,@fmtoff \
oz / stock.hs
Created Aug 16, 2013
Playing with Yahoo's stock API in Haskell, use this little program to quickly check stock prices, or change currencies.
View stock.hs
import Prelude
import System.Environment
import Network.HTTP
import Control.Monad
showUsage :: IO ()
showUsage = do
putStrLn "Usage: stock <options...>\n"
putStrLn " - get a quote: stock <symbol>"
putStrLn " - change money: stock <from> <to> <amount>"
oz / ambulante_ics.rb
Created May 1, 2013
A memo of how ri_cal should be used to deal with timezones. It converts's schedule to ICS format too.
View ambulante_ics.rb
#!/usr/bin/env ruby
# encoding: utf-8
# What:
# A memo of how ri_cal should be used to deal with timezones. It converts
#'s schedule to ICS format too.
# Deps:
oz /
Last active Dec 16, 2015
This might come in handy whenever you need to add one or more hosts to a running VPN connection (on Mac OS).
# - Add hosts/IP addresses to route through your VPN.
# - Routed hosts are not persisted between restarts of your VPN software.
# - The VPN's gateway route is hardcoded to be on the tun0 interface.
# - Use of sudo is hard-coded too.
# - Only works on OSX
You can’t perform that action at this time.