Skip to content

Instantly share code, notes, and snippets.

View withgod's full-sized avatar
💭
I may be slow to respond.

takumi withgod

💭
I may be slow to respond.
View GitHub Profile
127.0.0.1 - - [02/Jun/2014:18:40:17 +0000] "GET /apc-json.php HTTP/1.1" 200 615 "-" "ganglia-apc-python"
127.0.0.1 - - [02/Jun/2014:18:40:47 +0000] "GET /apc-json.php HTTP/1.1" 200 615 "-" "ganglia-apc-python"
127.0.0.1 - - [02/Jun/2014:18:41:17 +0000] "GET /apc-json.php HTTP/1.1" 200 615 "-" "ganglia-apc-python"
127.0.0.1 - - [02/Jun/2014:18:41:40 +0000] "GET /apc-json.php HTTP/1.1" 200 616 "-" "ganglia-apc-python"
127.0.0.1 - - [02/Jun/2014:18:41:47 +0000] "GET /apc-json.php HTTP/1.1" 200 616 "-" "ganglia-apc-python"
127.0.0.1 - - [02/Jun/2014:18:41:53 +0000] "GET /apc-json.php HTTP/1.1" 200 616 "-" "ganglia-apc-python"
127.0.0.1 - - [02/Jun/2014:18:42:03 +0000] "GET /apc-json.php HTTP/1.1" 200 616 "-" "ganglia-apc-python"
127.0.0.1 - - [02/Jun/2014:18:42:13 +0000] "GET /apc-json.php HTTP/1.1" 200 616 "-" "ganglia-apc-python"
127.0.0.1 - - [02/Jun/2014:18:42:17 +0000] "GET /apc-json.php HTTP/1.1" 200 616 "-" "ganglia-apc-python"
127.0.0.1 - - [02/Jun/2014:18:42:47 +0000] "GET /apc-json.php HTTP/1.1" 200 616
<?php
var_dump($_SERVER);
#環境によって微妙に違うから好きなの選ぶ為にvar_dump
#REQUEST_URI
#SCRIPT_NAME
#PHP_SELF
#SCRIPT_FILENAME
if (preg_match('/index.php/', $_SERVER['SCRIPT_NAME'])) {
include_once('/path/to/hoge.php');
[withgod@crowbar]ping www.google.com [~]
PING www.google.com (74.125.235.177): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
64 bytes from 74.125.235.177: icmp_seq=0 ttl=46 time=2538.270 ms
64 bytes from 74.125.235.177: icmp_seq=1 ttl=46 time=2651.660 ms
64 bytes from 74.125.235.177: icmp_seq=2 ttl=46 time=2583.869 ms
Request timeout for icmp_seq 5
64 bytes from 74.125.235.177: icmp_seq=3 ttl=46 time=3116.976 ms
Request timeout for icmp_seq 7
[noname@sakura]sudo iptables -t nat -A PREROUTING -i eth0 -p udp --dport 65738 -j REDIRECT --to-port 64738 [/etc/ufw]
[noname@sakura] [/etc/ufw]
[noname@sakura]sudo iptables -t nat -A PREROUTING -i eth0 -p udp --dport 64748 -j REDIRECT --to-port 64738 [/etc/ufw]
[noname@sakura] [/etc/ufw]
@withgod
withgod / gist:85e77bf2b42a688eda1d
Created February 6, 2015 04:46
マリリン・マンソン.txt
Yahoo!ニュース 音楽「マリリン・マンソンからマリリン・マンソンが脱退表明」
12月25日、アメリカの有名ロックバンド、マリリン・マンソン
からボーカルのマリリン・マンソンが脱退するという意向を表明した。
マリリン・マンソンは89年にマリリン・マンソンとしてデビューし、
「メカニカル・アニマルズ」などのヒット作を生んだロックシンガー。
またマリリン・マンソンはマリリン・マンソンの奇抜さと
挑発的なパフォーマンスでも有名なバンドで、
特にマリリン・マンソンの宗教批判は団体からの
数々のバッシングを受けるほどである。
[vagrant@localhost ~]$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
ACCEPT all -- anywhere anywhere
INPUT_direct all -- anywhere anywhere
INPUT_ZONES_SOURCE all -- anywhere anywhere
INPUT_ZONES all -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
@withgod
withgod / gist:748086
Created December 20, 2010 06:26
oauth uploader sample
<?php
require_once "Services/OAuthUploader.php";
$oauth = new HTTP_OAuth_Consumer('APP KEY', 'APP SECRET', 'TOKEN', 'SECRET');
$uploader = Services_OAuthUploader::factory('yfrog', $oauth);
//twitpic require api key http://dev.twitpic.com/apps/new
//$uploader = Services_OAuthUploader::factory('twitpic', $this->oauth, 'apiKey');
//proxy
//$req = new HTTP_Request2();
@withgod
withgod / gist:762362
Created January 2, 2011 06:59
php curlを使ったgoogle calendar 新規作成の実装
<?php
function doReq($url, $param = null, $auth = null, $atomreq = null) {
//var_dump(array($url, $param, $auth));
$header = array();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
@withgod
withgod / gist:762363
Created January 2, 2011 07:02
php http_request2を使ったgoogle calendar 新規作成の実装
<?php
require_once 'HTTP/Request2.php';
function doReq($url, $param = null, $auth = null, $atomreq = null, $debug = false) {
//var_dump(array($url, $param, $auth));
$header = array();
$req = mkReq();
$req->setUrl($url);
if ($param != null) {
$req->setMethod("POST");
@withgod
withgod / gist:762364
Created January 2, 2011 07:03
php curlを使ったpicasaのアルバム作成の実装
<?php
function doReq($url, $param = null, $auth = null, $atomreq = null) {
//var_dump(array($url, $param, $auth));
$header = array();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);