Skip to content

Instantly share code, notes, and snippets.

View bohanyang's full-sized avatar

Brent Yang bohanyang

View GitHub Profile
@thenbrent
thenbrent / example-paypal-ipn-payloads.txt
Last active February 8, 2023 07:04
PayPal Standard & Express Checkout Subscription Related IPN Messages (from Sandbox)
-------------------------------------
PayPal Standard Subscription Sign-up
-------------------------------------
[txn_type] => subscr_signup
[subscr_id] => I-NARPL1C0KAHA
[last_name] => User
[residence_country] => US
[mc_currency] => AUD
[item_name] => Digital Subscription
@robinsmidsrod
robinsmidsrod / dhcpd.conf
Last active June 11, 2024 13:10
Trying to chainload iPXE with full feature set from a lesser featured one, whilst still being able to boot non-supported cards with UNDI
ddns-update-style none;
deny bootp; #default
authoritative;
include "/etc/dhcp/ipxe-option-space.conf";
# GREEN (private network)
subnet 10.1.1.0 netmask 255.255.255.0 {
range 10.1.1.100 10.1.1.199;
option subnet-mask 255.255.255.0;
@robertstarmer
robertstarmer / ubuntu-server.preseed
Last active August 25, 2022 10:06
example preseed for OpenStack deployment
d-i mirror/country string manual
d-i mirror/http/hostname string 192.168.26.170
d-i mirror/http/directory string /ubuntu
d-i partman/early_command string vgs --separator=: --noheadings | cut -f1 -d: |while read vg ; do vgchange -an $vg ; done ; pvs --separator=: --noheadings | cut -f1 -d: | while read pv ; do pvremove -ff -y $pv ; done
d-i partman-auto/disk string /dev/sda
d-i partman/alignment string cylinder
d-i partman-md/device_remove_md boolean true
d-i partman-md/confirm boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/confirm boolean true
@vladimirtsyupko
vladimirtsyupko / gist:10964772
Created April 17, 2014 08:32
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
@eduncan911
eduncan911 / go-build-all
Last active April 11, 2024 07:14
Go Cross-Compile Script
#!/bin/bash
#
# GoLang cross-compile snippet for Go 1.6+ based loosely on Dave Chaney's cross-compile script:
# http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go
#
# To use:
#
# $ cd ~/path-to/my-awesome-project
# $ go-build-all
#
@kekru
kekru / 01nginx-tls-sni.md
Last active June 19, 2024 17:24
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled
@liberal-boy
liberal-boy / HaProxy 通过 Domain Socket 与 V2Ray 通讯.md
Last active September 5, 2023 19:46
HaProxy 通过 Domain Socket 与 V2Ray 通讯

HaProxy 通过 Domain Socket 与 V2Ray 通讯

本文供高级玩家阅读,请先阅读 Vmess + TCP + TLS 方式的 HTTP 分流和网站伪装。 相比 TCP,Domain Socket 更为高效。 本文针对使用 Debian 10 的用户,其他系统请自行摸索。

预先准备

  1. 首先按照先前的教程安装好 HaProxy 和 V2Ray。

  2. 修改以下文件,示例见下方

  • /etc/haproxy/haproxy.cfg
@ragboyjr
ragboyjr / AbstractCrudDTOController.php
Last active February 15, 2024 13:16
Easy Admin 3 DTO Crud Controller
<?php
namespace App\EasyAdminExtensions\Controller;
use EasyCorp\Bundle\EasyAdminBundle\Config\Action;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto;
use EasyCorp\Bundle\EasyAdminBundle\Event\BeforeCrudActionEvent;
use EasyCorp\Bundle\EasyAdminBundle\Event\BeforeEntityPersistedEvent;
use EasyCorp\Bundle\EasyAdminBundle\Event\BeforeEntityUpdatedEvent;
@matusnovak
matusnovak / README.md
Last active June 17, 2024 18:31
GPG + Git SSH Authentication and Signing on Windows 10

GPG + Git SSH Authentication and Signing on Windows 10

Introduction

This simple Gist will explain how to settup your GPG key to work for SSH authentication (with Git) and Git commit signing on Windows 10. This may seem straightforward on Linux, but there are certain tweaks needed on Windows.

No Cygwin, no MinGW, no Git Bash or any other Linux emulated environment. This works in pure Windows 10.

Software needed

@xgugeng
xgugeng / seafile-caddy.conf
Last active May 25, 2024 08:33
Caddyfile for Seafile
seafile.example.com {
log {
output file /var/log/caddy/seafile.log
}
# Optional for Cloudflare
tls {
dns cloudflare {env.CF_API_TOKEN}
}