2012-03-11から1日間の記事一覧

pacmanのキーサーバを設定する

先日、Arch Linuxをインストールした。 そのときのメモはここ。 いくつかのメモを https://www.jottit.com/zku6z/ にまとめてる。 インストール時に一番ハマったのは、パッケージの署名でのエラーだった。pacmanでパッケージをインストールしようとすると、…

IPアドレスを取得

ip-address(){ local ip=$(LANG=C ifconfig | grep "inet " | grep -v "127.0.0.1" | awk '{print $2}') test -n "$ip" && printf $1 $ip } ip-address [Addr:%s] 参考 http://d.hatena.ne.jp/gunshot/20081216/p1

バッテリーの状態をパーセントで取得

ただしとってもおそい battery-status(){ local dir=/sys/class/power_supply/BAT0 if test -d $dir then local st=$(cat $dir/status) local full=$(cat $dir/charge_full) local now=$(cat $dir/charge_now) local rate=$(expr $now \* 100 / $full) print…