This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script> | |
/* | |
* A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined | |
* in FIPS 180-1 | |
* Version 2.2 Copyright Paul Johnston 2000 - 2009. | |
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet | |
* Distributed under the BSD License | |
* See http://pajhome.org.uk/crypt/md5 for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in $(ls -1 vzdump* | cut -f -3 -d - | sort | uniq); do echo -n $(du -c --block-size=1G $(eval echo '$i*') | tail -n 1 | cut -f 1); echo -e "\t$i"; done | sort -n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# jnm 20140311 | |
TOTAL_AVAILABLE=$(df /var/lib/vz | grep '/var/lib/vz$' | awk '{ print $2 }') | |
vzlist -o ctid,numproc,status,ip,hostname,diskspace -s diskspace | awk " | |
{ | |
printf \$0 \"\t\" | |
if(NR==1) | |
{ | |
print \"in G\tas % of host\" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_report(self, report_view, context): | |
import line_profiler | |
profiler = line_profiler.LineProfiler() | |
profiler.add_function(self.arse_get_report) | |
profiler.enable_by_count() | |
out = self.arse_get_report(report_view, context) | |
profiler.print_stats() | |
return out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir /tmp/empty | |
$ cd /tmp/empty | |
$ ls -la | |
total 8 | |
drwxrwxr-x 2 john john 4096 jun 9 13:31 . | |
drwxrwxrwt 11 root root 4096 jun 9 13:31 .. | |
$ echo 'print "trololo"' > dumb.py | |
$ python | |
Python 2.7.5+ (default, Feb 27 2014, 19:37:08) | |
[GCC 4.8.1] on linux2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO | |
$$ | |
DECLARE | |
row record; | |
BEGIN | |
FOR row IN SELECT table_name FROM information_schema.tables | |
WHERE table_schema <> 'pg_catalog' AND table_schema <> 'information_schema' AND table_catalog = 'kobotoolbox' | |
LOOP | |
EXECUTE 'ALTER TABLE ' || quote_ident(row.table_name) || ' OWNER TO kobo;'; | |
END LOOP; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head><title>download test</title></head> | |
<body> | |
<input type="text" id="status" style="width: 100%"> | |
<div id="log"></div> | |
<script> | |
/* | |
mostly cookbooked from | |
https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Monitoring_progress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import sys | |
import xml | |
import hashlib | |
import getpass | |
import datetime | |
from collections import OrderedDict | |
from django.conf import settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// mapReduce idea credit: http://stackoverflow.com/a/2308036 | |
db.instances.mapReduce( | |
function() { | |
// map | |
for(var key in this) { | |
emit(key, null); | |
} | |
}, | |
function(key, values) { | |
// reduce |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="tumblr-post" data-href="https://embed.tumblr.com/embed/post/1GjIG-_i_PMG0qAkoklkwQ/161507154717" data-did="2bd38ed99a4c97a215bb75c2085abf410fffcbbc"><a href="http://nancy-elsner-archive.tumblr.com/post/161507154717/a-gay-icon-batmanissue455oct1990">http://nancy-elsner-archive.tumblr.com/post/161507154717/a-gay-icon-batmanissue455oct1990</a></div> <script async src="https://assets.tumblr.com/post.js"></script> |
OlderNewer