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
curl --progress-bar \ | |
-o sending_output.txt \ | |
[email protected] \ | |
https://sitetest.io/upload | |
# If you want a progress meter for HTTP POST or PUT requests, you need to redirect the response output to a file, | |
# using shell redirect (>), -o [file] or similar. | |
# Source: https://stackoverflow.com/questions/9973056/curl-how-to-display-progress-information-while-uploading#answer-39302427:~:text=I%20had%20trouble%20with%20the%20accepted%20answer's%20command%20redirection%20and%20found |
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
# Two examples (TCP and UDP) showing how to redirect traffic to private ports (6120, 6121) used by a local service, | |
# using public ports (8000, 8001). | |
# Bonus: if your application/service has IP address or DNS name filtering, in this case, using this approach, | |
# it will understand that all requests are coming from "localhost" | |
socat tcp-listen:8001,reuseaddr,fork tcp:localhost:6121 | |
socat udp-listen:8000,reuseaddr,fork udp:localhost:6120 |
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
# Given a basic Lisp-like string expression, parse it (where the available functions are add, subtract, multiply, | |
# and divide, and they all take in 2 values). | |
# | |
# Examples: | |
# $ babyLisp(‘(add 1 2)’) | |
# $ 3 | |
# $ babyLisp(‘(multiply 4 (add 2 3))’) $ 20 | |
# ---------------------------------------------------------------------------------------------------------------------- | |
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
log_format compression '$time_local - $remote_addr: "$http_user_agent"'; | |
access_log /var/log/nginx/access.log compression; |
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
curl -i -X POST -L --insecure --progress-bar -o sending_output.txt -H 'Content-Type: multipart/form-data' -F 'uploadfile=@./b.bin' localhost:8001/demo/upload |
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
tcpdump -i any -nn -s0 -v -w ./tcpdump.cap port '(80 or 5201 or 5202 or 5203 or 5204 or 5205 or 5206 or 5207)' |
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 -e | |
if [ ! "$BASH_VERSION" ] ; then | |
exec /bin/bash "$0" "$@" | |
fi | |
for i in {1..7} | |
do | |
locust -f locust_file --worker --master-host=localhost & | |
done | |
locust -f locust_file --master |
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
For ($i=0; $i -le 6; $i++) { Start-Process -FilePath "python" -ArgumentList "-m","locust","-f","locustfile.py","--worker","--master-host=localhost" } | |
python -m locust -f locustfile.py --master |
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
$(aws ecr get-login --no-include-email --region us-east-1 --profile account1) | |
docker pull 000000000001.dkr.ecr.us-east-1.amazonaws.com/some-repo:latest | |
$(aws ecr get-login --no-include-email --region us-west-2 --profile account2) | |
docker tag 000000000001.dkr.ecr.us-east-1.amazonaws.com/some-repo:latest 000000000002.dkr.ecr.us-west-2.amazonaws.com/some-repo | |
docker push 000000000002.dkr.ecr.us-west-2.amazonaws.com/some-repo:latest |
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
cat hadoop_file.bin | gzip -d |
OlderNewer