Skip to content

Instantly share code, notes, and snippets.

View tinder_auto_swipe.js
setInterval(
function () {
const elem = document.getElementsByClassName("recsGamepad__button");
elem[3].click();
}, 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
Iman / clean.sh
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
View clean.sh
#!/bin/sh
#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
noelboss / git-deployment.md
Last active Feb 29, 2020
Simple automated GIT Deployment using Hooks
View git-deployment.md

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 github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

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

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
#!/bin/bash
counter=0
IFS=$'\n'
for input in $(netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n | sed -e 's/^[ \t]*//' | grep -v [a-z])
do
connections=$(echo $input | cut -d " " -f1)
source=$(echo $input | cut -d " " -f2)
if [ $connections -gt 50 ]
then
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.
[Definition]
failregex = ^<HOST> .*POST .*xmlrpc\.php.*
ignoreregex =
#open /etc/fail2ban/jail.conf to add this rule:
[apache-xmlrpc]
View linux_bash_get_ip_country.sh
[apareek@foo github-test]$ cat ./find-ip-country.sh
#!/usr/bin/env bash
echo "Country: " $(curl -XGET http://whatismyipaddress.com/ip/"$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
spin='-\|/'
i=0
while kill -0 $pid 2>/dev/null
You can’t perform that action at this time.