Skip to content

Instantly share code, notes, and snippets.

View khanhicetea's full-sized avatar
😎
solving human problems

KhanhIceTea khanhicetea

😎
solving human problems
View GitHub Profile
@Remiii
Remiii / README.md
Created August 19, 2015 15:31
Mac pfctl Port Forwarding for your VM/Docker

Mac pfctl Port Forwarding for your VM/Docker

Add rules

$ cat /etc/pf.anchors/remiii.forwarding
rdr pass on lo0 inet proto tcp from any to 127.0.0.1 port 80 -> 127.0.0.1 port 10080
rdr pass on lo0 inet proto tcp from any to 127.0.0.1 port 443 -> 127.0.0.1 port 10443

Enable rules

@valentin2105
valentin2105 / install-docker-exp.sh
Last active May 9, 2018 01:37 — forked from katopz/install-docker-exp.sh
Install Docker on Ubuntu 16.04 x64
# Install Docker on Ubuntu 14.04.4 x64
# Ref https://docs.docker.com/engine/installation/linux/ubuntulinux/
# No interactive for now.
export DEBIAN_FRONTEND=noninteractive
# Update your APT package index.
sudo apt-get -y update
# Update package information, ensure that APT works with the https method, and that CA certificates are installed.
sudo apt-get install apt-transport-https ca-certificates
# Add the new GPG key.
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
@funkotron
funkotron / docker_create_treeio.sh
Last active December 18, 2019 17:56
Using Docker (requires docker to be installed http://www.docker.io/gettingstarted/ ), spawn a postgresql instance and a dynamically configured treeio instance.
#!/bin/bash
# Description: Using Docker (requires docker to be installed http://www.docker.io/gettingstarted/ ), spawn a postgresql instance and a dynamically configured treeio instance
# Also requires postgresql client tools http://www.postgresql.org/download/linux/ubuntu/
# Run chmod +x to make this file executable then run it: ./docker_create_treeio.sh
# Author: Adam Awan
# Email: adam@tree.io
# Set the port to forward for Tree.io
TREEIO_PORT="80"
@Mteigers
Mteigers / allow
Created May 21, 2013 23:54
CSF Allow AND Ignore Cloudflare IPv4 IP's.
for i in `curl https://www.cloudflare.com/ips-v4`; do csf -a $i; done
@malwador
malwador / blockchina.sh
Created March 17, 2021 06:53
Script to block chinese CIDRs via SSH
# script para bloquear IPs de china - salvador aguilar
echo "Blocking 8444 Chinese IPs via IPTABLES"
echo "======================= by Sal Aguilar"
iptables -A INPUT -s 1.0.1.0/24 -j DROP
iptables -A INPUT -s 1.0.2.0/23 -j DROP
iptables -A INPUT -s 1.0.8.0/21 -j DROP
iptables -A INPUT -s 1.0.32.0/19 -j DROP
iptables -A INPUT -s 1.1.0.0/24 -j DROP
iptables -A INPUT -s 1.1.2.0/23 -j DROP
iptables -A INPUT -s 1.1.4.0/22 -j DROP
@ismell
ismell / setup-bridge.sh
Last active October 24, 2022 04:37 — forked from anonymous/setup-bridge.sh
Scripts to re-create the docker0 bridge and setup a different ip subnet
#!/bin/bash -e
IFADDR="192.168.3.1/24"
if [[ ! ip link show docker0 ]]; then
ip link add docker0 type bridge
ip addr add "$IFADDR" dev docker0
ip link set docker0 up
iptables -t nat -A POSTROUTING -s "$IFADDR" ! -d "$IFADDR" -j MASQUERADE
fi
@CHH
CHH / 00_rfc_decorators.md
Last active March 20, 2023 13:48
PHP Decorators RFC

PHP Decorators (alternative proposal to Annotations)

Inspiration: Python Decorators

Todo

  • Further refine how class decorators should work. Should they work on the instance level? Or should they just receive the class name, and can only be used for providing metadata? Instance level is probably the only one that makes sense in PHP. Problem is though, that then the decorator is not called when used in the declaration.
@epixoip
epixoip / 8x1080.md
Last active March 20, 2024 17:14
8x Nvidia GTX 1080 Hashcat Benchmarks
@enricofoltran
enricofoltran / main.go
Last active April 1, 2024 00:17
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active April 1, 2024 11:21
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert