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
| find . -type f -size +2000000k -exec ls -lh {} \; | awk '{ {for (i = 9; i <= NF; i++)printf("%s ", $i);} print ": " $5 }' |
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
| cat mail.mbox | formail -D 100000000 idcache -s >> dedupe.mbox |
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 bytesto(bytes, to, bsize=1024): | |
| """convert bytes to megabytes, etc. | |
| sample code: | |
| print('mb= ' + str(bytesto(314575262000000, 'm'))) | |
| sample output: | |
| mb= 300002347.946 | |
| """ | |
| a = {'k' : 1, 'm': 2, 'g' : 3, 't' : 4, 'p' : 5, 'e' : 6 } |
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
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| """ | |
| Copyright (c) 2013, Shawn Butts. All rights reserved. | |
| Permission to use, copy, modify, and/or distribute this software for any | |
| purpose with or without fee is hereby granted, provided that the above | |
| copyright notice and this permission notice appear in all copies. | |
| THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
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
| import crypt | |
| plaintext_password = 'txetnialp' | |
| salt = crypt.mksalt() | |
| shaadow_password = crypt.crypt(plaintext_password, '$6${0}'.format(salt)) |
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
| time sync; echo 3 > /proc/sys/vm/drop_caches | |
| time swapoff -a | |
| swapon -a |
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
| EC2_INSTANCE_TYPES = { | |
| 'c3.2xlarge': {'ebs': {'optimized': True}, | |
| 'ephemeral': {'number': '2', | |
| 'size': '80', | |
| 'type': 'SSD'}, | |
| 'network': {'enhanced': True, | |
| 'performance': 'High'}, | |
| 'processor': {'aes-ni': True, | |
| 'avx': True, | |
| 'speed': '2.8', |
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_aws_account_id(): | |
| conn_iam = boto.connect_iam() | |
| ret = conn_iam.get_all_users()['list_users_response']['list_users_result']['users'][0]['arn'].split(':')[4] | |
| return(ret) |
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
| time ssh <SERVER> 'a=1; while true; do echo $a `date` ; let a=a+1; sleep 1; done' |
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
| #!/usr/bin/python | |
| """ | |
| Save this file as server.py | |
| >>> python server.py 0.0.0.0 8001 | |
| serving on 0.0.0.0:8001 | |
| or simply | |
| >>> python server.py |
OlderNewer