Skip to content

Instantly share code, notes, and snippets.

View mahnve's full-sized avatar

Marcus Ahnve mahnve

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mahnve on github.
  • I am mahnve (https://keybase.io/mahnve) on keybase.
  • I have a public key whose fingerprint is 4ABA 33B1 3539 B480 81E0 6D86 1DAE 133E 4848 618C

To claim this, I am signing this object:

input {
stdin {
type => "stdin-type"
}
file {
type => "syslog"
path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ]
start_position => "beginning"
}
@mahnve
mahnve / gist:e50f07b21b413aaaacc3
Created June 11, 2014 22:00
logstash.aws.json
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "pblittle/docker-logstash",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "9292"
},
@mahnve
mahnve / gist:ec3e8d7494cd2c4a059c
Last active August 29, 2015 14:14
Count number of copies of NPM libs
find . -iname node_modules | xargs -I{} find {} -maxdepth 1 -type d | xargs -I{} basename {} | grep -v 'node_modules\|.bin' | sort | uniq -c | sort -rn
@mahnve
mahnve / gist:927fa44a4b22f34d3bf0
Created February 12, 2015 14:19
Find unused js libraries
for file in $(find . -iname "*.js" | sed 's/\.\///g' ); do grep -q $file ../*/*.html; if [ $? -ne 0 ]; then echo $file; fi; done
@mahnve
mahnve / late_print.ex
Last active August 29, 2015 14:16
Starts a few processes, who waits a randomly long time before calling back.
defmodule LatePrint do
def late_print(0) do
handle_message
end
def late_print(n) do
parent = self
spawn_link(fn ->
https://api.login.yahoo.com/oauth2/request_auth?redirect_uri=http%3A%2F%2Flocal.funnel.io%2Fauthv4.html%3Fsource_type%3Dyahoo%26callback%3Dtrue&response_type=code&client_id=<client_id>
plugin 'make_resourceful', :git => 'git://github.com/hcatlin/make_resourceful.git'
gem 'paperclip'
gem 'haml'
gem 'shoulda'
gem 'factory_girl'
gem 'cucumber'
############## commands #################
#!/bin/zsh
mpc play
sleep 1500
zenity --info --text "Pomodoro paus" &
mpc pause
mplayer ~/music/sounds/ting.mp3
@mahnve
mahnve / dump_to_svn.sh
Created February 9, 2011 12:47
A script to dump a git repo to svn.
#!/bin/bash
cd ~/svn-trunk
# Update from git
git pull
# Add files that need to be added to svn
svn status | grep "^\?" | awk '{print $2}' | xargs svn add