Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block C-Duv

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
thomasdarimont /
Last active Jun 9, 2019
Example for decoding a JWT Payload with your Shell (bash, zsh...)


Add this to your .profile, .bashrc, .zshrc...

decode_base64_url() {
  local len=$((${#1} % 4))
  local result="$1"
  if [ $len -eq 2 ]; then result="$1"'=='
  elif [ $len -eq 3 ]; then result="$1"'=' 
  echo "$result" | tr '_-' '/+' | openssl enc -d -base64
yunghoy / gist:a425f91824d26461bb2e3653bc56ebbf
Last active Jun 8, 2019
AMQP library (RabbitMQ) - async/await
View gist:a425f91824d26461bb2e3653bc56ebbf
alias babel-node='babel-node --presets stage-0'
------ RECV ------
// babel-node recv2.js "#"
// babel-node recv2.js "kern.*"
const amqp = require('amqplib');
const args = process.argv.slice(2);
if (args.length == 0) {
stevenringo /
Last active Jun 7, 2019
Shell script to check SSL certificate info like expiration date and subject. Taken from
cat <<EOF
Usage: $(basename $0) [options]
This shell script is a simple wrapper around the openssl binary. It uses
s_client to get certificate information from remote hosts, or x509 for local
certificate files. It can parse out some of the openssl output or just dump all
View postgres

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.


installation, Ubuntu

atcuno / gist:3425484ac5cce5298932
Last active Jun 14, 2019
HowTo: Privacy & Security Conscious Browsing
View gist:3425484ac5cce5298932

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents

tentacode / loop.php
Last active Aug 29, 2015
Quick & dirty loop with pcntl_fork
View loop.php
// every thing before will be used in every child process
while(true) {
$pid = pcntl_fork();
if ($pid === -1) {
die('Could not fork process');
} elseif ($pid) {
JamesMGreene /
Last active Jun 14, 2019
A comparison of using `git flow` commands versus raw `git` commands.


gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository


Symfony2 example project with:

  • Ruby (gem): manage deps (chef, cap)
  • Opscode Chef: apply config. to target system
  • Berkshelf: manage chfe deps (cookbooks)
  • Capistrano: deploy sources to server
  • composer: deps manager for php
  • Symfony 2
  • vagrant
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:


start new with session name:

Eising / findip.rb
Created Feb 27, 2012
Script to find IPs that belong in a list of subnets
View findip.rb
#!/usr/bin/env ruby
require 'ipaddr'
def usage
puts "#{$0} supernets file"
puts "Checks if a file full of ip-addresses is part of a supernet \n\n"
puts "Supernets: A comma-separated list of CIDR-noted networks. NO SPACES!\n\n"
puts "Example:"
puts "#{$0}, badguys.txt"
You can’t perform that action at this time.