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 | |
require_once 'tweet/tweet.php'; | |
$secret = "3LxNHeLXEzJS"; | |
//全てのリクエストヘッダーを取得 | |
$headers = getallheaders(); | |
//署名されたのを取得 | |
$hubSignature = $headers['X-Hub-Signature']; |
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 | |
/** | |
* Squid の File descriptor を引数で取得するもの | |
* Zabbix で 使ってください。 | |
*/ | |
/** | |
* @param string $host 第1引数 IPアドレス | |
* @param string $key 第2引数 maximum or largest or number or file or ..... | |
*/ |
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 |
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
/* | |
* 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 -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
<?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
[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
#!/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
for i in `(lxc-ls)`; do lxc-stop -n $i -r; done |
OlderNewer