Skip to content

Instantly share code, notes, and snippets.

View tohn's full-sized avatar
🏳️‍🌈
#fcknzs

Yana/Yannic Haupenthal tohn

🏳️‍🌈
#fcknzs
View GitHub Profile
@hans2103
hans2103 / server.badbots
Last active April 7, 2024 14:28
NGINX to block bad bots. (add Twenga|TwengaBot if you want to exclude them too)
if ($http_user_agent ~* (360Spider|80legs.com|Abonti|AcoonBot|Acunetix|adbeat_bot|AddThis.com|adidxbot|ADmantX|AhrefsBot|AngloINFO|Antelope|Applebot|BaiduSpider|BeetleBot|billigerbot|binlar|bitlybot|BlackWidow|BLP_bbot|BoardReader|Bolt\ 0|BOT\ for\ JCE|Bot\ mailto\:craftbot@yahoo\.com|casper|CazoodleBot|CCBot|checkprivacy|ChinaClaw|chromeframe|Clerkbot|Cliqzbot|clshttp|CommonCrawler|comodo|CPython|crawler4j|Crawlera|CRAZYWEBCRAWLER|Curious|Curl|Custo|CWS_proxy|Default\ Browser\ 0|diavol|DigExt|Digincore|DIIbot|discobot|DISCo|DoCoMo|DotBot|Download\ Demon|DTS.Agent|EasouSpider|eCatch|ecxi|EirGrabber|Elmer|EmailCollector|EmailSiphon|EmailWolf|Exabot|ExaleadCloudView|ExpertSearchSpider|ExpertSearch|Express\ WebPictures|ExtractorPro|extract|EyeNetIE|Ezooms|F2S|FastSeek|feedfinder|FeedlyBot|FHscan|finbot|Flamingo_SearchEngine|FlappyBot|FlashGet|flicky|Flipboard|g00g1e|Genieo|genieo|GetRight|GetWeb\!|GigablastOpenSource|GozaikBot|Go\!Zilla|Go\-Ahead\-Got\-It|GrabNet|grab|Grafula|GrapeshotCrawler|GTB5|GT\:\:WWW|Guzz
@tofirius
tofirius / mysql-dump-tables-by-prefix.txt
Last active January 16, 2023 19:56
MySQL dump of tables that begin with a given prefix
mysql database_name -u username -pPassWord -N -e 'show tables like "tableprefix\_%"' | xargs mysqldump database_name -u username -pPassWord > prefixedtable_dump.sql
@bmhatfield
bmhatfield / .profile
Last active March 18, 2024 07:43
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@Lewiscowles1986
Lewiscowles1986 / rPi3-ap-setup.sh
Last active July 16, 2023 15:33
Raspberry Pi 3 access-point-setup
#!/bin/bash
#
# This version uses September 2017 august stretch image, please use this image
#
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
@zachloubier
zachloubier / youtube_next.applescript
Created December 3, 2015 01:05
Scripts for controlling YouTube videos. Inspiration taken from https://gist.github.com/fent/7763775
# Next Youtube Video in Playlist
tell application "Google Chrome"
repeat with t in tabs of windows
tell t
if URL starts with "http://www.youtube.com/watch" or URL starts with "https://www.youtube.com/watch" then
execute javascript "
var player = document.getElementById('movie_player') || document.getElementsByTagName('embed')[0];
if (player) {
document.getElementsByClassName('ytp-next-button')[0].click()
@boynoiz
boynoiz / php7.sh
Last active September 5, 2018 16:30
PHP 7.0 on Debian 7 Wheezy
#!/bin/bash
set -e
PHP_VERSION=7.0
# Script base on php7.sh by Tom Van Looy https://gist.github.com/tvlooy/881d0d67d0ad699c38a3
# Dont use this shell script in production server unless you dont care
# You must first add the testing repository in your sourcelist before run this
# You must stop php7-fpm service if you already install
@gerbsen
gerbsen / ssh_agent_start.fish
Last active January 26, 2024 08:13 — forked from schaary/ssh_agent_start.fish
Auto-launching ssh-agent in fish shell
# content has to be in .config/fish/config.fish
# if it does not exist, create the file
setenv SSH_ENV $HOME/.ssh/environment
function start_agent
echo "Initializing new SSH agent ..."
ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV
echo "succeeded"
chmod 600 $SSH_ENV
. $SSH_ENV > /dev/null
@atcuno
atcuno / gist:3425484ac5cce5298932
Last active March 25, 2024 13:55
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents

@marcanuy
marcanuy / apache_error_log_parser.sh
Last active April 1, 2024 15:25
Apache error log list ordered by most common errors
#!/bin/bash
sed 's^\[.*\]^^g' error.log | sed 's^\, referer: [^\n]*^^g' | sort | uniq -c | sort -n
@n0ts
n0ts / get_oracle_jdk_x64.sh
Last active September 16, 2023 12:07
Get latest Oracle JDK package bash shell script for linux/osx/windows
#!/bin/bash
# You must accept the Oracle JDK License Update
# https://www.oracle.com/java/technologies/javase-downloads.html
# usage: get_oracle_jdk_x64.sh <jdk_version> <platform> <ext>
# jdk_version: 14
# platform: linux or osx or windows
# ext: rpm or dmg or tar.gz or exec
jdk_version=${1:-14}