This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "github_api" | |
require 'net/http' | |
require 'JSON' | |
require 'yaml' | |
require 'date' | |
module Gitracker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Encrypt | |
tar cz folder_to_encrypt | openssl enc -aes-256-cbc -e > out.tar.gz.enc | |
# Decrypt | |
openssl aes-256-cbc -d -in out.tar.gz.enc | tar xz | |
# Or using gpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FREQUENCY=${1:-daily} | |
DB_BACKUP_DIR_ROOT="/home/backup/mysql/$FREQUENCY" | |
DB_BACKUP_DIR_TODAY="$DB_BACKUP_DIR_ROOT/`date +%Y-%m-%d`" | |
DATESTRING=$(date +%Y.%m.%dT%H-%M-%S) | |
[[ $FREQUENCY = 'weekly' ]] && holdback="+182" || holdback="+31" | |
# Create the backup directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
rsync --partial --progress --rsh=ssh ~/file user@remote:~/file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -eq 0 ]; then | |
echo "No arguments supplied" | |
exit 1 | |
fi | |
SOURCEDIR="$1" | |
if [ ! -d "$SOURCEDIR" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2015 Philipp Staender <[email protected]> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# from https://saiyedfaishal.wordpress.com/2014/03/20/exporting-all-mysql-user-privileges/ | |
HOST="127.0.0.1";USER="root";PASSWORD="root";mysql -h $HOST -u $USER -p$PASSWORD -Ne "select distinct concat( \"SHOW GRANTS FOR '\",user,\"'@'\",host,\"';\" ) from user;" mysql | mysql -h $HOST -u $USER -p$PASSWORD | sed 's/\(GRANT .*\)/\1;/;s/^\(Grants for .*\)/## \1 ##/;/##/{x;p;x;}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
""" | |
scholar.py -c 1 --txt --phrase "Upper Echelons - The Organization as a Reflection of Its Top Managers" | |
""" | |
import os | |
import re | |
import subprocess | |
directory = os.path.dirname(os.path.abspath(__file__)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TARGET=/Volumes/Backup/vserver | |
SOURCE="root@server01:/folder;root@sever02:/folder" | |
EXCLUDE="--exclude='.DS_Store'" | |
LOCK="/tmp/backupserver.lock" | |
if [ -f "$LOCK" ]; then | |
echo "locked… remove $LOCK to proceed" >&2 | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
backup_tables('localhost', 'user', 'passw', 'databasename', '*', true); | |
/* backup the db OR just a table */ | |
function backup_tables($host, $user, $pass, $name, $tables = '*', $filename = null) { | |
$return = ""; | |
$link = mysqli_connect($host, $user, $pass, $name); |