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
echo|set /p="toomanysecrets" | openssl rsautl -encrypt -inkey public-key.pem -pubin | openssl base64 > secret.txt |
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
read -s -p "Password: " qpwd | |
echo $qpwd | openssl rsautl -encrypt -inkey public-key.pem -pubin | openssl base64 | |
unset qpwd |
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
[ | |
'http', | |
'https', | |
'util', | |
'path', | |
'fs', | |
'request', | |
'url', | |
'stream' |
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
# Configuration file for runtime kernel parameters. | |
# See sysctl.conf(5) for more information. | |
# See also http://www.nateware.com/linux-network-tuning-for-2013.html for | |
# an explanation about some of these parameters, and instructions for | |
# a few other tweaks outside this file. | |
# | |
# See also: https://gist.github.com/kgriffs/4027835 | |
# | |
# Assumes a beefy machine with lots of network bandwidth |
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
# See also: http://arstechnica.com/gadgets/2012/11/how-to-set-up-a-safe-and-secure-web-server/3/ | |
gzip on; | |
gzip_disable "msie6"; | |
gzip_min_length 1100; | |
gzip_vary on; | |
gzip_proxied any; | |
gzip_buffers 16 8k; | |
gzip_types text/plain text/css application/json application/x-javascript |
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
# See also http://arstechnica.com/gadgets/2012/11/how-to-set-up-a-safe-and-secure-web-server/4/ | |
server_tokens off; | |
client_max_body_size 4096k; | |
client_header_timeout 10; | |
client_body_timeout 10; | |
keepalive_timeout 10 10; | |
send_timeout 10; |
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
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
Read 4K randomly from SSD* 150,000 ns 0.15 ms |
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 enable_echo(enable): | |
fd = sys.stdin.fileno() | |
new = termios.tcgetattr(fd) | |
if enable: | |
new[3] |= termios.ECHO | |
else: | |
new[3] &= ~termios.ECHO | |
termios.tcsetattr(fd, termios.TCSANOW, new) |
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 functools | |
class Scooby(object): | |
def mood(self): | |
return 'frightended' | |
def scooby_snack(func): | |
@functools.wraps(func) | |
def brave(self): |
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
Note: "memo" is just testing constructing a string, to prove | |
that strings are not hashed at create time, but memoized with | |
__hash__(). The functions construct new strings each time, | |
with some variant of: | |
'24058098:33d2a96e-ffad-11e2-b14b-8acd18156acf' * m | |
Where m is passed into the test function. | |
--------------------------------------------- |
OlderNewer