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
#!/usr/bin/env bash | |
: <<'END' | |
Sample Run: ./list_venvs.sh /Users/talwai/ | |
Sample Output: | |
----------------------- | |
DIRECTORY: /Users/talwai/qorpus_env | |
PYTHON_VERSION: 3.3.2 | |
PACKAGES: |
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
# This leaks in Python 2.7 but does not in Python 3+ | |
def bad_scope_list(): | |
num = range(1,10) | |
i = 4 | |
print [i for i in num] | |
print i # Prints 9 instead of 4 | |
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 ten_most_prolific(rows): | |
# Who are the top 10 most prolific artists in the data | |
# along with the number of their songs that appear in the data? | |
artists = [row['ARTIST CLEAN'] for row in rows] | |
c = Counter(artists) | |
sorted_c = sorted(c.items(), key=operator.itemgetter(1), reverse=True) | |
return sorted_c[:10] |
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
{ echo -ne "HTTP/1.0 200 OK\r\nContent-Length: $(wc -c <some.file)\r\n\r\n"; cat some.file; } | nc -l 8080 |
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
mv blob/a_long_directory_name/{c/x.x,evenmore/y.y} # Moves blob/a_long_directory_name/c/x.x to blob/a_long_directory_name/evenmore/y.y | |
# Source: http://unix.stackexchange.com/questions/89555/cp-or-mv-files-to-same-directory-they-are-already-in-when-i-am-in-another |
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
boot2docker up && env | grep DOCKER | sed 's/^/export /' > docker.conf && . docker.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
(venv)Aadityas-MacBook-Pro:dd-agent aadityatalwai$ python agent.py check network --profile | |
2015-05-18 16:56:36,856 | INFO | dd.collector | config(config.py:922) | initialized checks.d checks: ['ntp', 'consul', 'network'] | |
2015-05-18 16:56:36,856 | INFO | dd.collector | config(config.py:923) | initialization failed checks.d checks: [] | |
2015-05-18 16:56:36,856 | INFO | dd.collector | checks.collector(collector.py:443) | Running check network | |
2015-05-18 16:56:36,873 | INFO | dd.collector | checks(__init__.py:654) | | |
network | |
Memory Before (RSS): 18206720 | |
Memory After (RSS): 18243584 | |
Difference (RSS): 36864 | |
Memory Before (VMS): 2534727680 |
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
# Mac OS X | |
echo "aaditya.test.metric:100|g" | nc -u -w0 $(docker-machine ip default) 8125 |
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
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --new-window "https://app.datadoghq.com/account/settings" \ | |
"https://app.datadoghq.com/infrastructure/map?fillby=avg%3Acpuutilization&sizeby=avg%3Anometric&groupby=availability-zone&nameby=aws_name&nometrichosts=false&tvMode=false&nogrouphosts=false&palette=hostmap_blues&paletteflip=false"\ | |
"https://app.datadoghq.com/dash/71811/demo---cassandra?live=true&page=0&is_auto=false&from_ts=1453149091364&to_ts=1453235491364&tile_size=m"\ | |
"https://app.datadoghq.com/monitors#/create" "https://app.datadoghq.com/monitors#183575?group=all&live=4h"\ | |
"https://app.datadoghq.com/event/stream?tags_execution=and&show_private=true&per_page=30&aggregate_up=true&use_date_happened=false&display_timeline=true&from_ts=1452632400000&is_zoomed=false&to_ts=1453237200000&is_auto=false&incident=true&only_discussed=false&no_user=false&page=0&live=true&bucket_size=10800000"\ | |
"https://www.datadoghq.com/customers/"\ | |
"https://github.com/DataDog/dd-agent"\ | |
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
--- /opt/datadog-agent/agent/checks.d/openstack.py 2016-02-01 11:12:37.000000000 -0500 | |
+++ /opt/datadog-agent/agent/checks.d/openstack_patch.py 2016-02-03 14:49:22.000000000 -0500 | |
@@ -281,7 +281,7 @@ | |
nova_version = nova_api_version or DEFAULT_NOVA_API_VERSION | |
catalog = json_resp.get('token', {}).get('catalog', []) | |
- nova_match = 'novav21' if nova_version == 'v2.1' else 'nova' | |
+ nova_match = 'nova' | |
for entry in catalog: |
OlderNewer