Skip to content

Instantly share code, notes, and snippets.

@maorkavod
maorkavod / script.sh
Created April 13, 2019 10:25
kill all processes matching a name
ps aux | grep -ie XXXX | awk '{print $2}' | xargs kill -9
@maorkavod
maorkavod / code.sh
Created May 5, 2019 16:16
How to find out top Directories and files in Linux
du -a /var | sort -n -r | head -n 10
@maorkavod
maorkavod / code.sh
Created May 5, 2019 16:18
Docker clear cach
docker system prune -a -f
@maorkavod
maorkavod / app.sh
Created July 14, 2019 11:07
How to quickly stress test a web server
curl -s "http://google.com?[1-1000]"
This will make 1000 calls to google i.e.
http://google.com?1
http://google.com?2
http://google.com?3
\...
http://google.com?1000
So say you want to stress test your web application and it won't complain if it's fed an extra parameter, 10,000 calls could be done something like.
@maorkavod
maorkavod / aws-multipartUpload.js
Created October 10, 2021 10:57 — forked from sevastos/aws-multipartUpload.js
Example AWS S3 Multipart Upload with aws-sdk for Node.js - Retries to upload failing parts
// Based on Glacier's example: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/examples.html#Amazon_Glacier__Multi-part_Upload
var fs = require('fs');
var AWS = require('aws-sdk');
AWS.config.loadFromPath('./aws-config.json');
var s3 = new AWS.S3();
// File
var fileName = '5.pdf';
var filePath = './' + fileName;
var fileKey = fileName;
git reset --hard 56e05fced
# Move the branch pointer back to the previous HEAD
git reset --soft "HEAD@{1}"
git commit -m "Revert to 56e05fced"
ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}'