scriptコマンド
上書き overwrite
$ script <logfile_name>
追記 append
$ script -a <logfile_name>
scriptコマンド
$ script <logfile_name>
$ script -a <logfile_name>
Xcode 7以降ではiOSシミュレータで取得したスクリーンショットが画面サイズに連動してしまう。
画面サイズ50%で表示すると、スクリーンショットも実寸大の50%の解像度になってしまう。
スクリーンショットファイル(PNG)保存のショートカットキー : ⌘ + s
Debug => Optimize Rendering for Window Scale
のチェックを外す。
東京ビッグサイトで開催されたMaker Faire Tokyo 2017の会場にて先行発売されていたタミヤのロボット工作セットを購入し、マイコンボード(Arduino Uno)を載せる改造を試みてみました。
XcodeのAnalyze(静的コード解析)において以下の警告がでる。
Null passed to a callee that requires a non-null 1st parameter
nil(null)を渡してはならない引数にnilを渡すケースがある。
全ての動作パスでnilを渡さないように修正する。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <!-- 中略 --> <key>UISupportedInterfaceOrientations~iphone</key> <array> <string>UIInterfaceOrientationPortrait</string> </array> <key>UISupportedInterfaceOrientations~ipad</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> </dict> </plist> |
注:Xcodeからの変更はうまく反映されないため Info.plist をエディタで直接変更する。
旧来の AutoSizing が(デフォルトで)有効になったままで、あたらしい AutoLayout は無効になっている。
UIオブジェクトのプロパティ translatesAutoresizingMaskIntoConstraints が有効になっている。
1 2 3 |
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; indicator.translatesAutoresizingMaskIntoConstraints = NO; // !!! HERE !!! |
UIViewControllerのtopLayoutGuideプロパティを参照する。
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 |
self.upperView.translatesAutoresizingMaskIntoConstraints = NO; self.lowerView.translatesAutoresizingMaskIntoConstraints = NO; NSNumber *vPadding = @0; NSNumber *hPadding = @0; id topGuide = self.topLayoutGuide; UIView *upperView = self.upperView; UIView *lowerView = self.lowerView; NSDictionary *views = NSDictionaryOfVariableBindings(topGuide, upperView, lowerView); NSDictionary *metricsDictionary = NSDictionaryOfVariableBindings(vPadding, hPadding); NSArray *vConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-[vPadding]-[topGuide]-[upperView(100)]-[lowerView]-[vPadding]-|" options:0 metrics:metricsDictionary views:views]; [self.view addConstraints:vConstraints]; NSArray *hConstraints1 = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[hPadding[-[upperView]-[hPadding]-|" options:0 metrics:metricsDictionary views:views]; [self.view addConstraints:hConstraints1]; NSArray *hConstraints2 = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[hPadding[-[lowerView]-[hPadding]-|" options:0 metrics:metricsDictionary views:views]; [self.view addConstraints:hConstraints2]; [self.view layoutIfNeeded]; |
https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/AutolayoutPG/
1 |
$ nohup <command> & |
1 |
$ nohup tar cvzf foo.tgz ./foo & |
ログアウトしたり、リモートターミナルが切断された後もコマンドを継続する。
パーソナルクラウドストレージ(個人向けNAS)製品 "WD Cloud" に、macOS 10.12 (Sierra) から ssh接続を試みると失敗する。
1 2 |
$ ssh -l sshd wdcloud.local Unable to negotiate with 192.168.xx.xx port 22: no matching host key type found. Their offer: ssh-dss |
(macOSに限らず)最新のsshクライアントにおいて、暗号化アルゴリズム ssh-dss がデフォルトでは無効にされている。
1 |
$ ssh -oHostKeyAlgorithms=+ssh-dss sshd@wdcloud.local |
.ssh/config
でssh-cssを有効にする
1 2 3 4 |
Host wdcloud HostName wdcloud.local User sshd HostKeyAlgorithms +ssh-dss |