Skip to content

Instantly share code, notes, and snippets.

C-Duv

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
thomasdarimont / readme.md
Last active Oct 4, 2019
Example for decoding a JWT Payload with your Shell (bash, zsh...)
View readme.md

Setup

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"'=' 
  fi
  echo "$result" | tr '_-' '/+' | openssl enc -d -base64
@yunghoy
yunghoy / gist:a425f91824d26461bb2e3653bc56ebbf
Last active Oct 3, 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
stevenringo / ssl-cert-info.sh
Last active Oct 4, 2019
Shell script to check SSL certificate info like expiration date and subject. Taken from http://giantdorks.org/alain/shell-script-to-check-ssl-certificate-info-like-expiration-date-and-subject/
View ssl-cert-info.sh
#!/bin/bash
usage()
{
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 cheatsheet.md

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.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL

@mauvm
mauvm / gist:5de07085f3b51e117378
Created Jul 26, 2015
An "envsubst" alternative for replacing env variables in NGinX site configurations (for using it with Docker)
View gist:5de07085f3b51e117378
#!/bin/bash
# NOTE: Brackets are not supported and '$' in values will break the script.
mkdir /etc/nginx/sites-enabled 2> /dev/null
for file in /etc/nginx/sites-available/*.conf
do
TPL=$(cat $file)
for row in $(env)
do
@atcuno
atcuno / gist:3425484ac5cce5298932
Last active Oct 10, 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
tentacode / loop.php
Last active Aug 29, 2015
Quick & dirty loop with pcntl_fork
View loop.php
<?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) {
View xpath-cheatsheet.js
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active Oct 18, 2019
A comparison of using `git flow` commands versus raw `git` commands.
View gitflow-breakdown.md

Initialize

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

Connect to the remote repository

View src_deploy.md

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
You can’t perform that action at this time.