Capturing fucking bound/inbound packets to Android devices.

Network setup

Network composition is fucking important here because your computer is going to be an observer of packets bound or inbound to your android devices in this particular circumstance. In most of home wireless network scenarios, people connect their mobile devices and laptops to the Internet via broadband router. Here, because all the packets go through router, the routers are absolutely possible candidate to observe all the packets going out to the Internet. But sorry, you can't use router to see the packets. Why can't you use it as an observer? Well, that's because unless your router is fucking expensive one, you can't login into router to see the packets. Moreover, even if it is possible to login, you may not be allowed to access them. To do that, we will put our computer in the middle of the device and the Internet. Not literally though. In short, your device should be connected to the internet/LAN via your computer, an packet observer. On Macbook Pro, open up "Sharing". Select "Internet Sharing". Plugin an ethernet cable to your MBP. Share your connection from Ethernet to computers using WiFi. Since my MacbookPro doesn't have Ethernet port, I used USB Ethernet Adapter.

tcpdump(BSD)

As a Mac user, I recommend you tcpdump instead of Wireshark. Wireshark is great tool but it runs kinda slow. Also, X11 desktop application is not my cup of tea; we are forced to use CTRL key to copy and paste. tcpdump command requires you superuser privilege. If you don't have it, ask it to your mom.
Note that tcpdump on Mac doesn't work like GNU's tcpdump since it's BSD tcpdump.
Make sure that the manual you are refering is a manual for BSD tcpdump, otherwise you are wasting your time looking at wrong documentation: it's like playing video games on Windows.

Case studies

Assumption

device IP Address port protocol
MacbookPro 192.168.20.1 * *
Server brazzers.com 9000 TCP/IP
Android 192.168.20.2 * TCP/IP
  • Android connected to the Internet via Network interface bridge0 on MacbookPro.

All packets coming to your Android device.

sudo tcpdump -i bridge0 -v 'dst 192.168.20.2'

option `-v` triggers verbose mode.

All packets from brazzers.com coming to your Android device.

sudo tcpdump -i bridge0 -v 'dst 192.168.20.2 and src brazzers.com'

All packets from port 9000 at brazzers.com coming to your Android device.

sudo tcpdump -i bridge0 -v 'dst 192.168.20.2 and (src brazzers.com and tcp port 9000)'

Save all raw packets to a file:dump bound from port 9000 at brazzers.com coming to your Android device.

sudo tcpdump -i bridge0 -w dump -v 'dst 192.168.20.2 and (src brazzers.com and tcp port 9000)'

That's All I needed.

Love.

Tokyo onion does matter

Matsuya is a famous Japanese fast-food chain. Unlike other chains, Matsuya provides us a variety of “grilled” menus at lower price. Also, from the viewpoint of hygiene, I prefer Matsuya because at the other restaurant like Sukiya, which is my least favorite, servers serves our dishes without washing their hand after they touched the highly bacteria active bills and coins. (Justin said the same thing) Ew. When it comes to Matsuya, we usually buy a ticket for the meal, which means that servers doesn’t touch any bills and coins during the operation. And of course the most attractive factor of Matsuya dishes is unconditional free Miso-soup to all menus.

So I love Matsuya. And I go there really frequently like 4 days a week basis. Only the downside is that Matsuya is lack of seafoods menus in late hours. After all, despite that fact, I still loved Matsuya.

Suddenly, the problem come up.

Fourth of October, Matsuya suddenly changed the Miso-soup serving system. In the past, they were serving the soup from big jar, but now they serves the soup from the Machine! Machine like one which you can find at Sukiya. Truely, the taste gone bad. More worse, they changes green onion! Damn! They were serving green onions that looks almost white, natural green onion, which I like. Now they serves fucking artificially processed GREEN ONION like the one you can find on Sukiya’s damn beef bowl.

Shame on you, Matsuya.

Hope it’s temporary thing.

Love,

Jiro, the Ramen

Japanese people love ramen. They eat it like they are obsessed. Everyday, how much ramen are consumed in this nation? Well, that is a kind of a question that God can possibly answer. Their love for ramen invented instant ramen. Now, that thingy are loved even by Solid Snake, the famous character on MGS video game series. Moreover, it can be found all over the world nowadays. Okay, this story ain’t about instant ramen invention or its world wide spread. Let’s get back to the topic.

Jiro is the general term declaring Jiro-related or Jiro-inspired ramen shops. Headquater of Jiro is located at Mita near fucking phat university, Keio University. This time, I went to Jiro at Shinagawa with a assistance of @takeshik, a Jiro enthusiast.

We arrived at the shop around 12pm, and found many people were waiting in the line. We waited for about 20 mins. We purchased ticket for ramen. If I remember correctly, there are small Ramen, large Ramen, small fucking Pork Ramen and large fucking Pork Ramen. Even if you purchased the ticket, unless there is not available seat, you can’t go inside of the shop. If you do so, almost Yakuza-looking owner will yell at you. So be careful.

Since I didn’t know about toppings, I just said what my buddy said! There are 4 toppings you can optionally put on your ramen: Vegitable(consisting of cooked bean sprouts and cabbage), Minced Garlic, Pork back fat, Extra sauce.

I said, Vegitable and Garlic.

The day before this, I had attended the ceremony at TOKYO. It was actually 6 minutes ceremony. Anyway, after that, I stayed at the HOTEL. It was kind of scary hotel. All aisles were dark enough to scare me, and my room was dark too even if I turned on all the lights. I was not able to sleep well.

More worse, hard toothbrush was served.

That hard toothbrush made a scratch on my mouth tissue; consequently it made me difficult to enjoy highly garlic-effective ramen. Too much pain. Incapable to overcome. I gave up rest of 20%.

Taste was good. But, I prefer to have no vegitables on top of my ramen.

Minced Garlic is fine. But, you need breath care.

Next time I face you, no scratches in my mouth.

Love,

Jenkins CI: Switching server program jars at build.

The aim

I'm working on Java/Scala project that is deployed as jar file. What I want to do is: When a push is made to github, I want Jenkins to replace the old jar by new jar and launch a new processes from the new jar. In that way, there is no more worries about human error. Note that this is my way of doing it, there should be better way.

Step 1: Installing daemonize

If you spawn a new process from Jenkins post build shell, the build won't finish AFAIK. This happens because Jenkins always wait for child processes to be completed, thus, never ending story. To avoid Jenkins to hung up, we want to daemonize the process as we launches it; hence we need a daemonize command.

 yum install daemonize 

To Daemonize command properly, the daemonize command should be called from root user. Now we add jenkins to sudoers to achive it.

 /etc/sudoers
 jenkins ALL=(ALL)       NOPASSWD:ALL

Note that full path is required for any arguments when you call daemonize command.

Step 2: Killing the old processes

On Jenkins post build action, let Jenkins kill the old processes before launching from new jar. Suppose that jar file name is JarOfHearts.jar. Following bash compatible shellscript kills the processes launched from JarOfHearts.jar.

#!/bin/bash
# Extracting process ids from ps x dump
PIDS=($(sudo ps x | grep -v grep | grep -oP "JarOfHearts.jar" | grep -oP "^\s*[1-9]+[0-9]*" | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g'))
# Killing bastards
for pid in ${PIDS[@]}
do
 echo killing $pid ...
 sudo kill -9 $pid
done
Step 3: Launching new processes from brand new jar.

Finally, launching server programs from the new jar. In this senario, we redirect stdout to /var/log/server.log and stderr to /var/log/server.error.log.

sudo daemonize -o /var/log/$BUILD_NUMBER.server.log -e /var/log/$BUILD_NUMBER.server.error.log /usr/bin/java -classpath /path/to/JarOfHearts.jar main.Main Argument1 Argument2 ...  

End Product

#!/bin/bash
# Extracting process ids from ps x dump
PIDS=($(sudo ps x | grep -v grep | grep -oP "JarOfHearts.jar" | grep -oP "^\s*[1-9]+[0-9]*" | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g'))
# Killing bastards
for pid in ${PIDS[@]}
do
 echo killing $pid ...
 sudo kill -9 $pid
done

echo Assembling jar ...
sbt clean assembly

echo Launching server from new jar ...
sudo daemonize -o /var/log/$BUILD_NUMBER.server.log -e /var/log/$BUILD_NUMBER.server.error.log /usr/bin/java -classpath /path/to/JarOfHearts.jar main.Main Argument1 Argument2 ...  

peace.

TOEICで英語力をのばすための心構え

Greatest Hits

Greatest Hits


中学生の小生は軽い気持ちで、ALTに向かって中指を立て

fuck

と言った。私が初めてfuckを口にした瞬間である。
それを見た、カルメン・アボット先生は、凍り付いたような表情をして、私の中指を覆い隠した。
張りつめた緊張感が彼女の表情から読み取れる。私は、母上に買ってもらった2PacのグレイテストヒッツのPVからの言葉をただ再現しただけだ。だのに、カルメン・アボット先生はおこっているやうだ。小生は何か悪いことをしたのか?そう感じていた。
何かいけないことをしてしまったに違いない。それだけは彼女の表情から明らかだった。英語で毎日日記を書いて仲良くなったカルメン先生との日記交換もこれが原因でできなくなってしまうのか。小生はその一日終止落ち込んでいた。

勉強机に座った小生は、いつもより沈んだ気持ちでメカニカル・ペンシルを握っていた。日記を開く。昨日のページにぎっしりとコメントが書いてある。今日の一件について言及しているようだ。fuckは本当に汚い言葉なので使っては駄目。そしてfuckの意味がどのようなものなのか説明されていた。私は嬉しかった。インターネットも家では使えなかった時代である。いとこに懇願して譲ってもらったぼろぼろのジーニアスを調べても

to have sex

としか書いてない。これでは意味の知りようが無い。わからなかった言葉を実際にその言葉の意味を知っている人にキチンと説明してもらったことが嬉しかった。その新しい言葉が、私の見る世界を広げてくれたのを感じた。

そんな私は、アメリカ合衆国に住みたいという願望を抱きながら、高校、大学と進学する。

その頃だろうか、TOEICという言葉を目にしはじめたのは。小生の通っていた大学ではTOEICの規定点数が単位習得に必須とされた。授業はすべてTOEIC向けの対策授業で、TOEICを強制で受験させられる。私はそこで初めてTOEICの受験をする。初めての受験では800点であった。その後、2年後に2回目受験945点, 3年後に3回目受験で945点, 4年後に4回目受験で980点(2012年2月)を取得した。最初の受験は公開テストではないのでスコアの有効性は無い。現状では、検討がつかないような問題はほぼ無い。凡ミスか集中力切れによる聞き逃しで数問間違えるぐらいだろう。

点数など重要ではない。小生が最も強調したいことは、この点数に至る日々の勉強で、TOEIC用の教材を一切使っていないということである。

小生は、2009/10/13日のmixi日記で以下のように述べている。

初めに言っておく。
TOEICで点数をあげたいだけなら、もうTOEICなんて受けなくていい。
TOEICの点数をあげるために問題集をやるのも、同じ理由で止めた方がいい。

TOEICの点数は、自分の能力を客観的に証明しなきゃいけないから必要であるだけで、点数だけにとらわれて、高得点をとるために勉強するのでは意味はない。

「英語を語学として大成したいという願いの元に、勉強し、結果、高得点がとれる。」

これが正しいTOEIC受験へのあなたのモラールの筋書きである。

(英語の前に、日本語の書き方を勉強しろという突っ込みはご容赦願いたい。)

今年度のスコアはこの文言を自分の身を以て示したことを意味する。

TOEICの問題集や対策本にある英語は死んでいる。

と私は憶っている。脈略も何もない文が本来の言語としての役割を削ぎ取られ、問題としてのせられている。もちろんそのアーティフィシャルな英語をあえて楽しむということにおいては試験問題であっても意味はある。

まあ、要するにもっといい英語を咀嚼していこうじゃないかということである。生きた英語とか言い出すと胡散臭いので辞めておくが、このインターネットの時代、リアルな英語の文章を手に入れるのはそんなに難しくはない。そんな死んだ英語をしかめっ面で見ているよりは、リアルな英語を読んだ方がよっぽどためになる。この方法では、すぐには点数は上がらないかもしれないが、ただ単に問題の数をこなすより、パーシステントに身に付く。

以下、私のオヌヌメする参考書などを紹介する。

人生を変えた一冊 。初学者にはつらいかもしれないが、700点台からの人にはいいのではないだろうか?

Writing Academic English (The Longman Academic Writing Series, Level 4) (4th Edition)

Writing Academic English (The Longman Academic Writing Series, Level 4) (4th Edition)

非常にいい、論理だった文章を英語で書くための知識

英語をしゃべりたい人にお勧めの動画

実は英語がしゃべれないジャパニーズなど日本にはいないのではないだろうか、義務教育で6年は英語を勉強しているのだから。ようは勇気があるかないかである。 恥ずかしがらずにしゃべればいいのである。小生が渡米2週間後に初めて人前でしゃべったときの記録である。こんなゴミ英語でも、レイシストでなければしゃべれば聞いてくれるのである。

生先生

元来彼は、日本語を教えているのだが、英語も学ぶことができる。

ポッドキャストは非常に有用な教材になりうる。しかし選び方に注意していただきたい。ポッドキャストにもレベルがあるので、うまくレベルアップして聞いていかないと、分からなすぎて嫌になってしまう。これより、小生の独断と偏見によるリストアップを行う。簡単なものから難しいものへ

Urban dictionary

一つ一つの単語の説明が非常に面白い。これみているだけで一晩明かせる
http://urbandictionary.com/

eChatバンクーバー [550点前後]

非常に簡単。日本語解説あり。留学生などをゲストに招いて番組を進行。話題は面白い。日系カナダ人がホスト。声がタイプ。全エピソードを消化した。
http://echatvancouver.com/

ESLポッドキャスト [600点前後]

嫌になるぐらいにゆっくりしゃべってくれます。小生が初めて聞いたのはこれでした。にちじょう会話なので内容があんまり面白くない。簡単すぎるので今はもう聞かない。
http://www.eslpod.com/website/index_new.html

TOEIC Upgrader [600点前後]

TOEICの提供するポッドキャスト。内容はESL Podcastに似ている。日本語がへん。全エピソード消化
http://square.toeic.or.jp/kyouzai/englishupgrader/podcast/

British Council Elementary Podcast [650点前後]

ブリティッシュアクセントフェチならこれ。
http://learnenglish.britishcouncil.org/en/elementary-podcasts

The New Boston Live Podcast [750点前後]

ローラがかわいいし、おっぱいが大きいのがポイント。惜しまれつつも番組終了。ペットボトルで見えないときがあるので注意。

BBC Radio 4 [850点前後]

初学者には難しいと思う。
http://www.bbc.co.uk/podcasts/series/cc

CNN Breaking News Podcast [850点前後]

初学者には難しいと思うの。
http://edition.cnn.com/services/podcasting/

カルチャーとしてのファック

fuck という言葉はその字体としての美しさに加えて、実に多様な使い方ができることが知られている。 実際、fuck は意味的な側面からも品詞的な側面からも多様である。 名詞、代名詞、形容詞、副詞、動詞になりえ、それぞれの形態に応じた多くの意味を持つ。

 もともとは、英語の卑猥なFワードとして使われていたこの単語も、今では、英語という箱庭を飛び出し、その他の自然言語にも取り入れられるようになった。現に、日本でもtwitterなどで、元来の記法であるfuckであったり、ファックといったような表現によって使われているのが容易に観察できる。

  いうなれば、fuck は言語に従属する一単語という存在から、多岐にわたるの自然言語にその概念を投影する"文化"へと姿をかえてきたということである。 これは、文化・民族性といったものに影響を受けやすい自然言語群の一要素として極めて珍しいことであるのは言うまでもない。本来文化の従属的存在であるはずの自然言語のさらにその一要素が、従属関係を飛び越えてドメインを再定義したということだ。

 とどのつまり、相異なる自然言語を包括的に再定義したこの言葉をしることは、言語という枠組みのそのさらに上にある何かを見つけることであるといえる。

CodeTime: Write less, talk more.

Motivation

f:id:sumioturk:20120909220649p:plain
As you can see in the motto of jQuery website, doing things with less key-strokes is the name of the game in the recent world of software developments. That is, policy that lets computers do non-creative stuffs and human take care of the rest. In the famous quote we see our goal.

Building more valuable system with less coding is the name of the game. That is important because in the mean time we can play the video games. - Anonymous

We have a good news for that. Apple released their yet another legendary operating system, Mac OS X Mountain Lion. Mountain Lion sometimes scratches you in some ways, but it also listens to you carefully in case you want to talk to it. As some of you know, Mountain Lion comes with sophisticated voice recognition system. I am going to write the code with it. No. I won't really write anything.

Goal

Our goal is to make a classic "hello, world" program in php with only 4 key-strokes. Actually, this is the most important thing to point out, any program can be written with 4 key-strokes! Also, you can write it in any kind of language, but case intensive language should be avoided. You will know why.

<?php echo "hello, world";?>

New Era of Programming

In the ancient IT era, we were typing codes to make computer programs. Now it's done in totally different way; we talk to computers to make computer programs. I'm gonna show you how to do it.

How to

  • Open up your favorite text editor, preferably Vim.
  • Do first 2 key-strokes here. [fn x 2]
  • Consult with your computer
  • Do last 2 key-strokes here . [fn x 2]

How easy is that! Let me show you what I talked with my computer.

less-than-sign question-mark php. 
echo.
open quote
hello comma.
world period
close quote semi-colon.
question mark greater-than-sign.


Notice that I only touched keyboard for 4 times. That's how you fucking write a code.

f:id:sumioturk:20120909220800p:plain
f:id:sumioturk:20120909220820p:plain