Navigation Menu

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
@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
@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
@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'
@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)
@mems
mems / gist:5301297
Last active February 23, 2022 13:12
How to convert a (simple) SWF to PDF

Convert (simple) SWF to PDF

In SWFTools a programs called gfx2gfx is available to do this task, but it's not officially available precompiled.

It can convert SWF, PDF or image to SWF, PDF, ebook or image.

For discard downscaling for rasterized image (default: 72dpi) we use the provided by @m-p-y: add -r attribute to increase maxdpi

Requirements

@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">
@willurd
willurd / web-servers.md
Last active April 23, 2024 04:35
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active April 17, 2024 10:51
Backend Architectures Keywords and References