Skip to content

Instantly share code, notes, and snippets.

@atton
atton / docker
Created October 10, 2017 07:48
Docker configuration which change data location
# /etc/sysconfig/docker
OPTIONS='--selinux-enabled -g /path/to/directory'
@atton
atton / a.txt
Last active October 9, 2017 12:05
Output by virsh vol-list
# virsh vol-list a
Name Path
------------------------------------------------------------------------------
hoge.img /path/to/a/hoge.img
@atton
atton / gist:ddf851658a606fe2de0c6960255d00d1
Created October 8, 2017 23:18
Time Machine Local Backup
raven% df
Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on
/dev/disk1 974700800 716893256 257295544 74% 2759317 4292207962 0% /
devfs 366 366 0 100% 634 0 100% /dev
map -hosts 0 0 0 100% 0 0 100% /net
map auto_home 0 0 0 100% 0 0 100% /home
localhost:/hogehogefugafugapiyopi 974700800 974700800 0 100% 0 0 100% /Volumes/MobileBackups
[3] pry(main)> RGhost::Convert.new(nil).to :jpeg
NoMethodError: undefined method `empty?' for nil:NilClass
from /Users/atton/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rghost-141a28abb655/lib/rghost/ruby_ghost_engine.rb:156:in `shellescape'
[5] pry(main)> RGhost::Convert.new(true).to :jpeg
NoMethodError: undefined method `empty?' for nil:NilClass
from /Users/atton/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rghost-141a28abb655/lib/rghost/ruby_ghost_engine.rb:156:in `shellescape'
@atton
atton / data-remote-false.rb
Created August 31, 2017 04:45
rails 5.1 form_with
form_with(url: hoge_url, data: {remote: false})
@atton
atton / redis.service
Created July 7, 2017 08:07
install-redis 3.2.9
[Unit]
Description=Redis persistent key-value database
After=network.target
[Service]
ExecStart=/usr/local/bin/redis-server /etc/redis.conf --daemonize no
ExecStop=/usr/local/bin/redis-cli -p 6379 shutdown
[Install]
WantedBy=multi-user.target
cat > /usr/lib/systemd/system/httpd.service << EOF
[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target
Documentation=man:httpd(8)
Documentation=man:apachectl(8)
[Service]
Type=notify
#EnvironmentFile=/usr/local/apache2/conf/httpd.conf
@atton
atton / inspect.json
Created June 13, 2017 03:13
docker inspect json
"Mounts": [
{
"Name": "98ef888300af713d65b6d7534d835c7bd2e95270ad5eb016da749bbbb5f6d409",
"Source": "/var/lib/docker/volumes/98ef888300af713d65b6d7534d835c7bd2e95270ad5eb016da749bbbb5f6d409/_data",
"Destination": "/var/jenkins_home",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
}
@atton
atton / ignore
Last active June 8, 2017 11:13
~/.config/git/ignore
# ~/.config/git/ignore
.DS_Store
*.swp
@atton
atton / ancestors.rb
Last active December 3, 2016 08:31
okinawa.rb advent calendar 2016
# [13] pry(#<#<Class:0x007ffdce310d48>>)> puts (p self.class.ancestors)
[#<Class:0x007ffdce310d48>,
#<Module:0x007ffdcead5600>,
#<Module:0x007ffdce9c6f48>,
UsersHelper,
ApplicationHelper,
#<Module:0x007ffdcd741030>,
ActionDispatch::Routing::RouteSet::MountedHelpers,
#<Module:0x007ffdce310ca8>,
#<Module:0x007ffdcd1a8c68>,