This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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. |
NewerOlder