Skip to content

Instantly share code, notes, and snippets.

@164c
164c / gist:ec9a9efb70ceac89fd5f
Created February 5, 2016 07:51
CentOS6.xでRuby2.1.5でRailsが動きそうなDockerfile
FROM centos:6
MAINTAINER 164c <morotomi.hiroshi@gmail.com>
RUN yum clean all && yum update -y && yum install -y \
openssh \
openssh-clients \
openssh-server \
passwd \
sudo \
git \
@164c
164c / gist:9e4a6ed3bf6b20b873cf
Created November 12, 2014 05:12
.rubocop.yml
AllCops:
Include:
- '**/Rakefile'
- '**/config.ru'
Exclude:
- 'db/**/*'
- 'config/**/*'
- 'script/**/*'
- 'bin/**/*'
- 'vendor/bundle/**/*'
ruby:
enabled: true
config_file: .rubocop.yml
coffee_script:
enabled: true
java_script:
enabled: true
@164c
164c / sync_nodename.sh
Created June 14, 2012 10:46
chefのnodeファイルのnameをファイル名と合わせるscript
#!/bin/sh
BASE_DIR=/path/to/chef_nodes_dir
for filepath in $BASE_DIR/*.json
do
filename=`basename $filepath`
hostname=`echo $filename | sed -e "s/\.json//"`
written_host=`grep "\"name\"" $filepath | awk '{print $2}' | sed -e 's/[,"]//g'`
if [ $written_host != $hostname ] ; then
sed -i -e "s/$written_host/$hostname/" $filepath