Skip to content

Instantly share code, notes, and snippets.

@nukino
nukino / million_make.rb
Created March 15, 2012 02:03
[20120315-1102]million_make.rb/○万ファイル作成(ruby版)
# -*- coding: utf-8 -*-
require 'pathname'
require 'FileUtils'
@g_max_depth = 100
@g_file_count = 10000
#作成
def make_files(dir, count)
dir.mkdir() if !dir.exist?
@nukino
nukino / million_make.js
Created March 15, 2012 02:02
[20120315-1101]million_make.js/○万ファイル作成(JScript版)
if ( true )
{
var g_max_depth = 100;
var g_file_count = 10000;
}
else
{
var g_max_depth = 10;
var g_file_count = 1000;
}
@nukino
nukino / mkarc.sh
Created March 10, 2012 06:09
[20120310-1509]mkarc.sh/指定パス内ディレクトリ・ファイル毎に圧縮ファイルを作成
#!/bin/bash
# $1 指定パス。指定パス内のディレクトリ・ファイル毎に圧縮ファイルを作成する
if [ -z $1 ]; then
echo "引数を指定してね"
exit
fi
cd $1
for i in *; do
if [[ -f ${i} && -r ${i} ]]; then
arcdir=../Archive/afile/${i}/linux
@nukino
nukino / exedll.diff
Created March 10, 2012 01:47
[20120310-1047]exedll.diff/exedll.c変更点
--- E:/SRC/VS_NET2008/exedll/exedll/exedll.c Sat Feb 10 10:40:46 2012
+++ E:/Tools/exedll/exedll.c Sat Mar 08 00:00:02 2003
@@ -310,7 +310,6 @@
ai[j] = (unsigned int)(av[j+2]);
}
}
- __try {
switch(i){
case 1:
ret = paddress(ai[0]);
@nukino
nukino / make_CentOS6_file.bat
Created March 9, 2012 22:55
[20120310-0755]make_CentOS6_file.bat/CentOS6ファイル化バッチ
@echo off
set exe_7zip="C:\Program Files\7-Zip\7z.exe"
::末尾に"\"を付けては駄目
set dir_centos=C:\Work\Original\CentOS6
if exist %dir_centos%.tar del %dir_centos%.tar
%exe_7zip% a %dir_centos%.tar %dir_centos%
if not exist %dir_centos%.tar exit /B
::先頭16バイトに適当なデータを付ける
cd /d %~dp0
@nukino
nukino / double_size.bat
Created March 9, 2012 22:41
[20120310-0740]double_size.bat/容量2倍化バッチ
::%1 容量2倍にするファイル
copy /B %1+%1 %1_1
del %1
ren %1_1 %1
@nukino
nukino / externalhelp.vim
Created February 18, 2012 05:14
[20120218-1414]externalhelp.vim/vim外部ヘルプ実行スクリプト
let g:external_hlp_hhhexe = get(g:, 'external_hlp_hhhexe', '')
let g:external_hlp_winhlpexe = get(g:, 'external_hlp_winhlpexe', '')
" 引数1:キーワード種類
" 0:カーソル位置をキーワードとする
" 1:キーワード入力
" 2:引数2をキーワードとする
"
" 引数2:キーワード
"
@nukino
nukino / .bashrc
Created February 2, 2012 07:08
[20120202-1608].bashrc/ls等色分け表示
if [ -x /usr/bin/dircolors ]; then
test -r ~/cygwin/.dircolors && eval "$(dircolors -b ~/cygwin/.dircolors)" || eval "$(dircolors -b)"
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias ls='ls -hF --color=auto' # classify files in colour
alias dir='ls --color=auto --format=vertical'
alias vdir='ls --color=auto --format=long'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
@nukino
nukino / .bashrc
Created February 2, 2012 06:31
[20120202-1530].bashrc/英語man表示コマンド
#英語のmanページを表示
alias eman='LANG=en_US LC_ALL=en_US /usr/bin/man'
@nukino
nukino / wvi.sh
Created February 2, 2012 00:58
[20120202-0958]wvi.sh/gVimで編集
#!/bin/bash
if [[ $# = 1 && ! -f $1 ]]; then
#改行コードunix 同期実行
gvim -c "setl ff=unix" `cygpath -w $1`
#ファイルが存在するならパーミッション設定
if [ -f $1 ]; then
#umaskの結果を参照する場合(要bcコマンド)
um=`umask`
perm=`echo "ibase=8; obase=8; 666 - $um" | bc`
chmod $perm "$1"