Skip to content

Instantly share code, notes, and snippets.

View mcnemesis's full-sized avatar
💭
DNAP hackathons on days with good weather ;-)

Nemesis Fixx Da JWL mcnemesis

💭
DNAP hackathons on days with good weather ;-)
View GitHub Profile
@mcnemesis
mcnemesis / upgrade_wordpress_wpcli.sh
Last active August 29, 2015 14:25
This is how to upgrade your WordPress site, its plugins and themes automatically via a shell, using wp-cli
#!/bin/bash
#requires: wp-cli installed
# run all the following commands inside your wordpress root directory
wp core update #updates wp itself
wp plugin update --all #update all plugins
wp theme update -all #update all themes
@mcnemesis
mcnemesis / df_mail_alert.sh
Created November 26, 2012 14:42
linux : mail-report on low disk-space in one line!
df -h | grep -e "/home$" | awk '{print $5}' | tr '%' ' ' | xargs -n 1 -I{} echo {} | xargs -n1 -I_percent -- sh -c '[ _percent -ge 70 ] && echo "Low Space on server:/home (_percent% full)" | mail -s "Disk Space Alert" johndoe@site.com'
@matlads
matlads / check-df-mail.pl
Created November 26, 2012 15:08
Checking disk space using Filesys::Df with Email::Simple to email warnings.
#!/usr/bin/env perl
use strict;
use warnings;
use Filesys::Df;
use Email::Simple;
use Email::Sender::Simple qw(sendmail);
my $warn_limit = 75;
@mcnemesis
mcnemesis / history_viz.sh
Created December 28, 2012 18:55
A Bash One-liner to visualize one's command-usage based on frequencies in one's Bash History.
history | awk '{ print $2}' | sort | uniq -c | sort -n | tail -n 30 | sed -n '{s/^[ \t]*//};p' | gnuplot -p -e 'set xtics rotate out;set style data histogram;set style fill solid 1.0 border -1;plot "-" u 1:xtic(2) notitle'
@MarkNenadov
MarkNenadov / ciphering_rc5.py
Created March 8, 2011 21:07
Some throwaway code I used to demonstrate the RC5 cipher with the PyCrypto library
# Sample code by Mark Nenadov.
#
# Warning, this is OLD legacy code. It hasn't been tested in semi recent versions
# of Python or PyCrypto.
#
# You may use this however you wish, but I retain no responsibility whatsoever for how
# you use it and provide it with no warranty, either.
from Crypto.Cipher import RC5
@justincarroll
justincarroll / bootstrap-basic-template.htm
Last active May 11, 2018 04:43
This is my personal Bootstrap 3 and Font Awesome 4 basic HTML template.
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Basic Template</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">
<link rel="stylesheet" href="style.css">
@mcnemesis
mcnemesis / uganda_districts.txt
Created June 4, 2014 07:23
List of all current (as of 2014) Uganda's Districts - useful in forms-authoring and other tasks of your liking (source : http://www.statoids.com/uug.html)
Abim
Adjumani
Agago
Alebtong
Amolatar
Amudat
Amuria
Amuru
Apac
Arua
@duncanbeevers
duncanbeevers / sc-dl-min.js
Created March 22, 2012 12:16 — forked from pheuter/sc-dl.js
Bookmarklet that generates download link for a Soundcloud upload
(function(window){var i,$sound,$buttonGroup;var $sounds=$(".sound");var clientId=require("config").get("client_id");var oauthToken=require("lib/connect").getAuthToken();var conversionHelper=require("lib/helpers/conversion-helper");var $downloadButton,size;var params,downloadUrl,onSuccess;for(i=$sounds.length-1;i>=0;i--){$sound=$($sounds[i]);var soundcloudUrl="https://soundcloud.com"+($sound.find(".soundTitle__title").attr("href")||window.location.pathname);params={url:soundcloudUrl,client_id:clientId};onSuccess=function($sound){return function(data){var params={client_id:clientId};downloadUrl=require("lib/url").stringify({query:params},data.stream_url+".mp3");$buttonGroup=$($sound.find(".sound__soundActions .sc-button-group")[0]);size=$buttonGroup.find(".sc-button:first")[0].className.match(/sc-button-((?:small)|(?:medium))/)[1];$downloadButton=$('<a class="sc-button sc-button-download sc-button-icon sc-button-responsive">Download</a>').attr({title:"Download this sound ("+conversionHelper.bytesToMB(data.origi
@zgohr
zgohr / admin.py
Last active April 17, 2019 10:01
Remove Tastypie from Django admin
from django.contrib import admin
from tastypie.models import ApiKey, ApiAccess
admin.site.unregister(ApiKey)
admin.site.unregister(ApiAccess)
@mcnemesis
mcnemesis / DRAMON.default.config.json
Last active July 6, 2020 08:18
Sample DRAMON Configuration
{"DRINK":["Soda","Water","Something Hot","Tea","Some Wine","Milk","Yorghurt","Beer","Spirit","Porridge","A Herb.","some Fresh Juice","Bushera","Warm Water"],"CALL":["A Girlfriend","A Relative","Your Friend","someone you miss."],"EAT":["A Fruit","Leafy Vegetables","Fish","Nuts","Something Starchy","No meat","Chicken","some Seeds"],"GO TO":["Entebbe","A Forest","The Lake","Kampala","Home","School","a dance floor.","Bed.","work. "],"Summon":["God","Guardian Angel","Allself","Certain","your muse."],"LISTEN TO":["Some Nu Music","A Podcast","Old Hip Hop","Ragga!","Jazz","Some music.","Something you can play yourself, using things around you.","Traffic"],"WATCH":["A Music Video","A Science Video","Some News","A Cartoon","A Movie","A Comedy","Nature","Your Inner World","Something Erotic","The Skies."],"READ":["from SHRINES, by JWL.","a Holy Scripture.","One of your old documents.","Poetry","A Novel","the News","the Clouds","that book. "],"RITE":["Alone","With Someone else. (No more than 5).","With Someone else. (No m