Skip to content

Instantly share code, notes, and snippets.

View erdii's full-sized avatar
🪤

Josh Gwosdz erdii

🪤
View GitHub Profile

Keybase proof

I hereby claim:

  • I am erdii on github.
  • I am erdii (https://keybase.io/erdii) on keybase.
  • I have a public key whose fingerprint is 57C9 D204 50AA ADD8 F2D8 C33C A7F3 4A2C BDF1 130E

To claim this, I am signing this object:

@erdii
erdii / README.md
Last active November 15, 2016 14:56
Dockerizing Postgres

Dockerizing Postgres

docker run --name postgres -e POSTGRES_PASSWORD=YOURSECRETPASS -d -v /your/db/path:/var/lib/postgresql/data postgres

then link other containers with this one

using systemd:

// spotted @ https://davidwalsh.name/convert-image-data-uri-javascript
function getDataUri(url, callback) {
var image = new Image();
image.onload = function () {
var canvas = document.createElement("canvas");
canvas.width = this.naturalWidth;
canvas.height = this.naturalHeight;
canvas.getContext("2d").drawImage(this, 0, 0);
@erdii
erdii / networking.sh
Created March 31, 2016 08:54
Debug linux networking...
# List all open connections
netstat -atp tcp | grep -i "listen"
# Proto Recv-Q Send-Q Local Address Foreign Address (state)
# tcp4 0 0 localhost.25035 *.* LISTEN
###
# List all open ports
sudo lsof -i -P | grep -i "listen"
@erdii
erdii / android_instructions.md
Created April 19, 2016 16:14 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@erdii
erdii / gist:7ecfa93661b73a3f4033cbd35bfeb455
Created July 31, 2016 11:45 — forked from eito/gist:8108401
git rewrite committer/author in history
git filter-branch --commit-filter '
if [ "$GIT_COMMITTER_NAME" = "<Old Name>" ];
then
GIT_COMMITTER_NAME="<New Name>";
GIT_AUTHOR_NAME="<New Name>";
GIT_COMMITTER_EMAIL="<New Email>";
GIT_AUTHOR_EMAIL="<New Email>";
git commit-tree "$@";
else
git commit-tree "$@";

Install certbot

sudo su
yum install wget -y
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto

Install certificate

@erdii
erdii / root.sh
Created October 27, 2016 09:12 — forked from Arinerron/root.sh
"Root" via dirtyc0w privilege escalation exploit (automation script) / Android (32 bit)
#!/bin/bash
# Give the usual warning.
clear;
echo "[INFO] Automated Android root script started.\n\n[WARN] Exploit requires sdk module \"NDK\".\nFor more information, visit the installation guide @ https://goo.gl/E2nmLF\n[INFO] Press Ctrl+C to stop the script if you need to install the NDK module. Waiting 10 seconds...";
sleep 10;
clear;
# Download and extract exploit files.
echo "[INFO] Downloading exploit files from GitHub...";
@erdii
erdii / observer.md
Created March 1, 2017 14:07 — forked from pnc/observer.md
Using Erlang observer/appmon remotely

Using OTP's observer (appmon replacement) remotely

$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769

Note the running on port for epmd itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:

$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
@erdii
erdii / observer.md
Created March 1, 2017 14:07 — forked from pnc/observer.md
Using Erlang observer/appmon remotely

Using OTP's observer (appmon replacement) remotely

$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769

Note the running on port for epmd itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:

$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host