teppeilog

ちょっとずつエンジンかかってきた

Archive for the ‘ネットワーク’ Category

iOSでマルチキャスト送受信

leave a comment

ブックマーク的メモ

Geekなページ:CFSocketでマルチキャスト送受信

stackoverflow

CFSocket Reference

CFRunLoop Reference

このエントリーをはてなブックマークに追加
はてなブックマーク - iOSでマルチキャスト送受信
Share on Facebook

Written by teppei

4月 8th, 2012 at 6:28 pm

GoogleにClientLoginしてみる

leave a comment

GoogleのAPIを使用するためにClientLogin処理、C2DMを使ってみたいのでRubyで実装してみました。ClientLoginで取得するのは他のサービスを使うために必要なAuthのパラメータなので、それを取り出す。

require 'net/https'
require 'uri'

auth_hash = Hash.new

url = URI.parse("https://www.google.com/accounts/ClientLogin")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
https.verify_mode = OpenSSL::SSL::VERIFY_PEER
https.verify_depth = 5

req = Net::HTTP::Post.new(url.path)

req.set_form_data({
:accountType => 'HOSTED_OR_GOOGLE',
:Email => 'hogehoge@gmail.com',
:Passwd => 'hogehoge',
:service => 'ac2dm',
:source => 'hogetest'
})

https.start do
  res = https.request(req)
  if res.code == "200"
    res.body.split("\n").each do |data|
      key,value = data.split("=")
      auth_hash[key] = value
    end
  end
end

print auth_hash['Auth'] # => 必要なAuth
このエントリーをはてなブックマークに追加
はてなブックマーク - GoogleにClientLoginしてみる
Share on Facebook

Written by teppei

2月 4th, 2011 at 2:30 pm

さくらVPSを借りてまずしたこと

4 comments

さくらVPS借りました。ある意味仕方がなく。色々使う前にいじってみるさ。
いじりはこの辺を参考にしました。

Read the rest of this entry »

このエントリーをはてなブックマークに追加
はてなブックマーク - さくらVPSを借りてまずしたこと
Share on Facebook

Written by teppei

2月 1st, 2011 at 12:59 am

Posted in ネットワーク

Tagged with , ,

screenコマンド

leave a comment

便利なscreenについてメモ。

起動後の操作コマンドは以下

・Ctrl-a c : 新しいウインドウを作成する
・Ctrl-a n : 前方のウインドウに移動
・Ctrl-a p : 後方のウインドウに移動
・Ctrl-a w : ウインドウのリストを表示する。
・Ctrl-a ” : スクリーン上にウインドウのリストを表示する。リスト上はjとkで移動し、Enterで選択。
・Ctrl-a A : 現在のウインドウに名前をつける
・Ctrl-a k : 現在のウインドウを消去
・Ctrl-a d : スクリーンからdetachする

detach(スクリーンから離脱)しても、reattach(復帰)できます。

・screen -list : 現在起動中のscreen一覧を表示する
・screen -r (プロセス名) : 指定のscreenへ復帰する

screenが固まってしまったら!

・Ctrl-a Ctrl-\ : screenをkillするコマンド

基本は以上かな。

このエントリーをはてなブックマークに追加
はてなブックマーク - screenコマンド
Share on Facebook

Written by teppei

9月 15th, 2009 at 12:09 pm

Posted in ネットワーク

Tagged with

scpコマンド

leave a comment

サーバサイドのお仕事が多くなってきたのでメモ。

scpコマンドを使うとホストーホストとか、ローカルーホスト、ホストーローカル間でファイル転送できる。

・ローカルのtest.txtをホストお/home/document/ディレクトリへ転送
$ scp -P ポート番号 -i 鍵 ./text.txt tep-pey@example.com:/home/document
-r オプションをつけるとディレクトリ毎転送できる
$ scp -P ポート番号 -i 鍵 -r ./ tep-pey@example.com:/home/document
・リモートのindex.htmlをローカルのカレントディレクトリに転送
$ scp -P ポート番号 -i 鍵  tep-pey@example.com:/home/document/index.html .
このエントリーをはてなブックマークに追加
はてなブックマーク - scpコマンド
Share on Facebook

Written by teppei

9月 15th, 2009 at 11:16 am

Posted in ネットワーク

Tagged with