忍者ブログ
Admin / Write / Res
ちゃんとカテゴリ分けされておりませんので、 記事をお探しならブログ内検索が便利です。 ご活用くださいませー+.(≧∀≦)゚+.゚
ブログ内検索
カレンダー
03 2024/04 05
S M T W T F S
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
カウンター
アクセスカウンター
最新コメント
[04/05 Fully Vaccinated Adorable Escort Service in bengaluru 8273600238]
[03/26 Tonaldcet]
[01/16 jilibet]
[10/20 Call Girl in Delhi]
[09/07 לפרטים נוספים]
最新トラックバック
プロフィール
+ハンドル+
y_ayamori(purple)
+職業+
IT系エンジニア
+すまい+
さいたま
バーコード
[690]  [689]  [688]  [687]  [686]  [685]  [684]  [683]  [681]  [680]  [679
またまた唐突にtorをインストールしてくれと言われました。。。
会社として本当にそんなツールを使うのだったら、ダメだと思うの。。。
まぁ、用途は(あたしは)きいてませんしー
聞かない聞かない
見なかったことにするのはこの業界で生き残る技術よ♡

rpm -qi wget || \
  yum -y install wget
rpm -qi automake || \
  yum -y install automake
rpm -qi make || \
  yum -y install make
rpm -qi gcc-c++ || \
  yum -y install gcc-c++
rpm -qi libevent-devel || \
  yum -y install libevent-devel
rpm -qi openssl-devel || \
  yum -y install openssl-devel
rpm -qi php || \
  yum -y install php

cd /tmp
test -f tor.tgz ||
wget 'https://gitweb.torproject.org/tor.git/snapshot/c0441cca8b483882f5676b98081f0fe4b52d3ae1.tar.gz' -O tor.tgz 
tar zxf tor.tgz
cd tor-*/

./autogen.sh && \
./configure --prefix=/usr/local/tor --disable-asciidoc && \
make clean && \
make -j2 && \
make install

mkdir -p /usr/local/tor/var/{log,tmp,run}

php -r ' 
$conf = "";
$ip = "0.0.0.0";
$conf .= sprintf("SocksPort %s:9100\n", $ip);
$conf .= "Log notice file /usr/local/tor/var/log/notices.log\n";
file_get_contents("/usr/local/tor/etc/torrc", $conf);
'

# 起動
cd /usr/local/tor/var/tmp
nohup /usr/local/tor/bin/tor -f /usr/local/tor/etc/torrc &
_pid=$!
cd /usr/local/tor/var/run
echo -n ${_pid} > tor.pid

# 停止
cat /usr/local/tor/var/run/tor.pid | xargs kill

# 確認
php -r ' 
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL, "http://taruo.net/e/");
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
curl_setopt ($ch, CURLOPT_PROXY, "127.0.0.1:9100");
curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt ($ch, CURLOPT_FAILONERROR, true);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
$result = curl_exec($ch);
print curl_errno ($ch);
print strip_tags($result);
curl_close ($ch); 
' | grep -A1 -e REMOTE_HOST -e REMOTE_ADDR

さんざんPHPとかねじ込んできた割に、最後はgrepというのがあたしらしいわねー
でわでわ

拍手

PR
この記事にコメントする
Name
Title
Color
Mail
URL
Comment
Password   Vodafone絵文字 i-mode絵文字 Ezweb絵文字
secret (管理人にのみ表示)
Copyright ©  アナログを愛するデジタル生活館 All Rights Reserved.
* material by Pearl Box   * Template by tsukika

忍者ブログ [PR]