Skip to content

Instantly share code, notes, and snippets.

@RazZziel
RazZziel / fuck_talktalk.sh
Created March 25, 2018 18:35
Script to reboot the ever-so-stable TalkTalk-branded Huawei HG633 router
#!/bin/bash -e
router_ip="192.168.1.1"
user="admin"
password="<check_your_password_in_the_sticker_behind_your_router>"
cookie_jar="$(mktemp)"
cleanup() { rm -f "$cookie_jar"; }
trap cleanup QUIT
@RazZziel
RazZziel / update_db.sh
Created March 1, 2017 11:49
Stupid simple database migration management script
cd "$(dirname "$0")"
DB_USER="${DB_USER:-root}"
DB_PASS="${DB_PASS}"
DB_HOST="${DB_HOST:-localhost}"
DB_NAME="${DB_NAME}"
mysql_run() {
mysql -u"$DB_USER" -p"$DB_PASS" -h"$DB_HOST" "$DB_NAME" "$@"
}
#!/bin/bash
set -e
# http://datacenteroverlords.com/2012/03/01/creating-your-own-ssl-certificate-authority/
openssl genrsa -des3 -out ca.key 2048
openssl req -x509 -new -nodes -key ca.key -days 1024 -out ca.pem
@RazZziel
RazZziel / generate_cert.sh
Last active October 29, 2015 07:36
Generate HTTPS certificates
#!/bin/bash
set -e
# http://www.akadia.com/services/ssh_test_certificate.html
# Step 1: Generate a Private Key
openssl genrsa -des3 -out server.key 1024
# Step 2: Generate a CSR (Certificate Signing Request)
openssl req -new -key server.key -out server.csr
@RazZziel
RazZziel / analyze.sh
Created March 5, 2015 00:08
Setup and run ddp-analyzer-proxy + meteor
#!/bin/bash
# https://meteorhacks.com/introduction-to-ddp.html
# https://meteorhacks.com/discover-meteor-ddp-in-realtime.html
if which ddp-analyzer-proxy 2>/dev/null; then
echo "ddp-analyzer-proxy found in $(which ddp-analyzer-proxy)"
elif [ -f $(npm root)/.bin/ddp-analyzer-proxy ]; then
echo "ddp-analyzer-proxy found in $(npm root)/.bin/ddp-analyzer-proxy"
export PATH="$(npm root)/.bin/:$PATH"
@RazZziel
RazZziel / makeColorConsole.js
Created March 2, 2015 12:27
Colorify console.log() familly of functions
# Inspiration:
# http://zurb.com/forrst/posts/Add_color_to_console_warn_and_console_error_outp-Go0
# https://gist.github.com/spmason/1670196
try {
var colors = require('colors');
var util = require('util');
var makeColorConsole = function(fct, color){
return function() {
var args = [util.format.apply(util.format, Array.prototype.slice.call(arguments))];
@RazZziel
RazZziel / .gitignore
Last active February 15, 2016 16:16
Update to Qt 5.4.0 and parametrize Qt version
rootfs_files_after.txt
rootfs_files_before.txt
libiconv-*.*
mariadb_client-*-src*
qtbase-opensource-src-*
openssl-*