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
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "Need arg for host." | |
echo "ex) p-s 192.168.20.100" | |
exit 1 | |
elif [ $# -eq 1 ]; then | |
HOST=$1 | |
fi |
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
#!/bin/vbash | |
args=$1 | |
# Setup for using vyatta command | |
# ================================= | |
shopt -s expand_aliases | |
. /etc/bash_completion.d/vyatta-op | |
result=`show hardware temperature` |
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 `(lxc-ls)`; do lxc-stop -n $i -r; done |
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
#!/bin/bash | |
i=$1 | |
shift | |
(sleep $i; kill $$) & exec "$@" |
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
[Unit] | |
Description=Run API program as node user on boot | |
[Service] | |
Type=simple | |
RemainAfterExit=yes | |
User=node | |
ExecStart=/usr/bin/forever start /home/node/Web-API/app.js | |
ExecStop=/usr/bin/forever stop /home/node/Web-API/app.js | |
ExecReload=/usr/bin/forever restart /home/node/Web-API/app.js |
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
<?php | |
function check_cache() | |
{ | |
$path = preg_replace("/wp-content/", " ", WP_CONTENT_DIR); | |
$path = trim($path); | |
$wp_config = file_get_contents("${path}wp-config.php"); | |
if (preg_match("/^define\('WP_CACHE',\s*true\);/mi", $wp_config) === 1) { | |
file_put_contents(WP_CONTENT_DIR . '/block-wpscan/cache_status', "1", LOCK_EX); |
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
#!/bin/bash -e | |
virsh list --all | egrep '実行中|running' | awk '{print $2}' | xargs -t -I {} virsh shutdown {} |
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
/* | |
* Notify tracking status with Twitter on Node.js. | |
* | |
* Usage | |
* ------------------- | |
* node app.js "<tracking number>" "<your twitter username>" | |
* | |
* This code scraping 'track.aftership.com' | |
*/ |
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
#!/bin/bash | |
url="<web hook url>" | |
readonly USER=`whoami` | |
readonly HOST=`hostname` | |
ip=`lastlog | grep -w "${USER}" | awk '{print $3}'` | |
day=`lastlog | grep -w "${USER}" | awk '{print $4}'` | |
month=`lastlog | grep -w "${USER}" | awk '{print $5}'` |
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
<?php | |
/** | |
SMARTで異常があるかどうか調べる。 | |
( This script checks S.M.A.R.T for Zabbix. ) | |
=== Setting === | |
[zabbix_agentd.conf] | |
+ UserParameter=hdd.smart[*],/usr/bin/php /path/to/smart.php $1 $2 $3 | |
+ AllowRoot=1 |