Skip to content

Instantly share code, notes, and snippets.

@ai2ik
ai2ik / EXIM
Last active April 6, 2017 14:29
# Get queue count
exim -bpc
# Display messages
exim -bp
# Display message headers
exim -Mvh <message-id>
# Display message body
find /home/USERNAME/public_html -type f -ctime -1 -exec ls -ls {} \; | mail -E -s "File Changes, Past 24 Hours" me@my_domain.com
# Click RAW button above, select all and copy (Ctrl-C) then paste (Ctrl-V) before all other rules in .htaccess file
# Wish to "deny" countries from accessing your site, see IP2Location: http://www.ip2location.com/blockvisitorsbycountry.aspx
RewriteEngine on
# Security related. Block browser access to log files
<Files ~ "\.log$">
Order allow,deny
</Files>
# Disallow execution, except for browser readable images
<FilesMatch "(^#.*#|\.(asp|bak|config|cxz|dist|exe|fla|htm|inc|ini|jsp|log|mso|php|pl|psd|py|sh|shtml|sql|sw[op]|txt)|~)$">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
# macADMIN
Create a new Mac admin account by restarting the setup assistant
1. Boot into Single User Mode: `Command + S`
2. Mount the drive by typing `/sbin/mount -uw /` then `ENTER`
3. Remove the Apple Setup Done file by typing `rm /var/db/.AppleSetupDone` then `ENTER`
4. Reboot by typing `reboot` then `ENTER`
5. Complete the setup process, creating a new admin account.
#
RewriteEngine on
# Start Abuse Agent Blocking
RewriteCond %{HTTP_USER_AGENT} "^Mozilla.*Indy" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Mozilla.*NEWT" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^$" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Maxthon$" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^SeaMonkey$" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Acunetix" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^binlar" [NC,OR]
# nano /etc/nginx/nginx.conf
# Start Abuse Agent Blocking
if ($http_user_agent ~* "^Mozilla.*Indy"){return 403;}
if ($http_user_agent ~* "^Mozilla.*NEWT"){return 403;}
if ($http_user_agent ~* "^$"){return 403;}
if ($http_user_agent ~* "^Maxthon$"){return 403;}
if ($http_user_agent ~* "^SeaMonkey$"){return 403;}
if ($http_user_agent ~* "^Acunetix"){return 403;}
if ($http_user_agent ~* "^binlar"){return 403;}
if ($http_user_agent ~* "^BlackWidow"){return 403;}
@ai2ik
ai2ik / blueimp-gallery
Last active November 1, 2016 13:15
Working Gallery for Liz Jones Make-up