Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
> 突然の死 <

SATOH Fumiyasu (TSUCHIDA Fumiyasu) fumiyas

💭
> 突然の死 <
View GitHub Profile
@fumiyas
fumiyas / pre-commit
Created Apr 3, 2014
Subversion: UTF-8 以外のファイル名を拒否する pre-commit スクリプト (UTF-8-Mac, NFD, NFKD も拒否)
View pre-commit
#!/bin/sh
##
## SVN: pre-commit hook script
## Copyright (c) 2014 SATOH Fumiyasu @ OSS Technology Corp., Japan
## <http://www.OSSTech.co.jp/>
##
## License: GNU General Public License version 3
## Date: 2014-03-03, since 2014-04-03
##
View LICENCE
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2014 Hayaki Saito <user@zuse.jp>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
View bonnie++.hshs-wo-tuning.txt
チューニングされてない HSHS?
Version 1.96 ------Sequential Output------ --Sequential Input- --Random-
Concurrency 8 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
msearch.edu. 16000M 20 99 153877 99 12008 29 1 19 13753 18 336.6 30
Latency 407ms 1654us 309ms 5798ms 453ms 68967us
Version 1.96 ------Sequential Create------ --------Random Create--------
msearch.edu.tut.ac. -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files:max:min /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
@fumiyas
fumiyas / ntpasswd.py
Created May 13, 2014
Generate Windows NT password hash
View ntpasswd.py
#!/usr/bin/python
import sys
import getpass
import hashlib
import binascii
if sys.stdin.isatty():
p = getpass.getpass()
else:
View wget-twitpic.sh
#!/bin/sh
set -u
user="$1"; shift
wget \
--recursive \
--level=inf \
--span-hosts \
View stty-a.txt
speed 38400 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke
@fumiyas
fumiyas / bash-4.1-dont-import-func.patch
Last active Aug 29, 2015
bash 4.1: Patch: Disable function import to avoid "ShellShock" vulnerability
View bash-4.1-dont-import-func.patch
Disable function import to avoid "ShellShock" vulnerability
(CVE-2014-6271 CVE-2014-7169)
diff -upr bash-4.1/variables.c bash-4.1-dont-import-func/variables.c
--- bash-4.1/variables.c 2009-11-04 04:13:58.000000000 +0900
+++ bash-4.1-dont-import-func/variables.c 2014-09-26 19:17:28.494577523 +0900
@@ -336,55 +336,6 @@ initialize_shell_variables (env, privmod
temp_var = (SHELL_VAR *)NULL;
@fumiyas
fumiyas / getaddrinfo-name2addr.c
Created Oct 24, 2014
Testing DNS stub resolver (getaddrinfo(3))
View getaddrinfo-name2addr.c
#include <stdio.h>
#include <string.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <errno.h>
int main(int argc, char **argv)
{
struct addrinfo hints, *ai, *ai_p;
const char *name;
@fumiyas
fumiyas / rpm-upgrade-package.bash
Created Nov 28, 2014
Do `rpm -U *.rpm` except already updated packages
View rpm-upgrade-package.bash
#!/bin/bash
##
## Do `rpm -U *.rpm` except already updated packages
## Copyright (c) 2013 SATOH Fumiyasu @ OSS Technology Corp., Japan
##
## License: DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2
##
set -u
@fumiyas
fumiyas / ln-s-relative.sh
Last active Aug 29, 2015
ln-s-relative.sh - Make a symlink in relative path form
View ln-s-relative.sh
#!/bin/dash
set -u
ln_s_relative() {
local root=""
if [ $# -eq 3 ]; then
local root="$1"; shift
fi
local target="$1"; shift