Skip to content

Instantly share code, notes, and snippets.

View Lu-Yi-Hsun's full-sized avatar
🐱
Just cute

Anson Lu-Yi-Hsun

🐱
Just cute
  • Tunghai University
  • TAIWAN
View GitHub Profile
@Lu-Yi-Hsun
Lu-Yi-Hsun / .gitignore
Created December 14, 2022 20:55 — forked from jirihnidek/.gitignore
Example of (Linux) client-server aplication using ECN bit in UDP packets.
.cproject
.project
build
1. 編輯你的fullchain.pem vim /etc/letsencrypt/live/blaha.tw/fullchain.pem
2. 把這個intermediate certificate(https://letsencrypt.org/certs/letsencryptauthorityx1.pem.txt)加入fullchain的兩個certificate中間
3. restart你的webserver
@franciscocpg
franciscocpg / README.md
Last active March 6, 2024 12:40
Import mitm certificate to CA in arch linux
  1. After installing mitmproxy run it (just type mitmproxy) in a terminal session and quit. This will create the necessaries certificates files at ~/.mitmproxy.

  2. Extract the certificate to .crt format:
    openssl x509 -in ~/.mitmproxy/mitmproxy-ca.pem -inform PEM -out ca.crt

  3. Trust the certificate into CA:
    sudo trust anchor ca.crt

  4. Run the mitmproxy again

@cfra
cfra / naming-netns.md
Last active May 9, 2022 15:06
How to access an unnamed network namespace

Some programs might create network namespaces without registering them in /run/netns as iproute2 does. This makes it hard to access them with readily available tools like ip netns exec. However, there is a way to register those network namespace, after they have been created.

The following session creates and enters an unnamed namespace:

# unshare -n bash
# ip a l
1: lo:  mtu 65536 qdisc noop state DOWN group default qlen 1000
@systemed
systemed / gist:be2d6bb242d2fa497b5d93dcafe85f0c
Last active April 10, 2024 03:49
Routing algorithm implementations
(Dijkstra and plain A* are generally not included here as there are thousands of
implementations, though I've made an exception for rare Ruby and Crystal versions,
and for Thor, Mapzen's enhanced A*. )
A* Ruby https://github.com/georgian-se/shortest-path
A* Crystal https://github.com/petoem/a-star.cr
A* (bidirectional with shortcuts) C++ https://github.com/valhalla/valhalla
NBA* JS https://github.com/anvaka/ngraph.path
NBA* Java https://github.com/coderodde/GraphSearchPal
NBA* Java https://github.com/coderodde/FunkyPathfinding
@Lu-Yi-Hsun
Lu-Yi-Hsun / 0_reuse_code.js
Created March 14, 2017 15:56
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@patwooky
patwooky / pysideEmbedImages_v01_02_20160921.py
Last active December 18, 2019 08:05
Embedding an base64 encoded image in a PySide application
'''
written by: Patrick Woo
patrickwoo@yahoo.com
'''
import sys
import os
import base64
qt=''
try:
1. 編輯你的fullchain.pem vim /etc/letsencrypt/live/blaha.tw/fullchain.pem
2. 把這個intermediate certificate(https://letsencrypt.org/certs/letsencryptauthorityx1.pem.txt)加入fullchain的兩個certificate中間
3. restart你的webserver
@dpino
dpino / ns-inet.sh
Last active April 19, 2024 18:12
Setup a network namespace with Internet access
#!/usr/bin/env bash
# set -x
if [[ $EUID -ne 0 ]]; then
echo "You must be root to run this script"
exit 1
fi
# Returns all available interfaces, except "lo" and "veth*".
@Preetam
Preetam / fdb-flow.md
Created February 3, 2016 15:33
FoundationDB Flow

Flow: Actor-based Concurrency with C++

Engineering challenges

FoundationDB began with ambitious goals for both high performance per node and scalability. We knew that to achieve these goals we would face serious engineering challenges while developing the FoundationDB core. We'd need to implement efficient asynchronous communicating processes of the sort supported by Erlang or the Async library in .NET, but we'd also need the raw speed and I/O efficiency of C++. Finally, we'd need to perform extensive simulation to engineer for reliability and fault tolerance on large clusters.

To meet these challenges, we developed several new tools, the first of which is Flow, a new programming language that brings actor-based concurrency to C++11. To add this capability