This file contains 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 /proc/self/cmdline | strings -1 | |
cat | |
/proc/self/cmdline |
This file contains 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
use strict; | |
use warnings; | |
use B; | |
B->new(); | |
#------------------------------- | |
package A; |
This file contains 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
$ ls | |
$ perl -e 'open my $fh, "+<", "hoge" or die $!' | |
No such file or directory at -e line 1. | |
$ ls | |
$ perl -MFcntl -e 'sysopen my $fh, "hoge", O_RDWR|O_CREAT or die $!' | |
$ ls | |
hoge |
This file contains 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
$ for i in no / /dev /boot /d /de /deva; do echo $i | grep -E '^/([^(dev)].+||d|de|dev.+)$' || echo "skip $i"; done | |
skip no | |
/ | |
skip /dev | |
/boot | |
/d | |
/de | |
/deva |
This file contains 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
for i in a aaa bbb abc abcd abcafa ab; do echo $i | grep -E '^a([^(bc)].+||b|bc.+)$' || echo "skip $i"; done | |
a | |
aaa | |
skip bbb | |
skip abc | |
abcd | |
abcafa | |
ab |
This file contains 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
#!/usr/bin/expect | |
spawn dpkg-reconfigure -f readline dash | |
expect "Use dash as the default system shell (/bin/sh)?" | |
send "n\n" | |
interact |
This file contains 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
default_run_options[:shell] = 'bash -l' | |
set :sudo, 'sudo -H' |
This file contains 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
app_home = "/home/#{node['app']['username']}" | |
execute "add localhost to known_hosts" do | |
user node['app']['username'] | |
group node['app']['username'] | |
cwd app_home | |
command "ssh-keyscan localhost >> #{app_home}/.ssh/known_hosts" | |
not_if "grep -q \"`ssh-keyscan localhost`\" #{app_home}/.ssh/known_hosts" | |
end |
This file contains 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
export PS1='\[\033k'"$HOSTNAME"'\033\\\]'"$PS1" |
This file contains 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
SERVER_ID=1 erb my.cnf.erb > /etc/my.cnf |