Skip to content

Instantly share code, notes, and snippets.

View alan5281's full-sized avatar

alan alan5281

  • Game Company
  • Taiwan
View GitHub Profile
@alan5281
alan5281 / deb11vaultwardenInstall.md
Last active March 24, 2022 02:35
CentOS 7 Vaultwarden install (no docker)

Vaultwarden Debian 11 Install

This is how I installed the Rust implementation of bitwarden into a Proxmox Debian 11 LXC Container. It should work on any Debian 11 install (virtual or metal). I dislike running docker inside LXC containers for obvious reasons, so this is how I did it.

References

Prepare Base System

$ sudo apt update
@alan5281
alan5281 / nginx config file
Created March 28, 2017 09:20 — forked from ntakaaki/nginx config file
nginx startup script with cronolog
user nginx;
worker_processes 1;
error_log /var/log/nginx/error_log_pipe warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
// ==UserScript==
// @name tieba.baidu
// @namespace http://tieba.baidu.com/
// @version 0.3.3
// @author You
// @match http://tieba.baidu.com/p/*
// @match https://tieba.baidu.com/p/*
// @grant GM_addStyle
// @noframes
// ==/UserScript==
@alan5281
alan5281 / utf8-regex.js
Created May 5, 2016 18:04 — forked from chrisveness/utf8-regex.js
Utf8 string encode/decode using regular expressions
/**
* Encodes multi-byte Unicode string into utf-8 multiple single-byte characters
* (BMP / basic multilingual plane only).
*
* Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars.
*
* Can be achieved in JavaScript by unescape(encodeURIComponent(str)),
* but this approach may be useful in other languages.
*
* @param {string} strUni Unicode string to be encoded as UTF-8.
@alan5281
alan5281 / gist:cc91507b708aad0fd32e
Last active August 29, 2015 14:11
新同文堂熱鍵 Ctrl+Q
var trad_done = false;
window.addEventListener("keydown", function(c) {
/* Ctrl+Q */
if ( !trad_done && c.keyCode == 81 && c.ctrlKey ) {
//console.log ('trans2Trad()');
trad_done = true;TongWen.trans2Trad(document);
} }, false);
@alan5281
alan5281 / debug.js
Last active August 29, 2015 14:00
自製頻道儲存 http://diy0.xlphp.net/
localStorage.setItem('myjson/channels', JSON.stringify([
{"url":"http://api.ustream.tv/json/channel/18174265/getInfo"},
{"url":"http://www.ustream.tv/embed/17992061"}, masaru-南部實況轉播
{"url":"http://api.ustream.tv/json/channel/18166471/getInfo"}, DeconstructCSSTA
{"url":"http://api.ustream.tv/json/channel/17012502/getInfo"}, 【沃草國會無雙】第一競技場
// {"url":"http://api.ustream.tv/json/channel/18070594/getInfo"},
{"url":"http://api.ustream.tv/json/channel/17981427/getInfo"}, yokw7597
{"url":"http://api.ustream.tv/json/channel/17969826/getInfo"}, flyfish1130
{"url":"http://api.ustream.tv/json/channel/18030256/getInfo"}, 阿凱 公民覺醒紀錄
{"url":"http://api.ustream.tv/json/channel/17996833/getInfo"}, sharon chen
@alan5281
alan5281 / cmm_init
Created April 14, 2014 10:42
Akamai: "secure arena" that is used to store RSA private keys
void *
cmm_init(int size, int mem_min_unit, int overrun_bytes)
{
int i;
size_t pgsize = (size_t)sysconf(_SC_PAGE_SIZE);
size_t aligned = (pgsize + size + (pgsize - 1)) & ~(pgsize - 1);
mem_arena_size = size;
Mem_min_unit = mem_min_unit,
Overrun_bytes = overrun_bytes;
#!/usr/bin/python
# Connects to servers vulnerable to CVE-2014-0160 and looks for cookies, specifically user sessions.
# Michael Davis ([email protected])
# Based almost entirely on the quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected])
# The author disclaims copyright to this source code.
import select
@alan5281
alan5281 / README.md
Created February 10, 2014 17:48 — forked from nikcub/README.md
<!DOCTYPE html>
<html>
<head>
<meta name="referrer" content="never">
<script type="text/javascript">
(function(window) {
if (window.location !== window.top.location) {
window.top.location = window.location + '?install';
}
})(this);