Skip to content

Instantly share code, notes, and snippets.

@mithereal
mithereal / Makefile
Created March 26, 2019 18:51 — forked from xenogenesi/Makefile
create self signed certificates
DOMAIN ?= mydomain.com
COUNTRY := IT
STATE := IT
COMPANY := Evil Corp.
# credits to: https://gist.github.com/fntlnz/cf14feb5a46b2eda428e000157447309
# usage:
@mithereal
mithereal / QuickGit.php
Last active July 1, 2016 22:03 — forked from lukeocodes/QuickGit.php
Current git version.
<?php
class QuickGit {
private $version;
function __construct() {
if(function_exists('exec')) {
exec('git describe --always',$version_mini_hash,$error);
if($error == 0 ){
exec('git rev-list HEAD | wc -l',$version_number);
exec('git log -1',$line);
@mithereal
mithereal / Git-precommit-hook-mysqldump
Last active April 14, 2021 00:12 — forked from wilcollins/Git-precommit-hook-mysqldump
Git pre-commit hook for MySQL database backup ( remote mysqldump + Git push )
#!/bin/bash -e
# -e means exit if any command fails
DBHOST=address.to.your.server
DBUSER=username
DBPASS=password # do this in a more secure fashion
DBNAME=DBNAME
GITREPO=/where/is/your/repo
DUMP=$GITREPO/where/you/store/dumps
NEW=$DUMP/schema.sql
OLD=$NEW.old
@mithereal
mithereal / backup-github.sh
Last active August 29, 2015 14:26 — forked from bjtitus/backup-github.sh
A shell script to backup your Github organization's repos.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
GHBU_API=${GHBU_API-"https://api.github.com"} # base URI for the GitHub API
GHBU_GITHOST=${GHBU_GITHOST-"<CHANGE-ME>.github.com"} # the GitHub hostname (see comments)
# I recommend using an API token so it is easily trackable and removable.
# Note that you MUST have SSH keys for a user with the access to all repos set up