2011年8月2日火曜日

Windowsのサーバ情報取得

Windowsのサーバ情報取得メモ

コマンドプロンプトで次を発行します。
> systeminfo

ホスト名: 001-AG                    ##hostnameに記述
OS 名: Microsoft® Windows Server® 2008 Enterprise ##os_nameに記述
OS バージョン: 6.0.6002 Service Pack 2 ビルド 6002 ##releaseに記述
OS 製造元: Microsoft Corporation
OS 構成: スタンドアロン サーバー
OS ビルドの種類: Multiprocessor Free
登録されている所有者: Windows ユーザー
登録されている組織:
プロダクト ID: XXXX-XXXX-XXX-XXX
最初のインストール日付: 2010/05/10, 14:58:25
システム起動時間: 2011/07/24, 12:24:42
システム製造元: Microsoft Corporation
システム モデル: Virtual Machine
システムの種類: x64-based PC ##machine_type,hardware_platform両方に記述
プロセッサ: 1 プロセッサインストール済みです。    ##cpu_coresに記述
[01]: Intel64 Family 6 Model 23 Stepping 10   ##cpu_nameに記述
Intel ~2666 Mhz
BIOS バージョン: American Megatrends Inc. 080002 , 2008/05/05 
Windows ディレクトリ: C:\Windows
システム ディレクトリ: C:\Windows\system32
起動デバイス: \Device\HarddiskVolume1
システム ロケール: ja;日本語
入力ロケール: ja;日本語
タイム ゾーン: (GMT+09:00) 大阪、札幌、東京
物理メモリの合計: 2,047 MB         ##memtotal 2,047,000で入力
利用できる物理メモリ: 535 MB
ページ ファイル: 最大サイズ: 4,331 MB
ページ ファイル: 利用可能: 2,684 MB

kernelにはWindowsと入力
cpu_MHZは入力しません

2011年7月30日土曜日

JavaからGoogleカレンダー登録

JavaからGoogleカレンダー登録のメモ

1. http://code.google.com/apis/gdata/client-java.html から Download the Java client library.」をクリックして「gdata-src.java-1.45.0.zip」を取得。解凍し適当なところへ保存。

2.http://code.google.com/p/google-collections/downloads/list より「google-collect-1.0.zip」をダウンロード。。解凍し適当なところへ保存。

3.Eclipseを起動し
プロジェクト名:GoogleCal(なんでもOK)
プロジェクトを右クリック⇒ビルド・パス⇒外部アーカイブの追加から
[1.より]
・gdata-calendar-2.0.jar
・gdata-core-1.0.jar
・gdata-client-1.0.jar
[2.より]
・google-collect-1.0.jar
を追加

新規クラスを作成「GoogleCalMain.java」を作成

############以下ソース##################

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import com.google.gdata.client.Query;
import com.google.gdata.client.calendar.CalendarService;
import com.google.gdata.data.DateTime;
import com.google.gdata.data.Entry;
import com.google.gdata.data.Feed;
import com.google.gdata.data.Person;
import com.google.gdata.data.PlainTextConstruct;
import com.google.gdata.data.calendar.CalendarEventEntry;
import com.google.gdata.data.extensions.EventEntry;
import com.google.gdata.data.extensions.When;
import com.google.gdata.data.extensions.Where;
import com.google.gdata.util.AuthenticationException;
import com.google.gdata.util.ServiceException;

/**
*
* GoogleCalendar APIで実行
* @version 1.0.0
*/
public class GoogleCalMain {

// Google アカウント
private static String GOOGLE_ACCOUNT = "sangi.XXXXX.X@gmail.com";
// Google アカウントのパスワード
private static String GOOGLE_PASSWORD = "XXXXX.XX";
// 送信URL
private static String GOOGLE_CAL_URL = "http://www.google.com/calendar/feeds/default/private/full";

/**
* Google カレンダーAPIを使用して、登録と参照
* @param args
*/
public static void main(String[] args) {

GoogleCalMain main = new GoogleCalMain();
main.googleCalAddAndRef();

}

/**
* Google カレンダーAPIを使用して、
* 登録と登録したデータの参照を行います。
  *ここを変更し、カレンダに書き込む内容を指定します。
*/
private void googleCalAddAndRef() {

String title = "javaからの登録";

String place = "静岡";

String memo = "テスト";

try {
URL postURL = new URL(GOOGLE_CAL_URL);

// イベント登録クラス
CalendarEventEntry myEntry = new CalendarEventEntry();
// スケジュールのタイトル
myEntry.setTitle(new PlainTextConstruct(title));
// スケジュールの詳細
myEntry.setContent(new PlainTextConstruct(memo));
// 作成アプリ名
Person author = new Person("Mashup Sample Test", null, GOOGLE_ACCOUNT);

myEntry.getAuthors().add(author);

DateTime startTime = new DateTime();
startTime.setTzShift(9);
startTime = DateTime.parseDateTime("2011-07-30T08:00:00");//スケジュール開始を指定

DateTime endTime = new DateTime();
endTime.setTzShift(9);
endTime = DateTime.parseDateTime("2011-07-30T17:00:00");//スケジュール終了を指定

// 開始終了日時をWhen型オブジェクトに代入し、イベントクラスに追加
When eventTimes = new When();
eventTimes.setStartTime(startTime);
eventTimes.setEndTime(endTime);
myEntry.addTime(eventTimes);

// 場所をWhere型オブジェクトに代入し、イベントクラスに追加
Where evLocation = new Where();
evLocation.setValueString(place);
myEntry.addLocation(evLocation);

// Google Calendarサービスに接続
CalendarService calService = new CalendarService("Sangi_Ricoh");//これは何?
calService.setUserCredentials(GOOGLE_ACCOUNT, GOOGLE_PASSWORD);

// スケジュールを追加する
CalendarEventEntry insertEntry = calService.insert(postURL, myEntry);

// 特定のスケジュールを操作するリクエストを取得
URL entryUrl = new URL(insertEntry.getSelfLink().getHref());
EventEntry retrievedEntry = calService.getEntry(entryUrl, EventEntry.class);

// 特定のスケジュールを探す
Query myQuery = new Query(postURL);
myQuery.setFullTextQuery(title);
Feed myResultsFeed = calService.query(myQuery, Feed.class);
if (myResultsFeed.getEntries().size() >= 0) {
Entry firstMatchEntry = myResultsFeed.getEntries().get(0);
System.out.println("Titie: " + firstMatchEntry.getTitle().getPlainText());
}

} catch (MalformedURLException e) {
e.printStackTrace();
} catch (AuthenticationException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ServiceException e) {
e.printStackTrace();
}
}
}


カレンダをみるとスケジュールが追加されています。

参考:
http://d.hatena.ne.jp/jawssame7/20091009/1255064509
http://simultechnology.blendmix.jp/blog/archives/495

2011年7月26日火曜日

Ricoh開発環境準備

Ricoh環境の設定手順です。

1.Dropbox中のeclipseをデスクトップに解凍、Eclipseを起動
2.ファイル->インポート->一般->既存プロジェクトをワークスペースへ
3.%Dropbox\Ricoh\2011年度新規追加\2010年度講習会使用資料\ソースコード\配布用ソースコード\GUI - 6.Full Version を選択
*「プロジェクトをワークスペースへコピー」にチェック


4.manifest.xml ⇒ 333333333.xml に名前を変更
5.ファイル->エクスポート->Java->JARファイル-> 図のようにチェックして出力

出力先は「参照」ボタンを押して
C:\Embedded_Software_Architecture_Emulator_4.13d\cdc-dsdk4\mnt\sd2\sdk\dsdk\dist
を開き
「333333333」という名前の新規フォルダを作成
※「333333333」はマニフェストファイルと同様の名前


「333333333」を開き、
ファイル名に「ScreenSample.jar」を記入し、保存


元の画面に戻り、次へをクリック

6.マニフェストファイルを指定
7.出力した「333333333」にFramework_V2.0.3.jarとScreenSample.dalpをいれておく
dalpはアプリ名と同じ




8.ScreenSample.dalpを編集
[id変更]


[パス確認]



これでOK。あとはエミュレータで取り込んで出力できればいいです。

2011年7月22日金曜日

CCNA,CCENT対策

CCNAシミュレーション対策

・VLAN
VLAN間ルーティング+VTP
スイッチの設定をしっかりやっておく(ルータは設定済み)
CCNA3 9.3.6に実習
1.アドレスデザイン
2.VLAN設定(スイッチ2個)
3.VTP設定

・NATまたはPAT
CCNA4 1.1.4aなど

・DHCP
CCNA4 1.2.6


CCENT対策
・スイッチ
ポートセキュリティ
ALSwitch(config-if)#switchport mode access
ALSwitch(config-if)#switchport port-security
ALSwitch(config-if)#switchport port-security mac-address sticky

・showコマンド
# show cdp neighbors
local interfaceが自分のルータと考える
# show cdp neighbors detail
# show interfaces
違いがわかるようにしておく

・フレームリレー
DLCIの意味

・ケーブルの種類
長さとコスト

・アクセスリスト基本を確認
・無線LAN