Skip to content

Instantly share code, notes, and snippets.

Avatar
🆒

Patrick Oscity padde

🆒
View GitHub Profile
@padde
padde / install_tomato.sh
Created April 1, 2012 18:28
Install Tomato Firmware via TFTP from *NIX system
View install_tomato.sh
#!/bin/bash
echo "==================================================================="
echo "This bash script will upload tomato.trx in the current directory to"
echo "192.168.11.1 during the router's bootup."
echo
echo "* Set your ethernet card's settings to:"
echo " IP: 192.168.11.2"
echo " Mask: 255.255.255.0"
echo " Gateway: 192.168.11.1."
@padde
padde / gist:2628262
Created May 7, 2012 15:05
Ruby Fixnum each_bit
View gist:2628262
class Fixnum
def each_bit
8.times do |p|
yield (self & 1 << p) >> p
end
end
end
@padde
padde / DefaultKeyBinding.dict
Created November 11, 2011 16:45
Disable non-breaking space (Alt+Space) on OS X
View DefaultKeyBinding.dict
# in ~/Library/KeyBindings/DefaultKeyBinding.dict
{
"~ " = ("insertText:", " ");
}
@padde
padde / SSH-Remote-Port-Forwarding.markdown
Last active September 8, 2022 06:03
SSH Remote Port Forwarding
View SSH-Remote-Port-Forwarding.markdown

!!! WIP !!!

SSH Remote Port Forwarding

TODO: intro

Provision Server

  • DigitalOcean
  • 512 MB RAM
@padde
padde / c9-elixir.sh
Last active July 9, 2022 18:03
Install Script for Erlang/Elixir/Phoenix on Cloud9
View c9-elixir.sh
#!/usr/bin/env bash
############### USAGE ###############
#
# 1. Create a new workspace on Cloud9 using the "Blank" template
#
# 2. Run this command in the console:
# bash <(curl -fsSL https://gist.githubusercontent.com/padde/3c6301f15cbd5025e131740dae33aa95/raw/c9-elixir.sh)
#
# 3. There is no step 3!
@padde
padde / sidekiq_retry_schedule.rb
Last active January 8, 2021 11:08
Sidekiq retry schedule
View sidekiq_retry_schedule.rb
require 'active_support/duration'
offset = 0
puts "attempt 0 immediately"
0.upto(24) do |count|
# https://github.com/mperham/sidekiq/blob/v6.1.2/lib/sidekiq/job_retry.rb#L225
average_jitter = (15 * (count + 1))
delay = count**4 + 15 + average_jitter
@padde
padde / gist:2623647
Created May 6, 2012 18:23
Convert video for PowerPoint with ffmpeg
View gist:2623647
ffmpeg -i INFILE -r 25 -f mpeg -vcodec mpeg1video -ar 48000 -b 1500k -acodec mp2 -ar 44100 -ac 1 -y OUTFILE.mpg
@padde
padde / export-plot-as-csv.m
Created June 19, 2012 11:56
Mathematica: Export Plot Values as CSV
View export-plot-as-csv.m
plot = Plot[Cos[x],{x,0,2\[Pi]}];
mydata = Flatten[Cases[plot, Line[x__] -> x, Infinity], 1];
Export["/Users/padde/Desktop/plot-data.dat", mydata, "CSV"];
@padde
padde / keybase_proof.md
Created April 5, 2019 09:09
Keybase proof
View keybase_proof.md

Keybase proof

I hereby claim:

  • I am padde on github.
  • I am padde (https://keybase.io/padde) on keybase.
  • I have a public key ASAEolg38G1AcHEJA02qn5GcHNIM5025SKK7qMthoGn4RAo

To claim this, I am signing this object:

View Elektrotechnik 2.1.c
# Patrick Oscity
#
# Bauhaus-Universität Weimar
# Fakultät Medien
# SoSe 2011
require 'rubygems'
require 'wavefile'