Skip to content

Instantly share code, notes, and snippets.

View ProfFan's full-sized avatar
🎯
Focusing

Fan Jiang ProfFan

🎯
Focusing
View GitHub Profile
@ProfFan
ProfFan / default
Created July 31, 2014 15:40
Force Full Site SSL with non-SSL redirecting
server {
listen your-ip:80 default_server;
server_name ex1.ex.net;
server_name ex2.ex.net;
return 301 https://$host$request_uri;
}
@ProfFan
ProfFan / FlarumValetDriver.php
Created July 22, 2016 16:42
Larvel Valet Flarum Driver
<?php
class FlarumValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@ProfFan
ProfFan / README.md
Created March 22, 2017 06:13 — forked from ingenthr/README.md
Various DTrace scripts for memcached

These are various scripts I've written in the past for tracing through memcached

LICENSE

The MIT License (MIT)

Copyright (c) 2013, Matt Ingenthron

Permission is hereby granted, free of charge, to any person obtaining a copy

@ProfFan
ProfFan / package_esp8266com_index.json
Created February 20, 2018 17:15
emergency package_esp8266com_index.json
{
"packages": [
{
"name": "esp8266",
"maintainer": "ESP8266 Community",
"websiteURL": "https://github.com/esp8266/Arduino",
"email": "ivan@esp8266.com",
"help": {
"online": "http://esp8266.com/arduino"
},
CONFIG_X86=y
CONFIG_SYS_TEXT_BASE=0xFFF00000
CONFIG_MAX_CPUS=2
# CONFIG_AHCI is not set
CONFIG_SMP=y
CONFIG_GENERATE_PIRQ_TABLE=y
CONFIG_GENERATE_MP_TABLE=y
CONFIG_GENERATE_ACPI_TABLE=y
CONFIG_NR_DRAM_BANKS=8
CONFIG_BUILD_ROM=y
@ProfFan
ProfFan / mem-loader.asm
Created August 13, 2019 23:57 — forked from zznop/mem-loader.asm
Fun little loader shellcode that executes an ELF in-memory using an anonymous file descriptor (inspired by https://x-c3ll.github.io/posts/fileless-memfd_create/)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Copyright (C), zznop, zznop0x90@gmail.com
;;;
;;; This software may be modified and distributed under the terms
;;; of the MIT license. See the LICENSE file for details.
;;;
;;; DESCRIPTION
;;;
;;; This PoC shellcode is meant to be compiled as a blob and prepended to a ELF
@ProfFan
ProfFan / AddressSanitizerLog.lua
Created September 24, 2019 04:01
AddressSanitizerLog.txt
[HANDLER_OUTPUT]
Test project /home/fan/Projects/CV/SLAM/gtsam/build
Start 1: testArgument
1/177 Test #1: testArgument ....................... Passed 0.01 sec
Start 2: testClass
2/177 Test #2: testClass .......................... Passed 0.01 sec
Start 3: testGlobalFunction
3/177 Test #3: testGlobalFunction ................. Passed 0.01 sec
Start 4: testMethod
@ProfFan
ProfFan / decode.js
Last active April 18, 2020 02:06
decode georgia power outage map
function decodePos(t) {
var e = [];
try {
for (var n = t.length, r = 0, o = null, i = 0, u = 0; r < n;) {
var a = void 0,
c = 0,
s = 0;
do {
a = t.charCodeAt(r) - 63, r += 1, s |= (31 & a) << c, c += 5
} while (a >= 32);
@ProfFan
ProfFan / swift.json
Created April 20, 2020 23:34
Swift REPL Seccomp for Docker
{
"defaultAction": "SCMP_ACT_ERRNO",
"archMap": [
{
"architecture": "SCMP_ARCH_X86_64",
"subArchitectures": [
"SCMP_ARCH_X86",
"SCMP_ARCH_X32"
]
},
VERTEX_SE2 0 0 0 0
VERTEX_SE2 1 1.03039 0.01135 -0.081596
VERTEX_SE2 2 2.03614 -0.129733 -0.301887
VERTEX_SE2 3 3.0151 -0.442395 -0.345514
VERTEX_SE2 4 3.34395 0.506678 1.21471
VERTEX_SE2 5 3.68449 1.46405 1.18379
VERTEX_SE2 6 4.06463 2.41478 1.17633
VERTEX_SE2 7 4.42978 3.30018 1.25917
VERTEX_SE2 8 4.12888 2.32148 -1.82539
VERTEX_SE2 9 3.88465 1.32751 -1.95302