This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! HardMode () | |
noremap <Up> <Nop> | |
noremap <Down> <Nop> | |
noremap <Left> <Nop> | |
noremap <Right> <Nop> | |
endfunction | |
function! EasyMode () | |
noremap <Up> <Up> | |
noremap <Down> <Down> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "https://rubygems.org" | |
gem "sinatra" | |
gem "rake" | |
gem "thin" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'serverspec' | |
include RSpec::Matchers | |
include Serverspec::Helper::Exec # リモートが対象ならここはSsh | |
include Serverspec::Helper::DetectOS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cat <<'EOL' | chef-apply -s | |
> bash 'mysql_secure_install emulate' do | |
> code <<-"EOH" | |
> /usr/bin/mysqladmin drop test -f | |
> /usr/bin/mysql -e "delete from user where user = '';" -D mysql | |
> /usr/bin/mysql -e "delete from user where user = 'root' and host = \'#{node[:hostname]}\';" -D mysql | |
> /usr/bin/mysql -e "SET PASSWORD FOR 'root'@'::1' = PASSWORD('newpassword');" -D mysql | |
> /usr/bin/mysql -e "SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('newpassword');" -D mysql | |
> /usr/bin/mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpassword');" -D mysql | |
> /usr/bin/mysqladmin flush-privileges -pnewpassword |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pry(main)> Chef::Util::FileEdit.instance_methods(false) | |
=> [:search_file_replace_line, | |
:search_file_replace, | |
:search_file_delete_line, | |
:search_file_delete, | |
:insert_line_after_match, | |
:insert_line_if_no_match, | |
:write_file] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pry(main)> build_encrypt_by_plane('password3') | |
=> "$6$f22eb55ffd0731f$FhoAmeAQmcqsGbEnRJWLuqv.AwlpYHiRz8xecGE.0teBnIY3pzko2y7lRl.rXcUraZVLJ4Kc.vF5EUU5HjTir0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## -- snip -- | |
Sidekiq.configure_server do |config| | |
config.redis = { | |
:master_name => "example-test", | |
:sentinels => [ | |
{:host => "localhost", :port => 26379}, | |
{:host => "localhost", :port => 26380} | |
] | |
} | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'zonefile' | |
require 'route53' | |
my_access_key = 'REPLACE_TO_YOUR_KEY' | |
my_secret_key = 'REPLACE_TO_YOUR_SECRET' | |
domain = 'example.com.' | |
zone_id = '/hostedzone/ZONEID' | |
default_ttl = '600' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Omnibus Chef Client | |
# | |
# VERSION 0.0.1 | |
FROM ubuntu | |
MAINTAINER Yukihiko Sawanobori "[email protected]" | |
# install curl | |
RUN apt-get update | |
RUN apt-get install -y curl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
file "/tmp/dna.json" do | |
content JSON.pretty_generate(node) | |
end |