Skip to content

Instantly share code, notes, and snippets.

View mamemomonga's full-sized avatar
🏠
Working from home

mamemomonga mamemomonga

🏠
Working from home
View GitHub Profile
@mamemomonga
mamemomonga / php-downloader.pl
Created May 2, 2014 02:14
phpのソースの最新バージョンを取得する
#!/usr/bin/env perl
use strict;
use warnings;
my $curl='curl';
sub php_latest {
my $release=shift;
my $atom=`$curl http://www.php.net/releases/feed.php`;
while( $atom=~m#<link rel="enclosure" title="([^"]+)" href="([^"]+)">#mg ) {
@mamemomonga
mamemomonga / .vimrc
Created July 8, 2014 08:49
シンプルなvimrc
syntax on
set wildmenu
set history=100
set number
"set list
set scrolloff=5
"set nobackup
"set backupdir=/tmp
@mamemomonga
mamemomonga / .screenrc
Created July 8, 2014 08:51
シンプルなscreenrc
hardstatus alwayslastline "%H [%02c] %`%-w%{=b bw}%n %t%{-}%+w"
vbell off
bind s
bind ^U encoding utf8
bind ^E encoding euc
startup_message off
autodetach on
defscrollback 8192
@mamemomonga
mamemomonga / clone_virtual_machine.sh
Last active August 29, 2015 14:03
VMware ESXi Tech Support Mode(SSH)で仮想マシンをクローンする
#!/bin/ash
# ESXi Tech Support Mode(SSH)で仮想マシンをクローンする。
# コピー先のディスクイメージはThin Provisioning
# 一つのディレクトリにまとまっている必要がある。
# 仮想マシンは /vmfs/volumes/以下に [DATASTORE]/[VM] という形で存在しているので
# データストア: DS1にあるVM1をDS2のVM2としてクローンする場合は
# clone_virtual_machine.sh "DS1/VM1" "DS2/VM2"
# と実行する。クローン後は上記の例のVM2の名前でIntentoryに登録される。
@mamemomonga
mamemomonga / gist:6aacce6761ecff1b166b
Last active August 29, 2015 14:06
iTunesで選択範囲のアルバムアーティストが空の場合、アーティストをアルバムアーティストとして設定する(OSX 10.9用)
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use 5.10.0;
binmode(STDOUT,':utf8');
# --------------------------------------------------------------
# iTunesで選択範囲のアルバムアーティストが空の場合
# アーティストをアルバムアーティストとして設定する
@mamemomonga
mamemomonga / gist:c3df0c021116b367d478
Created November 25, 2014 01:10
ルートディレクトリにある各種ディレクトリごとの容量を調べる
find / -maxdepth 1 -type d -exec du -sh {} \;
@mamemomonga
mamemomonga / ssh_proxy_command.sh
Last active August 29, 2015 14:12
GitでProxyCommandを使う
#!/bin/sh
exec ssh -o 'ProxyCommand=ssh PFUSER@PFHOST -W %h:%p 2> /dev/null' "$@"
@mamemomonga
mamemomonga / prowl_notify_ipaddr.pl
Last active August 29, 2015 14:13
prowlで現在のwlan0のIPアドレスを通知する
#!/usr/bin/env perl
use utf8;
use strict;
use warnings;
use URI::Escape;
binmode(STDOUT,':utf8');
my %cnf=(
name => 'prowl_notify_wifi_addr',
curl => '/usr/bin/curl',
@mamemomonga
mamemomonga / gist:f4d9e997898a60060666
Last active August 29, 2015 14:13
MinGW+MinTTY セットアップメモ
@mamemomonga
mamemomonga / gist:f47a9c87acc1328b25a8
Created January 18, 2015 07:48
ディレクトリ単位でパッチを作成、パッチを当てる

ディレクトリ単位でパッチを作成、パッチを当てる

diff -cr [元フォルダ] [修正後フォルダ] > [パッチファイル]
patch -p0 < [パッチファイル]