Skip to content

Instantly share code, notes, and snippets.

<?php
$filename = dirname('.') . $_SERVER['PHP_SELF'];
if (isset($_GET['download-source'])) {
header("Content-type: application/force-download");
$file = fopen(__FILE__, 'r');
$content = fread($file, filesize(__FILE__));
print $content;
die();
}
@rogersguedes
rogersguedes / ssh-agent-snippets.sh
Created June 11, 2018 00:19 — forked from alexras/ssh-agent-snippets.sh
Bash snippets to automatically start and stop an ssh-agent process on login and logout
#!/bin/bash
## in .bash_profile
SSHAGENT=`which ssh-agent`
SSHAGENTARGS="-s"
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then
eval `$SSHAGENT $SSHAGENTARGS`
trap "kill $SSH_AGENT_PID" 0
fi
/**
*
* MD5 (Message-Digest Algorithm)
* http://www.webtoolkit.info/
*
**/
 
var MD5 = function (string) {
 
function RotateLeft(lValue, iShiftBits) {
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite