Skip to content

Instantly share code, notes, and snippets.

Avatar
🆒

Patrick Oscity padde

🆒
View GitHub Profile
@padde
padde / c9-elixir.sh
Last active Feb 22, 2021
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 / SSH-Remote-Port-Forwarding.markdown
Last active Jan 28, 2021
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 / sidekiq_retry_schedule.rb
Last active Jan 8, 2021
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
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 Jun 19, 2012
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"];
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'
@padde
padde / NSData+CRC32.h
Created Jul 27, 2012
NSData CRC32 Category
View NSData+CRC32.h
@interface NSData (CRC32)
-(NSUInteger) crc32;
@end
@padde
padde / lets-encrypt-nginx.md
Last active Jul 10, 2018
Let's Encrypt with Nginx
View lets-encrypt-nginx.md

Let's Encrypt with Nginx

Here's how I set up a tiny Nginx/Rails server that uses HTTPS via a Let's Encrypt issued certificate.

https://letsencrypt.paddd.de/

Server

I use the smallest DigitalOcean droplet (512 MB) here, which is built from the "Ubuntu Ruby on Rails on 14.04" image provided by them.

@padde
padde / openvpn.md
Last active Apr 30, 2018
OpenVPN on Ubuntu 12.10 at DigitalOcean
View openvpn.md

OpenVPN on Ubuntu 12.10 at DigitalOcean

Install OpenVPN

sudo apt-get install openvpn

Generate Server Certificates

sudo cp -r /usr/share/doc/openvpn/examples/easy-rsa/2.0 /etc/openvpn/easy-rsa2
cd /etc/openvpn/easy-rsa2