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
#!/bin/sh | |
find ~/Documents/Virtual\ Machines.localized/ -name '*.vmx' -print0 | xargs -0 -I@ -L1 sh -c 'f="@";cat ${f}|grep displayName|address' |
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
#!/bin/sh | |
find ./jail/base*/ -name 'resolv.conf' | xargs -L1 -I@ sh -c 'f="@";echo ">>>${f}";cat ${f}; echo "<<<${f}";echo;' |
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
#!/bin/sh | |
jls | awk 'NR>1 {print $4}' | awk -F'/' '{print $NF}' | xargs -I@ sh -c 'j=@; c=$(jexec ${j} test -e /usr/local/etc/postfix/main.cf && jexec ${j} cat /usr/local/etc/postfix/main.cf); echo "${c}" > "${j}.txt"' |
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
#!/bin/sh | |
jls | awk 'NR>1 {print $4}' | awk -F'/' '{print $NF}' | xargs -I@ sh -c 'j=@; c=$(jexec ${j} cat /etc/hosts); echo "${c}" > "${j}.txt"' |
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
#!/bin/sh | |
jls | awk 'NR>1 {print $4}' | awk -F'/' '{print $NF}' | xargs -I@ sh -c 'j=@; v=$(jexec ${j} php -v | head -1); echo "${j}: ${v}"' |
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
#!/bin/sh | |
# nginx.conf の pid /path/nginx.pid; の調整は必要。 | |
args=${1:-""} | |
case "${args}" in | |
stop) | |
echo 'stop'; | |
;; | |
restart) |
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
set ip=`ifconfig -l | awk '{print $1}' | xargs -L1 -I@ ifconfig @ inet | grep inet | awk '{print $2}' | head -n 1` | |
set prompt="%{\e[00;32;40m%}${ip}:%/%{\e[0m%} \n[freebsd]❯" |
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
<?php | |
$file = new SplFileObject(__FILE__); | |
while (!$file->eof()) { | |
echo $file->current(); | |
$file->next(); | |
} | |
?> |
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
<?php | |
class a { | |
protected $hoge = 'foo'; | |
} | |
$a = new a(); | |
$closure = Closure::bind(function () { | |
$this->hoge = 'foofoo'; | |
}, $a, $a); | |
$closure(); |
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
#!/bin/sh | |
pkg_base_path="/usr/local/bin/" | |
get_python_path () { | |
ls -1 "${pkg_base_path}" | grep -E '^python[0-9]{1}\.[0-9]{1}$' | |
} | |
pkg -N > /dev/null | |
st_code=$? |