Skip to content

Instantly share code, notes, and snippets.

@voluntas
voluntas / webrtc_turn.rst
Last active April 1, 2024 00:49
WebRTC で利用されいる TURN プロトコルの解説

WebRTC で利用されいる TURN プロトコルの解説

日時

2021-01-29

@voluntas

バージョン

2021.2

url

https://voluntas.github.io/

image

@Treeki
Treeki / TurnipPrices.cpp
Last active April 5, 2024 13:55
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@harv
harv / glibc-2.17_centos6.sh
Last active March 1, 2024 08:42
update glibc to 2.17 for CentOS 6
#! /bin/sh
# update glibc to 2.17 for CentOS 6
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-common-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-devel-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-headers-2.17-55.el6.x86_64.rpm
sudo rpm -Uvh glibc-2.17-55.el6.x86_64.rpm \
@makcuk
makcuk / tap-linux.py
Created January 29, 2016 21:58
A simple python tun/tap udp tunnel example
# Simple linux tun/tap device example tunnel over udp
# create tap device with ip tuntap add device0 tap
# set ip address on it and run tap-linux on that device and set desitation ip
# run same on another node, changing dst ip to first node
import fcntl
import struct
import os
import socket
import threading
@nostah
nostah / gist:d610459d50564c729c56
Created April 13, 2015 07:42
php swagger 2.0 api sample
<?php
use Swagger\Annotations as SWG;
/**
* @SWG\Swagger(
* basePath="/v1",
* host="api.local",
* schemes={"http"},
* produces={"application/json"},
@nicolasembleton
nicolasembleton / restart_bluetooth.sh
Last active October 21, 2022 20:10
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@shigeki
shigeki / large_file.js
Created November 26, 2012 13:47
大容量ファイルのダウンロードを提供するサンプルコード
var fs = require('fs');
var http = require('http');
var util = require('util');
var file = './1G.file';
var stat = fs.statSync(file);
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'octet-stream/binary',
'Content-Length': stat.size
});
var rStream = fs.createReadStream(file);
@vi
vi / README
Created September 5, 2012 03:16
Create tun/tap device that just copies all packets to/from the given ethernet interface.
Primary use case: workaround non-working "ip link set wlan0 netns ..." for some network drivers.
Secondary use case: simple demo for getting/setting the MAC address, tun/tap, raw sockets...
Pre-built version: http://vi-server.org/pub/tap_copy
@taichi
taichi / code_reading.md
Last active April 10, 2024 13:04
太一のコードの読み方メモ

太一のコードの読み方メモ

全体として太一が感覚的に実践している事を論理的に説明しようと試みている為、
説明の粒度が適切でなかったり一貫性が無いように見える部分があるかもしれない。
普段やっているけども書ききれていない事も多分きっとある。

コードを読むとは何か

  • コードを嗜む
  • コードを学ぶ
  • 武器を手に入れる
@dakatsuka
dakatsuka / gist:1249674
Created September 29, 2011 00:23
値を指定して配列から要素を削除する
item1 = {}
item2 = {}
item3 = {}
array = [item1, item2, item3]
array.splice array.indexOf(item2), 1