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
@sergeifilippov
sergeifilippov / domain-nginx.conf
Created February 10, 2014 03:22
linux-dash with nginx
server {
server_name $domain_name;
root /var/www;
index index.html index.php;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
# Cache static files for as long as possible
location ~* \.(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)$ {
try_files $uri =404;
def verify_sign(public_key_loc, signature, data):
'''
Verifies with a public key from whom the data came that it was indeed
signed by their private key
param: public_key_loc Path to public key
param: signature String signature to be verified
return: Boolean. True if the signature is valid; False otherwise.
'''
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active April 17, 2024 10:51
Backend Architectures Keywords and References
@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
@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">
@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

@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 / 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'
@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 / 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'