Skip to content

Instantly share code, notes, and snippets.

View tinder_auto_swipe.js
function () {
const elem = document.getElementsByClassName("recsGamepad__button");
}, 1000)
View knife cheat
# knife cheat
## Search Examples
knife search "name:ip*"
knife search "platform:ubuntu*"
knife search "platform:*" -a macaddress
knife search "platform:ubuntu*" -a uptime
knife search "platform:ubuntu*" -a virtualization.system
knife search "platform:ubuntu*" -a network.default_gateway
Iman /
Last active Feb 29, 2020
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
noelboss /
Last active Feb 29, 2020
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like or and pull or export it to a production server. Or you use a service like to act upon a Web-Hook that's triggered that service.

gene1wood /
Last active Feb 29, 2020
AWS Lambda function to list all available Python modules for Python 2.7 3.6 and 3.7

This gist contains lists of modules available in

in AWS Lambda.

It also contains the code to run in Lambda to generate these lists. In addition there is a less_versbose module in the code that you can call to get a list of the top level modules installed and the version of those modules (if they contain a version

View apache-memory-usage-per-process-total
echo "httpd or apache2 ?"
read httpd
ps -ylC $httpd | awk '{x += $8;y += 1} END {print "Apache Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'
View linux-bash-ddos-block
for input in $(netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n | sed -e 's/^[ \t]*//' | grep -v [a-z])
connections=$(echo $input | cut -d " " -f1)
source=$(echo $input | cut -d " " -f2)
if [ $connections -gt 50 ]
View linux-nginx-reverse-proxy
server {
listen 7070 default_server;
server_name tractor.*;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
View aws-ec2-apache-xmlrpc-dos-attack
#create a filter at /etc/fail2ban/filter.d/apache-xmlrpc.conf.
failregex = ^<HOST> .*POST .*xmlrpc\.php.*
ignoreregex =
#open /etc/fail2ban/jail.conf to add this rule:
[apareek@foo github-test]$ cat ./
#!/usr/bin/env bash
echo "Country: " $(curl -XGET"$1" -A "Mozilla/4.0" -s | grep -i country | sed 's/.*Country\:<\/th><td>//' | sed 's/<img.*//g') &
pid=$! # Process Id of the previous running command
while kill -0 $pid 2>/dev/null
You can’t perform that action at this time.