>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found
/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
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 | |
# | |
# Usage: dev_signed_cert.sh HOSTNAME | |
# | |
# Creates a CA cert and then generates an SSL certificate signed by that CA for the | |
# given hostname. | |
# | |
# After running this, add the generated dev_cert_ca.cert.pem to the trusted root | |
# authorities in your browser / client system. | |
# |
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
ab \ | |
-n 1000 \ | |
-c 20 \ | |
-s 30 \ | |
-p post-data.txt \ | |
-T 'application/x-www-form-urlencoded; charset=UTF-8' \ | |
-v 3 \ | |
-H "X-Requested-With: XMLHttpRequest" \ | |
-H "X-Ajax-Referer: http://example.com" \ | |
-H "Accept-Encoding: gzip, deflate" \ |
Let's say you're using Ubuntu 13.04 (Raring Ringtail, released in April 2013) and it just went End-of-Life on you, because it's supported for only 6 months, and the deprecated packages are taken down after 12 months.
You'll probably figure this out the hard way. When you run sudo apt-get update
, it will eventually report these errors:
Ign http://archive.ubuntu.com raring-updates/universe Sources/DiffIndex
Err http://security.ubuntu.com raring-security/main Sources
404 Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com raring-security/universe Sources
404 Not Found [IP: 91.189.91.15 80]
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
# post_loc.txt contains the json you want to post | |
# -p means to POST it | |
# -H adds an Auth header (could be Basic or Token) | |
# -T sets the Content-Type | |
# -c is concurrent clients | |
# -n is the number of requests to run in the test | |
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/ |
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
<?php | |
function cls() | |
{ | |
print("\033[2J\033[;H"); | |
} | |
echo "hello world"; | |
cls(); |
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
Remove file from git repository (history) | |
SOLUTION: This is the shortest way to get rid of the files: | |
1. check .git/packed-refs - my problem was that I had there a refs/remotes/origin/master line for a remote repository, delete it, otherwise git won't remove those files | |
2. (optional) git verify-pack -v .git/objects/pack/#{pack-name}.idx | sort -k 3 -n | tail -5 - to check for the largest files | |
3. (optional) git rev-list --objects --all | grep #{SHA_FROM_#_3} - to check what files those are |