Skip to content

Instantly share code, notes, and snippets.

View fumiyas's full-sized avatar
💭
> 突然の死 <

SATOH Fumiyasu fumiyas

💭
> 突然の死 <
View GitHub Profile
@mattn
mattn / ipset.bat
Created March 9, 2018 04:18
IPを切替えるバッチ(sudo for Windows 必須)
@echo off
setlocal enabledelayedexpansion
set ifname="ローカル エリア接続"
set count=0
if "%1" equ "" (
for /F "tokens=1,2,3,4,5 delims=," %%i in (%~dp0ipset.csv) do (
set "n=00!count!"
echo !n:~-2! %%i %%j
@zhangyoufu
zhangyoufu / unbuffer.py
Last active May 5, 2023 06:12
force unbuffer stdout of Windows program
#!/usr/bin/env python3
from msvcrt import get_osfhandle
from ctypes.wintypes import *
from ctypes import *
import os
import struct
if sizeof(c_ulong) == sizeof(c_void_p):
ULONG_PTR = c_ulong
elif sizeof(c_ulonglong) == sizeof(c_void_p):
@hatsusato
hatsusato / kmc-advent-2017.md
Last active November 5, 2024 06:48
gpg のはなし

gpg のはなし

この記事は [KMC Advent Calendar 2017][advent] の 10 日目の記事です。 昨日の記事は tron 君 ([id:tron_kmc][tron-id]) の[今年の活動を振り返る - tron-Factory 業務日誌][tron]でした。 はたち:tada:めでたい:congratulations:

はじめに

KMC 6 回生の hatsusato です。 修士 2 回生ともなると研究にかまけて KMC 活動がおろそかになっているので、この場を借りて申し訳程度に KMC 活動をしようと思います。

@aldaris
aldaris / buildAM13.sh
Created April 4, 2017 08:05
Shell script to build OpenAM 13.0.0 from openam-public repository
#!/bin/bash
#Run buildDJ3.sh script first in the same folder from: https://gist.github.com/aldaris/fe234d76f3940c42ae9bb5aa69b8e98e
function build() {
mvn clean install
if [ $? -ne 0 ] ; then
exit 1;
fi
}
@ttdoda
ttdoda / .vimrc
Last active November 28, 2019 03:50
tmux使用時のvimでのBracketed Paste Mode有効化
if has('patch-8.0.0238')
if &term =~ "screen"
let &t_BE = "\e[?2004h"
let &t_BD = "\e[?2004l"
exec "set t_PS=\e[200~"
exec "set t_PE=\e[201~"
endif
else
if has('patch-8.0.0210')
set t_BE=
@tmtm
tmtm / trackpoint.sh
Created November 18, 2016 16:19
trackpointの速度を調整して、トラックパッドを無効にする
#!/bin/bash
DIR=/sys/devices/platform/i8042
SPEED=200
SENSITIVITY=200
modprobe -r psmouse
modprobe psmouse proto=any
while :; do
until [ -f $DIR/serio*/serio*/speed -a -f $DIR/serio*/serio*/sensitivity ]; do
sleep 1
@magnetikonline
magnetikonline / README.md
Last active March 28, 2025 13:35
Enable LDAP over SSL (LDAPS) for Microsoft Active Directory servers.

Enable LDAP over SSL (LDAPS) for Microsoft Active Directory servers

Tip

Microsoft active directory servers by default provide LDAP connections over unencrypted connections (boo!).

The steps below will create a new self signed certificate appropriate for use with and thus enabling LDAPS for an AD server. Of course the "self-signed" portion of this guide can be swapped out with a real vendor purchased certificate if required.

Steps have been tested successfully with Windows Server 2012R2, but should work with Windows Server 2008 without modification. Requires a working OpenSSL install (ideally Linux/OSX) and (obviously) a Windows Active Directory server.

@atoponce
atoponce / gist:07d8d4c833873be2f68c34f9afc5a78a
Last active April 25, 2025 13:56 — forked from tqbf/gist:be58d2d39690c3b366ad
Cryptographic Best Practices

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@ttdoda
ttdoda / kcodecheck.rb
Last active March 31, 2017 02:45
端末の漢字コード設定の判別
#!/usr/bin/env ruby
# encoding: ascii-8bit
#
# 端末の漢字コード設定判別のサンプルスクリプト
#
# コンセプトとしてはUTF-8, EUC-JP, Shift_JISのどれと解釈しても正しい、
# しかしどのエンコーディングとして解釈したかで端末での表示幅が変わる
# バイト列を送信し、その時のカーソル位置で端末がどのエンコーディング
# として解釈したかを判別する。
#
@nurse
nurse / gist:99adc8a91972c915380b
Last active June 9, 2016 08:37
Windowsに欲しいUnix互換機能メモ