Skip to content

Instantly share code, notes, and snippets.

Daisuke Takeuchi daicham

  • Tokyo, Japan
Block or report user

Report or block daicham

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@daicham
daicham / Vagrantfile
Created Jul 15, 2014
Vagrantfile for ec2
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "dummy"
config.vm.provider :aws do |aws, override|
@daicham
daicham / gist:dec93e7c8b133a66e98b
Last active Aug 29, 2015
[WIP] Installing Gitlab CE Omnibus Package on CentOS 6
View gist:dec93e7c8b133a66e98b

Installing Gitlab Omnibus Package on CentOS 6.0

see also: https://about.gitlab.com/downloads/

sudo yum install curl openssh-server postfix cronie -y
sudo service postfix start
sudo chkconfig postfix on
@daicham
daicham / gist:8fcdc6113591ffc819ad
Last active Aug 29, 2015
Download kernel source for CentOS 6
View gist:8fcdc6113591ffc819ad
@daicham
daicham / proxy.conf
Last active Aug 29, 2015
Apache2 reverse proxy setting for fixing a Jekins warning
View proxy.conf
# See also: https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+says+my+reverse+proxy+setup+is+broken
# Tested on Apache2.2.15/CentOS6
# /etc/httpd/conf.d/proxy.conf
ProxyPass /jenkins http://localhost:8080/jenkins nocanon
ProxyPassReverse /jenkins http://localhost:8080/jenkins
ProxyRequests off
AllowEncodedSlashes on
@daicham
daicham / gist:1593715
Created Jan 11, 2012
Import csv to Outlook calendar by ruby
View gist:1593715
require 'win32ole'
require 'kconv'
require 'csv'
require 'date'
class Ticket
attr_reader :id
attr_reader :subject
attr_reader :from
attr_reader :to
@daicham
daicham / gist:1593722
Created Jan 11, 2012
Export csv from a Oracle table by sqlplus
View gist:1593722
sqlplus -s << EOF > ${sdata_file}
${ora_user_name}/${ora_user_pass}@${ora_sid}
set echo off
set linesize 1000
set pagesize 0
set trimspool on
set trimout on
set feedback off
set colsep ','
@daicham
daicham / gist:1593740
Created Jan 11, 2012
iCalendar by ruby
View gist:1593740
require 'rubygems'
require 'icalendar'
require 'date'
cal = Icalendar::Calendar.new
cal.event do
dtstart DateTime.new(2010, 05, 19, 22, 00), {'TZID' => 'Asis/Tokyo'}
dtend DateTime.new(2010, 05, 19, 22, 30), {'TZID' => 'Asis/Tokyo'}
summary "うちあわせ"
end
@daicham
daicham / gist:1964899
Created Mar 3, 2012
Show simple alert dialog on iOS
View gist:1964899
//refs http://d.hatena.ne.jp/thata/20100213/1265987041
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"hoge"
message:textfield.text
delegate: nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
@daicham
daicham / random.bat
Last active Oct 1, 2015
Generate random strings and copy to clipboard by ruby on batch file
View random.bat
@echo off
ruby -S -x %0 %*
goto end
#! ruby
require 'win32/clipboard' # before install "win32-clipboard" gem
pattern = ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a
puts "Random String => " + Array.new(8){pattern[rand(pattern.size)]}.join
Win32::Clipboard.set_data(value, Win32::Clipboard::UNICODETEXT)
puts "Stored to clipboard"
You can’t perform that action at this time.