Skip to content

Instantly share code, notes, and snippets.

View matti's full-sized avatar
🎯
Focusing

Matti Paksula matti

🎯
Focusing
View GitHub Profile
@matti
matti / beddit.rb
Last active August 29, 2015 14:10
beddit api starter
require "httparty"
ENDPOINT = "https://cloudapi.beddit.com"
login_options = {
"grant_type" => "password",
"username" => "TODO",
"password" => "TODO"
}
@matti
matti / e
Created May 12, 2015 06:40
e
#!/usr/bin/env sh
/Applications/Atom.app/Contents/MacOS/Atom $@ &>/dev/null &
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
@matti
matti / send_authorized_keys.expect
Created July 10, 2015 16:08
expect send authorized_keys before
#!/usr/bin/expect -f
# NOTE: ..and then I discovered ssh-copy-id && sshpass: sshpass -p raspbian ssh-copy-id -i ~/.ssh/id_rsa.pub -p 22 root@pi
set rpi_host [lindex $argv 0];
set rpi_host_port [lindex $argv 1];
set authorized_key [lindex $argv 2];
spawn scp -P $rpi_host_port -o PubkeyAuthentication=no -r $authorized_key root@$rpi_host:authorized_keys
expect "assword:"
\documentclass[11pt]{report}
\begin{document}
\title{Title of this document}
\maketitle
\tableofcontents
\abstract{This is the abstract}
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the Uno and
Leonardo, it is attached to digital pin 13. If you're unsure what
pin the on-board LED is connected to on your Arduino model, check
the documentation at http://www.arduino.cc
This example code is in the public domain.
puts "lol"
abba = func(x)
/*
Arduino Starter Kit example
Project 7 - Keyboard
This sketch is written to accompany Project 7 in the
Arduino Starter Kit
Parts required:
two 10 kilohm resistors
1 Megohm resistor
#!/usr/bin/env sh
brew uninstall postgres
launchctl remove homebrew.mxcl.postgresql
rm /Users/mpa/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
rm -rf /usr/local/var/postgres
brew install postgres
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
@matti
matti / pg_dump_eats_args
Created August 2, 2016 13:34
pg_dump that eats -i for rails 3.2
#!/usr/bin/env bash
# use with ln -s pg_dump /usr/local/bin/pg_dump (or something that is before actual pg_dump in path)
actual_pg_dump=$(/usr/bin/pg_dump)
better=""
while true; do
case "$1" in
-i)
;;