2016年9月29日木曜日

bash 拡張子を変更しつつcopy


$ for i in *.jpg; do cp $i ${i%.jpg}.jpg_uptodate; done

$ for i in *.mp4; do cp $i ${i%.mp4}.mp4_uptodate; done

2016年8月16日火曜日

bash 引数 check

#!/bin/bash

set -eu



if [ $# -ne 1 ]; then
  echo "指定された引数は$#個です。" 1>&2
  echo "実行するには3個の引数が必要です。" 1>&2
  exit 1
fi

2016年8月9日火曜日

sed

[上書き保存]
o Original File保存 -i.org
o 文字列を置換 -e "s/oldstrings/newstrings/"
o File上書き -i

sed -i.org -e "s/ pi --noclear/ PIPI --noclear/" /etc/systemd/system/getty.target.wants/getty@tty1.service



[commnet行削除]
$ sed -e '/^#/d' sample.txt
 
[commnet記号削除] 
$ sed -e 's/^#//' sample.txt

 

2016年7月29日金曜日

連続file作成


bash

$ touch sample_{0..100}.txt


timestamp 2016.08.01 12:59
$ touch -t 2016008011259 sample_{0..100}.txt

2016年6月1日水曜日

tree Command

-N : 日本語File名表示
-C : Color表示

2016年5月12日木曜日

Firefoxのフォントが汚い

Firefoxのフォントが汚い(インク切れのような文字)のに気がついた.

環境
 Windows7 32bit
 Firefox 46.0.1

調査
 chrome, ie, vivaldiは,綺麗に表示されている.

対応
 コントロールパネル - システム - システムの詳細
 詳細設定 - パフォーマンス(視覚効果) - 設定
 スクリーンフォントの縁を滑らかにする ← これをEnable


VirtualBox VM起動しない場合

現象
VirtualBoxをVersion Upしすると(?), VMが起動しなくなった.
Version Up直後は起動した気がしたが...

調査
  • Headless modeだと起動する(よう)
  • 3D Acceleration Option Off/On, ISO Imageで起動 など試したが解決せず
  • VirtualBox再インストールでも解決せず


対処
  1. 起動しなくなったVMを捨てる.
  2. さっさと新たにVMを作成する. この時Diskは, "起動しなくなったVMのDisk" を使用する.