Skip to content

Instantly share code, notes, and snippets.

View Izumiko's full-sized avatar

OxO Izumiko

  • BUAA
  • China
  • 13:17 (UTC +08:00)
View GitHub Profile
@enjalot
enjalot / cors_server.py
Created June 10, 2012 06:19
Allow CORS with python simple http server
import SimpleHTTPServer
class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def send_head(self):
"""Common code for GET and HEAD commands.
This sends the response code and MIME headers.
Return value is either a file object (which has to be copied
to the outputfile by the caller unless the command was HEAD,
and must be closed by the caller under all circumstances), or
@snakevil
snakevil / router.pi-2.md
Last active September 27, 2023 02:25
使用树莓派3B打造超强路由之二:初成

使用树莓派3B打造超强路由之二:初成

通过第一篇《使用树莓派3B打造超强路由之一:初装》的努力,树莓派3B已经可以作为一台超低能耗、随身携带的开发用服务器来使用了。但这对于目标——打造超强路由而言,才刚刚开始。接下来,我们需要将其打磨成一台基本的无线路由器。

WARNING 本文所有指令均仅供参考,切勿无脑复制粘贴!

@samueljon
samueljon / toggleHT.sh
Last active May 31, 2024 09:51
Disable / Enable HyperThreading cores on runtime - linux
#!/bin/bash
HYPERTHREADING=1
function toggleHyperThreading() {
for CPU in /sys/devices/system/cpu/cpu[0-9]*; do
CPUID=`basename $CPU | cut -b4-`
echo -en "CPU: $CPUID\t"
[ -e $CPU/online ] && echo "1" > $CPU/online
THREAD1=`cat $CPU/topology/thread_siblings_list | cut -f1 -d,`
@AveYo
AveYo / .. MediaCreationTool.bat ..md
Last active June 29, 2024 01:12
Universal MediaCreationTool wrapper for all MCT Windows 10 versions - MOVED TO github.com/AveYo/MediaCreationTool.bat
@chutsu
chutsu / Eigen Spline Module 1D Example.md
Last active February 17, 2023 17:05
Eigen Spline Module 1D Example

Eigen has an unsupported spline module where you can fit a spline given some data. Once a spline is fitted you can use it as a function to obtain points inbetween. The following example fits 1D data but can be modified to fit N-dimensional data.

Usage

 git clone https://gist.github.com/chutsu/815c7c916c329eec85f34690a012f7cb spline_example
 g++ -I/usr/include/eigen3 spline_example.cpp -o spline_example

./spline_example

@jo-makar
jo-makar / pxeboot.md
Last active May 28, 2024 17:42
Setup a PXE boot server

Setup a PXE boot server

Using dnsmasq (on Debian)

apt-get install dnsmasq pxelinux syslinux-common syslinux-efi

mkdir /srv/tftpboot

ln -s /usr/lib/PXELINUX/pxelinux.0 /srv/tftpboot/