Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/ruby
ARGV.each do |src|
if src.scan(/([0-9]{2,2})([0-9]{2,2})([0-9]{2,2})/)
yy = $1
mm = $2
dd = $2
dst = "/mnt/tmp/Archive/Photo#{yy}/#{yy}#{mm}/#{File.basename(src)}"
dstd = File.dirname(dst)
puts "mkdir -p #{dstd}"
hello world
@zunda
zunda / .vimrc
Created September 4, 2009 01:31
set formatoptions=tmvM
set autoindent
set shiftwidth=2
set tabstop=2
set nojoinspaces
set noexpandtab
set ambiwidth=double
set fileencodings=utf-8,euc-jisx0213,ucs-bom,default,latin1
set backspace=indent,eol,start
map Q gq
http://d.hatena.ne.jp/idesaku/20090323/1237825080
checkout:
git svn clone -s <URL for repository of subversion>
update:
git svn rebase
commit (push):
git svn dcommit
@zunda
zunda / wol.rb
Last active February 14, 2020 07:41
A ruby script which sends out a magic packet to wake up your PC
#!/usr/bin/ruby
# wol.rb: sends out a magic packet to wake up your PC
#
# Copyright (c) 2004 zunda <zunda at freeshell.org>
#
# This program is free software. You can re-distribute and/or
# modify this program under the same terms of ruby itself ---
# Ruby Distribution License or GNU General Public License.
#
@zunda
zunda / pp-pstore.rb
Created September 17, 2009 20:54
A ruby script to dump content from PStore files. Happened to be similar with http://www.machu.jp/diary/20090915.html#p01
#!/usr/bin/env ruby
# pp-pstore.rb: dumps data from PStore files
#
# Copyright 2007 zunda <zunda at freeshell.org>
#
# Permission is granted for use, copying, modification, distribution,
# and distribution of modified versions of this work as long as the
# above copyright notice is included.
#
@zunda
zunda / gist:188705
Created September 17, 2009 20:57
Possibly the shortest GPL compatible freesoftware license from [ruby-talk:24759]
Permission is granted for use, copying, modification, distribution,
and distribution of modified versions of this work as long as the
above copyright notice is included.
--- gnome.xsession-errors 2009-10-14 00:15:20.000000000 -1000
+++ xfce4.xsession-errors 2009-10-14 00:15:58.000000000 -1000
@@ -1,18 +1,17 @@
-Xsession argument [gnome-session]
-GDMSESSION [gnome]
-LANG=[C] GDM_LANG=[C]
+Xsession argument [startxfce4]
+GDMSESSION [xfce4]
+LANG=[ja_JP.UTF-8] GDM_LANG=[ja_JP.UTF-8]
SESSION = <xfce4>
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "Files"
ModulePath "/usr/lib/xorg/modules"
FontPath "catalogue:/etc/X11/fontpath.d"
@zunda
zunda / inspect-jpeg.rb
Created November 2, 2009 06:12
A ruby script to show segments in jpeg files
#!/usr/bin/ruby
#
# usage: ruby inspect-jpeg.rb jpeg-file ...
#
# Copyright (C) 2009 zunda <zunda at freeshell.org>
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.