Skip to content

Instantly share code, notes, and snippets.

location ~ .(gif|png|jpe?g)$ {
valid_referers none blocked mywebsite.com *.mywebsite.com;
if ($invalid_referer) {
return 403;
}
}
location /pict/ {
valid_referers none blocked mywebsite.com *.mywebsite.com;
if ($invalid_referer) {
@ItsMeooooooo
ItsMeooooooo / mountftp.sh
Created August 27, 2015 09:35
Mount FTP servers on Linux as folder
yum install curlftpfs -y
curlftpfs ftp://user:password@example.com /mnt/ftp_mounted
@ItsMeooooooo
ItsMeooooooo / del.ps1
Last active May 3, 2016 08:10
Deleting files from a given list on Windows Powershell
$targetfolder = "C:\foo\bar\nattebums"
$files = gc C:\foo\bar\list.txt
foreach ($file in $files)
{write-host "Deleting $file" -foregroundcolor "Red"; Remove-Item $file | out-null}
write-host "D O N E" -foregroundcolor "Red"
@ItsMeooooooo
ItsMeooooooo / gist:4543fbd8ad91e95c5503
Created August 6, 2015 09:12
show the most accessed URL in web server log
awk '{print $7}' access.log | sort | uniq -c | sort -rn
@ItsMeooooooo
ItsMeooooooo / gist:f8ac2b290a4dee7e6a6a
Created June 12, 2015 06:34
Check gzip compression on webserver
curl -I -H 'Accept-Encoding: gzip,deflate' http://www.bubbleclub.de

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ItsMeooooooo
ItsMeooooooo / nginx.conf
Last active August 29, 2015 14:15 — forked from plentz/nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@ItsMeooooooo
ItsMeooooooo / extract_uri
Created September 4, 2013 06:28
Extract the real URI from google
#!/bin/sh
# Convert Google's fuxnored URLs to the true URL
sed 's/^.*\&url=//; s/\&.*//' | urlenc2ascii
------------------------------------------------------------------------
#!/usr/bin/awk -f
# Print URL-encoded URL as ASCII
@ItsMeooooooo
ItsMeooooooo / iptables_flush
Created September 2, 2013 14:01
Script to flush all iptables rules
#!/bin/sh
echo "Stopping firewall and allowing everyone..."
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
@ItsMeooooooo
ItsMeooooooo / geoip
Last active December 21, 2015 19:29
get the GeoIP.dat and decompress it into a given folder
#!/usr/bin/env bash
#
# OK lets work
geoIPPath='/home/urbanterror/geoip/'
IPAddress='http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz'
zcat=/bin/zcat
wget=/usr/bin/wget
echo 'Checking if the remote File is available...'