Skip to content

Instantly share code, notes, and snippets.

View wjn's full-sized avatar
Learning always

Will Nielsen wjn

Learning always
View GitHub Profile
@stokito
stokito / firewall.user
Last active January 7, 2024 22:06 — forked from Manouchehri/cloudflare.sh
OpenWrt: Allow only CloudFlare to access HTTP 80 and HTTPS 443 ports. Use if your uhttpd is hidden behind CF. Put this file to /etc/firewall.user. NOTE: It uses HTTP to get the list of IPs because to wget via https we need to install ca-certs. This makes you vulnerable to MiTM attacks but that's ok to be protected from internet's hackers
# https://www.cloudflare.com/ips replace the ips-v4 with ips-v6 if needed
# https://blog.cloudflare.com/cloudflare-now-supporting-more-ports/
for ip in `wget -qO- http://www.cloudflare.com/ips-v4`; do
iptables -I INPUT -p tcp -m multiport --dports 80,443,8080,8443,2052,2053,2082,2083,2086,2087,2095,2096,8880 -s $ip -j ACCEPT
done
@Manouchehri
Manouchehri / cloudflare.sh
Last active April 21, 2024 21:55
Allow CloudFlare only
# Source:
# https://www.cloudflare.com/ips
# https://support.cloudflare.com/hc/en-us/articles/200169166-How-do-I-whitelist-CloudFlare-s-IP-addresses-in-iptables-
for i in `curl https://www.cloudflare.com/ips-v4`; do iptables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
for i in `curl https://www.cloudflare.com/ips-v6`; do ip6tables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
# Avoid racking up billing/attacks
# WARNING: If you get attacked and CloudFlare drops you, your site(s) will be unreachable.
iptables -A INPUT -p tcp -m multiport --dports http,https -j DROP
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@franz-josef-kaiser
franz-josef-kaiser / iso_639-2.json
Created January 20, 2013 22:55
ISO 639-2 JSON file that contains different international as well as local names for languages. The file is sorted by the ISO 639-2 language codes
{
"aar":
{
"int":["Afar"],
"native":["Afaraf"]
},
"aa":
{
"int":["Afar"],
"native":["Afaraf"]
@bzerangue
bzerangue / php.ini
Created February 17, 2012 19:00
PHP.ini for Mac OS X Lion (running Litespeed)
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@brendo
brendo / Symphony23.md
Created August 22, 2011 11:53
Symphony 2.3 Release Notes

Symphony 2.3 Release Notes

These release notes are a work in progress and will be updated regularly through the development cycle, things may change from time to time. Symphony 2.3 supports updating from any 2.2.x release.

This is a major release and may break backwards compatibility with existing extensions. It is recommended that extension developers read the Migration Guide for 2.3 and look out for Dev Notes released by the team to help migrate their extensions to this new release.

Release Candidate 4

Features