Skip to content

Instantly share code, notes, and snippets.

@loftwah
loftwah / waf.md
Last active April 18, 2024 06:21
WAF

Ultimate Web Application Firewall (WAF) Design with Caddy

This design outlines an advanced Web Application Firewall (WAF) system using Caddy as the core reverse proxy and security gateway. The system integrates a comprehensive set of features aimed at providing top-tier security, performance, and manageability.

System Overview

The ultimate WAF design incorporates several layers of security and operational features, including:

  • Threat Detection and Mitigation: Advanced algorithms and patterns for detecting and mitigating a wide range of threats.
  • Performance Optimization: Features that ensure high availability and optimal performance.
@mwpastore
mwpastore / 00README.md
Last active April 18, 2024 06:21
Lightning Fast WordPress: Caddy+Varnish+PHP-FPM

README

This gist assumes you are migrating an existing site for www.example.com — ideally WordPress — to a new server — ideally Ubuntu Server 16.04 LTS — and wish to enable HTTP/2 (backwards compatibile with HTTP/1.1) with always-on HTTPS, caching, compression, and more. Although these instructions are geared towards WordPress, they should be trivially extensible to other PHP frameworks, other FastCGI backends, and even non-FastCGI backends (using proxy in lieu of fastcgi in the terminal Caddyfile stanza).

Quickstart: Use your own naked and canonical domain names instead of example.com and www.example.com and customize the Caddyfile and VCL provided in this gist to your preferences!

These instructions target Varnish Cache 4.1, PHP-FPM 7.0, and Caddy 0.10. (I'm using MariaDB 10.1 as well, but that's not relevant to this guide.)

@bom-d-van
bom-d-van / ddos.txt
Created February 12, 2017 11:46
Detecting and Mitigating DDOS Attacks
Detecting and Mitigating DDOS Attacks
#List all Finish (FIN) packets
machine1 : sudo /usr/sbin/tcpdump -Nnn -i any -s0 'tcp[13] & 1 != 0'
#List all SYN and SYN-ACK packets
machine1 : sudo /usr/sbin/tcpdump -Nnn -i any -s0 'tcp[13] & 2 != 0'

Torch can be installed to your home folder in ~/torch by running these three commands:

in a terminal, run the commands WITHOUT sudo

git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; bash install-deps;
./install.sh

The first script installs the basic package dependencies that LuaJIT and Torch require. The second script installs LuaJIT, LuaRocks, and then uses LuaRocks (the lua package manager) to install core packages like torch, nn and paths, as well as a few other packages.

@nhtua
nhtua / 00.install-android-sdk.sh
Last active April 18, 2024 06:19
Run a Headless Android Device on Ubuntu server (no GUI)
#!/bin/bash -i
#using shebang with -i to enable interactive mode (auto load .bashrc)
set -e #stop immediately if any error happens
# Install Open SDK
apt update
apt install openjdk-8-jdk -y
update-java-alternatives --set java-1.8.0-openjdk-amd64
java -version
@mizutanikirin
mizutanikirin / unityCamerasWithMultiDisplay.md
Last active April 18, 2024 06:18
Unityでマルチディスプレイで各ディスプレイに違うカメラを設定する方法

(1) 画面分割

まずここを参考にカメラを複数置き画面分割する。自分の場合はCameraを以下のようにpublicにして使用した。

using UnityEngine;
using System.Collections;

public class SampleScript : MonoBehaviour {
@zchee
zchee / cgo.md
Last active April 18, 2024 06:14
cgo convert list

See also, http://libraryofalexandria.io/cgo/

Using Go cgo

cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.

So, Here collect materials.

@simonista
simonista / .vimrc
Last active April 18, 2024 06:11
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@gabe565
gabe565 / change-arc-icon.md
Last active April 18, 2024 06:11
Change Arc Browser Icon

Change Arc Browser Icon

arc

A collection of commands that change the Arc Browser icon.

Commands

Theme Command
Candy Arc defaults write company.thebrowser.Browser currentAppIconName candy