Skip to content

Instantly share code, notes, and snippets.

@saltydizz
saltydizz / uninstall_office_2016.sh
Created July 29, 2018 16:01 — forked from pirafrank/uninstall_office_2016.sh
Uninstall Office 2016 from OS X completely
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo -e "
ROOT PRIVILEDGES NEEDED!
You have to run this script as root.
Aborting...
"
exit 1
else
<!--
How to use Google JS Visualization Api offline, step by step
this approach might work with other libraries loaded with google.load, after all it's still JavaScript!!!
-->
<!DOCTYPE html>
<html>
@saltydizz
saltydizz / Archive Moodle Logs.md
Created June 7, 2017 08:17 — forked from atenni/Archive Moodle Logs.md
Script to archive moodle logs to a separate stats server for future long time series/big data analysis.

Archiving mdl_log, daily

(From http://www.ualberta.ca/~dostatni/moodlemoot2013/mdl_log.html)

The following script is executed daily. It generates a CSV file with all the moodle activity for previous day. That file is saved together with apache access and error logs in a log server. This data is used to verify student challenges ( eg. "I couldn't submit my assignment because there was a problem with the system"), identify trends and trace the origin of errors (to a specific code deployment).

This level of archiving allows us to remove the mdl_log entries from the active database. Currently the logs take up about half of the size of the database on disk.

dump_yesterdays_logs.sql

@saltydizz
saltydizz / decrypt.rb
Created January 20, 2017 13:57 — forked from refractalize/decrypt.rb
Decrypt HTTP Live Streaming TS files
def read_m3u8(m3u8)
File.open(m3u8, 'r') do |file|
keyfile = nil
iv = 0
file.each_line do |line|
line.chomp!
if line =~ /^#EXT-X-KEY:METHOD=AES-128,URI="(.*?)"(,IV=0x(.*))?/
keyfile = $1
if $2
iv = $3
@saltydizz
saltydizz / ec
Created August 13, 2016 17:06 — forked from alexmurray/ec
Start Emacs Client in GUI (and launch Emacs server if not already running)
#!/bin/bash
# Shamelessly taken from http://mjwall.com/blog/2013/10/04/how-i-use-emacs/
# This script starts emacs daemon if it is not running, opens whatever file
# you pass in and changes the focus to emacs. Without any arguments, it just
# opens the current buffer or *scratch* if nothing else is open. The following
# example will open ~/.bashrc
# ec ~/.bashrc
@saltydizz
saltydizz / 0_reuse_code.js
Created April 1, 2016 02:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console