Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am tavisto on github.
  • I am tavisto (https://keybase.io/tavisto) on keybase.
  • I have a public key ASD_psd-iY5nHeYrRpshXV9YhYoXD2-BIa0EnOdlBORT1go

To claim this, I am signing this object:

$ mediainfo test.mp4
General
Complete name : test.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 56.6 MiB
Duration : 1h 1mn
Overall bit rate mode : Constant
Overall bit rate : 129 Kbps
@tavisto
tavisto / whitespace_fix.vim
Last active August 29, 2015 13:56
Add some commands to fix whitespace issues.
" Make all tabs 4 spaces
" Make tabs delete properly
" Make autoindent add 4 spaces per indent level
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab " Convert all tabs
set smarttab
function! Preserve(command)
#!/usr/bin/env bash
BREW='/usr/local/bin/brew'
if [ -f $BREW ]; then
echo "Tapping all the kegs!"
taps='homebrew/versions'
tapped=`$BREW tap`
for tap in $taps
do
if [[ "$tapped" != *$tap* ]]
@tavisto
tavisto / clear-dns.sh
Created January 20, 2014 18:12
A simple script to clear dns on OSX > 10.8
#!/usr/bin/env bash
echo "Clearing Cache"
dscacheutil -flushcache
sleep 3
echo "Restarting mDNSResponder"
sudo killall -HUP mDNSResponder
@tavisto
tavisto / gist:4455203
Created January 4, 2013 19:27
Logstash geoip filter traceback
Exception in thread "LogStash::Runner" org.jruby.exceptions.RaiseException: (ENOENT) No such file or directory - file:/home/user/logstash/logstash-1.1.7-monolithic.jar!GeoLiteCity.dat
at org.jruby.RubyFile.initialize(org/jruby/RubyFile.java:333)
at org.jruby.RubyIO.open(org/jruby/RubyIO.java:1179)
at RUBY.initialize(jar:file:/home/user/logstash/logstash-1.1.7-monolithic.jar!/gems/geoip-1.2.1/lib/geoip.rb:155)
at RUBY.register(file:/home/user/logstash/logstash-1.1.7-monolithic.jar!/logstash/filters/geoip.rb:43)
at RUBY.run_with_config(file:/home/user/logstash/logstash-1.1.7-monolithic.jar!/logstash/agent.rb:432)
at org.jruby.ext.thread.Mutex.synchronize(org/jruby/ext/thread/Mutex.java:149)
at RUBY.run_with_config(file:/home/user/logstash/logstash-1.1.7-monolithic.jar!/logstash/agent.rb:431)
at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1612)
at RUBY.run_with_config(file:/home/user/logstash/logstash-1.1.7-monolithic.jar!/logstash/agent.rb:429)