気ままなつぶやき

おべんきょしたこととか

悶々と CVSのクローズについて考える

gitとかいっといて、cvsまだ閉じてなかったのかとか言わないで。。(・-・)

CVSのクローズにあたって・・・

ちなみにOS古め(年期が感じられるな)

$ cat /etc/issue
CentOS release 4.6 (Final)

移行とか

まあ色々CVSにあるものはsvnやらgitやらに移行しました。

  • 基本はGitHub Enterpriseに。
  • 画像の管理に使ってるのかな的なものはsvnに。

て感じの流れで。

可能な限り臨機応変に。
可能な限りサポート。

CVSの停止

さてはて。移行が一段落おわりました。
CVSクローズ宣言を何度周知したかはわかんないくらいしたけどついにクローズの日を迎えました。

でもチキンだから、実は活かしたまま、みんなアクセスできなくなればいい的な対応をしたかった(・-・)

現状

認証:LDAP
ユーザのアクセス:ext+sshLDAPアカウントを使って操作出来る(各拠点、各データセンターから)
プロジェクトユーザ:ビルドツールとかからは、LDAPとは別に、アカウントがある

作戦

sshのポートをかえる

22以外にする。
ポートスキャンされない限りはばれないのでは。。。

実質何も無効化せずにできる。
その気になれば、ポート戻せば、復活。

でも、実質何もはじいてない辺りが私無理・・。
しかもコワイ。あんまりやりたくない。他の方法がいい(・-・)

iptablesで特定ip以外をはじく

私の管理している特定のサーバからのみアクセスできるようにする
これが一番betterかもって考えた(・-・)

コワいのには変わりないけど(・-・)

$ /sbin/iptables --version
iptables v1.2.11


初期状態は基本的には、すべて受け付けている状態

$ /sbin/iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

特定IPの追加して他を拒否

#IP追加
$ /sbin/iptables -A INPUT -s xxx.xxx.xxx.xxx -j ACCEPT
#他を拒否
$/sbin/iptables -A INPUT -s! xxx.xxx.xxx.xxx -j DROP

ぶっちゃけ他を拒否する段階で!は必要ないかもしれないけど、チキンだったのでやってしまった。

これでいけるじゃーんって思ったけど、これによってLDAPアカウント使えなくなった・・・(・-・)
隠しアカウントでもログインできないジャーンって、サーバ再起動した(・-・)

結局のところ、ローカルユーザでログインできるけどLDAPタイムアウトまで結構待たなきゃ行けないという現象であった。

タイムアウト遅すぎて使えなくなったかと思った(・-・)

LDAP無効化

そんなこんなでiptablesは今回はやりたくないってなった。

NWとかはじかずに、LDAPで認証できなくすればいいじゃん。ってなった。
ビルドツール用のアカウントはログインできないようにだけしておく

事前にLDAPじゃないローカルアカウントを作っておいてログインできることを確認。

#LDAPとLDAP認証無効化
$ authconfig --disableldap --disableldapauth

あとは、不要なローカルユーザの無効化

$/usr/sbin/usermod -s /sbin/nologin hoge

これでひとまず。。。

今日はiptablesのコワさで神経使ったやい

追記

CentOS 6.2でそのまま動かなかった

$cat /etc/issue
CentOS release 6.2 (Final)
$LANG=en_US.UTF-8 authconfig --disableldap --disableldapauth --updateall
nslcd を停止中:                                            [  OK  ]
nscd を起動中:                                             [  OK  ]


#確認
$authconfig --test | grep ldap
nss_ldap is disabled
 LDAP server = "ldap://xxx.xxx.xxx.xxx/,ldap://xxx.xxx.xxx.xxx/"
pam_ldap is disabled
 LDAP server = "ldap://xxx.xxx.xxx.xxx/,ldap://xxx.xxx.xxx.xxx/"
##何もかえってこないはず
$ grep ldap /etc/nsswitch.conf 

【JIRA】GHEとの連携

最近、トライアルでJIRAをさわてみてるので、色々メモしてこ〆(._.)メモメモ.

JIRAのバージョンは6.0.3
GHEのバージョンは11.10.314

GHE側の設定

JIRAとGHEはOAuth認証をするので、GHEのクライアントIDを発行しますよ。

Applicationの作成

管理者のアカウントでApplicationを作成します。

Account settingsのページに移動して、Appilicationsを選択。
f:id:pnsk:20130816193954p:plain

Developer applicationsの【Register new application】
f:id:pnsk:20130816194213p:plain


JIRAのホームURLを登録するとクライアントIDとクライアントSecretが発行されるお
発行された画面は割愛。
f:id:pnsk:20130816195211p:plain

JIRA側の設定

管理ユーザでJIRAにログインして「アドオン」タブを選択
f:id:pnsk:20130813181642p:plain

その1「GitHub Enterprise OAuth Settings」の設定をする

f:id:pnsk:20130816193746p:plain

さっきフロー4のところで、GHE側で発行したクライアントIDとクライアントSecretを登録する。
ホストURLはGHEのホームのURLにする
f:id:pnsk:20130816195537p:plain

DVCS Accountsの設定をしまふ

f:id:pnsk:20130813181752p:plain

ボタンぽっちして
f:id:pnsk:20130816195914p:plain

GitHubEnterpriseを選択して、JIRAと連携したいorganazationを指定を登録。
今回は、ideっていうorganazationと連携させてみたよ
f:id:pnsk:20130816200406p:plain

この時、自分が管理権限を持っているorganazationしかできないので注意

できた。repoの内容をsyncしている様子。。syncかー
f:id:pnsk:20130816200442p:plain

なんか連携してみる

f:id:pnsk:20130819175724p:plain
JIRAプロジェクトのJIRA-14という課題チケットと紐づける

GHE側の作業

テスト用のGHEリポジトリつくって
f:id:pnsk:20130816204238p:plain

なんか適当にコミットするときに、課題IDをコミットメッセージに指定すれば良い。

f:id:pnsk:20130819175848p:plain

課題IDをメッセージにいれると、その課題のCommitタブのところでGHEの変更内容が連携される
f:id:pnsk:20130819180006p:plain

リンクに飛ぶと、対象コミットの変更履歴を参照することができる

f:id:pnsk:20130819180050p:plain

また、対象プロジェクトのアクティビティにも表示されるお

f:id:pnsk:20130819180142p:plain

【playframework】2.1.3入れた

紆余曲折ありまして・・・
【playframework】2.0.4いれた - 気ままなつぶやき

playframework入れ直した。現時点の最新の2.1.3

アプリの作成

$ play new sampleApp
       _            _
 _ __ | | __ _ _  _| |
| '_ \| |/ _' | || |_|
|  __/|_|\____|\__ (_)
|_|            |__/

play! 2.1.3 (using Java 1.6.0_37 and Scala 2.10.0), http://www.playframework.org

The new application will be created in /Users/okuda_junko/Documents/workspace/eclipse/sampleApp

What is the application name? [sampleApp]
>

Which template do you want to use for this new application?

  1             - Create a simple Scala application
  2             - Create a simple Java application

> 1
OK, application sampleApp is created.

Have fun!

eclipseの形に変換

$ cd sampleApp/
$ play
Getting org.scala-sbt sbt 0.12.2 ...
:: retrieving :: org.scala-sbt#boot-app
	confs: [default]
	40 artifacts copied, 0 already retrieved (8381kB/170ms)
[info] Loading project definition from /Users/okuda_junko/Documents/workspace/eclipse/sampleApp/project
[info] Set current project to sampleApp (in build file:/Users/okuda_junko/Documents/workspace/eclipse/sampleApp/)
       _            _
 _ __ | | __ _ _  _| |
| '_ \| |/ _' | || |_|
|  __/|_|\____|\__ (_)
|_|            |__/

play! 2.1.3 (using Java 1.6.0_37 and Scala 2.10.0), http://www.playframework.org

> Type "help play" or "license" for more information.
> Type "exit" or use Ctrl+D to leave this console.

[sampleApp] $ eclipse with-source=true

微妙に2.0.4と変換のコマンドがちがうのね

あとはeclipseからimportすればOK

f:id:pnsk:20130812234710p:plain

【Homebrew】updateの時にgitのエラーがでた

playの新しいのを入れたくて、brew updateしようとしたらエラーった(・-・)

$ brew update
error: The following untracked working tree files would be overwritten by merge:
	Library/Formula/log4shib.rb
	Library/Formula/opensaml.rb
	Library/Formula/xml-security-c.rb
	Library/Formula/xml-tooling-c.rb
Please move or remove them before you can merge.
Aborting
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

解決方法

ここにのってるお
homebrew - Brew update failed - Stack Overflow

Formulaのディレクトリに移動してgit fetchする

$cd /usr/local
$git fetch origin
$git reset --hard origin/master

これでOK〆(._.)メモメモ.

アップデートしてみる

$ brew update
Already up-to-date.

ヽ(・∀・)ノ ワチョーイ♪

どうでもいいけど

ちなみにScalaもインストールしたらビールでてきた(・-・)
かわいい・・・(・-・)

$ brew install scala

f:id:pnsk:20130812234159p:plain

【playframework】2.0.4いれた

この前いれたのは1系だったけど今回は2系いれた
【playframework】入門編 windows7 - 気ままなつぶやき

今回はmac

インストール

$brew install play

アプリ作成してみる

$ play new sampleApp
       _            _
 _ __ | | __ _ _  _| |
| '_ \| |/ _' | || |_|
|  __/|_|\____|\__ (_)
|_|            |__/

play! 2.0.4, http://www.playframework.org

The new application will be created in /Users/okuda_junko/Documents/workspace/eclipse/sampleApp

What is the application name?
> sampleApp

Which template do you want to use for this new application?

  1 - Create a simple Scala application
  2 - Create a simple Java application
  3 - Create an empty project

> 1

OK, application sampleApp is created.

Have fun!

なんかscalaかjavaか選択できるようになってるのね。
前からこんなだっけ・・(○゚ε゚○)ワスレター

eclipseで開きたいからeclipseの形式に変換

$cd sampleApp
$ play eclipsify
[info] Loading project definition from /Users/okuda_junko/Documents/workspace/eclipse/sampleApp/project
[info] Set current project to sampleApp (in build file:/Users/okuda_junko/Documents/workspace/eclipse/sampleApp/)
[info] About to create Eclipse project files for your project(s).
[info] Successfully created Eclipse project files for project(s):
[info] sampleApp

playのコンソール経由で実行してみる

$ play
[info] Loading project definition from /Users/okuda_junko/Documents/workspace/eclipse/sampleApp/project
[info] Set current project to sampleApp (in build file:/Users/okuda_junko/Documents/workspace/eclipse/sampleApp/)
       _            _
 _ __ | | __ _ _  _| |
| '_ \| |/ _' | || |_|
|  __/|_|\____|\__ (_)
|_|            |__/

play! 2.0.4, http://www.playframework.org

> Type "help play" or "license" for more information.
> Type "exit" or use Ctrl+D to leave this console.

[sampleApp] $
[sampleApp] $ run

--- (Running the application from SBT, auto-reloading is enabled) ---

[info] play - Listening for HTTP on port 9000...

(Server started, use Ctrl+D to stop and go back to the console...)


起動した

f:id:pnsk:20130812233201p:plain

以前とあんまり変わらないのね。

てかこのバージョン古い(;゚ロ゚)ハッ

 |ョ・ω・`) でもバージョンで方法が微妙に違うっぽいからこのメモは置いておこ

CVSで消したいっぱいのブランチがGHEで復活したお話

CVSでいっぱいあったブランチさんとタグさんを沢山消したんだけど、
GHEに移行したら、ブランチさんが復活してた

unlabeled-xxxxという名前に変わってGHEに存在していた(つωi`。)ツライィ

このへんに書いてるかな。
cvs2svn - dev - why unlabeled Branches will come from cvs2svn

復活しちゃうならブランチは消さなくてよかったな。。

マージしたブランチさんではないので

$git push origin hogebranch

といった感じでブランチを削除すればよい様子。
普通に消す場合はこれでいいお

↓これみた
Git で不要になったローカルブランチ・リモートブランチの削除 - sotarokのお勉強

あとは、ぽちぽちGHE上から消してもいいんだけど、

すっげー数あったので、
cloneしてきて、わっしょーいって削除しますた。

$git branch -a | grep -v master | grep "unlabeled" | sed -e 's% *remotes/origin/%%' | xargs  -I%  git push origin :%

こわいからmasterって名前がついてるのを最初に除外してるのがお味噌

綺麗にいなくなった

(ノωヾ*)ウゥ… (ノω・ヾ*) チラ

【CVS】タグの削除

|ω・`)コソ

CVS撤廃に向けて、わーきゃーしている今日この頃です。

「GHEに移行してねー」
「不要なブランチとかタグとか移行する前に消しておいてねー」

とか言ってたら

「すみません。。。多すぎて消せません」

と連絡が。。

どれどれと見てみたら、タグとブランチ合わせて500個近くあった。。。((((;゚Д゚))))

とかとか、そんな背景がありまして、削除する事となりました。

バージョン確認

$ cvs --version
Concurrent Versions System (CVS) 1.11.17 (client/server)

タグの削除

対象プロジェクトをローカルにチェックアウトしてくる

Project_AをCVSサーバからチェックアウト

$cvs -d :ext:user_name@cvs.hogehost.jp:/usr/local/cvsrepo checkout Project_A
$cd Project_A

タグの状況をみる

チェックアウトしてきたプロジェクト配下に移動して、ブランチやタグの状況をみる

$ cd Project_A
$ cvs status -vl

ここで、タグ一覧が表示されるが

hogehoge  	(branch: 1.1.6)
hagehage	(revision: 1.1)

branchと書いてあるのがブランチでrevisionとなっているのがタグになる

削除

消し方はこんな感じ。

#タグ削除
$cvs rtag -d tag_name Project_A
#タグが削除されていることを確認
$ cvs status -vl | grep tag_name
#ブランチ削除
$cvs rtag -d -B branch_name Project_A
$ cvs status -vl | grep branch_name