JINS PC

JINS PCを買いました。
眼の疲れを防ぐためのメガネです。

さすがに歳なのか、それとも8時間(仕事)+2~6時間(残業or趣味)でモニタを見つめているので、辛い時が多くなりました。
そういや初めてPCを買った時、親にフィルタを買ってもらったなあと思いだして検索したらJINS PCが引っかかりました。
あの当時もCRT15インチのモニタにガバッと被せるタイプで2万くらいした覚えがありましたが、メガネサイズなのでお手頃です。
#今でもモニタ装着タイプもあるようですが、27インチとかだと凄まじく高いので手が出ません

普段はメガネを掛けないので、やはりフレームが視界に入ると違和感があります。それとレンズに暖色系の色が付いているため色見が変わってしまいます。
それ以外は安い割に眼に優しくて気に入ってます。外見もオシャレなので、職場で掛けても違和感はないと思います。

これにブルーベリーのサプリと目薬で完璧です。

windowsでgitを使う

今や大流行のgitをwindowsで使うには、TortoiseGitを使うのが一番簡単。
インストールが終わったら、ディレクトを右クリックでgitのメニューがでるので、お好きにどうぞ。GUIでも操作出来るし、git bashというコマンドラインからも操作できます。

私は基本的にはEclipseのEgitプラグインでやってしまうので、あまり必要はないのですが、たまにupdateでバグったり、Eclipseで管理しないようなドキュメント系のファイルで使ったりします。

大人数での開発でも無い限り、どれでもいいや!という気もしますが
・cvs はリネームができない(たしか削除して新規登録するればできるが履歴が飛ぶ)
・svn はファイルが多いと遅い
などの問題でgitを使ってます。(WEBシステム屋がgit使えないってのもアレだし・・・)
とにかくgitは早いです。Branch切ったら丸々コピーされてるだけで超遅いなんて事もないです。

さすがLinuxカーネルのソースコード管理の為に開発されただけはあります。

関連

CKEditorシリーズにCKFinderがあったのだが、設定が意味不明で断念。
そこで見つけたのがelfinder

ダウンロードして、CSSとIMG,JSを配置しテンプレートから読み込む。

View

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
31
32
33
34
<?php echo $this->Html->css('elfinder.css'); ?>
<?php echo $this->Html->script('elfinder.full.js'); ?>
<?php echo $this->Html->script('i18n/elfinder.jp.js'); ?>
 
<script type="text/javascript" charset="utf-8">
	$().ready(function() {
		var f = $('#finder').elfinder({
			url : '/el_finders/index',
			lang : 'jp',
			docked : true,
			toolbar : [
				['reload'],
				['mkdir', 'upload'],
			],
			dialog : {
				title : 'File manager',
				height : 500
			}
 
			// Callback example
			//editorCallback : function(url) {
			//	if (window.console && window.console.log) {
			//		window.console.log(url);
			//	} else {
			//		alert(url);
			//	}
			//},
			//closeOnEditorCallback : true
		});
		// window.console.log(f)
	})
</script>
 
<div id="finder">finder</div>

問題はファイル操作を実行するPHPの移植。

connectors/php/elFinder.class.php を app/Vendor/elFinder.php に入れる。

ElFindersController.php

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
App::uses('AppController', 'Controller');
App::uses('elFinder', 'Vendor');
 
class ElFindersController extends AppController {
 
	public function index() {
		$opts = array(
			'root'            => '/cakepath/app/webroot/img',                       // path to root directory
			'URL'             => '/img/article/', // root directory URL
			'rootAlias'       => 'img',       // display this instead of root directory name
			'uploadAllow'   => array('images/*'),
			'uploadDeny'    => array(),
			'uploadOrder'   => 'deny,allow',
			//'disabled'     => array(),      // list of not allowed commands
			'dotFiles'     => false,        // display dot files
			// 'dirSize'      => true,         // count total directories sizes
			'fileMode'     => 0666,         // new files mode
			'dirMode'      => 0777,         // new folders mode
			// 'mimeDetect'   => 'internal',       // files mimetypes detection method (finfo, mime_content_type, linux (file -ib), bsd (file -Ib), internal (by extensions))
			// 'uploadAllow'  => array(),      // mimetypes which allowed to upload
			// 'uploadDeny'   => array(),      // mimetypes which not allowed to upload
			// 'uploadOrder'  => 'deny,allow', // order to proccess uploadAllow and uploadAllow options
			'imgLib'       => 'gd',       // image manipulation library (imagick, mogrify, gd)
			// 'tmbDir'       => '.tmb',       // directory name for image thumbnails. Set to "" to avoid thumbnails generation
			// 'tmbCleanProb' => 1,            // how frequiently clean thumbnails dir (0 - never, 100 - every init request)
			// 'tmbAtOnce'    => 5,            // number of thumbnails to generate per request
			// 'tmbSize'      => 48,           // images thumbnails size (px)
			// 'fileURL'      => true,         // display file URL in "get info"
			'dateFormat'   => 'Y M j H:i',  // file modification date format
			// 'logger'       => null,         // object logger
			// 'defaults'     => array(        // default permisions
				// 	'read'   => true,
				// 	'write'  => true,
				// 	'rm'     => true
				// 	),
			// 'perms'        => array(),      // individual folders/files permisions
			// 'debug'        => true,         // send debug to client
			// 'archiveMimes' => array(),      // allowed archive's mimetypes to create. Leave empty for all available types.
			// 'archivers'    => array()       // info about archivers to use. See example below. Leave empty for auto detect
			// 'archivers' => array(
				// 	'create' => array(
					// 		'application/x-gzip' => array(
					// 			'cmd' => 'tar',
					// 			'argc' => '-czf',
					// 			'ext'  => 'tar.gz'
					// 			)
					// 		),
				// 	'extract' => array(
					// 		'application/x-gzip' => array(
					// 			'cmd'  => 'tar',
					// 			'argc' => '-xzf',
					// 			'ext'  => 'tar.gz'
					// 		),
					// 		'application/x-bzip2' => array(
					// 			'cmd'  => 'tar',
					// 			'argc' => '-xjf',
					// 			'ext'  => 'tar.bz'
					//		)
				//	)
			//	)
		);
 
		$fm = new elFinder($opts);
		$fm->run();
	}
}

として完成。これでAuthも通るので管理画面なんかでも使える。