Skip to content

Instantly share code, notes, and snippets.

View koji's full-sized avatar
🫚
orz

koji koji

🫚
orz
View GitHub Profile
@koji
koji / sort.pl
Created July 21, 2013 07:48
Perl入学式
#!/usr/bin/env perl
use strict;
use warnings;
my @array1; # 配列
# 3回入力する
for my $i (1..3) {
print $i."番目";
chomp($array1[$i-1] = <STDIN>);
#!/usr/bin/env perl
use strict;
use warnings;
for my $i (1..100) {
if ($i%15 == 0) {
print "FizzBuzz\n";
} elsif ($i%5 == 0 ) {
print "Buzz\n";
} elsif ($i%3 == 0 ) {
@koji
koji / qw.pl
Created August 25, 2013 05:43
perl入学式 #3
#!/usr/bin/env perl
#use strict;
#use warnings;
my @array = qw ( 0123 123 XXX);
print "表示:"."@array\n";
my $num = join '-' , @array;
print "電話番号的なもの:"."$num\n";
@koji
koji / gist:4029fcebb382ce37c220
Last active August 29, 2015 14:11
Update ruby-build
If you hit
rbenv install --list
There isn't 2.1.0.
You should try this.
cd "$(rbenv root)"/plugins/ruby-build && git pull
CentOS rbenv + ruby-build
@koji
koji / gist:32c64b16aa1269f4298f
Created January 1, 2015 20:26
How to install iptables on CentOS7(CentOS7のiptablesのインストール方法)
Step1
yum install iptables-services
Step2
to start iptables 起動
systemctl start iptables
to stop iptables 停止
systemctl stop iptables
@koji
koji / gist:1482469dbaa7df66e3c5
Created January 3, 2015 08:00
Install php 5.4 on CentOS6
If you want to install php5.4, you have to introduce epel and remi to install php5.4.
If you don't have wget, you have to do this, but if you have wget, you don't need this step.
Step1. Install wget
sudo yum install wget -y
@koji
koji / gist:a6f2a1380e28a3e3dc02
Last active August 29, 2015 14:12
How to untar a tar.xz
tar Jxvf FileName.tar.xz
or
tar -Jxvf FileName.tar.xz
If you get an error and don't have xz, you have to install this like below
sudo yum install xz
@koji
koji / gist:53d1e6849a97b0076e8e
Last active August 29, 2015 14:12
If you can't install ruby2.0 or later with rbenv and vagrant(CentOS 6.6)
If you can't install ruby2.0 or later with rbenv, you should check you installed those already.
sudo yum -y install libyaml libyaml-devel zlib zlib-devel readline readline-devel openssl openssl-devel libxml2 libxml2-devel libxslt libxslt-devel
If you finish installing those, you can install ruby2.0 or later probably.
And you should confirm which you can install
rbenv install -l
@koji
koji / provision.sh
Created January 4, 2015 05:27
Vagrant Provisioning(CentOS 6.6)
#httpd
sudo yum -y install httpd
sudo service httpd start
sudo chkconfig httpd on
#iptables
sudo service iptables stop
sudo chkconfig iptables off
#epel & remi
@koji
koji / gist:ae3dbb7f94a30bb6b491
Created January 4, 2015 06:46
Install rails
You have had to install ruby on your machine.
Update gem
gem update --system
Install rails without documents because it's going to be faster than with documents
gem install rails --no-ri --no-rdoc