Skip to content

Instantly share code, notes, and snippets.

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

Minoru KAWAMOTO k12u

🏠
Working from home
View GitHub Profile
@k12u
k12u / gist:10449594
Last active August 29, 2015 13:59
つらい
[vagrant@localhost setup]$ gem install chef --version 11.10
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
bad response Service Unavailable 503 (https://api.rubygems.org/api/v1/dependencies?gems=highline)
[vagrant@localhost setup]$ gem install chef --version 11.10
^CERROR: Interrupted
[vagrant@localhost setup]$ gem install chef --version 11.10
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
bad response Service Unavailable 503 (https://api.rubygems.org/api/v1/dependencies?gems=puma)
[vagrant@localhost setup]$ gem install chef --version 11.10
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "base"
config.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.synced_folder ".", "/var/www/html"
[root@ip-10-120-94-184 php55]# env LANG=C yum install php55u-pecl-jsonc.x86_64
Loaded plugins: priorities, update-motd, upgrade-helper
49 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package php55u-pecl-jsonc.x86_64 0:1.3.5-1.ius.centos6 will be installed
--> Processing Dependency: /usr/bin/pecl for package: php55u-pecl-jsonc-1.3.5-1.ius.centos6.x86_64
--> Processing Dependency: /usr/bin/pecl for package: php55u-pecl-jsonc-1.3.5-1.ius.centos6.x86_64
--> Running transaction check
---> Package php55u-pear.noarch 1:1.9.4-20.ius.centos6 will be installed
@k12u
k12u / 0_reuse_code.js
Created August 22, 2014 16:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@k12u
k12u / swedish
Last active August 29, 2015 14:27
swedish
vagrant@ubuntu:/tmp$ docker run -d --name=test -e MYSQL_DATABASE=db -e MYSQL_ROOT_PASSWORD=pass -p 3307:3306 mysql
83a04cde686930ad72df76df5d2662ed927c901867c4e4562b18841a49140aa3
vagrant@ubuntu:/tmp$ docker exec test cat /var/lib/mysql/db/db.opt
default-character-set=latin1
default-collation=latin1_swedish_ci
@k12u
k12u / list_branch
Created August 9, 2011 12:06
svn ls helper
#!/usr/bin/perl
use strict;
#use warnings;
use Getopt::Std;
my $svn_info = `svn info|grep URL`;
die "not http repository: $svn_info" unless $svn_info =~ /^URL: https?.+$/sm;
die "trunk/branches directory not found in svn info: $svn_info" unless $svn_info =~ m#^URL: https?.+/(branches|tags|trunk)#sm;
@k12u
k12u / switch_branch
Created August 9, 2011 12:05
svn switch helper
#!/usr/bin/perl
use strict;
#use warnings;
use Getopt::Std;
my $svn_info = `svn info|grep URL`;
die "not http repository: $svn_info" unless $svn_info =~ /^URL: https?.+$/sm;
die "trunk/branches directory not found in svn info: $svn_info" unless $svn_info =~ m#^URL: https?.+/(branches|tags|trunk)#sm;
@k12u
k12u / make_branch
Created August 9, 2011 12:06
svn copy helper
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Std;
my %opts;
Getopt::Std::getopts('b:t:', \%opts);
@k12u
k12u / term.txt
Created August 10, 2011 05:02
mysql: 意外な挙動
mysql> show create table m\G
*************************** 1. row ***************************
Table: m
Create Table: CREATE TABLE `m` (
`id` int(11) NOT NULL,
`status` varchar(64) DEFAULT NULL,
`value` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1 row in set (0.00 sec)
@k12u
k12u / gist:1162161
Created August 22, 2011 11:20
ログインセッションの SSH_AUTH_SOCKを 取得する (macのcrontabからssh)
$ ps -ef -E |grep ssh-a[g]ent | perl -lne 'm/SSH_AUTH_SOCK=([^ ]+)/;print $1'
/tmp/launch-aaaaaa/Listeners