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
| ps -ef | grep <filter-here> | grep -v grep | awk '{print $2}' | xargs kill -9 |
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
| # setup | |
| sudo tc qdisc add dev $1 root tbf rate 1.0mbit latency 50ms burst 50kb mtu 10000 | |
| # remove | |
| sudo tc qdisc del dev $1 root |
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
| # docker run -runtime=nvidia --rm -ti -v "${PWD}:/app" tensorflow/tensorflow:latest-gpu python /app/test.py gpu 10000 | |
| import sys | |
| import numpy as np | |
| import tensorflow as tf | |
| from datetime import datetime | |
| device_name = sys.argv[1] # Choose device from cmd line. Options: gpu or cpu | |
| shape = (int(sys.argv[2]), int(sys.argv[2])) | |
| if device_name == "gpu": |
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 | |
| trap 'kill $(jobs -p)' EXIT | |
| for MNT in $(ls /dev/disk/by-id/*|grep -v part) | |
| do | |
| echo $MNT | |
| dd if=$MNT of=/dev/null & | |
| 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
| import os | |
| try: | |
| child_pid = os.fork() | |
| if child_pid == 0: | |
| # finally block runs twice | |
| #exit(1) | |
| # finally block runs once on exception | |
| #try: | |
| # raise Exception('bang!') |
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 /path/to/dir ! -newermt 2018-01-01 ! -type d -delete |
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 /path/to/dir/ -xtype l -delete -print |
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 -ex | |
| # first go to http://mitm.it/ and follow instructions | |
| # then got to chrome://settings/certificates -> Authorities and import: ~/.mitmproxy/mitmproxy-ca-cert.pem | |
| docker run --rm -it -v ~/.mitmproxy:/home/mitmproxy/.mitmproxy -p 8080:8080 -p 127.0.0.1:8081:8081 mitmproxy/mitmproxy mitmweb --web-host 0.0.0.0 |
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
| REQUESTS_CA_BUNDLE=~/.mitmproxy/mitmproxy-ca-cert.cer HTTPS_PROXY=http://localhost:8080 az "$@" |
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
| lsof -nP +L1 |