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 | |
set -u | |
set -e | |
set -o pipefail | |
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
cat <<'EOF' > /etc/modprobe.d/blacklist-ipv6.conf |
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
### Handling error example | |
import sys | |
import traceback | |
try: | |
f = open('myfile.txt') | |
s = f.readline() | |
i = int(s.strip()) | |
except OSError as err: |
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
acm.amazonaws.com | |
apigateway.amazonaws.com | |
athena.amazonaws.com | |
autoscaling.amazonaws.com | |
clouddirectory.amazonaws.com | |
cloudformation.amazonaws.com | |
cloudfront.amazonaws.com | |
cloudsearch.amazonaws.com | |
cloudtrail.amazonaws.com | |
codecommit.amazonaws.com |
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
# | |
# Acts as a nginx HTTPS proxy server | |
# enabling CORS only to domains matched by regex | |
# /https?://.*\.mckinsey\.com(:[0-9]+)?)/ | |
# | |
# Based on: | |
# * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html | |
# * http://enable-cors.org/server_nginx.html | |
# | |
server { |
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
Recently, I use JMXterm to collect info about Java JVM via JMX and MBeans. Here is a short note. | |
- Download JMXterm | |
https://sourceforge.net/projects/cyclops-group/files/jmxterm/1.0.0/jmxterm-1.0.0-uber.jar/download | |
- Run JMXterm | |
java -jar jmxterm-1.0.0-uber.jar --url localhost:<jmx listen port> | |
- All MBeans from java.lang | |
$>domain java.lang |
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
# | |
# Config file for collectd(1). | |
# Please read collectd.conf(5) for a list of options. | |
# http://collectd.org/ | |
# | |
################## | |
# Global settings | |
################## |
First, you have to enable profiling
> db.setProfilingLevel(1)
Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...
NewerOlder