Skip to content

Instantly share code, notes, and snippets.

View jadkik's full-sized avatar

Jad El Kik jadkik

  • Aiven
  • Berlin, DE
View GitHub Profile
@jadkik
jadkik / eb-rds-psql.sh
Created January 9, 2019 13:20
Connect to your RDS database that was created by Elastic Beanstalk
#!/bin/bash -ex
# ssh-add ~/path/to/aws-key-file.pem
LOCAL_PORT=${1:-15432}
EB_ENV=`mktemp`
trap 'rm -f $EB_ENV; exit' SIGINT SIGQUIT SIGKILL SIGTERM
# See https://serverfault.com/a/883673/373074
eb ssh --quiet -e 'ssh' -c 'cat /opt/python/current/env' > "$EB_ENV"
@jadkik
jadkik / validate-nginx-config.sh
Created August 24, 2017 07:06
Used to validate nginx templated config files before actually using them. For use with Ansible.
#!/usr/bin/env bash
# Example usage from an Ansible playbook:
# - name: Copy the nginx validate script
# copy: src=validate-nginx-config.sh dest=/opt/validate-nginx-config.sh mode=0744
#
# - name: Update main nginx config file
# template:
# src: nginx.conf.j2
# dest: /etc/nginx/nginx.conf
// ==UserScript==
// @name aub-banner
// @namespace aub-banner
// @description aub banner
// @include https://www-banner.aub.edu.lb/pls/*
// @version 1.1
// @grant none
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js
// @require https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js
// ==/UserScript==
@jadkik
jadkik / android_broken_screen.py
Created December 20, 2015 12:12
A small tool to manipulate your phone without a working touchscreen. Install [TouchControl](https://github.com/ternes3/TouchControl-for-Android) to see what happens on your screen as it's happening.
#!/usr/bin/env python3
import os
import sys
import readline
import atexit
from collections import defaultdict
def completer(funcs):
completionhelper = dict()