Skip to content

Instantly share code, notes, and snippets.

@t-takata
t-takata / scapy_layer-_gtp.py
Created September 11, 2017 12:23 — forked from thomasbhatia/scapy_layer-_gtp.py
Scapy layer: GTP
## This file is not now part of Scapy
## Look iniqua.com for more informations
## ffranz <ffranz@iniqua.com>
## This program is published under a GPLv2 license
import time
import logging
from scapy.packet import *
from scapy.fields import *
@t-takata
t-takata / run-at
Last active April 15, 2020 09:07
Run command at specified time without at(1).
#!/bin/sh
EX_USAGE=64
EX_DATAERR=65
WAKEUP_BEFORE_S=10
BUSYLOOP_SLEEP_US=500000
usage_exit() {
echo "Usage: $0 [-xf] time command args..." 1>&2
#include <stdio.h>
template <typename T> T get_additive_identity(T* x) {};
template <> int get_additive_identity(int* x) { return 0;};
template <> double get_additive_identity(double* x) { return 0.0;};
template <typename T> T sum(T* X, int N) {
T s = get_additive_identity(X);
for (int i = 0; i < N; i++) {
s += X[i];
@t-takata
t-takata / win-cvn.ahk
Last active May 16, 2018 18:14
Win+[CVN] で Copy,Paste,NewWindow する AutoHotkey 設定
#IfWinActive ahk_class mintty
#c::Send,^+c
#v::Send,^+v
#n::Send,^+n
#IfWinNotActive ahk_exe mstsc.exe
#a::Send,^a
#c::Send,^c
#v::Send,^v
#n::Send,^n
@t-takata
t-takata / machine-enter
Created May 23, 2018 08:51
machinectl login 出来ないコンテナに対して nsenter で殴り込むためのスクリプト
#!/bin/sh
usage() {
echo "usage: " >&2
echo " machine-neter MACHINE-NAME [commands ...]" >&2
}
if [ "$#" -lt 1 ]; then
usage
exit 1
#!/bin/bash
# vim: ai ts=2 sw=2 et sts=2 ft=sh
readonly SCRIPT_DIR=$(cd $(dirname $0); pwd)
readonly SCRIPT_NAME=$(basename $0)
readonly LOCKDIR_BASE="/tmp/.lock.$SCRIPT_NAME"
LOCKDIR=""
TMPFILES=""
lock() {