Linux_command
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
- [[@IT Linux tips:http://www.atmarkit.co.jp/flinux/ren...
- [[日経リナックス コマンド逆引き大全:http://homepage2.ni...
- [[パクリの Tips 集>UnixTips]]
- [[Linux コマンド(kernel API):http://kazmax.zpp.jp/cmd/p...
----
#contents
*** OS 起動時のサービスの開始/停止設定 [#lc9ebf29]
''COLOR(GREEN){現在の起動時の設定を確認する} ''
[root@rh01 root]# chkconfig --list
kudzu 0:off 1:off 2:off 3:off 4:off ...
syslog 0:off 1:off 2:on 3:on 4:on ...
netfs 0:off 1:off 2:off 3:on 4:on ...
network 0:off 1:off 2:on 3:on 4:on ...
random 0:off 1:off 2:on 3:on 4:on ...
rawdevices 0:off 1:off 2:off 3:on 4:on ...
pcmcia 0:off 1:off 2:off 3:off 4:off ...
( 以下 サービスのリストが続く、サービス名を指定すること...
''COLOR(GREEN){サービスの起動/停止を指定する}''
[root@rh01 root]# chkconfig --list sendmail
sendmail 0:off 1:off 2:on 3:on 4:on ...
[root@rh01 root]# chkconfig --level 2345 sendmail off
[root@rh01 root]# chkconfig --list sendmail
sendmail 0:off 1:off 2:off 3:off 4:off ...
&heart; [[KnoweldgeBase トップページに戻る>Knowledge_Bank...
*** サービス中のポートの検査 [#caea6da0]
''COLOR(GREEN){netstat -ln}''~
例えば http サーバーを起動している場合 80番ポートが LIS...
確認することができる。 WindowsNT 系では netstat -an とい...
[root@muna-linux root]# netstat -ln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Addr...
tcp 0 0 0.0.0.0:32768 0.0.0.0:* ...
tcp 0 0 127.0.0.1:32769 0.0.0.0:* ...
tcp 0 0 0.0.0.0:32771 0.0.0.0:* ...
tcp 0 0 0.0.0.0:139 0.0.0.0:* ...
tcp 0 0 127.0.0.1:783 0.0.0.0:* ...
tcp 0 0 0.0.0.0:111 0.0.0.0:* ...
tcp 0 0 0.0.0.0:6000 0.0.0.0:* ...
tcp 0 0 0.0.0.0: 0.0.0.0:* ...
tcp 0 0 0.0.0.0:22 0.0.0.0:* ...
tcp 0 0 127.0.0.1:631 0.0.0.0:* ...
tcp 0 0 0.0.0.0:23 0.0.0.0:* ...
udp 0 0 0.0.0.0:32768 0.0.0.0:*
udp 0 0 192.168.1.11:137 0.0.0.0:*
udp 0 0 0.0.0.0:137 0.0.0.0:*
udp 0 0 192.168.1.11:138 0.0.0.0:*
udp 0 0 0.0.0.0:138 0.0.0.0:*
udp 0 0 0.0.0.0:854 0.0.0.0:*
udp 0 0 0.0.0.0:111 0.0.0.0:*
udp 0 0 0.0.0.0:631 0.0.0.0:*
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node...
unix 2 [ ACC ] STREAM LISTENING 4659 ...
unix 2 [ ACC ] STREAM LISTENING 4994 ...
unix 2 [ ACC ] STREAM LISTENING 4763 ...
unix 2 [ ACC ] STREAM LISTENING 4762 ...
unix 2 [ ACC ] STREAM LISTENING 44 /...
unix 2 [ ACC ] STREAM LISTENING 4911 ...
unix 2 [ ACC ] STREAM LISTENING 4967 ...
unix 2 [ ACC ] STREAM LISTENING 4976 ...
unix 2 [ ACC ] STREAM LISTENING 5053 ...
unix 2 [ ACC ] STREAM LISTENING 5074 ...
unix 2 [ ACC ] STREAM LISTENING 5118 ...
unix 2 [ ACC ] STREAM LISTENING 5140 ...
unix 2 [ ACC ] STREAM LISTENING 5288 ...
unix 2 [ ACC ] STREAM LISTENING 5319 ...
unix 2 [ ACC ] STREAM LISTENING 6234 ...
unix 2 [ ACC ] STREAM LISTENING 4515 ...
unix 2 [ ACC ] STREAM LISTENING 4669 ...
unix 2 [ ACC ] STREAM LISTENING 4343 ...
unix 2 [ ACC ] STREAM LISTENING 4899 ...
unix 2 [ ACC ] STREAM LISTENING 4353 ...
unix 2 [ ACC ] STREAM LISTENING 4796 ...
[root@muna-linux root]#
&heart; [[KnoweldgeBase トップページに戻る>Knowledge_Bank...
*** Fedra Core に 東風フォント を導入する [#me0e5b9f]
[ Font の実体 ] ( X Font Server を利用している環境 )
Redhat: /usr/share/fonts/
Vine : /usr/X11R6/lib/X11/fonts
[ xfs の設定ファイル ]
/etc/X11/fs/config
Redhat9 のデータ ----------> &ref(rh9_fonts_list.txt);~
Fedra core 1 のデータ -----> &ref(fedra_fonts_list.txt);~
~
Redhat 9.0 config --------> &ref(fs_config_rh9.txt);~
Fedra Core 1.0 config ----> &ref(fs_config_fedra.txt);
~
[ Redhat 9.0 で使われている 東風フォント ]
[root@muna-linux /]# ls -l /usr/share/fonts/ja/TrueType/
合計 9700
-rw-r--r-- 1 root root 1548 1月 31 2003...
-rw-r--r-- 1 root root 8313 5月 5 21:33...
-rw-r--r-- 1 root root 3823 5月 5 21:34...
-rw-r--r-- 1 root root 3823 5月 5 21:34...
-rw-r--r-- 1 root root 4043488 1月 31 2003...
-rw-r--r-- 1 root root 17318 1月 31 2003...
-rw-r--r-- 1 root root 51972 1月 31 2003 k...
-rw-r--r-- 1 root root 17318 1月 31 2003...
Kochi Font Archive -----> &ref(kochi.tgz);~
[東風フォント制作活動終了]~
古川さんによって行われていたフリーのアウトラインフォント...
の制作活動が終了となりました。~
http://www.on.cs.keio.ac.jp/~yasu/jp_fonts.html~
slashdotジャパン「東風フォント製作中止に」: http://slashd...
[ Fedra Core では 東風フォント の代替フォントが組み込ま...
[root@hmuna ja]# ls -l /usr/share/fonts/ja/TrueType/
合計 16444
-rw-r--r-- 1 root root 1548 8月 11 2003...
-rw-r--r-- 1 root root 8343 6月 29 13:26...
-rw-r--r-- 1 root root 3465 6月 29 13:26...
-rw-r--r-- 1 root root 3465 6月 29 13:26...
-rw-r--r-- 1 root root 7770652 8月 11 2003...
-rw-r--r-- 1 root root 17318 8月 11 2003...
-rw-r--r-- 1 root root 8967464 8月 11 2003...
-rw-r--r-- 1 root root 17318 8月 11 2003...
[ Fedra に 東風フォント をコピーして関連ファイルをリネー...
[root@hmuna wk]# ls -l /usr/share/fonts/ja/TrueType/
合計 32108
-rw-r--r-- 1 root root 1548 7月 7 21:49...
-rw-r--r-- 1 root root 1548 8月 11 2003...
-rw-r--r-- 1 root root 8313 7月 7 21:49...
-rw-r--r-- 1 root root 8343 6月 29 13:26...
-rw-r--r-- 1 root root 3823 7月 7 21:49...
-rw-r--r-- 1 root root 3465 6月 29 13:26...
-rw-r--r-- 1 root root 3823 7月 7 21:49...
-rw-r--r-- 1 root root 3465 6月 29 13:26...
-rw-r--r-- 1 root root 7770652 8月 11 2003...
-rw-r--r-- 1 root root 17318 8月 11 2003...
-rw-r--r-- 1 root root 4043488 7月 7 21:44...
-rw-r--r-- 1 root root 17318 7月 7 21:44...
-rw-r--r-- 1 root root 8967464 8月 11 2003...
-rw-r--r-- 1 root root 17318 8月 11 2003...
-rw-r--r-- 1 root root 51972 7月 7 21:44 k...
-rw-r--r-- 1 root root 17318 7月 7 21:44...
単純にコピーしただけでは 動作しなかったので強引に逆に -...
[root@hmuna TrueType]# mv kochi-gothic-subst.ttf kochi-g...
[root@hmuna TrueType]# mv kochi-gothic-subst.tti kochi-g...
[root@hmuna TrueType]# mv kochi-mincho-subst.ttf kochi-m...
[root@hmuna TrueType]# mv kochi-mincho-subst.tti kochi-m...
[root@hmuna TrueType]# mv kochi-gothic.ttf kochi-gothic-...
[root@hmuna TrueType]# mv kochi-gothic.tti kochi-gothic-...
[root@hmuna TrueType]# mv kochi-mincho.ttf kochi-mincho-...
[root@hmuna TrueType]# mv kochi-mincho.tti kochi-mincho-...
[root@hmuna TrueType]# ls -l
合計 32108
-rw-r--r-- 1 root root 1548 7月 7 21:49...
-rw-r--r-- 1 root root 1548 8月 11 2003...
-rw-r--r-- 1 root root 8313 7月 7 21:49...
-rw-r--r-- 1 root root 8343 6月 29 13:26...
-rw-r--r-- 1 root root 3823 7月 7 21:49...
-rw-r--r-- 1 root root 3465 6月 29 13:26...
-rw-r--r-- 1 root root 3823 7月 7 21:49...
-rw-r--r-- 1 root root 3465 6月 29 13:26...
-rw-r--r-- 1 root root 4043488 7月 7 21:44...
-rw-r--r-- 1 root root 7770652 8月 11 2003...
-rw-r--r-- 1 root root 17318 7月 7 21:44...
-rw-r--r-- 1 root root 17318 8月 11 2003...
-rw-r--r-- 1 root root 51972 7月 7 21:44 k...
-rw-r--r-- 1 root root 17318 7月 7 21:44...
-rw-r--r-- 1 root root 8967464 8月 11 2003...
-rw-r--r-- 1 root root 17318 8月 11 2003...
&heart; [[KnoweldgeBase トップページに戻る>Knowledge_Bank...
*** [[Fedra project ミラー:http://fedora.redhat.com/downl...
*** [[Fedra core 3 のソースコードのインストール:http://ww...
Fedora Core 2まではyumコマンドでカーネルソースをダウンロ...
そのため、FTPサイトなどからカーネルソースをダウンロードし...
- まず最初に、unameコマンドでダウンロードすべきバージョン...
# uname -r -m
2.6.9-1.681_FC3smp i686
- 動作しているカーネルのバージョン(2.6.9-1.681_FC3smp)...
- サイトによってディレクトリ構成は異なるが、Fedora/update...
- ダウンロードが終わったら、rootになってrpmコマンドでイン...
# rpm -ihv kernel-2.6.9-1.681_FC3.src.rpm
1:kernel ################################...
- そして、Fedora Core 3独自の設定などを適用したソースを作...
- その際に、unameで調べたCPUのタイプを--targetオプション...
# rpmbuild -bp --target i686 /usr/src/redhat/SPECS/kerne...
作成中ターゲットプラットフォーム: i686
(省略)
- ビルドが終了すると、/usr/src/redhat/BUILD/kernel-2.6.9...
# mv /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9 /usr...
# ls /usr/src/linux-2.6.9/
COPYING Makefile configs include lib ...
CREDITS README crypto init mm ...
Documentation REPORTING-BUGS drivers ipc net ...
MAINTAINERS arch fs kernel scripts
*** Fedra core の yum によるパッケージのアップデート [#cf...
yum の設定ファイル /etc/yum.conf → &ref(yum.conf);~
yum download サイト一覧 ---------→ http://fedora.redhat.c...
+ yum.conf にダウンロード先を設定する ・・・・ yum.conf ...
baseurl=http://ftp.kddlabs.co.jp/pub/Linux/distributions...
+GPG(GNU Privacy Guard )を有効にする ・・・・ yum.co...
gpgcheck=1
+rpm --import /usr/share/rhn/PRM-GPG-KEY-fedora を実行しg...
+yum を自動実行を設定する
chkconfig yum on
+yum サービスを起動状況を確認する
service yum status
+yum サービスを起動する ・・・・ /etc/cron.daily/yum.cron...
service yum start
+/etc/cron.daily/yum.cron の中の yum 自動起動の記述
#!/bin/sh
if [ -f /var/lock/subsys/yum ]; then
/usr/bin/yum -R 10 -e 0 -d 0 -y update yum
/usr/bin/yum -R 120 -e 0 -d 0 -y update
fi
***YUM コマンドの使い方 [#ba9fa039]
-yum list
>利用可能なソフトウェアの一覧を表示させます。
-yum check-update OR yum list updates
>更新可能なパッケージがあるかどうかの確認ができます。
-yum update
>U新しいパッケージがあれば、全て更新します。
-yum install <packagename>
>指定した特定のパッケージをインストールします。(この場合...
-yum search <word>
>パッケージ名をもとにして、その詳細などを検索できます。
-yum info <packagename>
>あるパッケージについての基本情報を表示できます。
All of the above commands can take shell-style wildcards ...
&heart; [[KnoweldgeBase トップページに戻る>Knowledge_Bank...
*** Fedra core 3 で yum を使う方法 [#s6d6965b]
-Fedora Core 3のインストール後、初めてyumコマンドを実行す...
が表示される。
# yum install samba
You have enabled checking of packages via GPG keys. This...
thing. However, you do not have any GPG public keys inst...
download the keys for packages you wish to install and i...
You can do that by running the command:
rpm --import public.gpg.key
For more information contact your distribution or packag...
[root@localhost ~]# rpm --import public.gpg.key
エラー: public.gpg.key: import read failed.
-これは、Fedora Core 3ではパッケージのGPGキーチェックがデ...
# rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora
-これでyumコマンドを使用できるようになる。なお、Fedora Co...
# yum update
Setting up Update Process
Setting up Repo: base
repomd.xml 100% |=========================| 1....
Setting up Repo: updates-released
repomd.xml 100% |=========================| 9...
*** DNS レコードの検索 [#f16e3331]
''COLOR(GREEN){nslookup ドメイン名}''~
DNS サーバーに配信されている ドメイン名のアドレスを検索す...
通常は トップドメイン[ hmuna.com 等 ] を検索するが、ロ...
[ ns1.hmuna.com ]や Web Server [ www.hmuna.com ]など...
して検索することもできる。 このアドレスが不一致になってい...
の更新が正しく行われていないので解析と対策が必要。 DNS サ...
いる場合など、片方の更新がエラーになっている可能性がある...
[root@muna-linux root]# nslookup hmuna.com
Note: nslookup is deprecated and may be removed from fu...
Consider using the `dig' or `host' programs instead. Ru...
the `-sil[ent]' option to prevent this message from appe...
Server: 192.168.1.1
Address: 192.168.1.1#53
...
Non-authoritative answer:
Name: hmuna.com
Address: 210.130.99.82
...
[root@muna-linux root]# nslookup www.hmuna.com
Note: nslookup is deprecated and may be removed from fu...
Consider using the `dig' or `host' programs instead. Ru...
the `-sil[ent]' option to prevent this message from appe...
Server: 192.168.1.1
Address: 192.168.1.1#53
...
Non-authoritative answer:
Name: www.hmuna.com
Address: 210.130.99.82
...
[root@muna-linux root]# nslookup ns1.hmuna.com
Note: nslookup is deprecated and may be removed from fu...
Consider using the `dig' or `host' programs instead. Ru...
the `-sil[ent]' option to prevent this message from appe...
Server: 192.168.1.1
Address: 192.168.1.1#53
...
Name: ns1.hmuna.com
Address: 210.130.99.82
...
&heart; [[KnoweldgeBase トップページに戻る>Knowledge_Bank...
*** パッチの 作成 と 適用 [#y69f6705]
''COLOR(GREEN){diff コマンドを利用してパッチ情報を作成す...
ここでは''-u(unified形式)''を利用してゆくが''-c(context形...
diff -u 変更前ファイル 変更後ファイル > patch.txt
(ファイルの順番に注意。最新は2の方なので)
''COLOR(GREEN){パッチの当て方}''
patch < patch.txt
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- test Thu May 8 14:57:14 2003
|+++ test2 Thu May 8 15:02:48 2003
--------------------------
Patching file test using Plan A...
Hunk #1 succeeded at 1.
done
-ちなみに、パッチを当てると''test.orig''としてtestのバッ...
&heart; [[KnoweldgeBase トップページに戻る>Knowledge_Bank...
*** パッチの適用(2) [#lc30ae7a]
- パッチは diff を用いることで作成できます。この際 -c オ...
-- -c オプションを付けると変更部分の前後関係も記録する co...
- ファイル単位のパッチ作成~
1ファイル毎にパッチを作成するには以下のようにします。
-- FROM_FILE の所に変更前のファイル名
-- TO_FILE の所に変更済みのファイル名
-- PATCH_FILE の所に作成するパッチのファイル名
diff -c FROM_FILE TO_FILE > PATCH_FILE
- ディレクトリの中にある複数のファイルに対して一度にパッ...
-- FROM_DIRECTORY の所に変更前のファイルが入っているディ...
-- TO_DIRECTORY の所に変更済みのファイルが入っているディ...
-- PATCH_FILE の所に作成するパッチのファイル名
diff -c FROM_DIRECTORY TO_DORECTORY > PATCH_FILE
- ディレクトリ以下を全てパッチ作成~
ディレクトリ以下のファイル全てについてパッチを作成する場...
diff -cr FROM_DIRECTORY TO_DORECTORY > PATCH_FILE
-- -r オプションを加えるとディレクトリ以下を階層的に検索...
- ディレクトリ単位のパッチ(追加/削除ファイルも記録)
-- 上記の方法では一方にしか存在しない、つまり追加または削...
-- 追加または削除されたファイルも記録するためには以下のよ...
diff -crN FROM_DIRECTORY TO_DORECTORY > PATCH_FILE
-- -N オプションは、ディレクトリを比較する際、片方のディ...
- パッチの適用には patch コマンドを利用する
-- ファイル単位のパッチ
-- 適用したいファイルの存在するディレクトリ上で以下のよう...
patch < PATCH_FILE
-- ディレクトリ単位のパッチ~
パッチを作成したときと相対的に同じディレクトリにて以下の...
patch -p0 -d . < PATCH_FILE
-- -p オプションは差分作成時の相対ディレクトリを有効にし...
-- -p の後ろの 0 は差分ファイルに記録されている相対ディレ...
-- 1、2 と増えていくと、記録された相対ディレクトリが頭か...
-- -d オプションはパッチを適用するディレクトリを指定しま...
- ディレクトリ単位のパッチ(追加/削除ファイルの再現)
上記の方法では、ファイルの追加はされても削除が行われませ...
patch -p -d . -E < PATCH_FILE
-- -E オプションはパッチ適用後、空のファイルは削除するよ...
*** Redhat 8/9 系で telnet を有効にするには [#z731e883]
/etc/indetd.d/telnet を編集する
service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
disable = no ・・・ 初期値としては、"yes"に
} 成っているが"no"に変える
&heart; [[KnoweldgeBase トップページに戻る>Knowledge_Bank...
***文字コードセットの変更(UTF8->EUC) [#b276e6d3]
Fedoraでは日本語でセットアップしても文字コードセットがUTF...
そこで、文字コードセットをUTF8からEUCに変更する方法です。
-LANGの設定
--「/etc/sysconfig/i18n」を編集し「LANG」および「SUPPORTE...
変更前~
LANG="ja_JP.UTF-8"
SUPPORTED="en_US.UTF-8:en_US:en:ja_JP.UTF-8:ja_JP:ja"
SYSFONT="latarcyrheb-sun16"
変更後~
#LANG="ja_JP.UTF-8"
#SUPPORTED="en_US.UTF-8:en_US:en:ja_JP.UTF-8:ja_JP:ja"
LANG="ja_JP.eucJP"
SUPPORTED="ja_JP.eucJP:ja_JP.ujis:ja_JP:ja"
SYSFONT="latarcyrheb-sun16"
//*** 複数ファイルの文字コードの一括変換 [#uabcd0d5]
// [root@spirit ja_JP_EUC]# for fname in *.hlp; do
// > nkf -e $fname > $fname.hlp_E;
// > done
*** 複数ファイルの拡張子の一括変換 [#j8f6249f]
- http://homepage2.nifty.com/cs/linux_command/re-command/...
- 検討中 (以下はだめだった)
[root@spirit ja_JP_EUC]# for fname in *.hlp.hlp; do
> mv $fname ${fname%.hlp_E}.hlp;
> done
*** [[漢字コードの自動変換:http://masaoo.blogspot.com/200...
root@mythen:# find . *.txt -exec nkf -w --overwrite {} \;
*** CD-ROM から isoイメージを作成する方法 [#g08dbbaf]
- [[mkisofs コマンドを使う方法:http://www.atmarkit.co.jp/...
[root@spirit ~]# mkisofs -r -l -J -o /home/munakata/sh2a...
INFO: EUC-JP character encoding detected by locale set...
Assuming EUC-JP encoded filenames on source file...
use -input-charset to override.
Using FS000 for ./rr_moved/fs (fs)
Using H000 for ./rr_moved/h (h)
(snip)
1.77% done, estimate finish Tue Dec 5 08:04:56 2006
3.55% done, estimate finish Tue Dec 5 08:06:48 2006
(snip)
97.60% done, estimate finish Tue Dec 5 08:05:43 2006
99.37% done, estimate finish Tue Dec 5 08:05:40 2006
Total translation table size: 0
Total rockridge attributes bytes: 1801799
Total directory bytes: 4501504
Path table size(bytes): 20078
Max brk space used f34000
281779 extents written (550 MB)
*** iso イメージを CD-ROM に焼かずにマウントする方法 [#a3...
mount -t iso9660 -o loop (iso image) /mnt/cdrom
*** kernel source code の導入 [#r579bb0c]
- SRPM ファイルを CD-ROM イメージから規定の場所にコピーする
cp /mnt/cdrom/FC...iso /usr/src/redhat/SRPM
cd /usr/src/redhat
rpmbuild --rebuild SRPMS/kernel-util-***
- git clone git://git.kernel.org/pub/scm/linux/kernel/git...
*** Linuxでrootパスワードを忘れた際の復旧方法 [#jbaf915e]
-シングルユーザモードで起動する
--LILOの場合
---電源立ち上げ時に"boot:"と表示されたら"single"シングル...
"-s"など使用している環境によって違います)
---電源立ち上げ時にグラフィカルな画面が表示される場合は[C...
boot:linux single
--GRUBの場合
---起動するカーネルを選択して[E]を押すと起動コマンドの編...
を押します。起動コマンド行の編集でコマンドの末尾に"single...
---※シングルユーザモードでのログイン後にドライブが書込み...
#mount -o remount,rw /
-ログイン後のパスワード変更
--起動後、すぐにrootユーザとしてログインするので"passwd"...
#passwd
現在使用しているパスワードが要求されるので初期パスワード...
Old Password:
新しく設定するパスワードを入力します。
New Password:
確認のために再度、新しく設定するパスワードを入力します。
Retype New Password:
設定が完了したらログアウトします。
#exit
--パスワードの変更を確認する
"root"を入力します。
login: root
次に新しく変更したパスワードを入力してログインできること...
password:
問題無くログイン出来る事を確認したらログアウトします。
#exit
*** vsftpd で root での ftp を許可する方法 [#u438727a]
-Fedora Core 3 付属の vsftpd で root での ftp を許可する...
-初期状態では ftp サーバへ root での接続が出来ない。
-『 root 』と入れただけで【 Permission denined. 】と蹴ら...
# ftp 192.168.11.253
Connected to 192.168.11.253 (192.168.11.253).
220 (vsFTPd 2.0.1)
Name (192.168.11.253:zem): root
530 Permission denied.
Login failed.
- /etc/vsftpd.ftpusers と /etc/vsftpd.user_list 両方から ...
-(設定ファイル /etc/vsftpd/vsftpd.conf で userlist_enabl...
# ftp 192.168.11.253
Connected to 192.168.11.253 (192.168.11.253).
220 (vsFTPd 2.0.1)
Name (192.168.11.253:zem): root
331 Please specify the password.
Password:
230 Login successful.
-その後は ftp で root ログイン可能。
*** 圧縮・解凍コマンド一覧 [#abf55018]
-解凍(伸展)
LEFT:
|拡張子| 圧縮形式| コマンド |h
|.tar.gz または .tgz|gzip |$ tar zxvf 解凍対象|
|.tar.bz2 または .tbz | bzip2 |$ tar jxvf 解凍対象|
|.gz |gzip| $ gunzip 解凍対象 または $ gzip -d 解凍対象|
|.bz2| bzip2| $ bunzip2 解凍対象 または $ bzip2 -d 解凍対...
|.lha または .lzh | LZH |$ lha x 解凍対象|
|.zip |zip |$ unzip 解凍対象|
|.jar|JAR|$ jar xf 解凍対象|
-圧縮
|拡張子|圧縮形式|コマンド|h
|.tar.gz |gzip| $ tar zcvf ファイル名.tar.gz 圧縮対象|
|.tar.bz2| bzip2| $ tar jcvf ファイル名.tar.bz2 圧縮対象|
|.gz |gzip |$ gzip 圧縮対象|
|.bz2 |bzip2 |$ bzip2 圧縮対象|
|.lha |LZH| $ lha c ファイル名.lzh 圧縮対象|
|.zip |zip |$ zip ファイル名.zip 圧縮対象|
|.jar |JAR| $ jar cf ファイル名.jar 圧縮対象|
-tar
--tar にはファイルをまとめる機能しかついていません
--複数のファイルをまとめただけのファイルをアーカイブファ...
--大抵の場合 gzip フィルタを通して tar.gz のように gz 形...
--拡張子 tar.gz は tbz と省略されることもあります
--より圧縮率の高い bzip2 フィルタを通したものが tar.bz2 ...
--拡張子 tar.bz2 は tbz と省略されることもあります
--複数のファイルをまとめて圧縮することができます
--ディレクトリをまとめて圧縮することができます
--主なオプション
|-c (create) | 新しいアーカイブを作成する|
|-x (extract) | アーカイブからファイルを抽出する|
|-v (verbose) | 処理したファイルの一覧を詳しく出力する|
|-z (gzip,unzip) | アーカイブを gzip にファルタする|
|-j (bzip2) | アーカイブを bzip2 にフィルタする|
-gzip, gunzip
--gzip で圧縮されるファイルの拡張子は ,.tgz です
--gunzip という解凍用コマンドも持っています
--gnuzip が認識する拡張子は .gz,-gz,.z,-z,_z,.Z,.tg...
--tar のフィルタとしても使われます
--解凍は gunzip で行います
--主なオプション
|-d (decompress) | 解凍(伸展)する|
|-c (stdout) | 出力を標準出力に書き出し,元ファイルは変更...
|-l (list) | 圧縮された個々のファイルについての情報を列挙|
|-r (recursive) | ディレクトリ構造を再帰的にたどる|
-bzip2, bunzip2
--gzip より高い圧縮率を持っています
--解凍時に認識される拡張子は .bz2, .bz, .tbz2, .tbz です
--tar のフィルタとしても使われます
--解凍は bunzip2 で行います
--主なオプション
|-d (decompress) | 解凍(伸展)する|
|-c (stdout) | 出力を標準出力に書き出し,元ファイルは変更...
|-z (compress) | 起動された名前にかかわらず圧縮|
-zip, unzip
--zip は Windows でよく使われる圧縮形式です
--解凍は unzip で行います
--複数のファイルをまとめて圧縮することができます
-lha
--lha は LZH の圧縮形式を扱います
--LZH は Windows でよく使われる圧縮形式です
--LZH は日本人によって作られた圧縮形式です
--複数のファイルをまとめて圧縮することができます
--主なオプション
|x | アーカイブファイルからファイルを抽出する|
|c | アーカイブファイルの作成する|
-JAR
--J2SE SDKに含まれているコマンドです
--Javaプログラムの実行に必要なクラスファイルやデータファ...
--主なオプション
LEFT:|c | アーカイブを新規作成する |
|t | アーカイブの内容を一覧表示する |
|x | 指定の(またはすべての)ファイルをアーカイブから抽出...
|u | 既存アーカイブを更新する |
|v | 標準出力に詳細な出力を生成する |
|f | アーカイブファイル名を指定する |
|m | 指定のマニフェストファイルからマニフェスト情報を取り...
|O | 格納のみ.ZIP 圧縮を使用しない |
|M | エントリのマニフェストファイルを作成しない|
|i | 指定の jar ファイルのインデックス情報を生成する|
|C | 指定のディレクトリに変更し,以下のファイルを取り込 |
*** 実行中のシステムの情報を表示する(uname -r -m)[#oe89f9...
- uname は起動されたマシンと OS に関する情報を出力する。...
uname は -s オプションが指定されたかのように動作する。複...
指定された場合には、選択された情報は ‘snrvm’ の順に空白で...
+ -m, --machine : マシン (ハードウェア) のタイプを表示す...
+ -n, --nodename : マシンのネットワークノードのホスト名を...
+ -r, --release : OS のリリースを表示する。
+ -s, --sysname : OS の名称を表示する。
+ -v : OS のバージョンを表示する。
+ -a, --all : 以上の情報すべてを表示する。
+ --help : 標準出力に使用方法のメッセージを出力して正常終...
+ --version : 標準出力にバージョン情報を出力して正常終了...
*** Linux システム稼働状況の取得 [#o3ff5fcf]
Linux には、複数のリソースチェックコマンドが用意されてい...
- top コマンド
-- オプションを指定する事により、他のアプリケーションやフ...
[root@power root]# top -b -n 1
top - 10:14:01 up 17 days, 21:34, 4 users, load averag...
Tasks: 146 total, 1 running, 145 sleeping, 0 stopped...
Cpu(s): 6.3% us, 0.6% sy, 0.0% ni, 89.9% id, 3.1% wa...
Mem: 1034748k total, 979436k used, 55312k free, ...
Swap: 2048248k total, 48k used, 2048200k free, ...
PID USER PR NI VIRT RES SHR S %CPU %MEM TI...
1 root 16 0 3368 460 392 S 0.0 0.0 0:0...
2 root 34 19 0 0 0 S 0.0 0.0 0:0...
3 root 5 -10 0 0 0 S 0.0 0.0 0:0...
4 root 6 -10 0 0 0 S 0.0 0.0 0:0...
--"load average" の項目が、1プロセッサあたりの瞬間の処理...
--"CPU status" の項目が CPU 使用率を表し、左からユーザモ...
--"Mem" の項目は、メモリ容量を表し、合計、使用中、空き、...
られているメモリです。
--"Swap" の項目は、Swap の利用状況を表し、合計、使用中、...
上記 top コマンドをファイルに取るか、popen で取得し、必要...
- w, uptime コマンド
[root@power root]# w
10:12:42 up 17 days, 21:33, 4 users, load average: 0....
USER TTY FROM LOGIN@ IDLE JCPU...
root :0 - 22Oct05 ?xdm? 16:52 ...
root pts/2 114.8.221.202.ts 10:11 0.00s 0.00s...
root pts/1 114.8.221.202.ts 09:46 23:39 0.00s...
[root@power root]# uptime
10:13:20 up 17 days, 21:33, 4 users, load average: 0....
-- 左から現在時間、システム稼働時間、ログインユーザ数、過...
-- Load average 情報は、top, w, uptime コマンド共、/proc/...
いるみたいです。
-vmstat コマンド
[root@power root]# vmstat
procs -----------memory---------- ---swap-- -----io---- ...
r b swpd free buff cache si so bi bo ...
0 0 48 54672 136364 428548 0 0 8 17 ...
-- procs
--- r: 実行待ちプロセス数
--- b: 割り込み不可のスリープ状態にあるプロセス数
--- w: スワップアウトされている実行可能なプロセス数
-- memory
--- swpd: 仮想メモリの容量 (kbytes)
--- buff: バッファに使用されているメモリの容量 (kbytes)
--- cache: キャッシュに使用されているメモリの容量 (kby...
-- swap
--- si: スワップインされているメモリの容量 (kbytes/s)
--- so: スワップアウトされているメモリの容量 (kbytes/s)
-- io
--- bi: ブロックデバイスに送られてブロック (blocks/s)
--- bo: ブロックデバイスから受け取ったブロック (blocks...
-- system
--- in: 1秒当たりの割り込み回数
--- cs: 1秒当たりのコンテキストスイッチ回数
-- cpu
--- us: ユーザモードの CPU 使用率
--- sy: システムモードの CPU 使用率
--- id: アイドル時の CPU 使用率
--sysstat パッケージを使用して CPU 使用状況レポートの作成...
*** パッケージがどの RPM に含まれているかを確認する方法 [...
- 特定のプログラムのインストールポイントの確認
[root@power root]# which iptables
/sbin/iptables
- このプログラム(ここでは iptables )をインストールした ...
[root@power root]# rpm -qif /sbin/iptables
Name : iptables Relocations: ...
Version : 1.2.9 Vendor: ...
Release : 2.3.1 Build Date: ...
Install Date: 2004年12月24日 16時55分59秒 Build Hos...
Group : システム環境/ベース
Source RPM: iptables-1.2.9-2.3.1.src.rpm
Size : 383050
License : GPL
Signature : DSA/SHA1, 2004年05月07日 08時10分10秒, Key...
Packager : Red Hat, Inc. <http://bugzilla.redhat.com/...
URL : http://www.netfilter.org/
Summary : Linux のパケットフィルタリング機能を管理す...
Description : Iptables ユーティリティは、ネットワークパ...
コードをLinux カーネルの中で制御します。フ...
マスカレードをセットアップする必要がある場...
をインストールする必要があります。
- この RPM で同時にインストールされるファイル名の確認
[root@power root]# rpm -ql iptables-1.2.9-2.3.1
/etc/rc.d/init.d/iptables
/etc/sysconfig/iptables-config
/lib/iptables
/lib/iptables/libipt_CLASSIFY.so
/lib/iptables/libipt_CONNMARK.so
/lib/iptables/libipt_DNAT.so
/lib/iptables/libipt_DSCP.so
/lib/iptables/libipt_ECN.so
/lib/iptables/libipt_LOG.so
/lib/iptables/libipt_MARK.so
/lib/iptables/libipt_MASQUERADE.so
/lib/iptables/libipt_MIRROR.so
/lib/iptables/libipt_NETMAP.so
*** プログラムにシンボル情報が付いているかを確認する方法 ...
- シンボル情報の有無の確認
[root@power root]# file /sbin/iptables
/sbin/iptables: ELF 32-bit LSB executable, Intel 80386, ...
for GNU/Linux 2.2.5, dynamically linked (uses shared lib...
-- "stripped" がシンボル情報が削除されている.... という...
- strip コマンドによるシンボル情報削除
[root@power root]# strip (プログラム名)
[root@power root]# strip -s (ライブラリー名)
- 特定のディレクトリ下のプログラムのシンボル情報の有無を...
#!/bin/sh
cd (ターゲットディレクトリ)
for i in `find . -type f`
do
A=`file $q | grep archive`
if [[ ! -z $A ]] ; then
strip 0S $1
fi
B=`file $1 | grep "not stripped"`
if [[ ! -z $B ]] ; then
C=`echo $1 | grep lib`
if [[ ! -z $C ]] ; then
strip -S $1
else
strip $1
fi
fi
done
*** プログラムが使用しているシステムコールの表示 ( strac...
- straceコマンドを利用することで、任意のプロセスが使用し...
[root@power root]# strace /sbin/iptables
execve("/sbin/iptables", ["/sbin/iptables"], [/* 27 vars...
uname({sys="Linux", node="power.hmuna.com", ...}) = 0
brk(0) = 0x9ea8000
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No ...
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=85651, ...}) = 0
old_mmap(NULL, 85651, PROT_READ, MAP_PRIVATE, 3, 0) = 0x...
close(3) = 0
open("/lib/libdl.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0...
fstat64(3, {st_mode=S_IFREG|0755, st_size=16708, ...}) = 0
old_mmap(0x4b3000, 12412, PROT_READ|PROT_EXEC, MAP_PRIVA...
old_mmap(0x4b5000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVA...
close(3) = 0
open("/lib/tls/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0...
fstat64(3, {st_mode=S_IFREG|0755, st_size=1459344, ...})...
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|M...
old_mmap(0x395000, 1162188, PROT_READ|PROT_EXEC, MAP_PRI...
old_mmap(0x4ab000, 16384, PROT_READ|PROT_WRITE, MAP_PRIV...
old_mmap(0x4af000, 7116, PROT_READ|PROT_WRITE, MAP_PRIVA...
close(3) = 0
mprotect(0x4b5000, 4096, PROT_READ) = 0
mprotect(0x4ab000, 4096, PROT_READ) = 0
mprotect(0x391000, 4096, PROT_READ) = 0
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7f97...
munmap(0xb7f98000, 85651) = 0
write(2, "iptables v1.2.9: ", 17iptables v1.2.9: ) ...
write(2, "no command specified", 20no command specified)...
write(2, "\n", 1 ) = 1
write(2, "Try `iptables -h\' or \'iptables -"..., 61Try ...
exit_group(2) = ?
[root@power root]#
*** プロセスの親子関係を表示するコマンド [#b1dfbb19]
- pstrace コマンド
[root@power root]# pstree
init─┬─acpid
├─2*[antivir]
├─atd
├─avgated
├─avgatefwd───2*[avgatefwd]
├─bonobo-activati
├─cannaserver
├─clock-applet
├─courierlogger───authdaemond.pla───5*[authdaemond....
├─4*[courierlogger]
├─3*[couriertcpd]
├─couriertcpd───couriertls───imapd
├─cpuspeed
├─crond
├─cupsd
├─dbus-daemon-1
├─dhcpd
├─eggcups
├─events/0─┬─aio/0
│ ├─kacpid
│ ├─kblockd/0
│ ├─khelper
│ └─2*[pdflush]
├─firefox───run-mozilla.sh───firefox-bin
├─gconfd-2
*** Fedra core デバイスドライバー(モジュール)の追加 [#g...
- ドライバーのインストールされる場所
/lib/modules/(2.6.xx-kernel 名)/kernel/drivers
- ドライバー(モジュール)のインストール
modprobe (パス)ドライバー名[xxx.ko]
上記のデフォルトパスの場合にはパス名の指定は不要
- システム起動時のドライバーのローディング設定 → /etc/mod...
*** Linux (UNIX) 環境変数の有功範囲 [#v6fe7aad]
- 質問
> init.sh実行後にexportを確認したのですが
> LD_LIBRARY_PATH=/usr/local/pkg/directfb/libが追加され...
>
> コンソールでexport LD_LIBRARY_PATH=/usr/local/pkg/dire...
> 入力すると正しく追加され、df_andiも実行できるようにな...
>
> シェル内ではexportできないのでしょうか?
> 恐れ入りますが、ご対応の程お願い致します。
- 回答
-- UNIX の一般論ですが、シェル・スクリプトで export して...
-- &color(red){export コマンドは、実行したシェルの環境変...
-- 環境変数は、実行中のプロセスに動的に確保される領域で、...
-- 一度、プロセスが起動した後は、直接、実行中のプロセスの...
-- bash などの場合、これが export コマンドであり、C 言語...
- また、シェルのプロンプトでシェル・スクリプトを実行しる...
-- つまり、親プロセスの環境変数領域には影響しないため、シ...
-- &color(red){ ただし、};
% . init.sh ~
&color(red){のような実行の仕方をした場合は、別プロセスを...
*** ロードされたモジュールを確認する [#w9a7eae4]
- lsmod を利用する
[root@spirit ~]# lsmod
Module Size Used by
i915 81221 2
parport_pc 24577 1
lp 12077 0
parport 37129 2 parport_pc,lp
i2c_dev 11329 0
i2c_core 22081 1 i2c_dev
sunrpc 162725 1
iptable_filter 2753 1
ip_tables 16705 3 ipt_REJECT,ipt_state,ipt...
button 6481 0
*** /dev/ttyS0 (シリアルポート) にアクセスできない [#h78c...
- デバイスファイルのパーミッションを変更する
[root@spirit ~]# ls -al /dev/ttyS0
crw-rw---- 1 root uucp 4, 64 5月 20 23:04 /dev/ttyS0
[root@spirit ~]# chmod o+rw /dev/ttyS0
[root@spirit ~]# ls -al /dev/ttyS0
crw-rw-rw- 1 root uucp 4, 64 5月 20 23:04 /dev/ttyS0
*** minicom の起動 [#m404e92e]
[root@spirit ~]# minicom -o -s
- -o = 初期化をしない
- -s = セットアップメニューを表示
-- セットアップ情報をファイルに指定しておくと次回からは....
*** minicom の終了 [#tc079ce1]
- CTRL + Z、 A でメニューが出る
- Q で終了 (リセットして終了)
*** minicom が文字化けする ( Cent OS ) [#zf152b70]
- Cent OS の文字コードセットは UTF-8
- minicom は sjis か EUC を想定している
- Cent OS にバンドルされた minicom を起動するには
[root@spirit ~]# LANG=ja_JP.eucJP xterm &
-- 起動した xterm 上で minicom を実行する
-- sjis の場合には jp_JP.ujisJP で起動する
[root@spirit ~]# minicom -o (セットアップファイル名)
*** sudo が使えるようにする [#w56c1338]
- visudo コマンドで /etc/sudoers を編集する
[root@spirit ~]# cat /etc/sudoers
( snip )
# User privilege specification
root ALL=(ALL) ALL
munakata ALL=(ALL) NOPASSWD: ALL <---- 追加する
- sudoグループがに関する記述があると個別ユーザーやグルー...
メントアウトする。
-- &color(red){#};%sudo ALL=(ALL:ALL) ALL
*** sudo で複数コマンドを実行する [#z9a4335d]
- sudo sh -c 'whoami; whoami'
*** rsync によるサーバー間のディレクトリ同期 [#jb497b27]
- コマンド説明 → http://www.infoscience.co.jp/technical/r...
-- --exculde でバックアップしないファイルを指定することが...
-- --exclude には一つのパターンしか指定できない。 一回の...
-- パスワード無しで実行させるために "-i" で証明書を指定す...
- 同一サーバー内のファイルバックアップ ( cp -ur よりずっ...
-- &color(blue){rsync -avz };&color(red){(ソースファイル)...
[root@spirit cron.daily]# cat /etc/cron.daily/mail_daily...
#!/bin/sh
# stop mail delivery serice
service postfix stop
# backup each Maildir updates files
rsync -avz /home/munakata/Maildir /opt/backup/mail/mu...
rsync -avz /home/public_mail/Maildir /opt/backup/mail/pu...
rsync -avz /home/stored_mail/Maildir /opt/backup/mail/st...
# restart mail delivery serice
service postfix start
- Server_A -> Server_B
&color(red){この項、未完成。 検証後に作文すること};
#!/bin/sh
# sync server:/home/httpd/html to client:/work/html
while [ -n "$(echo $1 | grep '^-')" ]; do
options="$options $1"
shift
done
rsync -auv $options --exclude "*~" server:/home/httpd/ht...
- Server_A -> Server_B ( 完全同期=コピー元で削除されたフ...
[root@backup script]# cat ./peewee_sync.sh
#!/bin/sh
# sync spirit.hmuna.com master peewee data to "backup.hm...
while [ -n "$(echo $1 | grep '^-')" ]; do
optins="$options $1"
shift
done
rsync -avx --delete -e ssh $options --exclude "*~" spiri...
- 参考 URL
-- [[rsyncでお手軽バックアップ:http://linux.paken.org/ind...
-- [[パソコンおやじ:http://www.aconus.com/~oyaji/backup/r...
-- [[Backup by rsync (+ssh):http://www.double-h.com/linux...
-- [[rsync ssh で鍵交換によりパスワードを入力しないで実行...
*** Linux 環境変数の設定 [#k19f2417]
- ユーザーがログインすると まず /etc/profile を読み込み...
- (ROOT)/.bash_profileが存在しない場合は、(ROOT)/.bash_lo...
- ログイン時に一度設定すればいいものは.bash_profileに指定...
- (ROOT)/.bashrc は、プロセスとしてbashを起動される毎に読...
-- ログイン後でも $bash などとして新しくbashを起動するた...
-- ゆえに bash を起動するたびに設定したい環境変数は .bas...
-- どちらも同じ場合には .bash_profile には source .bash...
- &color(red){これらの環境変数設定ファイルを編集しただけ...
-- &color(red){いったんログアウトしてもう1度ログインし直...
-- &color(red){sourceコマンドを使って環境変数を再初期化す...
[root@spirit ~]# source /etc/profile <--- 環境変数の...
-- /etc/profiled の下の起動シェルスクリプトを呼び出すこと...
[root@spirit ~]# ls -l /etc/profile.d/
合計 96
-rwxr-xr-x 1 root root 720 8月 23 2005 colorls.csh
-rwxr-xr-x 1 root root 713 8月 23 2005 colorls.sh
-rwxr-xr-x 1 root root 192 2月 22 2005 glib2.csh
-rwxr-xr-x 1 root root 190 2月 22 2005 glib2.sh
-rwxr-xr-x 1 root root 58 3月 8 23:13 gnome-ssh-ask...
-rwxr-xr-x 1 root root 70 3月 8 23:13 gnome-ssh-ask...
-rwxr-xr-x 1 root root 218 3月 9 06:49 krb5.csh
-rwxr-xr-x 1 root root 210 3月 9 06:49 krb5.sh
-rwxr-xr-x 1 root root 2182 3月 9 12:35 lang.csh
-rwxr-xr-x 1 root root 2470 3月 9 12:35 lang.sh
-rwxr-xr-x 1 root root 122 2月 22 2005 less.csh
-rwxr-xr-x 1 root root 108 2月 22 2005 less.sh
-rwxr-xr-x 1 root root 13 8月 22 2005 vim.csh
-rwxr-xr-x 1 root root 181 8月 22 2005 vim.sh
-rwxr-xr-x 1 root root 170 2月 22 2005 which-2.sh
- 設定されている環境変数の確認
-- echo → 任意の環境変数を指定して設定内容を確認する
[root@spirit ~]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/us...
-- export → 現在設定されている環境変数の一覧
[root@spirit ~]# export
declare -x ANT_HOME="/usr/local/ant-1.6.5"
declare -x CATALINA_BASE="/usr/java/tomcat-5.5.17"
declare -x CATALINA_HOME="/usr/java/tomcat-5.5.17"
*** LD_LIBRARY_PATHが無効になってしまう問題 ( [[fedora J...
- .bash_profile内でLD_LIBRARY_PATHの設定をして、Xでログイ...
それ以外の.bash_profile内で定義した変数は通常通り有効にな...
- [ctrl+alt+F1]で端末を切り替えて、テキストログインすると...
- 結局、こう言う事でしょうか?
man bashから
bash が対話的なログインシェルとして起動されるか、 --logi...
起動されると、 /etc/profile ファイルが存在すれば、 bash ...
このファイルを読んだ後、 bash は ~/.bash_profile, ~/.bas...
bashは 、 この中で最初に見つかり、かつ読み込みが可能であ...
noprofile オプションを使ってシェルを起動すれば、この動作...
ログインシェルが終了するときには、 ~/.bash_logout ファイ...
ログインシェルでない対話的シェルとして起動されると、 ~/....
コマンドを読み込み、実行します。この動作は --norc オプシ...
--rcfile file オプションを使うと、コマンドの読み込みと実...
これと、
http://lists.debian.or.jp/debian-users/200209/msg00356.h...
*** プログラムの実行結果を画面(stdout)に出力しない [#z9...
LEFT:
|意 味 |Bシェル| Cシェル |BAシェル|h
|標準出力をfに書く |>f| >f| >f|
|標準入力をfから読み込む| <f| <f| <f|
|標準出力をfに追加する | >>f| >>f| >>f |
|標準エラー出力をfに書く| 2>f| 無し| 2>f|
|標準エラー出力をfに追加する| 2>>f| 無し |2>>f|
|標準エラー出力を標準出力と同じところに書く |2>&1| 無し| ...
|COLOR(red):標準出力,標準エラー出力,ともにfに書く|COLOR...
|標準出力,標準エラー出力,ともにfに追加する| >>f 2>&1 |>...
|標準出力を強制的にfに書く | 無し |>!f| 無し |
|標準出力を強制的にfに追加する| 無し| >>!f| 無し|
- &color(blue){プログラムの実行結果を出さない ⇒ コマン...
- &color(blue){エラーも画面に出さない ⇒ コマンド > /dev/...
*** [[正規表現(Regular Expressions)>RegularExpressions]]...
- &ref(正規表現 _ Evernote Web.pdf);
- &ref(正規表現辞典_改定版新版.pdf);
*** [[sed(Streaming Editor)>STreamingEditor]] [#xee7ccaa]
*** Log Watch の設定 [#d4e81be1]
- Log Watch で Amavisd New のログを出さない設定 /etc/log...
[root@spirit ~]# chmod 000 /etc/log.d/scripts/services/a...
[root@spirit ~]# ls -l /etc/log.d/scripts/services/
合計 772
-rwxr-xr-x 1 root root 1519 8月 23 2005 afpd
---------- 1 root root 7326 8月 23 2005 amavis
-rwxr-xr-x 1 root root 592 8月 23 2005 arpwatch
-rwxr-xr-x 1 root root 3487 8月 23 2005 automount
- Log Watch のレポート内容 (permission deny と表示され...
--------------------- amavis Begin ---------------------...
sh: /etc/log.d/scripts/services/amavis: Permission denied
---------------------- amavis End ----------------------...
*** 24時間以上古いファイルの削除 ⇒ find の -mtime オプシ...
- &color(blue){''-mtime +n の書式 = (n+1) * 24h''};
+ mtime +0 : 今から24時間以上前のファイル
+ mtime +1 : 今から48時間以上前のファイル
+ mtime +2 : 今から72時間以上前のファイル
- 現在のディレクトリ下で 24時間以上前のファイルを削除する
[root@spirit Maildir]# find /home/headline/Maildir/cur -...
- 参考 URL = http://sonic64.com/2005-07-06.html
*** サブディレクトリ以下を再帰的に削除 [#r94d4a67]
find ./ -name *.tex~ -exec rm {} \;
- rmi とすれば確認付きになる
*** FC5 が selinux の影響で起動できない (HP ProLiant )[#s...
- http://www.linuxquestions.org/questions/showthread.php?...
checking filesystems
FSCK.ext3: permission denied while trying to open /dev/i...
You must have r/w access to the filesystem or be root ( ...
An error occured during the file system check
Dropping you to a shell; the system will reboot
When you leave the shell
Warning ---SELinux is active
Disabling security, enforcement for system recovery
Run 'setenforce 1' to reenable
Give root password for maintenance
( or type control-D to continue )
- インストールCDでマシンをブートして :linux rescue でレ...
- インストールボリュームが /mnt/systeminage (?) にマウン...
- その位置から /mnt/systemimage/etc/selinux/config の中身...
selinux=disabled
- exit でシェルを抜けて、自動リブートで正常に起動する
*** 文字コードセットを Ja_JP.eucJP に変更後に man ページ...
- インストールされている man 関連ファイルを yum で一度...
[root@spirit]#yum remove man
[root@spirit]#yum remove man-pages.noarch
[root@spirit]#yum remove man-pages-ja.noarch
- lv (less の代わりの日本語対応ファイルビューワー) をイン...
-- [[lv ホームページ:http://www.ff.iij4u.or.jp/~nrt/lv/#e...
-- lv のビルド、インストール
[root@spirit Downloads]# cd lv451
[root@spirit lv451]# cd build/
[root@spirit build]# ../src/configure
[root@spirit build]# make
[root@spirit build]# make install
[root@spirit build]# lv -V
# lv v.4.51 (Jan.16th,2004)
# All rights reserved. Copyright (C) 1996-2004 by NARITA...
# ABSOLUTELY NO WARRANTY; for details type `lv -h'
[root@spirit build]# /usr/bin/makewhatis
[root@spirit build]# which lv
/usr/local/bin/lv
- 日本語 man ページデータをインストールする
-- [[マニュアルアーカイブ [man-pages-ja-20060915] のダウ...
-- &ref(man-pages-ja-20060915.tar.gz);
-- man-pages-jp のビルドとインストール
[root@spirit man-pages-ja-20060915]# make config
perl -w script/configure.perl
[INSTALLATION INFORMATION]
(just Return if you accept default)
Install directory [/usr/share/man/ja_JP.eucJP] ?: ...
( snip )
[root@spirit man-pages-ja-20060915]# make
[root@spirit man-pages-ja-20060915]# make install
- man コマンドのインストール と ビルド
-- kernel.org のサイト (http://www.kernel.org/pub/linux...
[root@spirit man-1.5p]# ./configure +lang ja
[root@spirit man-1.5p]# make
[root@spirit man-1.5p]# make install
-- &ref(man.conf,center,usr/lib/man.conf); の中の PAGER ...
#PAGER /usr/bin/less -is
PAGER /usr/local/bin/lv
*** [[checkstack.pl で関数のスタック消費量を調べる:http:/...
Linux カーネルのソースコードに付属する checkstack.pl を使...
- 入手方法
-- checkstack.pl は Linux カーネルのソースコードに付属し...
% apt-get source kernel-source-2.6.8
- [ 使い方 ]
-checkstack.pl の使い方は簡単です。スタックサイズを調べた...
% objdump -d foo.o | perl checkstack.pl
foo.o の部分は ELFバイナリなら実行ファイルでも共有ライブ...
- [ 実験 ]
- それでは次のプログラムに対して checkstack.pl を適用して...
#include <signal.h>
void *p;
void func() {
struct sigaction x;
p = &x;
}
% gcc -c test.c
% objdump -d test.o| checkstack.pl
0x0003 func: 144
結果は、144バイトになりました。sizeof(struct sigaction) ...
% gcc -c -Os test.c
% objdump -d test.o| checkstack.pl
0x0003 func: 140
#include <signal.h>
void *p, *q;
void func() {
struct sigaction x;
struct sigaction y;
p = &x;
q = &y;
}
プログラムを次のように変更して struct sigaction の変数を ...
#include <signal.h>
void *p, *q;
void func() {
struct sigaction x;
struct sigaction y;
p = &x;
q = &y;
}
ところで、手元の checkstack.pl はスタックの消費量が 100 ...
next if ($size < 100);
- [ 仕組み ]
- checkstack.pl の仕組みは簡単です。単純に objdump -d の...
/^.*[as][du][db] \$(0x$x{1,8}),\%esp$/
- [ まとめ ]
-checkstack.pl を使って関数のスタック消費量を調べる方法を...
*** kernel mmap の over_committe の抑止 [#w8167608]
- 物理メモリ以上にメモリ取得しようとした際にエラーメッセ...
echo 2 >/prco/sys/vm/overcommit_memory
- malloc の上限を oer_commit_ratio で設定する
echo 2 >/prco/sys/vm/overcommit_memory
echo 100 > /proc/sys/vm/overcommit_ratio
アプリケーションの実行
- [[説明ページ(web 引用)>Linux_Overcommit]]
*** 組み込み機器で malloc を使う時の留意点 [#sc0aa41a]
- malloc / free の繰り返しによるメモリーのフラグメント化...
-- malloc(3) を使うと、Linux が管理する通常 4KB のページ...
-- malloc(3)/free(3) を繰り返すと断片化は当然起きますが、...
-- malloc(3) で確保するメモリの特性上、ポインタが破壊され...
- malloc()に対する free()漏れでメモリ不足になることに対し...
-- これについては kernel 側では何もしません。ユーザプログ...
- malloc() したときに確保したいサイズが空いてないときにど...
-- メモリーが足りなくなると malloc() が内部で sbrk(2) を...
-- 実メモリーが不足してヒープが増やせない場合はメモリが足...
-- malloc() を使わない時には、ユーザが sbrk(2) を使ってヒ...
- glibcの関数などで malloc()と同じようにもしくは内部でmal...
-- glibc 内部で malloc(3) を使うものは strdup(3) など沢山...
-- 基本的に構造体を内部で確保するもの(stdio 系など)は危...
- 小まめに取得・開放を繰り返すメモリ管理を長時間安定動作...
-- メモリを固定サイズで予め確保 (メモリ・プール) して、...
-- カーネルの実装でよく使われている slab みたいな実装が参...
- メモリーサイズに制約があり SWAP を持っていない組み込み...
-- 基本的に malloc(3)/free(3) を小まめに繰り返すものには...
-- どうしても小まめに確保と開放を繰り返すメモリが必要であ...
-- この実装では、静的に取ったメモリか malloc(3) で確保し...
-- いわゆるオーバーコミットの挙動により malloc(3) や sbrk...
- overcommit_memory = 2 の時のアプリケーションスタックサ...
-- デフォルトで、pthread_create(3) を使用して、スレッドを...
-- この時確保されるスタック・サイズは、仮想メモリ空間上で...
-- 通常のデフォルトのLinux の動作では、実際にメモリを使用...
+ メモリープールの実装例
*** Linux デバッグに必要は機能 (京都マイクロコンピュータ...
http://www.kmckk.co.jp/linux/linux1.html
&ref(kmcc_001.JPG);~
&ref(kmcc_002.JPG);
*** IO scheduler の種類と特徴 (kernel2.6.10 から適用され...
- noop スケジューラ
-- noop スケジューラはその名の通り、何もしないスケジュー...
-- 入出力インタフェースや周辺機器自身がハードウェアレベル...
-- 普通のパソコンでは noop スケジューラを指定すると性能が...
- anticipatory スケジューラ
-- anticipatory スケジューラ (as) はデバイスが伝統的なハ...
-- 入出力要求を待っていくつか貯めてから処理を行う性質があ...
- deadline スケジューラ
-- データベース向きのスケジューラです。スループットよりも...
-- デスクトップなどの普通のファイルシステムで使用してもあ...
- &color(red){cfq スケジューラ};
-- Completely Fair Queuing (CFQ) スケジューラは Fedora Co...
-- これにより従来の Linux カーネルで見られた「バックグラ...
-- CFQ はどのような環境でも比較的良好な性能を示すオールラ...
*** ls でディレクトリ名だけを表示したい [#dc4074bb]
- ls -d */(一覧表示)
[KGB2] munakata:~/git/linux-firmware$ ls -d */
3com/ amphion/ av7110/ contrib/ emi26/ ...
acenic/ ar3k/ bnx2/ cpia2/ emi62/ ...
adaptec/ arm/ bnx2x/ cxgb3/ ene-ub62...
advansys/ ath10k/ brcm/ cxgb4/ ess/ ...
- ls -F | grep / (リスト表示)
[KGB2] munakata:~/git/linux-firmware$ ls -F | grep /
3com/
acenic/
adaptec/
advansys/
airoha/
amd/
*** ファイルの連結 [#i0cd5277]
- cat コマンドでファイルを連結することができる
- 並べた順番に連結される (ワイルドカードを使った場合の順...
[root@spirit ~]# cat maillog.4 maillog.3 maillog.2 maill...
*** cron はいつ実行されるか ----> /etc/crontab で実行時...
[root@spirit ~]# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
*** HEWで sh4-linux-gccのデバッグ情報が読めるか [#t7505ddd]
日立SK 開発事業部 第2開発本部 第3設計部(s2開32)菅野紀...
- HEWに手を加えていない状態で、gccのデバッグ情報を読むこ...
- 読み込むためにはgcc用のオブジェクトリーダーが必要になり...
- KPITで配布している"GNUSH v0603 Windows Tool Chain "(sh...
- これで、sh-linux-gccのオブジェクトが読めるようになりま...
- この件をKPITに問い合わせたところ、sh-linux-gccオブジェ...
- ですので、全てのsh-linux-gccが読めるかどうかはわかりま...
- HEWでプログラムを実行させる前にレジスタウインドウからPC...
- そのときに、HEWがソースファイルの場所を聞いてくるのでそ...
*** Linux コンソール端末のログインシェルの切替 [#w609e5c8]
- &color(red){[Ctrl]-[ALT]-[F1/2/3/4]}; でログインシェル...
- グラフィカルログインの途中で止まってしまった場合などに...
*** X-window でのグラフィカルログインが出来ない場合の対策...
- init 3 でテクストモードで起動し、テキストログインする
- シェルから X を起動するために以下のコマンドを使った
[root@spirit] aticonfig --initial --input=/etc/X11/xorg...
[root@spirit] startx
- X 関連ファイル
-- /etc/X11/xorg.conf <---- X 設定ファイル
-- /etc/ <---- gnome ログインシェルを指定し...
*** Fedora7 で nVidia のドライバーがインストールできない...
- インストーラと X11 の整合性がとれていない為の発生 ----...
- インストーラ起動時にオプションを指定する
# sh NVIDIA-Linux-version.run --x-module-path=`X -showDe...
-- 会社のマシンに nVidia 用のドライバーをインストールする...
*** git で kernel をダウンロード [#g9fb1fab]
- Fedora7 では yum で git (含 gitk)のインストールがで...
- git-clone は su(sudo) でないとできない
[root@localhost src]# git-clone git://git.kernel.org/pub...
Initialized empty Git repository in /home/munakata/src/l...
remote: Generating pack...
remote: Done counting 552198 objects.
remote: Deltifying 552198 objects...
remote: 100% (552198/552198) done
Indexing 552198 objects...
- &ref(http://www8.atwiki.jp/git_jp/pub/Documentation.ja/...
*** find と組み合わせた file パーミションの一括操作 [#df5...
[root@spirit peewee]# find . -type f -exec chmod 666 {} \;
[root@spirit peewee]# find . -type d -exec chmod 755 {} \;
*** SDカード FAT マウント時の umask 値設定 [#t40a3941]
# mount -t vfat -o umask=000 /dev/sd.. /mnt/sd
*** user 空間へのデータコピー [#c95dfefb]
ユーザ空間へのデータコピーは mm/filemap.c の中にある file...
で、何バイトをコピーしていそうか見て頂くと( 971 行目を使...
せん。
*** Linux で RAR f形式のアーカイブを解凍する方法 (= &ref(...
wget http://dag.wieers.com/packages/unrar/unrar-3.6.2-1....
rpm -Uvh unrar-3.6.2-1.el4.rf.i386.rpm
unrar x -kb "archibed_file.rar"
*** Sylpheed で外部エディターに秀丸を指定する [#oa08fc90]
'c:\Program Files\Hidemaru\Hidemaru.exe' '%s'
*** SH-Linux の intevent(割り込み番号)と kernel 割り込...
Just to follow. Linux kernel for SuperH always uses the
following math to convert Intevent Code to IRQ number:
(intevent >> 5) - 16 = IRQ number
Goda-san's calculation
(intevent - 0x200) / 0x20
is basically the same as above. ;) You can find this in
include/asm-sh/irq.h, evt2irq() macro.
*** SEGV発生箇所の特定方法 [#z29d24b0]
ライブラリ内でSEGV が発生した場合を例にして、
SEGV の発生箇所を特定する方法を記述します。
- カーネルイメージの変更
添付したカーネルイメージを使ってください。SEGV発生時にメ...
(オリジナルのカーネルイメージは残して置いてください)
- 参考プログラムの作成
ライブラリ内でSEGV を発生させるプログラムの作成
$ less segvtestlib.c
#include <stdio.h>
int test_func(void) {
int *ptr = NULL;
*ptr = 1;
return 0;
}
$ less segvtest2.c
#include <stdio.h>
extern int test_func(void);
int main() {
test_func();
return 0;
}
$ sh4eb-linux-gcc -shared -Wl,-soname,libsegv.so -o libs...
$ ln -s libsegv.so.1 libsegv.so
$ sh4eb-linux-gcc segvtest2.c -o segvtest2 -lsegv -L.
- ターゲットボード上で実行
添付したカーネルを使用してターゲットボードを立ち上げ、
プログラムを実行してください。
# ./segvtest2
info.si_addr= 0
pc=2957b6d0 pr=0040062c
pid=741
tid=741
name=segvtest2
SEGV の発生したPCや、
SEGV を発生させたpid, tid、
SEGV を発生させたプログラム名を確認してください。
(注意)
tid は、スレッドID です。
スレッドを作成された際にスレッドID をログに表示しておくと、
そのスレッドがエラーを吐いたか確認できるかと思います。
この際に、gettid(2) を使いスレッドのIDを表示するのではな...
syscall(__NR_gettid) を使ってください。
(gettid(2) では、pid の値が帰ってきてしまいます)
なお、syscall(__NR_gettid)を使用するために、
以下のマクロを定義し、ヘッダを読み込んでください。
#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
syscall(__NR_gettid)
- SEGV発生箇所の特定
-- ターゲットボード上で以下を実行してください。
# ldd segvtest2
libsegv.so => ./libsegv.so (0x2957b000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x2958c...
libc.so.6 => /lib/libc.so.6 (0x295ad000)
/lib/ld-linux.so.2 (0x29556000)
前手順で判明したPC より、libsegv.so 内で問題が発生してい...
0x2957b6d0 - 0x2957b000 = 0x06d0
ライブラリの上記の位置で問題が発生しています。
・開発機上で以下を実行しライブラリ内の何処で問題
が発生しているかを確認してください。
(nmコマンドが、ターゲットボード上に存在するなら
ターゲットボード上で実行しても構わないです)
$ sh4eb-linux-nm ./libsegv.so.1 |sort | less
w _Jv_RegisterClasses
w __cxa_finalize@@GLIBC_2.2
w __deregister_frame_info@@GLIBC_2.2
w __register_frame_info@@GLIBC_2.2
00000480 T _init
00000580 t __do_global_dtors_aux
00000620 t frame_dummy
000006c0 T test_func
000006e0 t __do_global_ctors_aux
00000720 W __gmon_start__
00000740 T _fini
00000778 r __EH_FRAME_BEGIN__
00000778 r __FRAME_END__
0001077c d __CTOR_LIST__
00010780 d __CTOR_END__
00010784 d __DTOR_LIST__
.....
問題発生箇所が、0x06d0 なので、
test_func の中で問題が発生しているのが分かります。
*** ubbot による uboot の書き換え ( u-boot 上での作業で...
+ nfs で u-boot.binをメモリにロードする。
+ フラッシュメモリの書き込みたい領域のプロテクトを解除&br...
+ フラッシュメモリの書き込みたい領域の領域を初期化&br; er...
+ 1 でロードしたu-boot.binイメージをフラッシュに書き込む&...
途中でリセットすると、起動できなくなるので、注意してくだ...
*** マルチメディアコンテンツのヘッダー解析ツール [#s0ed4e...
http://mediainfo.sourceforge.net/ja (日本語)
http://mediainfo.sourceforge.net/en (English)
*** Linux performance tuning parameters [#ydf24e88]
Just FYI, some of these writeback parameters can be tuned...
damm@rx1 / $ cat /proc/sys/vm/dirty_background_ratio5
Some /proc/sys/ parameters (like the above) will affect p...
Hi Paul,
The cause of the problem that we had has been understood.
Between kernel-2.6.21 and 2.6.22, the following setting...
diff -Nur linux-2.6.21.7/mm/page-writeback.c linux-2.6....
--- linux-2.6.21.7/mm/page-writeback.c 2007-08-05 01:1...
+++ linux-2.6.22/mm/page-writeback.c 2007-07-09 08:3...
@@ -67,12 +67,12 @@
/*
* Start background writeback (via pdflush) at this per...
*/
-int dirty_background_ratio = 10;
+int dirty_background_ratio = 5;
/*
* The generator of dirty data starts writeback at this...
*/
-int vm_dirty_ratio = 40;
+int vm_dirty_ratio = 10;
5% of the main memory is made a threshold, and pdflush ...
Pdflush is executed by exceeding this limen when "File ...
is being tested. Therefore, I understood that the score...
And, kernel-2.6.30 changes this setting again.
http://www.kernel.org/pub/linux/kernel/v2.6/testing/pat...
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 74dc57c..bb553c3 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -66,7 +66,7 @@ static inline long sync_writeback_pag...
/*
* Start background writeback (via pdflush) at this per...
*/
-int dirty_background_ratio = 5;
+int dirty_background_ratio = 10;
/*
* dirty_background_bytes starts at 0 (disabled) so tha...
@@ -83,7 +83,7 @@ int vm_highmem_is_dirtyable;
/*
* The generator of dirty data starts writeback at this...
*/
-int vm_dirty_ratio = 10;
+int vm_dirty_ratio = 20;
*** Original linux-2.6.27 for R0P7785LC
File Copy 1024 bufsize 2000 maxblocks 3960.0 ...
File Copy 256 bufsize 500 maxblocks 1655.0 ...
File Copy 4096 bufsize 8000 maxblocks 5800.0 ...
*** linux-2.6.27( changes to dirty_background_ratio=10 ...
File Copy 1024 bufsize 2000 maxblocks 3960.0 ...
File Copy 256 bufsize 500 maxblocks 1655.0 ...
File Copy 4096 bufsize 8000 maxblocks 5800.0 ...
*** GRUB の再インストール (Ubuntu) [#m5f0bb7b]
- Ubuntu Live CD でシステムを起動
- 最初の起動メニューで [F6]を押して起動オプションを書き...
boot=casper ---> boot=/dev/sda1 (Linux を起動したいパー...
- Enter でシステム起動
- HDD から起動した Linux 上から MBR に GRUB をインストール
sudo /usr/sbin/grub-install /dev/sda
通常はこれで Grub が再設定されるが、これが Windows との d...
[[FreeDOS:http://www.freedos.org/]] の iso イメージを焼い...
fdisk /mbr 1
で一番目のディスクの MBR への書き込みが行われる。 以降は...
*** [Ubuntu] Grubの設定をGUIで [#h73153f1]
$ sudo apt-get install startupmanager
これを使えば/boot/grub/menu.lstを直接編集せずにGrubの設定...
*** [[Linuxでうっかりrm -rfしちゃったけど復活出来たよ (ex...
- &ref(extundelete-0.2.0.tar.bz2);
## こーいうときはまずあれだ、現場保存!
## まずは今いるパーティションを確認
# df -hT
Filesystem Type サイズ 使用 残り 使用% マウント位置
/dev/sdb2 ext4 193G 6.9G 176G 4% /
/dev/sdb1 ext3 194M 22M 163M 12% /boot
/dev/sdb5 ext4 1.2T 752G 371G 67% /home ←イマ...
tmpfs tmpfs 999M 0 999M 0% /dev/shm
## とりあえず読み込み専用にしておこう!
# mount -o remount,ro /dev/sdb5
# touch /home/hoge
touch: cannot touch `/home/hoge': 読み込み専用ファイルシ...
## うし、ちゃんとリードオンリーになったな
## あと何だ?とりあえず時間メモ!
# date
2011年 1月 23日 日曜日 18:15:22 JST
## ふぅ、さてひとまずこれでいいだろう、あとはext4の復元...
## どうやら extundelete ってのがext3/ext4対応の復活プロ...
## 藁にもすがる思いでインストール。とりあえず/tmpでいい...
# cd /tmp
# mkdir a
# cd a
# wget "http://downloads.sourceforge.net/project/extunde...
# ls
extundelete-0.2.0.tar.bz2
# tar xfj extundelete-0.2.0.tar.bz2
# cd extundelete-0.2.0
# ./configure --prefix=/tmp/a && make && make install
## ビルド待ち…、うしっなんか出来たっぽい!
## んー何々…?
# /tmp/a/bin/extundelete
No action specified; implying --superblock.
Usage: /tmp/a/bin/extundelete [options] [--] device-file
Options:
--version, -[vV] Print version and exit successf...
--help, Print this help and exit succes...
--superblock Print contents of superblock in...
If no action is specified then ...
--journal Show content of journal.
--after dtime Only process entries deleted on...
--before dtime Only process entries deleted be...
Actions:
--inode ino Show info on inode 'ino'.
--block blk Show info on block 'blk'.
--restore-inode ino[,ino,...]
Restore the file(s) with known i...
The restored files are created i...
with their inode number as exten...
--restore-file 'path' Will restore file 'path'. 'path...
of the partition and does not st...
must be one of the paths returne...
The restored file is created in ...
directory as 'RECOVERED_FILES/pa...
--restore-files 'path' Will restore files which are lis...
Each filename should be in the s...
to --restore-file, and there sho...
--restore-all Attempts to restore everything.
-j journal Reads an external journal from t...
-b blocknumber Uses the backup superblock at bl...
the file system.
-B blocksize Uses blocksize as the block size...
system. The number should be t...
Error parsing command-line options.
## ふむ、どうやらパーティション&時間指定で復元できるっ...
## dtime って何だろ…、helpだと分からんかったのでサイトの...
## エポック秒で指定すればいいんだな。
## 取ってて良かった時間メモ、18:15ってことは18:00以降く...
# date -d "18:00"
2011年 1月 23日 日曜日 18:00:00 JST
## うむ、じゃエポックは…、と
# date -d "18:00" +%s
1295773200
## うし、じゃこんな感じかな?
# /tmp/a/bin/extundelete --after 1295773200 --restore-al...
Only show and process deleted entries if they are delete...
WARNING: Extended attributes are not restored.
Loading filesystem metadata ... 9607 groups loaded.
Loading journal descriptors ... 28902 descriptors loaded.
Writing output to directory RECOVERED_FILES/
Searching for recoverable inodes in directory / ...
327 recoverable inodes found.
Looking through the directory structure for deleted file...
Restored inode 3373 to file RECOVERED_FILES/share/家中共...
Restored inode 3374 to file RECOVERED_FILES/share/家中共...
*** SH-Debian cross toolchain の導入 (chroot 環境で実行)...
- パッケージ導入元 = http://debian-sh4.nigauri.org/ (gcc-...
-- binutils
-- linx-libc-dev
-- gcc*.*
+ 適当なディレクトリに移動
+ mkdir sid-rootfs
+ sudo apt-get update
+ sudo apt-get install debootstrap chroot
+ sudo debootstrap sid sid-rootfs http://ftp.jp.debian.or...
+ sudo chroot sid-rootfs
+ 依存するパッケージのインストール
dpkg --info gcc-4.3-sh4-linux-gnu_4.3.4-1_i386.deb を実...
出力される Depends の行が依存するパッケージです。
+ クロスコンパイラのインストール
+ 開発は sid-rootfs の中で行う。
*** GIMP GIF 背景色の透明化 [#nc4906cc]
//- アルファチャンネルの追加
//- 背景色を選択して切り取り
- 編集対象ファイルは GIF 形式でなければならない ( 必要に...
- 黄色いスポイトで背景色(=抜きたい色を選択、 シフトキー...
- 選択されたら 削除 で色が透明に抜ける
*** Youtube のファイルの扱い [#o8a7f37d]
- .264ファイルは、H.264/AVCのrawストリームファイルです。A...
% MP4Box -raw 2 tronlegacy.mp4
Extracting MPEG-4 AVC-H264 stream to h264
% ls
tronlegacy.mp4 tronlegacy_track2.h264
- mp4やmovファイルに含まれているAVストリームの仕様は 'med...
% mediainfo tronlegacy.mp4
General
Complete name : tronlegacy.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 35.3 MiB
Duration : 2mn 20s
Overall bit rate : 2 108 Kbps
Encoded date : UTC 2010-03-08 01:48:02
Tagged date : UTC 2010-03-08 01:48:02
gsst : 0
gstd : 140851
gssd : B4A7D6683HH1286348198...
gshh : v3.lscache3.c.youtube...
Video
ID : 2
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 2mn 20s
Bit rate mode : Variable
Bit rate : 1 980 Kbps
Maximum bit rate : 12.2 Mbps
Width : 1 280 pixels
Height : 534 pixels
Display aspect ratio : 2.35:1
Frame rate mode : Constant
Frame rate : 23.976 fps
Resolution : 8 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.121
Stream size : 33.1 MiB (94%)
Title : (C) 2007 Google Inc. ...
Encoded date : UTC 2010-03-08 01:48:02
Tagged date : UTC 2010-03-08 01:48:02
Audio
ID : 1
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : No
Codec ID : 40
Duration : 2mn 20s
Bit rate mode : Variable
Bit rate : 124 Kbps
Maximum bit rate : 220 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 KHz
Stream size : 2.08 MiB (6%)
Title : (C) 2007 Google Inc. ...
Encoded date : UTC 2010-03-08 01:48:02
Tagged date : UTC 2010-03-08 01:48:02
- 'youtube-dl'というツールを使うと、youtubeからビデオを f...
% ./youtube-dl -f 18 "http://www.youtube.com/watch?v=Ttb...
[youtube] Setting language
[youtube] TtbrLIwKWWA: Downloading video webpage
[youtube] TtbrLIwKWWA: Downloading video info webpage
[youtube] TtbrLIwKWWA: Extracting video information
[download] Destination: TtbrLIwKWWA.mp4
[download] 100.0% of 4.25M at 252.82k/s ETA 00:00
- .yuvファイルは、NV12 RAWイメージが連続して格納されたフ...
# omxvideodectest -d OMX.re.videodecoder -o output.yuv i...
- URL
-- [[MP4Box:http://www.videohelp.com/tools/mp4box]]
-- [[mediainfo:http://mediainfo.sourceforge.net/ja]]
-- [[youtube-dl:http://bitbucket.org/rg3/youtube-dl/wiki/...
--- [[数字の意味:http://d.hatena.ne.jp/michinao/20081115/...
*** [[NautilusSVN (RabbitVCS: Linux CVS GUI cleint):http:...
*** iPad/iPhone 4のビデオ再生仕様 [#vdd16e8c]
- iPad用1024×576 TMPEGENC 設定ファイル ----> &ref(MP4_AVC...
- H.264ビデオ
-- 最高720p
-- 毎秒30フレーム
-- 最高レベル3.1のメインプロファイル(最高160kbpsのAAC-LC...
-- 48kHz、.m4v、.mp4、.movファイルフォーマットのステレオ...
- MPEG-4ビデオ
-- 最高2.5Mbps、640×480ピクセル
-- 毎秒30フレーム
-- シンプルプロファイル(最高160KbpsのAAC-LC)、
-- 48kHz、.m4v、.mp4、.movファイルフォーマットのステレオ...
- Motion JPEG (M-JPEG)
-- 最高35Mbps、1280×720ピクセル、
-- 毎秒30フレーム
-- ulawオーディオ、.aviファイルフォーマットのPCMステレオ...
*** Live Linux USB Creator (LiLi) [#b8bd28a1]
- &ref(LinuxLive USB Creator 2.7.exe);
*** ideapad S10e wlan (BCN4312)ドライバー [#se6a2bb4]
- http://ja.broadcom.com/support/802.11/linux_sta.php か...
$ mkdir hybrid_wl
$ cd hybrid_wl
$ tar xzf <ダウンロードしたパス>/hybrid-portsrc.tar.gz
$ make clean (初めて実行する際は不要)
$ make
もし b43-fwcutter をインストーしていたら削除
$ sudo apt-get remove b43-fwcutter
ドライバーモジュールをインストール
$ sudo make install
$ sudo echo "blacklist ssb" >> /etc/modprobe.d/blacklist...
$ sudo echo "blacklist b43" >> /etc/modprobe.d/blacklist...
$ sudo depmod -a
ここまでで modprobe wl とすればとりあえず利用はできるのだ...
ここでメニューバーの 「システム - システム管理 ー ハード...
*** Ubuntu : scim-anthyのキーバインドやローマ字キーマップ...
設定方法は,SCIMを起動して右から2番目の[コマンドメニュー...
-&ref(TH400_01.jpg);
http://gihyo.jp/admin/serial/01/ubuntu-recipe/0065 より引用
*** [[virtualbox のクローン作成:http://www.webriverside.c...
- VirtualBoxで作成した仮想マシンのクローンを作成するには...
-- &color(red){[注意] VirtualBoxでは、単純に仮想マシンイ...
- 仮想マシンイメージファイルのクローンイメージをコマンド...
- クローンイメージをGUIツール (Sun xVM VirtualBox) の...
- 新規仮想マシン作成ウィザードから新規仮想マシンを作成し...
*** [[Magetta (OSS HTML5 authoring tool:http://www.maqett...
- account = public_mail@hmuna.com
- pass = frex
*** Ubuntu 1104 で無線LANが使えなくなっている問題の対策 [...
- https://forums.ubuntulinux.jp/viewtopic.php?id=11372
- 登録されたモジュールのリスト [lsmod]
munakata@muna-E420:~$ lsmod
Module Size Used by
parport_pc 36959 0
ppdev 17113 0
binfmt_misc 17565 1
↓ ↓ ↓
- インストール(認識)されたハードウエアのリスト [lswh -C]
munakata@muna-E420:~$ sudo lshw -C network
[sudo] password for munakata:
*-network
description: Ethernet interface
product: RTL8111/8168B PCI Express Gigabit Ethern...
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:02:00.0
logical name: eth0
version: 06
serial: f0:de:f1:65:e5:0a
size: 1Gbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_mast...
configuration: autonegotiation=on broadcast=yes d...
resources: irq:40 ioport:5000(size=256) memory:d0...
*-network DISABLED
description: Wireless interface
product: RTL8188CE 802.11b/g/n WiFi Adapter
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:08:00.0
logical name: wlan0
version: 01
serial: ec:55:f9:c4:3d:ae
width: 64 bits
clock: 33MHz
↓
- 無効化されている無線の確認 [rfkill list]
munakata@muna-E420:~$ rfkill list
0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
1: tpacpi_bluetooth_sw: Bluetooth
Soft blocked: no
Hard blocked: no
2: phy0: Wireless LAN
Soft blocked: yes
Hard blocked: no
3: acer-wireless: Wireless LAN
Soft blocked: yes
Hard blocked: no
- 無線LANの有効化
munakata@muna-E420:~$ sudo rmmod -f acer-wmi
munakata@muna-E420:~$ rfkill unblock all
*** Thinkpad E420 トラックパッドの無効化 (ポインターだけ...
- gpointing-device-settings を追加でインストール
-- タッチパッドの無効化
ーー スクロールは ホイールのエミュレーションを有効にし、...
- http://ishiguso328.appspot.com/article/3
*** Virtualbix のマウス統合機能の無効化、再有効化 [#x746e...
- Virtualbox でゲストOS のウインドウの境界部分のポインテ...
- Virtualbox のウィンドウ枠右下の 丸に矢印のついたアイコ...
- この状態からホストOS にマウスを渡すには 右側のコントロ...
*** /etc/fstab 設定例 [#mc4ef975]
- [デバイス] [マウントポイント] [ファイルシステム] [マウ...
-- ローカルファイルシステムもマウントする例
/dev/sdc1 /mnt ext3 defaults 1 2
-- NFSの設定例
192.168.1.1:/exports/www /exports/www nfs rsize=8192,wsi...
-オプション一覧
--デバイス
マウントする為のデバイスファイルを指定します。
通常は、/dev/hda1などのデバイスファイルを直接指定しますが...
また、リモートのファイルサーバなどのNFS、Samba用の記述も...
--マウントポイント
ファイルシステム上のマウントポイントを指定します。
実ディレクトリが存在している必要があります。swapの場合はs...
--ファイルシステム
ファイルシステムの形式を指定します。
ext3、xfs、swap、nfs、vfat、iso9660など、サポートされてい...
--マウントオプション
|オプション|意味|h
|async|ファイルシステムへの I/O が非同期で行われます。|
|atime|アクセス毎に inode のアクセスタイムをアップデート...
|auto| mount コマンドの -a オプションでマウントされるよう...
|codepage| 文字コードの指定|
|COLOR(red):defaults| COLOR(red):デフォルトのオプション(r...
|dev| ファイルシステム上のデバイスを利用できるようにしま...
|exec| バイナリの実行を許可します。|
|gid| マウントするグロープIDを指定|
|iocharset| マウントするシステムの文字コード|
|noatime| アクセス毎にinodeのアクセスタイムをアップデート...
|noauto| コマンドで明示的にmountコマンドを実行された場合...
|nodev| ファイルシステム上のデバイスを利用できないように...
|noexec| ファイルシステム上でのバイナリファイルの実行を無...
|nosuid| SUID や SGID を無効にします。|
|nouser| root以外マウントできないようにします。|
|ro| リードオンリーでファイルシステムをマウントします。|
|rw| 読み込み・書き込みができる状態でファイルシステムをマ...
|suid| SUID および SGID を有効にします。|
|sync| ファイルシステムへのI/Oを同期で行います。|
|user| 一般ユーザでもファイルシステムをマウントできるよう...
|uid| マウントするユーザIDを指定|
--dumpオプション
dumpの要否を指定します。
|0|dump不要|
|1|dump必要|
--fsckオプション
OS起動時に、fsckによるファイルシステムチェックの要否を指...
|0|チュック無し|
|1|/ 専用でチェック有り|
|2|チェック有り|
*** [[testdisk によるクラッシュしたHDDからのデーター救済...
- [[パーティションテーブルが壊れたHDDを復元するには:http:...
- http://www.cgsecurity.org/wiki/PhotoRec => &ref(testd...
*** [[Ubuntu 起動時にメッセージを出させる:http://d.hatena...
- /boot/grub/grub.cfg (通常は 444 → 744 にして編集、 ...
- /etc/default/rc.s の中の VERBOSE を yes に変更する
*** find の実行で 『find: パス名は評価式の前に置かなけれ...
- [[シェルが勝手にアスタリスクを展開してしまうので,find...
- 次のように検索対象ファイルをくくると検索できる
find ./ -name "*.php"
*** Lenovo E420 で無線LANが使えない問題 [#ca3773b4]
- デフォルトでソフト的に無効になっているのを、設定変更す...
munakata@muna-E420:~$ rfkill list
1: tpacpi_bluetooth_sw: Bluetooth
Soft blocked: yes
Hard blocked: no
munakata@muna-E420:~$ sudo rmmod -f acer-wmi
munakata@muna-E420:~$ rfkill unblock all
- https://forums.ubuntulinux.jp/viewtopic.php?id=11372
- http://ubuntuforums.org/showthread.php?t=1761472
*** root でも消せないファイルをどうするか [#g4d172f4]
- 例えば
root@mythen:/home/server-admin# ls -la
ls: .gvfs にアクセスできません: 許可がありません
合計 300
drwxr-xr-x 36 server-admin server-admin 4096 2011-12-31...
drwxr-xr-x 3 root root 4096 2011-12-17...
-rw------- 1 server-admin server-admin 7636 2011-12-30...
-rw------- 1 server-admin server-admin 103 2011-12-30...
drwx------ 3 server-admin server-admin 4096 2011-12-11...
drwx------ 3 server-admin server-admin 4096 2011-12-31...
(snip)
-rw-rw-r-- 1 server-admin server-admin 369 2011-12-17...
d????????? ? ? ? ? ...
drwxrwxr-x 4 server-admin server-admin 4096 2011-12-18...
- このような場合には,lsattrコマンドを利用してファイルの...
- chattrコマンドで変更すると正常なパーミッションに直すこ...
*** GUI 画像の一括リネーム 一括リサイズ 一括変換が簡単に...
- [[GTK Rename and Resize Image :http://ubuntuapps.blog67...
*** 画像ファイル整理用のperl スクリプト群 [#b953ac19]
- [[画像ファイルの整理(1):http://penguinclub.net/linux/p...
*** 画像のリサイズ(コマンドライン) [#pfa83eae]
- imagemagic の ''convert'' コマンドに、「-geometry」オプ...
munakata@muna-E450:~/Desktop$ convert -geometry "60%" bu...
- convert コマンドの代わりに ''mogrify'' コマンドを使えば...
munakata@muna-Linux:~/Desktop$ mogrify -resize 60% セレ...
*** [[デスクトップにホームディレクトリの内容が表示されて...
- 1)$HOME/.config/user-dirs.dirsをエディタで開く。※1
- 2)XDG_なんとか_DIRというキーに対する値が、希望のディレ...
- 3)再度ログイン。<- 重要!
で直ると思いますよ。この現象が起きたのは、$HOME/デスクト...
それをやると、$HOMEがデスクトップに表示されてしまう現象が...
*** ターミナル用フォント ( putty など) [#p20d12fe]
- [[inconsolata:http://www.levien.com/type/myfonts/incons...
*** grep で空行とコメント行を削除する [#ra2f7557]
grep -v -e '^$' -e '#' (file_name)
cat (file_name) | grep -v "^\s*$" | grep -v "^\s*#"
*** ディレクトリ以下を再帰的にgrepする (新2) [#v9fccf35]
- ディレクトリとファイルタイプを指定して、再起的に検索
grep -lr (検索文字) --include='*.log' ./app/logs(検索場...
*** ディレクトリ以下を再帰的にgrepする (新) [#b4d45846]
- grep hoge --include='dir' -r
[local] munakata:~/latex/LFS301-JP$ grep size --include=...
CHAPS/memmon/memmon.tex:Hugepagesize: 2048 kB
CHAPS/memmon/memmon.tex: RAM plus the size of the swap...
CHAPS/memmon/memmon.tex: exceed the size of RAM plus s...
CHAPS/memmon/memmon.tex: when the total memory comm...
CHAPS/containers/containers1.tex: \begin{responseva...
CHAPS/processes/processes1.tex: as stack size (\...
CHAPS/processes/libraries.tex: \begin{responsevar}{\no...
CHAPS/processes/libraries.tex: \begin{responsevar}{\sc...
*** ディレクトリ以下を再帰的にgrepする [#a5cdf576]
find ./ -name '*' | xargs grep "hogehoge"
*** R-Car で earlyprintk を使う方法 [#m42feab8]
- R-mobile 系は kernel command line での設定で有効となる
console=tty0 console=ttySC1,115200 earlyprintk=sh-sci.1,...
- R-Car 系の対応 (r-car 系では SCIF が 0xffxxxxx にマッ...
-- setup-r8a7779.c (= H1)に説明が書いてあります
*** stable tree の fetch と差分の確認 [#f49fb857]
- git://git.kernel.org/pub/scm/linux/kernel/git/stable/li...
- git log --oneline v3.4.25..v3.4.47
- git log --oneline v3.4.25..v3.4.47 | wc -l で差分の数を...
*** ディスク容量(=RootFS の構成) のグラフィカル表示 [#...
- [[baobao:http://www.marzocca.net/linux/baobab/index.htm...
-- ubuntu では 「ディスク使用量の解析」
- xdu
- xdiskusage
*** ビデオコンテンツのプロファイルを確認する [#o77894a6]
mediainfo
*** アプリケーション実行時の CPU 関連の動作を検証する [#l...
usr/bin/time --verbose
*** i2c デバイスの検出 i2cdetect [#fbcff204]
# i2cdetect -r -y 3
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
- -y Disable interactive mode. By default, i2cdetect will...
- -a Force scanning of non-regular addresses. Not recomme...
- -q Use SMBus "quick write" commands for probing (by def...
- -r Use SMBus "read byte" commands for probing (by defau...
- -F Display the list of functionalities implemented by t...
- -V Display the version and exit.
- -l Output a list of installed busses.
*** [[Ubuntu 64bit版 で 32bitのライブラリやアプリをコンパ...
- sudo apt-get install ia32-libs lib32gcc1 lib32stdc++6 l...
*** upstream kernel / stable-kernel のソース入手 [#p97122...
- git clone git://git.kernel.org/pub/scm/linux/kernel/git...
- git clone git://git.kernel.org/pub/scm/linux/kernel/git...
*** [[Ubuntu フォント:https://wiki.ubuntulinux.jp/UbuntuT...
- fc-list|less でインストールされているフォントの一覧が表...
*** ディレクトリ以下の全ファイルの文字コードを UTF-8 に一...
find . -type f | xargs -n 10 nkf -w --overwrite
*** 複数ファイルから文字列を一括置換 [#p4f56390]
find ./path/to/file -type f | xargs sed -i "s/hoge/hage/g"
*** bashのタブ補完で余分なスペースが入るようになった場合...
rm /etc/bash_completion.d/acroread.sh
*** dd イメージファイルからパーティション情報を読み出す [...
munakata@muna-E420:~/volumio/image$ sfdisk -l -uS Volumio...
ディスク VolumioBeta1.3BBB.img: ジオメトリを取得できません
ディスク VolumioBeta1.3BBB.img: シリンダ数 229、ヘッド数 ...
ユニット = 512 バイトのセクタ、0 から数えます
デバイス ブート 始点 終点 #セクタ Id シス...
VolumioBeta1.3BBB.img1 * 2048 4095 2048...
VolumioBeta1.3BBB.img2 4096 3751935 3747840...
シリンダ 233 にパーティションの終点、ディスクの最後を越え...
VolumioBeta1.3BBB.img3 0 - 0...
VolumioBeta1.3BBB.img4 0 - 0...
*** chorome で README.html などのローカルファイルファイル...
- セキュリティ対策で chorome ver5 以降はそういう仕様にな...
- オーバーライドして強制的に開くようにするには起動パラメ...
-- -allow-file-access-from-files
- [[参考URL(windows と mac の方法が書いてある):http://de...
*** 色々なバージョンの kernel ソースのディレクトリー毎の...
- kernel repo から git clone したソースには v2.6.11 以降...
- git checkout で tag を指定して以前のバージョンのソース...
- find でファイルを再帰的に探して wc で行数を数えたものを...
-- git checkout v2.6.18 -b v2.6.18
-- find . -type f -not -regex '\./\.git.*' -print | xargs...
-- find . -type f -not -regex '\./\.git.*' -print0|xargs ...
*** ファイルの属性変更、確認(書き込み禁止 など) [#lfbfb...
- lsattr [ -RVadv ] [ files... ]
-- -R ディレクトリやその内容の属性を再帰的に表示する。
-- -V プログラムのバージョンを表示する。
-- -a `.' ではじまるファイルも含め、全てのファイルお...
-- -d ディレクトリの内容ではなく、ディレクトリそのも...
-- -v ファイルのバージョン/世代を表示する。
- chattr [ -RV ] [ -v version ] [ mode ] files...
-- `A' 属性が設定されているファイルは、 アクセスされても ...
-- `a' 属性が設定されているファイルは、 書き込み...
-- `c' 属性が設定されているファイルは、 ディスク上に置か...
すと、伸長されたデータが返ってくる。 このファイルに書き...
-- `D' 属性が設定されているディレクトリは、 変更されると...
-- `d' 属性が設定されているファイルは、 dump(8) プログラ...
-- `E' 属性は実験的な圧縮パッチが用いるもので、 圧縮ファ...
-- `I' 属性は htree コードによって用いられ、 ディレクト...
chattr(1) によって設定したり解除したりすることはできない...
-- i' 属性が設定されているファイルは、変更することができ...
*** man ページを日本語表示にする [#p14e6180]
- sudo apt-get install manpages-ja
*** Ubuntu でランレベル毎の自動起動するサービルの指定 [#k...
- sysv-rc-conf
- sysv-rc-conf -list (表示のみ)
*** ディスクパーティションを変更した時の grub の再設定 (...
- まず手動で grub にパラメータを渡して Ubuntu を起動する
grub rescue> ls ← パーティションリストが表示される。/bo...
grub rescue> ls (hd0,msdos6)/boot/grub/i386-pc/normal.mod
grub rescue>set prefix=(hd0,msdos6)/boot/grub
grub rescue>set root=(hd0,msdo6)
grub rescue>insmod (hd0,msdos6)/boot/grub/i386-pc/normal...
grub rescue>normal
- 次に grub を再インストールする
-- 通常は
sudo grub-install /dev/sda
-- 上記でエラーになる場合(パーティションを削除した場合な...
sudo dpkg-reconfigure grub-pc
*** apt-get で保留されるパッケージのアップグレード [#kbb2...
- 再起動が必要であったり依存関係で削除されるファイルや設...
-- $ sudo apt-get -s dist-upgrade で確認て
-- $ sudo apt-get dist-upgrade でインストール
*** Ubuntu には inittab はない。 [#q1248cd7]
- While searching this in various forum, I got to know th...
- It uses /etc/init/rc-sysinit.conf
*** Ubuntu でテキストログイン [#mc833c8d]
- [[「Ubuntu のログインを CUI に変更する」:http://mattint...
-- /etc/default/grub の GRUB_CMDLINE_LINUX_DEFAULT を変更
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo...
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT="quiet text"
GRUB_CMDLINE_LINUX=""
- sudo update-grub
- reboot
*** putty で bash の color_shell(色付け)を有効にする方...
- [接続]-[データ]で端末名を xterm → xterm-256color ...
- このメニューは端末起動前でないと表示されない
- &ref(256color.jpg);
- ちなみに Font は Consolas 14pt がきれい
*** bashrc のカスタマイズ(プロンプト関係) [#k6d4e2b1]
ー &ref(bashrc); <- .bashrc にリネームして使う
- /root にもこの bashrc をコピーする(sudo 時に $HOME(=/r...
if [ "$color_prompt" = yes ]; then
if [ $UID -eq 0 ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;36m\]...
else
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;36m\]...
fi
else
if [ $UID -eq 0 ]; then
PS1='${debian_chroot:+($debian_chroot)}[AWS (sudo)]:\w...
else
PS1='${debian_chroot:+($debian_chroot)}[AWS] \u:\w\$ '
fi
fi
unset color_prompt force_color_prompt
*** Libre Office Impress で PDF 作成時にアニメーションを...
- &ref(ExpandAnimations-0.4.oxt);
-- このファイルを Libre Office Impress で開く → 拡張機能...
-- Libreoffice [ツール]ー[アドオン]ー[Expand Animation]...
→ これで アニメーションを展開した元ファイルを自動生成し、...
*** 半角/全角キーの無効化キーマップ [#ncf3cea6]
- vi 操作中にご入力で日本語入力になるのを回避するためのキ...
- [変換]で IME有効化、 [無変換] で IME 無効化する設定
- キーマップファイルは Mozc プロパティのツール から変更で...
-- 変更後キーマップファイル &ref(keymap_disable_HankakuZ...
-- オリジナルキーマップファイル &ref(keymap_default.txt);
*** Ubuntu 18.04 Natilus (File Manager) で Tree View を利...
- dconf-editor をインストールする
- <org>.<gnome>.<nautilus.list-view>, and here a check-bo...
- &ref(dconf.jpg);
*** Thinkpad E450 Trackpoint チューニング [#s8f59c22]
munakata@muna-E450:/sys/devices/platform$ xinput
⎡ Virtual core pointer id=2 [master ...
⎜ ↳ Virtual core XTEST pointer id=4 [sla...
⎜ ↳ AlpsPS/2 ALPS DualPoint TouchPad id=10 [sl...
⎜ ↳ AlpsPS/2 ALPS DualPoint Stick id=11 [sl...
⎣ Virtual core keyboard id=3 [master ...
↳ Virtual core XTEST keyboard id=5 [sla...
↳ Power Button id=6 [sla...
↳ Video Bus id=7 [sla...
↳ Integrated Camera: Integrated C id=8 [sla...
↳ AT Translated Set 2 keyboard id=9 [sla...
↳ ThinkPad Extra Buttons id=12 [sl...
munakata@muna-E450:/sys/devices/platform$ xinput list-pr...
Device 'AlpsPS/2 ALPS DualPoint Stick':
Device Enabled (142): 1
Coordinate Transformation Matrix (144): 1.000000, 0.000...
libinput Natural Scrolling Enabled (288): 0
libinput Natural Scrolling Enabled Default (289): 0
libinput Scroll Methods Available (292): 0, 0, 1
libinput Scroll Method Enabled (293): 0, 0, 1
libinput Scroll Method Enabled Default (294): 0, 0, 1
libinput Button Scrolling Button (306): 2
libinput Button Scrolling Button Default (307): 2
libinput Middle Emulation Enabled (298): 0
libinput Middle Emulation Enabled Default (299): 0
libinput Accel Speed (300): 0.798561 <---------------...
libinput Accel Speed Default (301): 0.000000 <--------...
libinput Accel Profiles Available (308): 1, 1
libinput Accel Profile Enabled (309): 1, 0
libinput Accel Profile Enabled Default (310): 1, 0
libinput Left Handed Enabled (302): 0
libinput Left Handed Enabled Default (303): 0
libinput Send Events Modes Available (265): 1, 0
libinput Send Events Mode Enabled (266): 0, 0
libinput Send Events Mode Enabled Default (267): 0, 0
Device Node (268): "/dev/input/event4"
Device Product ID (269): 2, 8
libinput Drag Lock Buttons (304): <no items>
libinput Horizontal Scroll Enabled (305): 1
- [[erratic behaviour of trackpoint on thinkpad t420s [UB...
*** ファイル名の一部分を一括変換(Ubuntu での rename コマ...
- ubuntu だけ rename の構文が異なる
rename "s/[変更したい部分,変更前]/[変更後の名前]/;" [...
*** ディスク一覧表示で loop デバイス等を表示しない [#uab3...
- lsblk -e 7
munakata@mvc:~$ lsblk -e 7
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 7.3T 0 disk
├─sda1 8:1 0 7.3T 0 part
│ └─md0 9:0 0 7.3T 0 raid1 /mnt/raid_vol
└─sda2 8:2 0 1007K 0 part
sdb 8:16 0 7.3T 0 disk
├─sdb1 8:17 0 7.3T 0 part
│ └─md0 9:0 0 7.3T 0 raid1 /mnt/raid_vol
└─sdb2 8:18 0 1007K 0 part
sdc 8:32 0 7.3T 0 disk
├─sdc1 8:33 0 7.3T 0 part /mnt/dtv_h264
└─sdc2 8:34 0 1004K 0 part
sdd 8:48 0 2.7T 0 disk
├─sdd1 8:49 0 2.7T 0 part /mnt/dtv_recipe
└─sdd2 8:50 0 1007K 0 part
sde 8:64 1 3.7T 0 disk
├─sde1 8:65 1 3.7T 0 part /mnt/dtv_slave
└─sde2 8:66 1 1007K 0 part
sdf 8:80 1 7.3T 0 disk
├─sdf1 8:81 1 7.3T 0 part /mnt/dtv_h264B
└─sdf2 8:82 1 1007K 0 part
sdg 8:96 1 3.7T 0 disk
├─sdg1 8:97 1 3.7T 0 part /mnt/dtv_recover
└─sdg2 8:98 1 1007K 0 part
nvme0n1 259:0 0 232.9G 0 disk
├─nvme0n1p1 259:1 0 218G 0 part /
├─nvme0n1p2 259:2 0 1K 0 part
└─nvme0n1p5 259:3 0 15G 0 part
- df -t ext4
munakata@mvc:~$ df -t ext4
Filesystem 1K-blocks Used Available Use% Mou...
/dev/nvme0n1p1 224824828 10101216 203280108 5% /
/dev/sdd1 2884152536 879263216 1858359684 33% /mn...
/dev/sdc1 7752326436 4828065860 2533542932 66% /mn...
/dev/sdf1 7751408932 3309782296 4050908992 45% /mn...
/dev/sde1 3845577736 1340366468 2309844052 37% /mn...
/dev/sdg1 3844640564 2819798184 829475120 78% /mn...
/dev/md0 7751235316 3215359744 4145164516 44% /mn...
- df -x squashfs -x tmpfs -x devtmpfs
munakata@mvc:~$ df -x squashfs -x tmpfs -x devtmpfs
Filesystem 1K-blocks Used Available Use% Mou...
/dev/nvme0n1p1 224824828 10101204 203280120 5% /
/dev/sdd1 2884152536 879572224 1858050676 33% /mn...
/dev/sdc1 7752326436 4828065860 2533542932 66% /mn...
/dev/sdf1 7751408932 3309782296 4050908992 45% /mn...
/dev/sde1 3845577736 1340366468 2309844052 37% /mn...
/dev/sdg1 3844640564 2819798184 829475120 78% /mn...
/dev/md0 7751235316 3215359816 4145164444 44% /mn...
*** Ubuntu パスワード再設定(忘れた時 → リカバリーモード...
+ BIOS起動直後にShiftキー連打
+ GRUBメニューが表示されたら &color(red){Advanced option ...
+ リカバリーメニューが表示されるので root を選択するとシ...
+ shell で以下を実行
# mount -o remount,rw / # ファイルシステム全体を読み書き...
# pwconv # /etc/passwdと/etc/shadowの整合性を取るように...
# passwd user # userのパスワードを変更する対話モードに移る
+ 再起動して通常モードでログイン
# shutdown -r now
*** [[HW 情報の表示(HW プロファイラー):https://news.myn...
|コマンド|内容|h
|hwinfo|ハードウェア情報をフル表示|
|lshw|ハードウェア情報をフル表示|
|inxi -Fxz|ハードウェア情報を表示|
|hwinfo --short|ハードウェア情報を表示|
|lshw -short|ハードウェア情報を表示|
|lscpu|CPU情報を表示|
|lshw -C cpu|CPU情報を表示|
|dmidecode -t memory|メモリ情報を表示|
|lshw -short -C memory|メモリ情報を表示|
|lspci | grep -i vga|VGA情報を表示|
|lspci -v -s|デバイス番号 指定したデバイスの情報表示|
|free -m|現在のメモリ使用状況を表示|
|top|現在のメモリ使用状況を表示|
|lshw -short -C disk|ディスク情報を表示|
|hdparm -i|デバイスファイル ディスク情報を表示|
|lsblk|ディスク情報を表示|
|fdisk -l|ディスク情報を表示|
|blkid|ディスク情報を表示|
|df|マウント情報を表示|
|lsusb|USB情報を表示|
|lspci|PCI情報を表示|
|lshw -C network|ネットワーク情報を表示|
|ifconfig -a|ネットワーク情報を表示|
|ip link show|ネットワーク情報を表示|
|netstat -i|ネットワーク情報を表示|
|ip route|ルーティング情報を表示|
|netstat -r|ルーティング情報を表示|
|dmidecode -t bios|BIOS/UEFI情報を表示|
*** apt 実行時に GPG キーエラーが出たとき → エラーとなっ...
- sudo apt-key adv --keyserver keyserver.ubuntu.com --rec...
無視:16 https://repo.mongodb.org/apt/ubuntu bionic/mongo...
パッケージリストを読み込んでいます... 完了 ...
W: GPG エラー: https://repo.mongodb.org/apt/ubuntu bioni...
公開鍵を利用できないため、以下の署名は検証できませんでし...
E: リポジトリ https://repo.mongodb.org/apt/ubuntu bionic...
N: このようなリポジトリから更新を安全に行うことができな...
N: リポジトリの作成とユーザ設定の詳細は、apt-secure(8) m...
[KGB] munakata:~$ sudo apt-key adv --keyserver keyserver...
Executing: /tmp/apt-key-gpghome.dQV3TadTUX/gpg.1.sh --ke...
gpg: 鍵68818C72E52529D4: 公開鍵"MongoDB 4.0 Release Sign...
gpg: 処理数の合計: 1
gpg: インポート: 1
*** [[Linuxカーネルビルド大全:https://qiita.com/progrunne...
*** [[マザーボード情報確認(dmidecode):https://orebibou....
- dmidecode -t BIOS
- dmidecode -t System
- dmidecode -t BaseBoard
*** Linux command line で Markdown を見る方法 [[mdless:ht...
- Ruby で書かれた Markdown ビューワー
- snap でインストール可能
*** Ubuntu でスクリーンキャスト(画面の録画) [#ue3b8a20]
- [CTRL] + [SHIFT] + [ALT] + [R] で録画開始
- 再度 [CTRL] + [SHIFT] + [ALT] + [R] で録画終了
- webm フォーマットで動画ファイルが作成され Videos または...
- デフォルトの録画時間は 10秒で、下記の設定で時間制約を...
gsettings set org.gnome.settings-daemon.plugins.media-ke...
- この方法では、画面キャストは可能だが &color(red){音声は...
- 代替手段として simplescreenrecorder というアプリを利用...
[local] munakata:~$ sudo apt install simplescreenrecorder
*** gedit で画面を左右分割 [#g8619995]
- [CTRL] + [ALT] + N
*** Ubuntu 20.04 でスケジュール Notify のポップアップを無...
- [[How to stop evolution-alarm-notify:https://askubuntu....
munakata@muna--E14G3:~$ cp /etc/xdg/autostart/org.gnome....
munakata@muna--E14G3:~$ sed -i "s/NoDisplay=true/NoDispl...
munakata@muna--E14G3:~$ gnome-session-properties
(gnome-session-properties:201684): Gtk-WARNING **: 09:49...
munakata@muna--E14G3:~$ systemctl --user mask evolution-...
Created symlink /home/munakata/.config/systemd/user/evol...
munakata@muna--E14G3:~$ systemctl --user mask evolution-...
Created symlink /home/munakata/.config/systemd/user/evol...
munakata@muna--E14G3:~$ systemctl --user mask evolution-...
Created symlink /home/munakata/.config/systemd/user/evol...
munakata@muna--E14G3:~$ systemctl --user mask evolution-...
Created symlink /home/munakata/.config/systemd/user/evol...
*** ゲストOS で ping が使えるようにする [#yb184942]
- sudo apt install iputils-ping net-tools
*** ゲストOS とホストOS 間でコピペが使えるようにする [#j9...
- sudo apt install spice-vdagent
*** [[Ubuntu のマウス中央ボタンでのペーストを無効にする:h...
- $ sudo apt-get install xbindkeys xsel xdotool
- $ ~/.xbindkeysrcに以下の二行を記入して保存
-- "echo -n | xsel -n -i; pkill xbindkeys; xdotool click ...
-- b:2 + Release
- $ xbindkeys -p
- ~/.xsessionrc
-- xbindkeys -p
*** [[GNOME shell extentions:]] のインストール [#c2661c79]
- sudo apt install gnome-shell-extension-prefs
*** [[BIZ UD フォント(モリサワ、無償版):https://fonts.g...
*** [[Dropbox CLI (for Ubuntu-server):https://www.dropbox...
- Dropbox デーモンのインストール
cd ~ && wget -O - "https://www.dropbox.com/download?plat...
- 上記コマンドの実行で新規作成される .dropbox-dist フォル...
[KGB2] munakata:~/.dropbox-dist$ ./dropboxd
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
Dropbox ...
https://www.dropbox.com/cli_link_nonce?nonce=86e1ae227f3...
- 最後の行(は、繰り返し表示される)の URL をブラウザーに...
- リンクが成功したら、上記のデーモンは [CTRL+C] で強制終...
- Dropbox CLI (実態は python スクリプト)をダウンロード
[KGB2] munakata:~/Downloads$ wget -O dropbox.py https://...
- CLI の実行 ''python3 dropbox.py コマンド''
[KGB2] munakata:~/Downloads$ python3 dropbox.py
Dropbox command-line interface
commands:
Note: use dropbox help <command> to view usage for a spe...
autostart automatically start Dropbox at login
exclude ignores/excludes a directory from syncing
filestatus get current sync status of one or more files
help provide help
lansync enables or disables LAN sync
ls list directory contents with current sync ...
proxy set proxy settings for Dropbox
puburl get public url of a file in your Dropbox's...
running return whether Dropbox is running
sharelink get a shared link for a file in your Dropbox
start start dropboxd
status get current status of the dropboxd
stop stop dropboxd
throttle set bandwidth limits for Dropbox
update download latest version of Dropbox
version print version information for Dropbox
[KGB2] munakata:~/Downloads$ python3 dropbox.py status
Dropbox isn't running!
[KGB2] munakata:~/Downloads$ python3 dropbox.py lansync
Dropbox isn't running!
[KGB2] munakata:~/Downloads$ python3 dropbox.py start
Starting Dropbox...dropbox: load fq extension '/raid_vol...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
Dropbox isn't running!
Done!
[KGB2] munakata:~/Downloads$ python3 dropbox.py lansync n
[KGB2] munakata:~/Downloads$ python3 dropbox.py update
Dropbox is the easiest way to share and store your files...
In order to use Dropbox, you must download the proprieta...
Downloading Dropbox... 100%
Unpacking Dropbox... 100%dropbox: load fq extension '/ra...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
success!
[KGB2] munakata:~/Downloads$ python3 dropbox.py status
開始中...
To link this computer to a Dropbox account, visit the fo...
https://www.dropbox.com/cli_link_nonce?nonce=c03c0bfb6a8...
[KGB2] munakata:~/Downloads$ python3 dropbox.py status
同期中(39,682 件のファイル • 17 分)
39,682 件のファイルをダウンロード中 (0.0KB/秒、17 分)
[KGB2] munakata:~/Downloads$ python3 dropbox.py autostar...
[KGB2] munakata:~/Downloads$ python3 dropbox.py status
同期中(35,890 件のファイル • 1 時間)
35,890 件のファイルをダウンロード中 (0.0KB/秒、1 時間)
*** Thinkpad E14 で vi 編集中に日本語入力ができなくなる [...
- 一旦 vi 終了し Terminal で [変換] キーを押して Mozc ...
*** Ubuntu 22.04 で突然ネットワークが使えなくなった [#jf3...
- 物理的なネットワークは正常(リンクアップしている)
- 物理的なネットワークカードは認識されている(が、lshw で...
munakata@muna-Linux:~$ lspci | grep net
03:00.0 Ethernet controller: Realtek Semiconductor Co., ...
munakata@muna-Linux:~$ sudo lshw
(snip)
*-network UNCLAIMED
詳細: Ethernet controller
製品: RTL8111/8168/8411 PCI Express Gigabit Ethern...
ベンダー: Realtek Semiconductor Co., Ltd.
物理ID: 0
バス情報: pci@0000:03:00.0
バージョン: 11
幅: 64 bits
クロック: 33MHz
性能: pm msi pciexpress msix vpd bus_master cap_list
設定: latency=0
リソース: IOポート:d000(サイズ=256) メモリー:f7100...
- しかし、ネットワークインターフェースが活性化されていな...
munakata@muna-Linux:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue st...
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: nm-bridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500...
link/ether da:8f:a5:ad:aa:0c brd ff:ff:ff:ff:ff:ff
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 ...
link/ether 52:54:00:e3:40:81 brd ff:ff:ff:ff:ff:ff
- システムSWの更新で、必要なドライバーがインストールされ...
- 現在のシステム環境を確認
munakata@muna-Linux:~$ uname -r
6.2.0-26-generic
- ''linux-modules-extra-$(uname -r)'' パッケージを ''http...
-- https://packages.ubuntu.com/jammy/kernel/linux-modules...
- Bootable Ubuntu image (usb) でシステムを起動(すればネ...
- ブラウザーから上記ファイル(linux-modules-extra-6.2.0-2...
- ホストマシン上のディスクをマウントして、書き込み可能エ...
- 再起動後に、上記ファイルをインストールし、再起動
munakata@muna-Linux:~$ sudo apt install ./linux-modules-...
- [[参考ページ:https://askubuntu.com/questions/1437477/22...
*** Ubuntu 22.04 以降の画面キャプチャの方法 [#i3eb0e09]
- shutter の領域を指定してキャプチャ機能が使えなくなった
- そのかわり [PrtSc] キーを押すと OS にバンドルされた画面...
- キャプチャ画面は Picture ホルダーの スクリーンショット ...
*** Ubuntu ホスト名の確認 [#e656109c]
- 以前は hostname コマンドを利用していたが、''hostnamectl...
-- KGB2 サーバー
[KGB2] munakata:~$ hostnamectl
Static hostname: kgb2
Icon name: computer-desktop
Chassis: desktop
Machine ID: ad37e2bbaa134fa18321a14b7b21ae30
Boot ID: 4359753f434d4360930bd9ab267e556c
Operating System: Ubuntu 22.04.3 LTS
Kernel: Linux 5.15.0-92-generic
Architecture: x86-64
Hardware Vendor: BIOSTAR Group
Hardware Model: B550MXC PRO
-- 会社 Linux Desktop
munakata@muna-Linux:~$ hostnamectl
Static hostname: muna-Linux
Icon name: computer-desktop
Chassis: desktop
Machine ID: 30aea48dddb743419e553e95758bddad
Boot ID: ced5ef1d2556421185469de6f335caf9
Operating System: Ubuntu 22.04.3 LTS
Kernel: Linux 6.5.0-14-generic
Architecture: x86-64
*** Ubuntu 22.04 で exFAT を利用するには ''exfat-utils'' ...
[KGB2] munakata:~$ sudo apt install exfat-fuse exfatprog...
*** [[Ununtu 22.04 で「Press 'Ctrl'+'C'” to cancel filesy...
- The key observation here is that normally, there's a lo...
- In my case (and I expect this to be not uncommon), this...
*** Ubuntu Server イメージでシステム修復 [#le6197e8]
- Ubuntu Server ISO で起動した場合、Tryモード(インストー...
-- インストーラープログラム実行中の任意のタイミングで Ctr...
*** Ubuntu で sudo が使えなくなった場合の回避策 [#ja730a9b]
- (例えば visudo の編集に失敗するなどして)sudo が使えな...
-- &color(red){電源 ON 直後に [ESC] キーを連打して GRUB ...
-- recovery モードを選択し、&color(red){root を選ぶ};(と...
-- shell で必要な操作を実行し reboot する。
*** USB 外付け HDD を含むシステムでのスクリプト実行の問題...
- USB 接続のHDDを接続しない状態でバックアップなどのスクリ...
-- &color(red){実際の USB HDD ではなく、そのマウントポイ...
-- 正常にマウントできた場合には、マウントポイント上のファ...
-- 一度アンマウントして、マウントポイント上に誤って書かれ...
-- バックアップスクリプトで、実際にファイルがマウントされ...
--- ChatGPT のスクリプト案(他にも色々方法の提案あり)
#!/bin/bash
MOUNT_POINT="/path/to/mount/point"
if grep -qs "$MOUNT_POINT" /proc/mounts; then
echo "External HDD is mounted."
else
echo "External HDD is not mounted. Exiting script."
exit 1
fi
--- &ref(backup_auto.sh);
*** Ubuntu Firmware 管理 (fwupdmgr) [#p92bd018]
-- ファームウエアアップデートの実行(可能なもの全て)
[KGB2] munakata:~$ sudo fwupdmgr update
Devices with no available firmware updates:
• CT500P1SSD8
No updatable devices
-- コマンド使用方法
[KGB2] munakata:~$ sudo fwupdmgr --help
Usage:
fwupdmgr [OPTION…]
activate [DEVICE-ID|GUID] Activate devices
block-firmware [CHECKSUM] Blocks a specific fi...
clear-results DEVICE-ID|GUID Clears the results f...
device-emulate [FILENAME1] [FILENAME2]
Emulate a device usi...
device-test [FILENAME1] [FILENAME2]
Test a device using ...
device-wait GUID|DEVICE-ID Wait for a device to...
disable-remote REMOTE-ID Disables a given rem...
downgrade [DEVICE-ID|GUID] Downgrades the firmw...
download LOCATION Download a file
emulation-load FILENAME Load device emulatio...
emulation-save FILENAME Save device emulatio...
emulation-tag [DEVICE-ID|GUID] Adds devices to watc...
emulation-untag [DEVICE-ID|GUID] Removes devices to w...
enable-remote REMOTE-ID Enables a given remote
get-approved-firmware Gets the list of app...
get-bios-setting [SETTING1] [SETTING2] [--no-authentic...
get-bios-settingsの...
get-bios-settings [SETTING1] [SETTING2] [--no-authenti...
Retrieve BIOS settin...
get-blocked-firmware Gets the list of blo...
get-details FILE Gets details about a...
get-devices Get all devices that...
get-history Show history of firm...
get-plugins Get all enabled plug...
get-releases [DEVICE-ID|GUID] Gets the releases fo...
get-remotes Gets the configured ...
get-results DEVICE-ID|GUID Gets the results fro...
get-topology get-devicesの別名
get-updates [DEVICE-ID|GUID] Gets the list of upd...
get-upgrades [DEVICE-ID|GUID] get-updatesの別名
inhibit [REASON] Inhibit the system t...
install [DEVICE-ID|GUID] [VERSION]
Install a specific f...
local-install FILE [DEVICE-ID|GUID]
Install a firmware f...
modify-config KEY,VALUE Modifies a daemon co...
modify-remote REMOTE-ID KEY VALUE
Modifies a given rem...
quit Asks the daemon to q...
refresh [FILE FILE_SIG REMOTE-ID]
Refresh metadata fro...
reinstall [DEVICE-ID|GUID] Reinstall current fi...
report-devices Upload the list of u...
report-export Export firmware hist...
report-history Share firmware histo...
security Gets the host securi...
security-fix [APPSTREAM_ID] Fix a specific host ...
security-undo [APPSTREAM_ID] Undo the host securi...
set-approved-firmware FILENAME|CHECKSUM1[,CHECKSUM2][,...
Sets the list of app...
set-bios-setting SETTING1 VALUE1 [SETTING2] [VALUE2]
Sets one or more BIO...
switch-branch [DEVICE-ID|GUID] [BRANCH]
Switch the firmware ...
sync Sync firmware versio...
sync-bkc syncの別名
unblock-firmware [CHECKSUM] Unblocks a specific ...
uninhibit INHIBIT-ID Uninhibit the system...
unlock DEVICE-ID|GUID Unlocks the device f...
update [DEVICE-ID|GUID] Updates all specifie...
upgrade [DEVICE-ID|GUID] updateの別名
verify [DEVICE-ID|GUID] Checks cryptographic...
verify-update [DEVICE-ID|GUID] Update the stored cr...
Help Options:
-h, --help Show help options
Application Options:
-v, --verbose 追加のデバッグ情報を表示します
--version Show client and daemon versi...
--download-retries Set the download retries for...
--offline Schedule installation for ne...
--allow-reinstall Allow reinstalling existing ...
--allow-older Allow downgrading firmware v...
--allow-branch-switch Allow switching firmware bra...
--force Force the action by relaxing...
-y, --assume-yes Answer yes to all questions
--sign Sign the uploaded data with ...
--no-unreported-check Do not check for unreported ...
--no-metadata-check Do not check for old metadata
--no-remote-check Do not check if download rem...
--no-reboot-check Do not check or prompt for r...
--no-safety-check Do not perform device safety...
--no-device-prompt Do not prompt for devices
--no-history Do not write to the history ...
--show-all Show all results
--disable-ssl-strict Ignore SSL strict checks whe...
--p2p Only use peer-to-peer networ...
--filter Filter with a set of device ...
--filter-release Filter with a set of release...
--json Output in JSON format
--no-security-fix Do not prompt to fix securit...
--no-authenticate Don't prompt for authenticat...
This tool allows an administrator to query and control t...
-- 管理対象デバイスの表示
[KGB2] munakata:~$ sudo fwupdmgr get-devices
BIOSTAR Group B550MXC PRO
│
├─AMD Ryzen 5 5600G with Radeon Graphics:
│ │ Device ID: 4bde70ba4e39b28f9eab1628f9dd6e...
│ │ Current version: 0x0a50000d
│ │ Vendor: Advanced Micro Devices, Inc.
│ │ GUIDs: 79759cdc-94db-5098-be7b-eb0252...
│ │ 20b595b0-5892-5870-8e4c-688133...
│ │ Device Flags: • Internal device
│ │
│ └─Secure Processor:
│ Device ID: c54ab0237d7a8db8c717b68e0be78e...
│ Current version: 00.11.02.7b
│ Bootloader Version:00.11.02.7b
│ Vendor: Advanced Micro Devices, Inc. (...
│ GUIDs: 0e8dc554-a0a2-51fb-b439-1eb72b...
│ bd5a5081-60b8-57cb-91d6-78e850...
│ Device Flags: • Internal device
│
├─CT500P1SSD8:
│ Device ID: 8e92eda1ab953dd9f27d11cd320c36...
│ Summary: NVM Express solid state drive
│ Current version: P3CR021
│ Vendor: Micron/Crucial Technology (NVM...
│ Serial Number: 2127300AAAB9
│ GUIDs: 43fd42e8-36d1-5486-9b96-cbac3c...
│ cad63970-876b-50ef-8576-36ffa1...
│ 375730e6-e87b-5a4c-9ee3-034f2d...
│ Device Flags: • Internal device
│ • Updatable
│ • System requires external pow...
│ • Needs a reboot after install...
│ • Device is usable for the dur...
│
├─Cezanne [Radeon Vega Series / Radeon Vega Mobile Serie...
│ │ Device ID: f0c42c4d354e719e9d5cd3366ebe36...
│ │ Summary: Cezanne Generic VBIOS
│ │ Current version: 017.010.000.030.000000
│ │ Vendor: Advanced Micro Devices, Inc. [...
│ │ GUID: abf6849d-1bc5-5941-80f8-babdaf...
│ │ Device Flags: • Cryptographic hash verificat...
│ │
├─Mass storage controller:
│ Device ID: 08740947f5235290dc47990eb8e346...
│ Current version: 02
│ Vendor: ASMedia Technology Inc. (PCI:0...
│ GUIDs: 210819f3-da74-587f-a857-8d4e38...
│ 08903ce1-1a19-53cd-b343-239f3b...
│ 340dec82-fc69-5ccc-8971-dfe6ff...
│ e2758d1c-dbd1-55fe-a571-3596a5...
│ Device Flags: • Internal device
│ • Cryptographic hash verificat...
│
└─TPM:
Device ID: c6a80ac3a22083423992a3cb150189...
Summary: TPM 2.0 Device
Current version: 3.84.0.5
Vendor: Advanced Micro Devices, Inc. (...
GUIDs: 9305de1c-1e12-5665-81c4-37f8e5...
78a291ae-b499-5b0f-8f1d-74e1fe...
65a3fced-b423-563f-8098-bf5c32...
5e704f0d-83cb-5364-8384-f46d72...
Device Flags: • Internal device
• System requires external pow...
• Needs a reboot after install...
• Device can recover flash fai...
• Full disk encryption secrets...
• Signed Payload
*** fail2ban [#dd24732f]
- 設定
-- インストール
sudo apt update
sudo apt install fail2ban
-- 動作確認(インストール後)
sudo systemctl status fail2ban
active (running) になっていればOKです。
-- SSH 用の保護設定(jail.local)
設定ファイルをコピーしてカスタマイズします:
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
sudo vi /etc/fail2ban/jail.local
以下のような項目を編集・確認します([sshd] セクション):
[sshd]
enabled = true
port = ssh
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
bantime = 3600
findtime = 600
|項目|説明|h
|enabled|SSH 用保護を有効に|
|port|SSH ポート(変更してる場合は合わせて)|
|maxretry|失敗回数(3回失敗したら)|
|bantime|BAN する秒数(3600秒 = 1時間)|
|findtime|この秒数内に maxretry 回失敗したら発動|
-- 設定反映(fail2ban 再起動)
sudo systemctl restart fail2ban
- 動作確認
[KGB2] munakata:~$ sudo fail2ban-client status sshd
Status for the jail: sshd
|- Filter
| |- Currently failed: 1
| |- Total failed: 3240
| `- Journal matches: _SYSTEMD_UNIT=sshd.service + _COM...
`- Actions
|- Currently banned: 0
|- Total banned: 38
`- Banned IP lis
*** Ubuntu NotePC (Ubuntu 24.04) から kgb2 のボリューム(...
- あらかじめサーバー側で 192.168.11.x からの NFS 接続を許可
[KGB2] munakata:~/winshare/haicon$ sudo apt install nfs-...
[KGB2] munakata:~/winshare/haicon$ sudo vi /etc/exports
[KGB2] munakata:~/winshare/haicon$ cat /etc/exports
/raid_vol/home/munakata/winshare 192.168.11.0/24(rw,syn...
[KGB2] munakata:~/winshare/haicon$ sudo exportfs -ra
[KGB2] munakata:~/winshare/haicon$ sudo systemctl restar...
[KGB2] munakata:~/winshare/haicon$ systemctl status nfs-...
● nfs-server.service - NFS server and services
Loaded: loaded (/usr/lib/systemd/system/nfs-server....
Active: active (exited) since Sat 2025-12-13 11:23:...
Process: 298135 ExecStartPre=/usr/sbin/exportfs -r (...
Process: 298137 ExecStart=/usr/sbin/rpc.nfsd (code=e...
Main PID: 298137 (code=exited, status=0/SUCCESS)
CPU: 9ms
12月 13 11:23:40 kgb2 systemd[1]: Starting nfs-server.se...
12月 13 11:23:40 kgb2 systemd[1]: Finished nfs-server.se...
[KGB2] munakata:~/winshare/haicon$ exportfs -v
/raid_vol/home/munakata/winshare
192.168.11.0/24(sync,wdelay,hide,no_subt...
- クライアント側で
munakata@muna-E14G3:sudo apt install nfs-common
munakata@muna-E14G3:sudo mkdir /mnt/samba_winshare
munakata@muna-E14G3:sudo mount -t nfs4 192.168.11.20:/ra...
*** scp でリモートファイルをコピーする [#j3361974]
scp -P(ポート)-i(秘密鍵)user@server:file_location/nam...
munakata@muna-U2404:~$ scp -P 8722 -i ~/.ssh/office2025 ...
auth.log.1 ...
195KB 3.0MB/s 00:00
munakata@muna-U2404:~$
*** [[The advanced color palette editor (Pallette App):ht...
終了行:
- [[@IT Linux tips:http://www.atmarkit.co.jp/flinux/ren...
- [[日経リナックス コマンド逆引き大全:http://homepage2.ni...
- [[パクリの Tips 集>UnixTips]]
- [[Linux コマンド(kernel API):http://kazmax.zpp.jp/cmd/p...
----
#contents
*** OS 起動時のサービスの開始/停止設定 [#lc9ebf29]
''COLOR(GREEN){現在の起動時の設定を確認する} ''
[root@rh01 root]# chkconfig --list
kudzu 0:off 1:off 2:off 3:off 4:off ...
syslog 0:off 1:off 2:on 3:on 4:on ...
netfs 0:off 1:off 2:off 3:on 4:on ...
network 0:off 1:off 2:on 3:on 4:on ...
random 0:off 1:off 2:on 3:on 4:on ...
rawdevices 0:off 1:off 2:off 3:on 4:on ...
pcmcia 0:off 1:off 2:off 3:off 4:off ...
( 以下 サービスのリストが続く、サービス名を指定すること...
''COLOR(GREEN){サービスの起動/停止を指定する}''
[root@rh01 root]# chkconfig --list sendmail
sendmail 0:off 1:off 2:on 3:on 4:on ...
[root@rh01 root]# chkconfig --level 2345 sendmail off
[root@rh01 root]# chkconfig --list sendmail
sendmail 0:off 1:off 2:off 3:off 4:off ...
&heart; [[KnoweldgeBase トップページに戻る>Knowledge_Bank...
*** サービス中のポートの検査 [#caea6da0]
''COLOR(GREEN){netstat -ln}''~
例えば http サーバーを起動している場合 80番ポートが LIS...
確認することができる。 WindowsNT 系では netstat -an とい...
[root@muna-linux root]# netstat -ln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Addr...
tcp 0 0 0.0.0.0:32768 0.0.0.0:* ...
tcp 0 0 127.0.0.1:32769 0.0.0.0:* ...
tcp 0 0 0.0.0.0:32771 0.0.0.0:* ...
tcp 0 0 0.0.0.0:139 0.0.0.0:* ...
tcp 0 0 127.0.0.1:783 0.0.0.0:* ...
tcp 0 0 0.0.0.0:111 0.0.0.0:* ...
tcp 0 0 0.0.0.0:6000 0.0.0.0:* ...
tcp 0 0 0.0.0.0: 0.0.0.0:* ...
tcp 0 0 0.0.0.0:22 0.0.0.0:* ...
tcp 0 0 127.0.0.1:631 0.0.0.0:* ...
tcp 0 0 0.0.0.0:23 0.0.0.0:* ...
udp 0 0 0.0.0.0:32768 0.0.0.0:*
udp 0 0 192.168.1.11:137 0.0.0.0:*
udp 0 0 0.0.0.0:137 0.0.0.0:*
udp 0 0 192.168.1.11:138 0.0.0.0:*
udp 0 0 0.0.0.0:138 0.0.0.0:*
udp 0 0 0.0.0.0:854 0.0.0.0:*
udp 0 0 0.0.0.0:111 0.0.0.0:*
udp 0 0 0.0.0.0:631 0.0.0.0:*
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node...
unix 2 [ ACC ] STREAM LISTENING 4659 ...
unix 2 [ ACC ] STREAM LISTENING 4994 ...
unix 2 [ ACC ] STREAM LISTENING 4763 ...
unix 2 [ ACC ] STREAM LISTENING 4762 ...
unix 2 [ ACC ] STREAM LISTENING 44 /...
unix 2 [ ACC ] STREAM LISTENING 4911 ...
unix 2 [ ACC ] STREAM LISTENING 4967 ...
unix 2 [ ACC ] STREAM LISTENING 4976 ...
unix 2 [ ACC ] STREAM LISTENING 5053 ...
unix 2 [ ACC ] STREAM LISTENING 5074 ...
unix 2 [ ACC ] STREAM LISTENING 5118 ...
unix 2 [ ACC ] STREAM LISTENING 5140 ...
unix 2 [ ACC ] STREAM LISTENING 5288 ...
unix 2 [ ACC ] STREAM LISTENING 5319 ...
unix 2 [ ACC ] STREAM LISTENING 6234 ...
unix 2 [ ACC ] STREAM LISTENING 4515 ...
unix 2 [ ACC ] STREAM LISTENING 4669 ...
unix 2 [ ACC ] STREAM LISTENING 4343 ...
unix 2 [ ACC ] STREAM LISTENING 4899 ...
unix 2 [ ACC ] STREAM LISTENING 4353 ...
unix 2 [ ACC ] STREAM LISTENING 4796 ...
[root@muna-linux root]#
&heart; [[KnoweldgeBase トップページに戻る>Knowledge_Bank...
*** Fedra Core に 東風フォント を導入する [#me0e5b9f]
[ Font の実体 ] ( X Font Server を利用している環境 )
Redhat: /usr/share/fonts/
Vine : /usr/X11R6/lib/X11/fonts
[ xfs の設定ファイル ]
/etc/X11/fs/config
Redhat9 のデータ ----------> &ref(rh9_fonts_list.txt);~
Fedra core 1 のデータ -----> &ref(fedra_fonts_list.txt);~
~
Redhat 9.0 config --------> &ref(fs_config_rh9.txt);~
Fedra Core 1.0 config ----> &ref(fs_config_fedra.txt);
~
[ Redhat 9.0 で使われている 東風フォント ]
[root@muna-linux /]# ls -l /usr/share/fonts/ja/TrueType/
合計 9700
-rw-r--r-- 1 root root 1548 1月 31 2003...
-rw-r--r-- 1 root root 8313 5月 5 21:33...
-rw-r--r-- 1 root root 3823 5月 5 21:34...
-rw-r--r-- 1 root root 3823 5月 5 21:34...
-rw-r--r-- 1 root root 4043488 1月 31 2003...
-rw-r--r-- 1 root root 17318 1月 31 2003...
-rw-r--r-- 1 root root 51972 1月 31 2003 k...
-rw-r--r-- 1 root root 17318 1月 31 2003...
Kochi Font Archive -----> &ref(kochi.tgz);~
[東風フォント制作活動終了]~
古川さんによって行われていたフリーのアウトラインフォント...
の制作活動が終了となりました。~
http://www.on.cs.keio.ac.jp/~yasu/jp_fonts.html~
slashdotジャパン「東風フォント製作中止に」: http://slashd...
[ Fedra Core では 東風フォント の代替フォントが組み込ま...
[root@hmuna ja]# ls -l /usr/share/fonts/ja/TrueType/
合計 16444
-rw-r--r-- 1 root root 1548 8月 11 2003...
-rw-r--r-- 1 root root 8343 6月 29 13:26...
-rw-r--r-- 1 root root 3465 6月 29 13:26...
-rw-r--r-- 1 root root 3465 6月 29 13:26...
-rw-r--r-- 1 root root 7770652 8月 11 2003...
-rw-r--r-- 1 root root 17318 8月 11 2003...
-rw-r--r-- 1 root root 8967464 8月 11 2003...
-rw-r--r-- 1 root root 17318 8月 11 2003...
[ Fedra に 東風フォント をコピーして関連ファイルをリネー...
[root@hmuna wk]# ls -l /usr/share/fonts/ja/TrueType/
合計 32108
-rw-r--r-- 1 root root 1548 7月 7 21:49...
-rw-r--r-- 1 root root 1548 8月 11 2003...
-rw-r--r-- 1 root root 8313 7月 7 21:49...
-rw-r--r-- 1 root root 8343 6月 29 13:26...
-rw-r--r-- 1 root root 3823 7月 7 21:49...
-rw-r--r-- 1 root root 3465 6月 29 13:26...
-rw-r--r-- 1 root root 3823 7月 7 21:49...
-rw-r--r-- 1 root root 3465 6月 29 13:26...
-rw-r--r-- 1 root root 7770652 8月 11 2003...
-rw-r--r-- 1 root root 17318 8月 11 2003...
-rw-r--r-- 1 root root 4043488 7月 7 21:44...
-rw-r--r-- 1 root root 17318 7月 7 21:44...
-rw-r--r-- 1 root root 8967464 8月 11 2003...
-rw-r--r-- 1 root root 17318 8月 11 2003...
-rw-r--r-- 1 root root 51972 7月 7 21:44 k...
-rw-r--r-- 1 root root 17318 7月 7 21:44...
単純にコピーしただけでは 動作しなかったので強引に逆に -...
[root@hmuna TrueType]# mv kochi-gothic-subst.ttf kochi-g...
[root@hmuna TrueType]# mv kochi-gothic-subst.tti kochi-g...
[root@hmuna TrueType]# mv kochi-mincho-subst.ttf kochi-m...
[root@hmuna TrueType]# mv kochi-mincho-subst.tti kochi-m...
[root@hmuna TrueType]# mv kochi-gothic.ttf kochi-gothic-...
[root@hmuna TrueType]# mv kochi-gothic.tti kochi-gothic-...
[root@hmuna TrueType]# mv kochi-mincho.ttf kochi-mincho-...
[root@hmuna TrueType]# mv kochi-mincho.tti kochi-mincho-...
[root@hmuna TrueType]# ls -l
合計 32108
-rw-r--r-- 1 root root 1548 7月 7 21:49...
-rw-r--r-- 1 root root 1548 8月 11 2003...
-rw-r--r-- 1 root root 8313 7月 7 21:49...
-rw-r--r-- 1 root root 8343 6月 29 13:26...
-rw-r--r-- 1 root root 3823 7月 7 21:49...
-rw-r--r-- 1 root root 3465 6月 29 13:26...
-rw-r--r-- 1 root root 3823 7月 7 21:49...
-rw-r--r-- 1 root root 3465 6月 29 13:26...
-rw-r--r-- 1 root root 4043488 7月 7 21:44...
-rw-r--r-- 1 root root 7770652 8月 11 2003...
-rw-r--r-- 1 root root 17318 7月 7 21:44...
-rw-r--r-- 1 root root 17318 8月 11 2003...
-rw-r--r-- 1 root root 51972 7月 7 21:44 k...
-rw-r--r-- 1 root root 17318 7月 7 21:44...
-rw-r--r-- 1 root root 8967464 8月 11 2003...
-rw-r--r-- 1 root root 17318 8月 11 2003...
&heart; [[KnoweldgeBase トップページに戻る>Knowledge_Bank...
*** [[Fedra project ミラー:http://fedora.redhat.com/downl...
*** [[Fedra core 3 のソースコードのインストール:http://ww...
Fedora Core 2まではyumコマンドでカーネルソースをダウンロ...
そのため、FTPサイトなどからカーネルソースをダウンロードし...
- まず最初に、unameコマンドでダウンロードすべきバージョン...
# uname -r -m
2.6.9-1.681_FC3smp i686
- 動作しているカーネルのバージョン(2.6.9-1.681_FC3smp)...
- サイトによってディレクトリ構成は異なるが、Fedora/update...
- ダウンロードが終わったら、rootになってrpmコマンドでイン...
# rpm -ihv kernel-2.6.9-1.681_FC3.src.rpm
1:kernel ################################...
- そして、Fedora Core 3独自の設定などを適用したソースを作...
- その際に、unameで調べたCPUのタイプを--targetオプション...
# rpmbuild -bp --target i686 /usr/src/redhat/SPECS/kerne...
作成中ターゲットプラットフォーム: i686
(省略)
- ビルドが終了すると、/usr/src/redhat/BUILD/kernel-2.6.9...
# mv /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9 /usr...
# ls /usr/src/linux-2.6.9/
COPYING Makefile configs include lib ...
CREDITS README crypto init mm ...
Documentation REPORTING-BUGS drivers ipc net ...
MAINTAINERS arch fs kernel scripts
*** Fedra core の yum によるパッケージのアップデート [#cf...
yum の設定ファイル /etc/yum.conf → &ref(yum.conf);~
yum download サイト一覧 ---------→ http://fedora.redhat.c...
+ yum.conf にダウンロード先を設定する ・・・・ yum.conf ...
baseurl=http://ftp.kddlabs.co.jp/pub/Linux/distributions...
+GPG(GNU Privacy Guard )を有効にする ・・・・ yum.co...
gpgcheck=1
+rpm --import /usr/share/rhn/PRM-GPG-KEY-fedora を実行しg...
+yum を自動実行を設定する
chkconfig yum on
+yum サービスを起動状況を確認する
service yum status
+yum サービスを起動する ・・・・ /etc/cron.daily/yum.cron...
service yum start
+/etc/cron.daily/yum.cron の中の yum 自動起動の記述
#!/bin/sh
if [ -f /var/lock/subsys/yum ]; then
/usr/bin/yum -R 10 -e 0 -d 0 -y update yum
/usr/bin/yum -R 120 -e 0 -d 0 -y update
fi
***YUM コマンドの使い方 [#ba9fa039]
-yum list
>利用可能なソフトウェアの一覧を表示させます。
-yum check-update OR yum list updates
>更新可能なパッケージがあるかどうかの確認ができます。
-yum update
>U新しいパッケージがあれば、全て更新します。
-yum install <packagename>
>指定した特定のパッケージをインストールします。(この場合...
-yum search <word>
>パッケージ名をもとにして、その詳細などを検索できます。
-yum info <packagename>
>あるパッケージについての基本情報を表示できます。
All of the above commands can take shell-style wildcards ...
&heart; [[KnoweldgeBase トップページに戻る>Knowledge_Bank...
*** Fedra core 3 で yum を使う方法 [#s6d6965b]
-Fedora Core 3のインストール後、初めてyumコマンドを実行す...
が表示される。
# yum install samba
You have enabled checking of packages via GPG keys. This...
thing. However, you do not have any GPG public keys inst...
download the keys for packages you wish to install and i...
You can do that by running the command:
rpm --import public.gpg.key
For more information contact your distribution or packag...
[root@localhost ~]# rpm --import public.gpg.key
エラー: public.gpg.key: import read failed.
-これは、Fedora Core 3ではパッケージのGPGキーチェックがデ...
# rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora
-これでyumコマンドを使用できるようになる。なお、Fedora Co...
# yum update
Setting up Update Process
Setting up Repo: base
repomd.xml 100% |=========================| 1....
Setting up Repo: updates-released
repomd.xml 100% |=========================| 9...
*** DNS レコードの検索 [#f16e3331]
''COLOR(GREEN){nslookup ドメイン名}''~
DNS サーバーに配信されている ドメイン名のアドレスを検索す...
通常は トップドメイン[ hmuna.com 等 ] を検索するが、ロ...
[ ns1.hmuna.com ]や Web Server [ www.hmuna.com ]など...
して検索することもできる。 このアドレスが不一致になってい...
の更新が正しく行われていないので解析と対策が必要。 DNS サ...
いる場合など、片方の更新がエラーになっている可能性がある...
[root@muna-linux root]# nslookup hmuna.com
Note: nslookup is deprecated and may be removed from fu...
Consider using the `dig' or `host' programs instead. Ru...
the `-sil[ent]' option to prevent this message from appe...
Server: 192.168.1.1
Address: 192.168.1.1#53
...
Non-authoritative answer:
Name: hmuna.com
Address: 210.130.99.82
...
[root@muna-linux root]# nslookup www.hmuna.com
Note: nslookup is deprecated and may be removed from fu...
Consider using the `dig' or `host' programs instead. Ru...
the `-sil[ent]' option to prevent this message from appe...
Server: 192.168.1.1
Address: 192.168.1.1#53
...
Non-authoritative answer:
Name: www.hmuna.com
Address: 210.130.99.82
...
[root@muna-linux root]# nslookup ns1.hmuna.com
Note: nslookup is deprecated and may be removed from fu...
Consider using the `dig' or `host' programs instead. Ru...
the `-sil[ent]' option to prevent this message from appe...
Server: 192.168.1.1
Address: 192.168.1.1#53
...
Name: ns1.hmuna.com
Address: 210.130.99.82
...
&heart; [[KnoweldgeBase トップページに戻る>Knowledge_Bank...
*** パッチの 作成 と 適用 [#y69f6705]
''COLOR(GREEN){diff コマンドを利用してパッチ情報を作成す...
ここでは''-u(unified形式)''を利用してゆくが''-c(context形...
diff -u 変更前ファイル 変更後ファイル > patch.txt
(ファイルの順番に注意。最新は2の方なので)
''COLOR(GREEN){パッチの当て方}''
patch < patch.txt
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- test Thu May 8 14:57:14 2003
|+++ test2 Thu May 8 15:02:48 2003
--------------------------
Patching file test using Plan A...
Hunk #1 succeeded at 1.
done
-ちなみに、パッチを当てると''test.orig''としてtestのバッ...
&heart; [[KnoweldgeBase トップページに戻る>Knowledge_Bank...
*** パッチの適用(2) [#lc30ae7a]
- パッチは diff を用いることで作成できます。この際 -c オ...
-- -c オプションを付けると変更部分の前後関係も記録する co...
- ファイル単位のパッチ作成~
1ファイル毎にパッチを作成するには以下のようにします。
-- FROM_FILE の所に変更前のファイル名
-- TO_FILE の所に変更済みのファイル名
-- PATCH_FILE の所に作成するパッチのファイル名
diff -c FROM_FILE TO_FILE > PATCH_FILE
- ディレクトリの中にある複数のファイルに対して一度にパッ...
-- FROM_DIRECTORY の所に変更前のファイルが入っているディ...
-- TO_DIRECTORY の所に変更済みのファイルが入っているディ...
-- PATCH_FILE の所に作成するパッチのファイル名
diff -c FROM_DIRECTORY TO_DORECTORY > PATCH_FILE
- ディレクトリ以下を全てパッチ作成~
ディレクトリ以下のファイル全てについてパッチを作成する場...
diff -cr FROM_DIRECTORY TO_DORECTORY > PATCH_FILE
-- -r オプションを加えるとディレクトリ以下を階層的に検索...
- ディレクトリ単位のパッチ(追加/削除ファイルも記録)
-- 上記の方法では一方にしか存在しない、つまり追加または削...
-- 追加または削除されたファイルも記録するためには以下のよ...
diff -crN FROM_DIRECTORY TO_DORECTORY > PATCH_FILE
-- -N オプションは、ディレクトリを比較する際、片方のディ...
- パッチの適用には patch コマンドを利用する
-- ファイル単位のパッチ
-- 適用したいファイルの存在するディレクトリ上で以下のよう...
patch < PATCH_FILE
-- ディレクトリ単位のパッチ~
パッチを作成したときと相対的に同じディレクトリにて以下の...
patch -p0 -d . < PATCH_FILE
-- -p オプションは差分作成時の相対ディレクトリを有効にし...
-- -p の後ろの 0 は差分ファイルに記録されている相対ディレ...
-- 1、2 と増えていくと、記録された相対ディレクトリが頭か...
-- -d オプションはパッチを適用するディレクトリを指定しま...
- ディレクトリ単位のパッチ(追加/削除ファイルの再現)
上記の方法では、ファイルの追加はされても削除が行われませ...
patch -p -d . -E < PATCH_FILE
-- -E オプションはパッチ適用後、空のファイルは削除するよ...
*** Redhat 8/9 系で telnet を有効にするには [#z731e883]
/etc/indetd.d/telnet を編集する
service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
disable = no ・・・ 初期値としては、"yes"に
} 成っているが"no"に変える
&heart; [[KnoweldgeBase トップページに戻る>Knowledge_Bank...
***文字コードセットの変更(UTF8->EUC) [#b276e6d3]
Fedoraでは日本語でセットアップしても文字コードセットがUTF...
そこで、文字コードセットをUTF8からEUCに変更する方法です。
-LANGの設定
--「/etc/sysconfig/i18n」を編集し「LANG」および「SUPPORTE...
変更前~
LANG="ja_JP.UTF-8"
SUPPORTED="en_US.UTF-8:en_US:en:ja_JP.UTF-8:ja_JP:ja"
SYSFONT="latarcyrheb-sun16"
変更後~
#LANG="ja_JP.UTF-8"
#SUPPORTED="en_US.UTF-8:en_US:en:ja_JP.UTF-8:ja_JP:ja"
LANG="ja_JP.eucJP"
SUPPORTED="ja_JP.eucJP:ja_JP.ujis:ja_JP:ja"
SYSFONT="latarcyrheb-sun16"
//*** 複数ファイルの文字コードの一括変換 [#uabcd0d5]
// [root@spirit ja_JP_EUC]# for fname in *.hlp; do
// > nkf -e $fname > $fname.hlp_E;
// > done
*** 複数ファイルの拡張子の一括変換 [#j8f6249f]
- http://homepage2.nifty.com/cs/linux_command/re-command/...
- 検討中 (以下はだめだった)
[root@spirit ja_JP_EUC]# for fname in *.hlp.hlp; do
> mv $fname ${fname%.hlp_E}.hlp;
> done
*** [[漢字コードの自動変換:http://masaoo.blogspot.com/200...
root@mythen:# find . *.txt -exec nkf -w --overwrite {} \;
*** CD-ROM から isoイメージを作成する方法 [#g08dbbaf]
- [[mkisofs コマンドを使う方法:http://www.atmarkit.co.jp/...
[root@spirit ~]# mkisofs -r -l -J -o /home/munakata/sh2a...
INFO: EUC-JP character encoding detected by locale set...
Assuming EUC-JP encoded filenames on source file...
use -input-charset to override.
Using FS000 for ./rr_moved/fs (fs)
Using H000 for ./rr_moved/h (h)
(snip)
1.77% done, estimate finish Tue Dec 5 08:04:56 2006
3.55% done, estimate finish Tue Dec 5 08:06:48 2006
(snip)
97.60% done, estimate finish Tue Dec 5 08:05:43 2006
99.37% done, estimate finish Tue Dec 5 08:05:40 2006
Total translation table size: 0
Total rockridge attributes bytes: 1801799
Total directory bytes: 4501504
Path table size(bytes): 20078
Max brk space used f34000
281779 extents written (550 MB)
*** iso イメージを CD-ROM に焼かずにマウントする方法 [#a3...
mount -t iso9660 -o loop (iso image) /mnt/cdrom
*** kernel source code の導入 [#r579bb0c]
- SRPM ファイルを CD-ROM イメージから規定の場所にコピーする
cp /mnt/cdrom/FC...iso /usr/src/redhat/SRPM
cd /usr/src/redhat
rpmbuild --rebuild SRPMS/kernel-util-***
- git clone git://git.kernel.org/pub/scm/linux/kernel/git...
*** Linuxでrootパスワードを忘れた際の復旧方法 [#jbaf915e]
-シングルユーザモードで起動する
--LILOの場合
---電源立ち上げ時に"boot:"と表示されたら"single"シングル...
"-s"など使用している環境によって違います)
---電源立ち上げ時にグラフィカルな画面が表示される場合は[C...
boot:linux single
--GRUBの場合
---起動するカーネルを選択して[E]を押すと起動コマンドの編...
を押します。起動コマンド行の編集でコマンドの末尾に"single...
---※シングルユーザモードでのログイン後にドライブが書込み...
#mount -o remount,rw /
-ログイン後のパスワード変更
--起動後、すぐにrootユーザとしてログインするので"passwd"...
#passwd
現在使用しているパスワードが要求されるので初期パスワード...
Old Password:
新しく設定するパスワードを入力します。
New Password:
確認のために再度、新しく設定するパスワードを入力します。
Retype New Password:
設定が完了したらログアウトします。
#exit
--パスワードの変更を確認する
"root"を入力します。
login: root
次に新しく変更したパスワードを入力してログインできること...
password:
問題無くログイン出来る事を確認したらログアウトします。
#exit
*** vsftpd で root での ftp を許可する方法 [#u438727a]
-Fedora Core 3 付属の vsftpd で root での ftp を許可する...
-初期状態では ftp サーバへ root での接続が出来ない。
-『 root 』と入れただけで【 Permission denined. 】と蹴ら...
# ftp 192.168.11.253
Connected to 192.168.11.253 (192.168.11.253).
220 (vsFTPd 2.0.1)
Name (192.168.11.253:zem): root
530 Permission denied.
Login failed.
- /etc/vsftpd.ftpusers と /etc/vsftpd.user_list 両方から ...
-(設定ファイル /etc/vsftpd/vsftpd.conf で userlist_enabl...
# ftp 192.168.11.253
Connected to 192.168.11.253 (192.168.11.253).
220 (vsFTPd 2.0.1)
Name (192.168.11.253:zem): root
331 Please specify the password.
Password:
230 Login successful.
-その後は ftp で root ログイン可能。
*** 圧縮・解凍コマンド一覧 [#abf55018]
-解凍(伸展)
LEFT:
|拡張子| 圧縮形式| コマンド |h
|.tar.gz または .tgz|gzip |$ tar zxvf 解凍対象|
|.tar.bz2 または .tbz | bzip2 |$ tar jxvf 解凍対象|
|.gz |gzip| $ gunzip 解凍対象 または $ gzip -d 解凍対象|
|.bz2| bzip2| $ bunzip2 解凍対象 または $ bzip2 -d 解凍対...
|.lha または .lzh | LZH |$ lha x 解凍対象|
|.zip |zip |$ unzip 解凍対象|
|.jar|JAR|$ jar xf 解凍対象|
-圧縮
|拡張子|圧縮形式|コマンド|h
|.tar.gz |gzip| $ tar zcvf ファイル名.tar.gz 圧縮対象|
|.tar.bz2| bzip2| $ tar jcvf ファイル名.tar.bz2 圧縮対象|
|.gz |gzip |$ gzip 圧縮対象|
|.bz2 |bzip2 |$ bzip2 圧縮対象|
|.lha |LZH| $ lha c ファイル名.lzh 圧縮対象|
|.zip |zip |$ zip ファイル名.zip 圧縮対象|
|.jar |JAR| $ jar cf ファイル名.jar 圧縮対象|
-tar
--tar にはファイルをまとめる機能しかついていません
--複数のファイルをまとめただけのファイルをアーカイブファ...
--大抵の場合 gzip フィルタを通して tar.gz のように gz 形...
--拡張子 tar.gz は tbz と省略されることもあります
--より圧縮率の高い bzip2 フィルタを通したものが tar.bz2 ...
--拡張子 tar.bz2 は tbz と省略されることもあります
--複数のファイルをまとめて圧縮することができます
--ディレクトリをまとめて圧縮することができます
--主なオプション
|-c (create) | 新しいアーカイブを作成する|
|-x (extract) | アーカイブからファイルを抽出する|
|-v (verbose) | 処理したファイルの一覧を詳しく出力する|
|-z (gzip,unzip) | アーカイブを gzip にファルタする|
|-j (bzip2) | アーカイブを bzip2 にフィルタする|
-gzip, gunzip
--gzip で圧縮されるファイルの拡張子は ,.tgz です
--gunzip という解凍用コマンドも持っています
--gnuzip が認識する拡張子は .gz,-gz,.z,-z,_z,.Z,.tg...
--tar のフィルタとしても使われます
--解凍は gunzip で行います
--主なオプション
|-d (decompress) | 解凍(伸展)する|
|-c (stdout) | 出力を標準出力に書き出し,元ファイルは変更...
|-l (list) | 圧縮された個々のファイルについての情報を列挙|
|-r (recursive) | ディレクトリ構造を再帰的にたどる|
-bzip2, bunzip2
--gzip より高い圧縮率を持っています
--解凍時に認識される拡張子は .bz2, .bz, .tbz2, .tbz です
--tar のフィルタとしても使われます
--解凍は bunzip2 で行います
--主なオプション
|-d (decompress) | 解凍(伸展)する|
|-c (stdout) | 出力を標準出力に書き出し,元ファイルは変更...
|-z (compress) | 起動された名前にかかわらず圧縮|
-zip, unzip
--zip は Windows でよく使われる圧縮形式です
--解凍は unzip で行います
--複数のファイルをまとめて圧縮することができます
-lha
--lha は LZH の圧縮形式を扱います
--LZH は Windows でよく使われる圧縮形式です
--LZH は日本人によって作られた圧縮形式です
--複数のファイルをまとめて圧縮することができます
--主なオプション
|x | アーカイブファイルからファイルを抽出する|
|c | アーカイブファイルの作成する|
-JAR
--J2SE SDKに含まれているコマンドです
--Javaプログラムの実行に必要なクラスファイルやデータファ...
--主なオプション
LEFT:|c | アーカイブを新規作成する |
|t | アーカイブの内容を一覧表示する |
|x | 指定の(またはすべての)ファイルをアーカイブから抽出...
|u | 既存アーカイブを更新する |
|v | 標準出力に詳細な出力を生成する |
|f | アーカイブファイル名を指定する |
|m | 指定のマニフェストファイルからマニフェスト情報を取り...
|O | 格納のみ.ZIP 圧縮を使用しない |
|M | エントリのマニフェストファイルを作成しない|
|i | 指定の jar ファイルのインデックス情報を生成する|
|C | 指定のディレクトリに変更し,以下のファイルを取り込 |
*** 実行中のシステムの情報を表示する(uname -r -m)[#oe89f9...
- uname は起動されたマシンと OS に関する情報を出力する。...
uname は -s オプションが指定されたかのように動作する。複...
指定された場合には、選択された情報は ‘snrvm’ の順に空白で...
+ -m, --machine : マシン (ハードウェア) のタイプを表示す...
+ -n, --nodename : マシンのネットワークノードのホスト名を...
+ -r, --release : OS のリリースを表示する。
+ -s, --sysname : OS の名称を表示する。
+ -v : OS のバージョンを表示する。
+ -a, --all : 以上の情報すべてを表示する。
+ --help : 標準出力に使用方法のメッセージを出力して正常終...
+ --version : 標準出力にバージョン情報を出力して正常終了...
*** Linux システム稼働状況の取得 [#o3ff5fcf]
Linux には、複数のリソースチェックコマンドが用意されてい...
- top コマンド
-- オプションを指定する事により、他のアプリケーションやフ...
[root@power root]# top -b -n 1
top - 10:14:01 up 17 days, 21:34, 4 users, load averag...
Tasks: 146 total, 1 running, 145 sleeping, 0 stopped...
Cpu(s): 6.3% us, 0.6% sy, 0.0% ni, 89.9% id, 3.1% wa...
Mem: 1034748k total, 979436k used, 55312k free, ...
Swap: 2048248k total, 48k used, 2048200k free, ...
PID USER PR NI VIRT RES SHR S %CPU %MEM TI...
1 root 16 0 3368 460 392 S 0.0 0.0 0:0...
2 root 34 19 0 0 0 S 0.0 0.0 0:0...
3 root 5 -10 0 0 0 S 0.0 0.0 0:0...
4 root 6 -10 0 0 0 S 0.0 0.0 0:0...
--"load average" の項目が、1プロセッサあたりの瞬間の処理...
--"CPU status" の項目が CPU 使用率を表し、左からユーザモ...
--"Mem" の項目は、メモリ容量を表し、合計、使用中、空き、...
られているメモリです。
--"Swap" の項目は、Swap の利用状況を表し、合計、使用中、...
上記 top コマンドをファイルに取るか、popen で取得し、必要...
- w, uptime コマンド
[root@power root]# w
10:12:42 up 17 days, 21:33, 4 users, load average: 0....
USER TTY FROM LOGIN@ IDLE JCPU...
root :0 - 22Oct05 ?xdm? 16:52 ...
root pts/2 114.8.221.202.ts 10:11 0.00s 0.00s...
root pts/1 114.8.221.202.ts 09:46 23:39 0.00s...
[root@power root]# uptime
10:13:20 up 17 days, 21:33, 4 users, load average: 0....
-- 左から現在時間、システム稼働時間、ログインユーザ数、過...
-- Load average 情報は、top, w, uptime コマンド共、/proc/...
いるみたいです。
-vmstat コマンド
[root@power root]# vmstat
procs -----------memory---------- ---swap-- -----io---- ...
r b swpd free buff cache si so bi bo ...
0 0 48 54672 136364 428548 0 0 8 17 ...
-- procs
--- r: 実行待ちプロセス数
--- b: 割り込み不可のスリープ状態にあるプロセス数
--- w: スワップアウトされている実行可能なプロセス数
-- memory
--- swpd: 仮想メモリの容量 (kbytes)
--- buff: バッファに使用されているメモリの容量 (kbytes)
--- cache: キャッシュに使用されているメモリの容量 (kby...
-- swap
--- si: スワップインされているメモリの容量 (kbytes/s)
--- so: スワップアウトされているメモリの容量 (kbytes/s)
-- io
--- bi: ブロックデバイスに送られてブロック (blocks/s)
--- bo: ブロックデバイスから受け取ったブロック (blocks...
-- system
--- in: 1秒当たりの割り込み回数
--- cs: 1秒当たりのコンテキストスイッチ回数
-- cpu
--- us: ユーザモードの CPU 使用率
--- sy: システムモードの CPU 使用率
--- id: アイドル時の CPU 使用率
--sysstat パッケージを使用して CPU 使用状況レポートの作成...
*** パッケージがどの RPM に含まれているかを確認する方法 [...
- 特定のプログラムのインストールポイントの確認
[root@power root]# which iptables
/sbin/iptables
- このプログラム(ここでは iptables )をインストールした ...
[root@power root]# rpm -qif /sbin/iptables
Name : iptables Relocations: ...
Version : 1.2.9 Vendor: ...
Release : 2.3.1 Build Date: ...
Install Date: 2004年12月24日 16時55分59秒 Build Hos...
Group : システム環境/ベース
Source RPM: iptables-1.2.9-2.3.1.src.rpm
Size : 383050
License : GPL
Signature : DSA/SHA1, 2004年05月07日 08時10分10秒, Key...
Packager : Red Hat, Inc. <http://bugzilla.redhat.com/...
URL : http://www.netfilter.org/
Summary : Linux のパケットフィルタリング機能を管理す...
Description : Iptables ユーティリティは、ネットワークパ...
コードをLinux カーネルの中で制御します。フ...
マスカレードをセットアップする必要がある場...
をインストールする必要があります。
- この RPM で同時にインストールされるファイル名の確認
[root@power root]# rpm -ql iptables-1.2.9-2.3.1
/etc/rc.d/init.d/iptables
/etc/sysconfig/iptables-config
/lib/iptables
/lib/iptables/libipt_CLASSIFY.so
/lib/iptables/libipt_CONNMARK.so
/lib/iptables/libipt_DNAT.so
/lib/iptables/libipt_DSCP.so
/lib/iptables/libipt_ECN.so
/lib/iptables/libipt_LOG.so
/lib/iptables/libipt_MARK.so
/lib/iptables/libipt_MASQUERADE.so
/lib/iptables/libipt_MIRROR.so
/lib/iptables/libipt_NETMAP.so
*** プログラムにシンボル情報が付いているかを確認する方法 ...
- シンボル情報の有無の確認
[root@power root]# file /sbin/iptables
/sbin/iptables: ELF 32-bit LSB executable, Intel 80386, ...
for GNU/Linux 2.2.5, dynamically linked (uses shared lib...
-- "stripped" がシンボル情報が削除されている.... という...
- strip コマンドによるシンボル情報削除
[root@power root]# strip (プログラム名)
[root@power root]# strip -s (ライブラリー名)
- 特定のディレクトリ下のプログラムのシンボル情報の有無を...
#!/bin/sh
cd (ターゲットディレクトリ)
for i in `find . -type f`
do
A=`file $q | grep archive`
if [[ ! -z $A ]] ; then
strip 0S $1
fi
B=`file $1 | grep "not stripped"`
if [[ ! -z $B ]] ; then
C=`echo $1 | grep lib`
if [[ ! -z $C ]] ; then
strip -S $1
else
strip $1
fi
fi
done
*** プログラムが使用しているシステムコールの表示 ( strac...
- straceコマンドを利用することで、任意のプロセスが使用し...
[root@power root]# strace /sbin/iptables
execve("/sbin/iptables", ["/sbin/iptables"], [/* 27 vars...
uname({sys="Linux", node="power.hmuna.com", ...}) = 0
brk(0) = 0x9ea8000
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No ...
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=85651, ...}) = 0
old_mmap(NULL, 85651, PROT_READ, MAP_PRIVATE, 3, 0) = 0x...
close(3) = 0
open("/lib/libdl.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0...
fstat64(3, {st_mode=S_IFREG|0755, st_size=16708, ...}) = 0
old_mmap(0x4b3000, 12412, PROT_READ|PROT_EXEC, MAP_PRIVA...
old_mmap(0x4b5000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVA...
close(3) = 0
open("/lib/tls/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0...
fstat64(3, {st_mode=S_IFREG|0755, st_size=1459344, ...})...
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|M...
old_mmap(0x395000, 1162188, PROT_READ|PROT_EXEC, MAP_PRI...
old_mmap(0x4ab000, 16384, PROT_READ|PROT_WRITE, MAP_PRIV...
old_mmap(0x4af000, 7116, PROT_READ|PROT_WRITE, MAP_PRIVA...
close(3) = 0
mprotect(0x4b5000, 4096, PROT_READ) = 0
mprotect(0x4ab000, 4096, PROT_READ) = 0
mprotect(0x391000, 4096, PROT_READ) = 0
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7f97...
munmap(0xb7f98000, 85651) = 0
write(2, "iptables v1.2.9: ", 17iptables v1.2.9: ) ...
write(2, "no command specified", 20no command specified)...
write(2, "\n", 1 ) = 1
write(2, "Try `iptables -h\' or \'iptables -"..., 61Try ...
exit_group(2) = ?
[root@power root]#
*** プロセスの親子関係を表示するコマンド [#b1dfbb19]
- pstrace コマンド
[root@power root]# pstree
init─┬─acpid
├─2*[antivir]
├─atd
├─avgated
├─avgatefwd───2*[avgatefwd]
├─bonobo-activati
├─cannaserver
├─clock-applet
├─courierlogger───authdaemond.pla───5*[authdaemond....
├─4*[courierlogger]
├─3*[couriertcpd]
├─couriertcpd───couriertls───imapd
├─cpuspeed
├─crond
├─cupsd
├─dbus-daemon-1
├─dhcpd
├─eggcups
├─events/0─┬─aio/0
│ ├─kacpid
│ ├─kblockd/0
│ ├─khelper
│ └─2*[pdflush]
├─firefox───run-mozilla.sh───firefox-bin
├─gconfd-2
*** Fedra core デバイスドライバー(モジュール)の追加 [#g...
- ドライバーのインストールされる場所
/lib/modules/(2.6.xx-kernel 名)/kernel/drivers
- ドライバー(モジュール)のインストール
modprobe (パス)ドライバー名[xxx.ko]
上記のデフォルトパスの場合にはパス名の指定は不要
- システム起動時のドライバーのローディング設定 → /etc/mod...
*** Linux (UNIX) 環境変数の有功範囲 [#v6fe7aad]
- 質問
> init.sh実行後にexportを確認したのですが
> LD_LIBRARY_PATH=/usr/local/pkg/directfb/libが追加され...
>
> コンソールでexport LD_LIBRARY_PATH=/usr/local/pkg/dire...
> 入力すると正しく追加され、df_andiも実行できるようにな...
>
> シェル内ではexportできないのでしょうか?
> 恐れ入りますが、ご対応の程お願い致します。
- 回答
-- UNIX の一般論ですが、シェル・スクリプトで export して...
-- &color(red){export コマンドは、実行したシェルの環境変...
-- 環境変数は、実行中のプロセスに動的に確保される領域で、...
-- 一度、プロセスが起動した後は、直接、実行中のプロセスの...
-- bash などの場合、これが export コマンドであり、C 言語...
- また、シェルのプロンプトでシェル・スクリプトを実行しる...
-- つまり、親プロセスの環境変数領域には影響しないため、シ...
-- &color(red){ ただし、};
% . init.sh ~
&color(red){のような実行の仕方をした場合は、別プロセスを...
*** ロードされたモジュールを確認する [#w9a7eae4]
- lsmod を利用する
[root@spirit ~]# lsmod
Module Size Used by
i915 81221 2
parport_pc 24577 1
lp 12077 0
parport 37129 2 parport_pc,lp
i2c_dev 11329 0
i2c_core 22081 1 i2c_dev
sunrpc 162725 1
iptable_filter 2753 1
ip_tables 16705 3 ipt_REJECT,ipt_state,ipt...
button 6481 0
*** /dev/ttyS0 (シリアルポート) にアクセスできない [#h78c...
- デバイスファイルのパーミッションを変更する
[root@spirit ~]# ls -al /dev/ttyS0
crw-rw---- 1 root uucp 4, 64 5月 20 23:04 /dev/ttyS0
[root@spirit ~]# chmod o+rw /dev/ttyS0
[root@spirit ~]# ls -al /dev/ttyS0
crw-rw-rw- 1 root uucp 4, 64 5月 20 23:04 /dev/ttyS0
*** minicom の起動 [#m404e92e]
[root@spirit ~]# minicom -o -s
- -o = 初期化をしない
- -s = セットアップメニューを表示
-- セットアップ情報をファイルに指定しておくと次回からは....
*** minicom の終了 [#tc079ce1]
- CTRL + Z、 A でメニューが出る
- Q で終了 (リセットして終了)
*** minicom が文字化けする ( Cent OS ) [#zf152b70]
- Cent OS の文字コードセットは UTF-8
- minicom は sjis か EUC を想定している
- Cent OS にバンドルされた minicom を起動するには
[root@spirit ~]# LANG=ja_JP.eucJP xterm &
-- 起動した xterm 上で minicom を実行する
-- sjis の場合には jp_JP.ujisJP で起動する
[root@spirit ~]# minicom -o (セットアップファイル名)
*** sudo が使えるようにする [#w56c1338]
- visudo コマンドで /etc/sudoers を編集する
[root@spirit ~]# cat /etc/sudoers
( snip )
# User privilege specification
root ALL=(ALL) ALL
munakata ALL=(ALL) NOPASSWD: ALL <---- 追加する
- sudoグループがに関する記述があると個別ユーザーやグルー...
メントアウトする。
-- &color(red){#};%sudo ALL=(ALL:ALL) ALL
*** sudo で複数コマンドを実行する [#z9a4335d]
- sudo sh -c 'whoami; whoami'
*** rsync によるサーバー間のディレクトリ同期 [#jb497b27]
- コマンド説明 → http://www.infoscience.co.jp/technical/r...
-- --exculde でバックアップしないファイルを指定することが...
-- --exclude には一つのパターンしか指定できない。 一回の...
-- パスワード無しで実行させるために "-i" で証明書を指定す...
- 同一サーバー内のファイルバックアップ ( cp -ur よりずっ...
-- &color(blue){rsync -avz };&color(red){(ソースファイル)...
[root@spirit cron.daily]# cat /etc/cron.daily/mail_daily...
#!/bin/sh
# stop mail delivery serice
service postfix stop
# backup each Maildir updates files
rsync -avz /home/munakata/Maildir /opt/backup/mail/mu...
rsync -avz /home/public_mail/Maildir /opt/backup/mail/pu...
rsync -avz /home/stored_mail/Maildir /opt/backup/mail/st...
# restart mail delivery serice
service postfix start
- Server_A -> Server_B
&color(red){この項、未完成。 検証後に作文すること};
#!/bin/sh
# sync server:/home/httpd/html to client:/work/html
while [ -n "$(echo $1 | grep '^-')" ]; do
options="$options $1"
shift
done
rsync -auv $options --exclude "*~" server:/home/httpd/ht...
- Server_A -> Server_B ( 完全同期=コピー元で削除されたフ...
[root@backup script]# cat ./peewee_sync.sh
#!/bin/sh
# sync spirit.hmuna.com master peewee data to "backup.hm...
while [ -n "$(echo $1 | grep '^-')" ]; do
optins="$options $1"
shift
done
rsync -avx --delete -e ssh $options --exclude "*~" spiri...
- 参考 URL
-- [[rsyncでお手軽バックアップ:http://linux.paken.org/ind...
-- [[パソコンおやじ:http://www.aconus.com/~oyaji/backup/r...
-- [[Backup by rsync (+ssh):http://www.double-h.com/linux...
-- [[rsync ssh で鍵交換によりパスワードを入力しないで実行...
*** Linux 環境変数の設定 [#k19f2417]
- ユーザーがログインすると まず /etc/profile を読み込み...
- (ROOT)/.bash_profileが存在しない場合は、(ROOT)/.bash_lo...
- ログイン時に一度設定すればいいものは.bash_profileに指定...
- (ROOT)/.bashrc は、プロセスとしてbashを起動される毎に読...
-- ログイン後でも $bash などとして新しくbashを起動するた...
-- ゆえに bash を起動するたびに設定したい環境変数は .bas...
-- どちらも同じ場合には .bash_profile には source .bash...
- &color(red){これらの環境変数設定ファイルを編集しただけ...
-- &color(red){いったんログアウトしてもう1度ログインし直...
-- &color(red){sourceコマンドを使って環境変数を再初期化す...
[root@spirit ~]# source /etc/profile <--- 環境変数の...
-- /etc/profiled の下の起動シェルスクリプトを呼び出すこと...
[root@spirit ~]# ls -l /etc/profile.d/
合計 96
-rwxr-xr-x 1 root root 720 8月 23 2005 colorls.csh
-rwxr-xr-x 1 root root 713 8月 23 2005 colorls.sh
-rwxr-xr-x 1 root root 192 2月 22 2005 glib2.csh
-rwxr-xr-x 1 root root 190 2月 22 2005 glib2.sh
-rwxr-xr-x 1 root root 58 3月 8 23:13 gnome-ssh-ask...
-rwxr-xr-x 1 root root 70 3月 8 23:13 gnome-ssh-ask...
-rwxr-xr-x 1 root root 218 3月 9 06:49 krb5.csh
-rwxr-xr-x 1 root root 210 3月 9 06:49 krb5.sh
-rwxr-xr-x 1 root root 2182 3月 9 12:35 lang.csh
-rwxr-xr-x 1 root root 2470 3月 9 12:35 lang.sh
-rwxr-xr-x 1 root root 122 2月 22 2005 less.csh
-rwxr-xr-x 1 root root 108 2月 22 2005 less.sh
-rwxr-xr-x 1 root root 13 8月 22 2005 vim.csh
-rwxr-xr-x 1 root root 181 8月 22 2005 vim.sh
-rwxr-xr-x 1 root root 170 2月 22 2005 which-2.sh
- 設定されている環境変数の確認
-- echo → 任意の環境変数を指定して設定内容を確認する
[root@spirit ~]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/us...
-- export → 現在設定されている環境変数の一覧
[root@spirit ~]# export
declare -x ANT_HOME="/usr/local/ant-1.6.5"
declare -x CATALINA_BASE="/usr/java/tomcat-5.5.17"
declare -x CATALINA_HOME="/usr/java/tomcat-5.5.17"
*** LD_LIBRARY_PATHが無効になってしまう問題 ( [[fedora J...
- .bash_profile内でLD_LIBRARY_PATHの設定をして、Xでログイ...
それ以外の.bash_profile内で定義した変数は通常通り有効にな...
- [ctrl+alt+F1]で端末を切り替えて、テキストログインすると...
- 結局、こう言う事でしょうか?
man bashから
bash が対話的なログインシェルとして起動されるか、 --logi...
起動されると、 /etc/profile ファイルが存在すれば、 bash ...
このファイルを読んだ後、 bash は ~/.bash_profile, ~/.bas...
bashは 、 この中で最初に見つかり、かつ読み込みが可能であ...
noprofile オプションを使ってシェルを起動すれば、この動作...
ログインシェルが終了するときには、 ~/.bash_logout ファイ...
ログインシェルでない対話的シェルとして起動されると、 ~/....
コマンドを読み込み、実行します。この動作は --norc オプシ...
--rcfile file オプションを使うと、コマンドの読み込みと実...
これと、
http://lists.debian.or.jp/debian-users/200209/msg00356.h...
*** プログラムの実行結果を画面(stdout)に出力しない [#z9...
LEFT:
|意 味 |Bシェル| Cシェル |BAシェル|h
|標準出力をfに書く |>f| >f| >f|
|標準入力をfから読み込む| <f| <f| <f|
|標準出力をfに追加する | >>f| >>f| >>f |
|標準エラー出力をfに書く| 2>f| 無し| 2>f|
|標準エラー出力をfに追加する| 2>>f| 無し |2>>f|
|標準エラー出力を標準出力と同じところに書く |2>&1| 無し| ...
|COLOR(red):標準出力,標準エラー出力,ともにfに書く|COLOR...
|標準出力,標準エラー出力,ともにfに追加する| >>f 2>&1 |>...
|標準出力を強制的にfに書く | 無し |>!f| 無し |
|標準出力を強制的にfに追加する| 無し| >>!f| 無し|
- &color(blue){プログラムの実行結果を出さない ⇒ コマン...
- &color(blue){エラーも画面に出さない ⇒ コマンド > /dev/...
*** [[正規表現(Regular Expressions)>RegularExpressions]]...
- &ref(正規表現 _ Evernote Web.pdf);
- &ref(正規表現辞典_改定版新版.pdf);
*** [[sed(Streaming Editor)>STreamingEditor]] [#xee7ccaa]
*** Log Watch の設定 [#d4e81be1]
- Log Watch で Amavisd New のログを出さない設定 /etc/log...
[root@spirit ~]# chmod 000 /etc/log.d/scripts/services/a...
[root@spirit ~]# ls -l /etc/log.d/scripts/services/
合計 772
-rwxr-xr-x 1 root root 1519 8月 23 2005 afpd
---------- 1 root root 7326 8月 23 2005 amavis
-rwxr-xr-x 1 root root 592 8月 23 2005 arpwatch
-rwxr-xr-x 1 root root 3487 8月 23 2005 automount
- Log Watch のレポート内容 (permission deny と表示され...
--------------------- amavis Begin ---------------------...
sh: /etc/log.d/scripts/services/amavis: Permission denied
---------------------- amavis End ----------------------...
*** 24時間以上古いファイルの削除 ⇒ find の -mtime オプシ...
- &color(blue){''-mtime +n の書式 = (n+1) * 24h''};
+ mtime +0 : 今から24時間以上前のファイル
+ mtime +1 : 今から48時間以上前のファイル
+ mtime +2 : 今から72時間以上前のファイル
- 現在のディレクトリ下で 24時間以上前のファイルを削除する
[root@spirit Maildir]# find /home/headline/Maildir/cur -...
- 参考 URL = http://sonic64.com/2005-07-06.html
*** サブディレクトリ以下を再帰的に削除 [#r94d4a67]
find ./ -name *.tex~ -exec rm {} \;
- rmi とすれば確認付きになる
*** FC5 が selinux の影響で起動できない (HP ProLiant )[#s...
- http://www.linuxquestions.org/questions/showthread.php?...
checking filesystems
FSCK.ext3: permission denied while trying to open /dev/i...
You must have r/w access to the filesystem or be root ( ...
An error occured during the file system check
Dropping you to a shell; the system will reboot
When you leave the shell
Warning ---SELinux is active
Disabling security, enforcement for system recovery
Run 'setenforce 1' to reenable
Give root password for maintenance
( or type control-D to continue )
- インストールCDでマシンをブートして :linux rescue でレ...
- インストールボリュームが /mnt/systeminage (?) にマウン...
- その位置から /mnt/systemimage/etc/selinux/config の中身...
selinux=disabled
- exit でシェルを抜けて、自動リブートで正常に起動する
*** 文字コードセットを Ja_JP.eucJP に変更後に man ページ...
- インストールされている man 関連ファイルを yum で一度...
[root@spirit]#yum remove man
[root@spirit]#yum remove man-pages.noarch
[root@spirit]#yum remove man-pages-ja.noarch
- lv (less の代わりの日本語対応ファイルビューワー) をイン...
-- [[lv ホームページ:http://www.ff.iij4u.or.jp/~nrt/lv/#e...
-- lv のビルド、インストール
[root@spirit Downloads]# cd lv451
[root@spirit lv451]# cd build/
[root@spirit build]# ../src/configure
[root@spirit build]# make
[root@spirit build]# make install
[root@spirit build]# lv -V
# lv v.4.51 (Jan.16th,2004)
# All rights reserved. Copyright (C) 1996-2004 by NARITA...
# ABSOLUTELY NO WARRANTY; for details type `lv -h'
[root@spirit build]# /usr/bin/makewhatis
[root@spirit build]# which lv
/usr/local/bin/lv
- 日本語 man ページデータをインストールする
-- [[マニュアルアーカイブ [man-pages-ja-20060915] のダウ...
-- &ref(man-pages-ja-20060915.tar.gz);
-- man-pages-jp のビルドとインストール
[root@spirit man-pages-ja-20060915]# make config
perl -w script/configure.perl
[INSTALLATION INFORMATION]
(just Return if you accept default)
Install directory [/usr/share/man/ja_JP.eucJP] ?: ...
( snip )
[root@spirit man-pages-ja-20060915]# make
[root@spirit man-pages-ja-20060915]# make install
- man コマンドのインストール と ビルド
-- kernel.org のサイト (http://www.kernel.org/pub/linux...
[root@spirit man-1.5p]# ./configure +lang ja
[root@spirit man-1.5p]# make
[root@spirit man-1.5p]# make install
-- &ref(man.conf,center,usr/lib/man.conf); の中の PAGER ...
#PAGER /usr/bin/less -is
PAGER /usr/local/bin/lv
*** [[checkstack.pl で関数のスタック消費量を調べる:http:/...
Linux カーネルのソースコードに付属する checkstack.pl を使...
- 入手方法
-- checkstack.pl は Linux カーネルのソースコードに付属し...
% apt-get source kernel-source-2.6.8
- [ 使い方 ]
-checkstack.pl の使い方は簡単です。スタックサイズを調べた...
% objdump -d foo.o | perl checkstack.pl
foo.o の部分は ELFバイナリなら実行ファイルでも共有ライブ...
- [ 実験 ]
- それでは次のプログラムに対して checkstack.pl を適用して...
#include <signal.h>
void *p;
void func() {
struct sigaction x;
p = &x;
}
% gcc -c test.c
% objdump -d test.o| checkstack.pl
0x0003 func: 144
結果は、144バイトになりました。sizeof(struct sigaction) ...
% gcc -c -Os test.c
% objdump -d test.o| checkstack.pl
0x0003 func: 140
#include <signal.h>
void *p, *q;
void func() {
struct sigaction x;
struct sigaction y;
p = &x;
q = &y;
}
プログラムを次のように変更して struct sigaction の変数を ...
#include <signal.h>
void *p, *q;
void func() {
struct sigaction x;
struct sigaction y;
p = &x;
q = &y;
}
ところで、手元の checkstack.pl はスタックの消費量が 100 ...
next if ($size < 100);
- [ 仕組み ]
- checkstack.pl の仕組みは簡単です。単純に objdump -d の...
/^.*[as][du][db] \$(0x$x{1,8}),\%esp$/
- [ まとめ ]
-checkstack.pl を使って関数のスタック消費量を調べる方法を...
*** kernel mmap の over_committe の抑止 [#w8167608]
- 物理メモリ以上にメモリ取得しようとした際にエラーメッセ...
echo 2 >/prco/sys/vm/overcommit_memory
- malloc の上限を oer_commit_ratio で設定する
echo 2 >/prco/sys/vm/overcommit_memory
echo 100 > /proc/sys/vm/overcommit_ratio
アプリケーションの実行
- [[説明ページ(web 引用)>Linux_Overcommit]]
*** 組み込み機器で malloc を使う時の留意点 [#sc0aa41a]
- malloc / free の繰り返しによるメモリーのフラグメント化...
-- malloc(3) を使うと、Linux が管理する通常 4KB のページ...
-- malloc(3)/free(3) を繰り返すと断片化は当然起きますが、...
-- malloc(3) で確保するメモリの特性上、ポインタが破壊され...
- malloc()に対する free()漏れでメモリ不足になることに対し...
-- これについては kernel 側では何もしません。ユーザプログ...
- malloc() したときに確保したいサイズが空いてないときにど...
-- メモリーが足りなくなると malloc() が内部で sbrk(2) を...
-- 実メモリーが不足してヒープが増やせない場合はメモリが足...
-- malloc() を使わない時には、ユーザが sbrk(2) を使ってヒ...
- glibcの関数などで malloc()と同じようにもしくは内部でmal...
-- glibc 内部で malloc(3) を使うものは strdup(3) など沢山...
-- 基本的に構造体を内部で確保するもの(stdio 系など)は危...
- 小まめに取得・開放を繰り返すメモリ管理を長時間安定動作...
-- メモリを固定サイズで予め確保 (メモリ・プール) して、...
-- カーネルの実装でよく使われている slab みたいな実装が参...
- メモリーサイズに制約があり SWAP を持っていない組み込み...
-- 基本的に malloc(3)/free(3) を小まめに繰り返すものには...
-- どうしても小まめに確保と開放を繰り返すメモリが必要であ...
-- この実装では、静的に取ったメモリか malloc(3) で確保し...
-- いわゆるオーバーコミットの挙動により malloc(3) や sbrk...
- overcommit_memory = 2 の時のアプリケーションスタックサ...
-- デフォルトで、pthread_create(3) を使用して、スレッドを...
-- この時確保されるスタック・サイズは、仮想メモリ空間上で...
-- 通常のデフォルトのLinux の動作では、実際にメモリを使用...
+ メモリープールの実装例
*** Linux デバッグに必要は機能 (京都マイクロコンピュータ...
http://www.kmckk.co.jp/linux/linux1.html
&ref(kmcc_001.JPG);~
&ref(kmcc_002.JPG);
*** IO scheduler の種類と特徴 (kernel2.6.10 から適用され...
- noop スケジューラ
-- noop スケジューラはその名の通り、何もしないスケジュー...
-- 入出力インタフェースや周辺機器自身がハードウェアレベル...
-- 普通のパソコンでは noop スケジューラを指定すると性能が...
- anticipatory スケジューラ
-- anticipatory スケジューラ (as) はデバイスが伝統的なハ...
-- 入出力要求を待っていくつか貯めてから処理を行う性質があ...
- deadline スケジューラ
-- データベース向きのスケジューラです。スループットよりも...
-- デスクトップなどの普通のファイルシステムで使用してもあ...
- &color(red){cfq スケジューラ};
-- Completely Fair Queuing (CFQ) スケジューラは Fedora Co...
-- これにより従来の Linux カーネルで見られた「バックグラ...
-- CFQ はどのような環境でも比較的良好な性能を示すオールラ...
*** ls でディレクトリ名だけを表示したい [#dc4074bb]
- ls -d */(一覧表示)
[KGB2] munakata:~/git/linux-firmware$ ls -d */
3com/ amphion/ av7110/ contrib/ emi26/ ...
acenic/ ar3k/ bnx2/ cpia2/ emi62/ ...
adaptec/ arm/ bnx2x/ cxgb3/ ene-ub62...
advansys/ ath10k/ brcm/ cxgb4/ ess/ ...
- ls -F | grep / (リスト表示)
[KGB2] munakata:~/git/linux-firmware$ ls -F | grep /
3com/
acenic/
adaptec/
advansys/
airoha/
amd/
*** ファイルの連結 [#i0cd5277]
- cat コマンドでファイルを連結することができる
- 並べた順番に連結される (ワイルドカードを使った場合の順...
[root@spirit ~]# cat maillog.4 maillog.3 maillog.2 maill...
*** cron はいつ実行されるか ----> /etc/crontab で実行時...
[root@spirit ~]# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
*** HEWで sh4-linux-gccのデバッグ情報が読めるか [#t7505ddd]
日立SK 開発事業部 第2開発本部 第3設計部(s2開32)菅野紀...
- HEWに手を加えていない状態で、gccのデバッグ情報を読むこ...
- 読み込むためにはgcc用のオブジェクトリーダーが必要になり...
- KPITで配布している"GNUSH v0603 Windows Tool Chain "(sh...
- これで、sh-linux-gccのオブジェクトが読めるようになりま...
- この件をKPITに問い合わせたところ、sh-linux-gccオブジェ...
- ですので、全てのsh-linux-gccが読めるかどうかはわかりま...
- HEWでプログラムを実行させる前にレジスタウインドウからPC...
- そのときに、HEWがソースファイルの場所を聞いてくるのでそ...
*** Linux コンソール端末のログインシェルの切替 [#w609e5c8]
- &color(red){[Ctrl]-[ALT]-[F1/2/3/4]}; でログインシェル...
- グラフィカルログインの途中で止まってしまった場合などに...
*** X-window でのグラフィカルログインが出来ない場合の対策...
- init 3 でテクストモードで起動し、テキストログインする
- シェルから X を起動するために以下のコマンドを使った
[root@spirit] aticonfig --initial --input=/etc/X11/xorg...
[root@spirit] startx
- X 関連ファイル
-- /etc/X11/xorg.conf <---- X 設定ファイル
-- /etc/ <---- gnome ログインシェルを指定し...
*** Fedora7 で nVidia のドライバーがインストールできない...
- インストーラと X11 の整合性がとれていない為の発生 ----...
- インストーラ起動時にオプションを指定する
# sh NVIDIA-Linux-version.run --x-module-path=`X -showDe...
-- 会社のマシンに nVidia 用のドライバーをインストールする...
*** git で kernel をダウンロード [#g9fb1fab]
- Fedora7 では yum で git (含 gitk)のインストールがで...
- git-clone は su(sudo) でないとできない
[root@localhost src]# git-clone git://git.kernel.org/pub...
Initialized empty Git repository in /home/munakata/src/l...
remote: Generating pack...
remote: Done counting 552198 objects.
remote: Deltifying 552198 objects...
remote: 100% (552198/552198) done
Indexing 552198 objects...
- &ref(http://www8.atwiki.jp/git_jp/pub/Documentation.ja/...
*** find と組み合わせた file パーミションの一括操作 [#df5...
[root@spirit peewee]# find . -type f -exec chmod 666 {} \;
[root@spirit peewee]# find . -type d -exec chmod 755 {} \;
*** SDカード FAT マウント時の umask 値設定 [#t40a3941]
# mount -t vfat -o umask=000 /dev/sd.. /mnt/sd
*** user 空間へのデータコピー [#c95dfefb]
ユーザ空間へのデータコピーは mm/filemap.c の中にある file...
で、何バイトをコピーしていそうか見て頂くと( 971 行目を使...
せん。
*** Linux で RAR f形式のアーカイブを解凍する方法 (= &ref(...
wget http://dag.wieers.com/packages/unrar/unrar-3.6.2-1....
rpm -Uvh unrar-3.6.2-1.el4.rf.i386.rpm
unrar x -kb "archibed_file.rar"
*** Sylpheed で外部エディターに秀丸を指定する [#oa08fc90]
'c:\Program Files\Hidemaru\Hidemaru.exe' '%s'
*** SH-Linux の intevent(割り込み番号)と kernel 割り込...
Just to follow. Linux kernel for SuperH always uses the
following math to convert Intevent Code to IRQ number:
(intevent >> 5) - 16 = IRQ number
Goda-san's calculation
(intevent - 0x200) / 0x20
is basically the same as above. ;) You can find this in
include/asm-sh/irq.h, evt2irq() macro.
*** SEGV発生箇所の特定方法 [#z29d24b0]
ライブラリ内でSEGV が発生した場合を例にして、
SEGV の発生箇所を特定する方法を記述します。
- カーネルイメージの変更
添付したカーネルイメージを使ってください。SEGV発生時にメ...
(オリジナルのカーネルイメージは残して置いてください)
- 参考プログラムの作成
ライブラリ内でSEGV を発生させるプログラムの作成
$ less segvtestlib.c
#include <stdio.h>
int test_func(void) {
int *ptr = NULL;
*ptr = 1;
return 0;
}
$ less segvtest2.c
#include <stdio.h>
extern int test_func(void);
int main() {
test_func();
return 0;
}
$ sh4eb-linux-gcc -shared -Wl,-soname,libsegv.so -o libs...
$ ln -s libsegv.so.1 libsegv.so
$ sh4eb-linux-gcc segvtest2.c -o segvtest2 -lsegv -L.
- ターゲットボード上で実行
添付したカーネルを使用してターゲットボードを立ち上げ、
プログラムを実行してください。
# ./segvtest2
info.si_addr= 0
pc=2957b6d0 pr=0040062c
pid=741
tid=741
name=segvtest2
SEGV の発生したPCや、
SEGV を発生させたpid, tid、
SEGV を発生させたプログラム名を確認してください。
(注意)
tid は、スレッドID です。
スレッドを作成された際にスレッドID をログに表示しておくと、
そのスレッドがエラーを吐いたか確認できるかと思います。
この際に、gettid(2) を使いスレッドのIDを表示するのではな...
syscall(__NR_gettid) を使ってください。
(gettid(2) では、pid の値が帰ってきてしまいます)
なお、syscall(__NR_gettid)を使用するために、
以下のマクロを定義し、ヘッダを読み込んでください。
#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
syscall(__NR_gettid)
- SEGV発生箇所の特定
-- ターゲットボード上で以下を実行してください。
# ldd segvtest2
libsegv.so => ./libsegv.so (0x2957b000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x2958c...
libc.so.6 => /lib/libc.so.6 (0x295ad000)
/lib/ld-linux.so.2 (0x29556000)
前手順で判明したPC より、libsegv.so 内で問題が発生してい...
0x2957b6d0 - 0x2957b000 = 0x06d0
ライブラリの上記の位置で問題が発生しています。
・開発機上で以下を実行しライブラリ内の何処で問題
が発生しているかを確認してください。
(nmコマンドが、ターゲットボード上に存在するなら
ターゲットボード上で実行しても構わないです)
$ sh4eb-linux-nm ./libsegv.so.1 |sort | less
w _Jv_RegisterClasses
w __cxa_finalize@@GLIBC_2.2
w __deregister_frame_info@@GLIBC_2.2
w __register_frame_info@@GLIBC_2.2
00000480 T _init
00000580 t __do_global_dtors_aux
00000620 t frame_dummy
000006c0 T test_func
000006e0 t __do_global_ctors_aux
00000720 W __gmon_start__
00000740 T _fini
00000778 r __EH_FRAME_BEGIN__
00000778 r __FRAME_END__
0001077c d __CTOR_LIST__
00010780 d __CTOR_END__
00010784 d __DTOR_LIST__
.....
問題発生箇所が、0x06d0 なので、
test_func の中で問題が発生しているのが分かります。
*** ubbot による uboot の書き換え ( u-boot 上での作業で...
+ nfs で u-boot.binをメモリにロードする。
+ フラッシュメモリの書き込みたい領域のプロテクトを解除&br...
+ フラッシュメモリの書き込みたい領域の領域を初期化&br; er...
+ 1 でロードしたu-boot.binイメージをフラッシュに書き込む&...
途中でリセットすると、起動できなくなるので、注意してくだ...
*** マルチメディアコンテンツのヘッダー解析ツール [#s0ed4e...
http://mediainfo.sourceforge.net/ja (日本語)
http://mediainfo.sourceforge.net/en (English)
*** Linux performance tuning parameters [#ydf24e88]
Just FYI, some of these writeback parameters can be tuned...
damm@rx1 / $ cat /proc/sys/vm/dirty_background_ratio5
Some /proc/sys/ parameters (like the above) will affect p...
Hi Paul,
The cause of the problem that we had has been understood.
Between kernel-2.6.21 and 2.6.22, the following setting...
diff -Nur linux-2.6.21.7/mm/page-writeback.c linux-2.6....
--- linux-2.6.21.7/mm/page-writeback.c 2007-08-05 01:1...
+++ linux-2.6.22/mm/page-writeback.c 2007-07-09 08:3...
@@ -67,12 +67,12 @@
/*
* Start background writeback (via pdflush) at this per...
*/
-int dirty_background_ratio = 10;
+int dirty_background_ratio = 5;
/*
* The generator of dirty data starts writeback at this...
*/
-int vm_dirty_ratio = 40;
+int vm_dirty_ratio = 10;
5% of the main memory is made a threshold, and pdflush ...
Pdflush is executed by exceeding this limen when "File ...
is being tested. Therefore, I understood that the score...
And, kernel-2.6.30 changes this setting again.
http://www.kernel.org/pub/linux/kernel/v2.6/testing/pat...
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 74dc57c..bb553c3 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -66,7 +66,7 @@ static inline long sync_writeback_pag...
/*
* Start background writeback (via pdflush) at this per...
*/
-int dirty_background_ratio = 5;
+int dirty_background_ratio = 10;
/*
* dirty_background_bytes starts at 0 (disabled) so tha...
@@ -83,7 +83,7 @@ int vm_highmem_is_dirtyable;
/*
* The generator of dirty data starts writeback at this...
*/
-int vm_dirty_ratio = 10;
+int vm_dirty_ratio = 20;
*** Original linux-2.6.27 for R0P7785LC
File Copy 1024 bufsize 2000 maxblocks 3960.0 ...
File Copy 256 bufsize 500 maxblocks 1655.0 ...
File Copy 4096 bufsize 8000 maxblocks 5800.0 ...
*** linux-2.6.27( changes to dirty_background_ratio=10 ...
File Copy 1024 bufsize 2000 maxblocks 3960.0 ...
File Copy 256 bufsize 500 maxblocks 1655.0 ...
File Copy 4096 bufsize 8000 maxblocks 5800.0 ...
*** GRUB の再インストール (Ubuntu) [#m5f0bb7b]
- Ubuntu Live CD でシステムを起動
- 最初の起動メニューで [F6]を押して起動オプションを書き...
boot=casper ---> boot=/dev/sda1 (Linux を起動したいパー...
- Enter でシステム起動
- HDD から起動した Linux 上から MBR に GRUB をインストール
sudo /usr/sbin/grub-install /dev/sda
通常はこれで Grub が再設定されるが、これが Windows との d...
[[FreeDOS:http://www.freedos.org/]] の iso イメージを焼い...
fdisk /mbr 1
で一番目のディスクの MBR への書き込みが行われる。 以降は...
*** [Ubuntu] Grubの設定をGUIで [#h73153f1]
$ sudo apt-get install startupmanager
これを使えば/boot/grub/menu.lstを直接編集せずにGrubの設定...
*** [[Linuxでうっかりrm -rfしちゃったけど復活出来たよ (ex...
- &ref(extundelete-0.2.0.tar.bz2);
## こーいうときはまずあれだ、現場保存!
## まずは今いるパーティションを確認
# df -hT
Filesystem Type サイズ 使用 残り 使用% マウント位置
/dev/sdb2 ext4 193G 6.9G 176G 4% /
/dev/sdb1 ext3 194M 22M 163M 12% /boot
/dev/sdb5 ext4 1.2T 752G 371G 67% /home ←イマ...
tmpfs tmpfs 999M 0 999M 0% /dev/shm
## とりあえず読み込み専用にしておこう!
# mount -o remount,ro /dev/sdb5
# touch /home/hoge
touch: cannot touch `/home/hoge': 読み込み専用ファイルシ...
## うし、ちゃんとリードオンリーになったな
## あと何だ?とりあえず時間メモ!
# date
2011年 1月 23日 日曜日 18:15:22 JST
## ふぅ、さてひとまずこれでいいだろう、あとはext4の復元...
## どうやら extundelete ってのがext3/ext4対応の復活プロ...
## 藁にもすがる思いでインストール。とりあえず/tmpでいい...
# cd /tmp
# mkdir a
# cd a
# wget "http://downloads.sourceforge.net/project/extunde...
# ls
extundelete-0.2.0.tar.bz2
# tar xfj extundelete-0.2.0.tar.bz2
# cd extundelete-0.2.0
# ./configure --prefix=/tmp/a && make && make install
## ビルド待ち…、うしっなんか出来たっぽい!
## んー何々…?
# /tmp/a/bin/extundelete
No action specified; implying --superblock.
Usage: /tmp/a/bin/extundelete [options] [--] device-file
Options:
--version, -[vV] Print version and exit successf...
--help, Print this help and exit succes...
--superblock Print contents of superblock in...
If no action is specified then ...
--journal Show content of journal.
--after dtime Only process entries deleted on...
--before dtime Only process entries deleted be...
Actions:
--inode ino Show info on inode 'ino'.
--block blk Show info on block 'blk'.
--restore-inode ino[,ino,...]
Restore the file(s) with known i...
The restored files are created i...
with their inode number as exten...
--restore-file 'path' Will restore file 'path'. 'path...
of the partition and does not st...
must be one of the paths returne...
The restored file is created in ...
directory as 'RECOVERED_FILES/pa...
--restore-files 'path' Will restore files which are lis...
Each filename should be in the s...
to --restore-file, and there sho...
--restore-all Attempts to restore everything.
-j journal Reads an external journal from t...
-b blocknumber Uses the backup superblock at bl...
the file system.
-B blocksize Uses blocksize as the block size...
system. The number should be t...
Error parsing command-line options.
## ふむ、どうやらパーティション&時間指定で復元できるっ...
## dtime って何だろ…、helpだと分からんかったのでサイトの...
## エポック秒で指定すればいいんだな。
## 取ってて良かった時間メモ、18:15ってことは18:00以降く...
# date -d "18:00"
2011年 1月 23日 日曜日 18:00:00 JST
## うむ、じゃエポックは…、と
# date -d "18:00" +%s
1295773200
## うし、じゃこんな感じかな?
# /tmp/a/bin/extundelete --after 1295773200 --restore-al...
Only show and process deleted entries if they are delete...
WARNING: Extended attributes are not restored.
Loading filesystem metadata ... 9607 groups loaded.
Loading journal descriptors ... 28902 descriptors loaded.
Writing output to directory RECOVERED_FILES/
Searching for recoverable inodes in directory / ...
327 recoverable inodes found.
Looking through the directory structure for deleted file...
Restored inode 3373 to file RECOVERED_FILES/share/家中共...
Restored inode 3374 to file RECOVERED_FILES/share/家中共...
*** SH-Debian cross toolchain の導入 (chroot 環境で実行)...
- パッケージ導入元 = http://debian-sh4.nigauri.org/ (gcc-...
-- binutils
-- linx-libc-dev
-- gcc*.*
+ 適当なディレクトリに移動
+ mkdir sid-rootfs
+ sudo apt-get update
+ sudo apt-get install debootstrap chroot
+ sudo debootstrap sid sid-rootfs http://ftp.jp.debian.or...
+ sudo chroot sid-rootfs
+ 依存するパッケージのインストール
dpkg --info gcc-4.3-sh4-linux-gnu_4.3.4-1_i386.deb を実...
出力される Depends の行が依存するパッケージです。
+ クロスコンパイラのインストール
+ 開発は sid-rootfs の中で行う。
*** GIMP GIF 背景色の透明化 [#nc4906cc]
//- アルファチャンネルの追加
//- 背景色を選択して切り取り
- 編集対象ファイルは GIF 形式でなければならない ( 必要に...
- 黄色いスポイトで背景色(=抜きたい色を選択、 シフトキー...
- 選択されたら 削除 で色が透明に抜ける
*** Youtube のファイルの扱い [#o8a7f37d]
- .264ファイルは、H.264/AVCのrawストリームファイルです。A...
% MP4Box -raw 2 tronlegacy.mp4
Extracting MPEG-4 AVC-H264 stream to h264
% ls
tronlegacy.mp4 tronlegacy_track2.h264
- mp4やmovファイルに含まれているAVストリームの仕様は 'med...
% mediainfo tronlegacy.mp4
General
Complete name : tronlegacy.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 35.3 MiB
Duration : 2mn 20s
Overall bit rate : 2 108 Kbps
Encoded date : UTC 2010-03-08 01:48:02
Tagged date : UTC 2010-03-08 01:48:02
gsst : 0
gstd : 140851
gssd : B4A7D6683HH1286348198...
gshh : v3.lscache3.c.youtube...
Video
ID : 2
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 2mn 20s
Bit rate mode : Variable
Bit rate : 1 980 Kbps
Maximum bit rate : 12.2 Mbps
Width : 1 280 pixels
Height : 534 pixels
Display aspect ratio : 2.35:1
Frame rate mode : Constant
Frame rate : 23.976 fps
Resolution : 8 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.121
Stream size : 33.1 MiB (94%)
Title : (C) 2007 Google Inc. ...
Encoded date : UTC 2010-03-08 01:48:02
Tagged date : UTC 2010-03-08 01:48:02
Audio
ID : 1
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : No
Codec ID : 40
Duration : 2mn 20s
Bit rate mode : Variable
Bit rate : 124 Kbps
Maximum bit rate : 220 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 KHz
Stream size : 2.08 MiB (6%)
Title : (C) 2007 Google Inc. ...
Encoded date : UTC 2010-03-08 01:48:02
Tagged date : UTC 2010-03-08 01:48:02
- 'youtube-dl'というツールを使うと、youtubeからビデオを f...
% ./youtube-dl -f 18 "http://www.youtube.com/watch?v=Ttb...
[youtube] Setting language
[youtube] TtbrLIwKWWA: Downloading video webpage
[youtube] TtbrLIwKWWA: Downloading video info webpage
[youtube] TtbrLIwKWWA: Extracting video information
[download] Destination: TtbrLIwKWWA.mp4
[download] 100.0% of 4.25M at 252.82k/s ETA 00:00
- .yuvファイルは、NV12 RAWイメージが連続して格納されたフ...
# omxvideodectest -d OMX.re.videodecoder -o output.yuv i...
- URL
-- [[MP4Box:http://www.videohelp.com/tools/mp4box]]
-- [[mediainfo:http://mediainfo.sourceforge.net/ja]]
-- [[youtube-dl:http://bitbucket.org/rg3/youtube-dl/wiki/...
--- [[数字の意味:http://d.hatena.ne.jp/michinao/20081115/...
*** [[NautilusSVN (RabbitVCS: Linux CVS GUI cleint):http:...
*** iPad/iPhone 4のビデオ再生仕様 [#vdd16e8c]
- iPad用1024×576 TMPEGENC 設定ファイル ----> &ref(MP4_AVC...
- H.264ビデオ
-- 最高720p
-- 毎秒30フレーム
-- 最高レベル3.1のメインプロファイル(最高160kbpsのAAC-LC...
-- 48kHz、.m4v、.mp4、.movファイルフォーマットのステレオ...
- MPEG-4ビデオ
-- 最高2.5Mbps、640×480ピクセル
-- 毎秒30フレーム
-- シンプルプロファイル(最高160KbpsのAAC-LC)、
-- 48kHz、.m4v、.mp4、.movファイルフォーマットのステレオ...
- Motion JPEG (M-JPEG)
-- 最高35Mbps、1280×720ピクセル、
-- 毎秒30フレーム
-- ulawオーディオ、.aviファイルフォーマットのPCMステレオ...
*** Live Linux USB Creator (LiLi) [#b8bd28a1]
- &ref(LinuxLive USB Creator 2.7.exe);
*** ideapad S10e wlan (BCN4312)ドライバー [#se6a2bb4]
- http://ja.broadcom.com/support/802.11/linux_sta.php か...
$ mkdir hybrid_wl
$ cd hybrid_wl
$ tar xzf <ダウンロードしたパス>/hybrid-portsrc.tar.gz
$ make clean (初めて実行する際は不要)
$ make
もし b43-fwcutter をインストーしていたら削除
$ sudo apt-get remove b43-fwcutter
ドライバーモジュールをインストール
$ sudo make install
$ sudo echo "blacklist ssb" >> /etc/modprobe.d/blacklist...
$ sudo echo "blacklist b43" >> /etc/modprobe.d/blacklist...
$ sudo depmod -a
ここまでで modprobe wl とすればとりあえず利用はできるのだ...
ここでメニューバーの 「システム - システム管理 ー ハード...
*** Ubuntu : scim-anthyのキーバインドやローマ字キーマップ...
設定方法は,SCIMを起動して右から2番目の[コマンドメニュー...
-&ref(TH400_01.jpg);
http://gihyo.jp/admin/serial/01/ubuntu-recipe/0065 より引用
*** [[virtualbox のクローン作成:http://www.webriverside.c...
- VirtualBoxで作成した仮想マシンのクローンを作成するには...
-- &color(red){[注意] VirtualBoxでは、単純に仮想マシンイ...
- 仮想マシンイメージファイルのクローンイメージをコマンド...
- クローンイメージをGUIツール (Sun xVM VirtualBox) の...
- 新規仮想マシン作成ウィザードから新規仮想マシンを作成し...
*** [[Magetta (OSS HTML5 authoring tool:http://www.maqett...
- account = public_mail@hmuna.com
- pass = frex
*** Ubuntu 1104 で無線LANが使えなくなっている問題の対策 [...
- https://forums.ubuntulinux.jp/viewtopic.php?id=11372
- 登録されたモジュールのリスト [lsmod]
munakata@muna-E420:~$ lsmod
Module Size Used by
parport_pc 36959 0
ppdev 17113 0
binfmt_misc 17565 1
↓ ↓ ↓
- インストール(認識)されたハードウエアのリスト [lswh -C]
munakata@muna-E420:~$ sudo lshw -C network
[sudo] password for munakata:
*-network
description: Ethernet interface
product: RTL8111/8168B PCI Express Gigabit Ethern...
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:02:00.0
logical name: eth0
version: 06
serial: f0:de:f1:65:e5:0a
size: 1Gbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_mast...
configuration: autonegotiation=on broadcast=yes d...
resources: irq:40 ioport:5000(size=256) memory:d0...
*-network DISABLED
description: Wireless interface
product: RTL8188CE 802.11b/g/n WiFi Adapter
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:08:00.0
logical name: wlan0
version: 01
serial: ec:55:f9:c4:3d:ae
width: 64 bits
clock: 33MHz
↓
- 無効化されている無線の確認 [rfkill list]
munakata@muna-E420:~$ rfkill list
0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
1: tpacpi_bluetooth_sw: Bluetooth
Soft blocked: no
Hard blocked: no
2: phy0: Wireless LAN
Soft blocked: yes
Hard blocked: no
3: acer-wireless: Wireless LAN
Soft blocked: yes
Hard blocked: no
- 無線LANの有効化
munakata@muna-E420:~$ sudo rmmod -f acer-wmi
munakata@muna-E420:~$ rfkill unblock all
*** Thinkpad E420 トラックパッドの無効化 (ポインターだけ...
- gpointing-device-settings を追加でインストール
-- タッチパッドの無効化
ーー スクロールは ホイールのエミュレーションを有効にし、...
- http://ishiguso328.appspot.com/article/3
*** Virtualbix のマウス統合機能の無効化、再有効化 [#x746e...
- Virtualbox でゲストOS のウインドウの境界部分のポインテ...
- Virtualbox のウィンドウ枠右下の 丸に矢印のついたアイコ...
- この状態からホストOS にマウスを渡すには 右側のコントロ...
*** /etc/fstab 設定例 [#mc4ef975]
- [デバイス] [マウントポイント] [ファイルシステム] [マウ...
-- ローカルファイルシステムもマウントする例
/dev/sdc1 /mnt ext3 defaults 1 2
-- NFSの設定例
192.168.1.1:/exports/www /exports/www nfs rsize=8192,wsi...
-オプション一覧
--デバイス
マウントする為のデバイスファイルを指定します。
通常は、/dev/hda1などのデバイスファイルを直接指定しますが...
また、リモートのファイルサーバなどのNFS、Samba用の記述も...
--マウントポイント
ファイルシステム上のマウントポイントを指定します。
実ディレクトリが存在している必要があります。swapの場合はs...
--ファイルシステム
ファイルシステムの形式を指定します。
ext3、xfs、swap、nfs、vfat、iso9660など、サポートされてい...
--マウントオプション
|オプション|意味|h
|async|ファイルシステムへの I/O が非同期で行われます。|
|atime|アクセス毎に inode のアクセスタイムをアップデート...
|auto| mount コマンドの -a オプションでマウントされるよう...
|codepage| 文字コードの指定|
|COLOR(red):defaults| COLOR(red):デフォルトのオプション(r...
|dev| ファイルシステム上のデバイスを利用できるようにしま...
|exec| バイナリの実行を許可します。|
|gid| マウントするグロープIDを指定|
|iocharset| マウントするシステムの文字コード|
|noatime| アクセス毎にinodeのアクセスタイムをアップデート...
|noauto| コマンドで明示的にmountコマンドを実行された場合...
|nodev| ファイルシステム上のデバイスを利用できないように...
|noexec| ファイルシステム上でのバイナリファイルの実行を無...
|nosuid| SUID や SGID を無効にします。|
|nouser| root以外マウントできないようにします。|
|ro| リードオンリーでファイルシステムをマウントします。|
|rw| 読み込み・書き込みができる状態でファイルシステムをマ...
|suid| SUID および SGID を有効にします。|
|sync| ファイルシステムへのI/Oを同期で行います。|
|user| 一般ユーザでもファイルシステムをマウントできるよう...
|uid| マウントするユーザIDを指定|
--dumpオプション
dumpの要否を指定します。
|0|dump不要|
|1|dump必要|
--fsckオプション
OS起動時に、fsckによるファイルシステムチェックの要否を指...
|0|チュック無し|
|1|/ 専用でチェック有り|
|2|チェック有り|
*** [[testdisk によるクラッシュしたHDDからのデーター救済...
- [[パーティションテーブルが壊れたHDDを復元するには:http:...
- http://www.cgsecurity.org/wiki/PhotoRec => &ref(testd...
*** [[Ubuntu 起動時にメッセージを出させる:http://d.hatena...
- /boot/grub/grub.cfg (通常は 444 → 744 にして編集、 ...
- /etc/default/rc.s の中の VERBOSE を yes に変更する
*** find の実行で 『find: パス名は評価式の前に置かなけれ...
- [[シェルが勝手にアスタリスクを展開してしまうので,find...
- 次のように検索対象ファイルをくくると検索できる
find ./ -name "*.php"
*** Lenovo E420 で無線LANが使えない問題 [#ca3773b4]
- デフォルトでソフト的に無効になっているのを、設定変更す...
munakata@muna-E420:~$ rfkill list
1: tpacpi_bluetooth_sw: Bluetooth
Soft blocked: yes
Hard blocked: no
munakata@muna-E420:~$ sudo rmmod -f acer-wmi
munakata@muna-E420:~$ rfkill unblock all
- https://forums.ubuntulinux.jp/viewtopic.php?id=11372
- http://ubuntuforums.org/showthread.php?t=1761472
*** root でも消せないファイルをどうするか [#g4d172f4]
- 例えば
root@mythen:/home/server-admin# ls -la
ls: .gvfs にアクセスできません: 許可がありません
合計 300
drwxr-xr-x 36 server-admin server-admin 4096 2011-12-31...
drwxr-xr-x 3 root root 4096 2011-12-17...
-rw------- 1 server-admin server-admin 7636 2011-12-30...
-rw------- 1 server-admin server-admin 103 2011-12-30...
drwx------ 3 server-admin server-admin 4096 2011-12-11...
drwx------ 3 server-admin server-admin 4096 2011-12-31...
(snip)
-rw-rw-r-- 1 server-admin server-admin 369 2011-12-17...
d????????? ? ? ? ? ...
drwxrwxr-x 4 server-admin server-admin 4096 2011-12-18...
- このような場合には,lsattrコマンドを利用してファイルの...
- chattrコマンドで変更すると正常なパーミッションに直すこ...
*** GUI 画像の一括リネーム 一括リサイズ 一括変換が簡単に...
- [[GTK Rename and Resize Image :http://ubuntuapps.blog67...
*** 画像ファイル整理用のperl スクリプト群 [#b953ac19]
- [[画像ファイルの整理(1):http://penguinclub.net/linux/p...
*** 画像のリサイズ(コマンドライン) [#pfa83eae]
- imagemagic の ''convert'' コマンドに、「-geometry」オプ...
munakata@muna-E450:~/Desktop$ convert -geometry "60%" bu...
- convert コマンドの代わりに ''mogrify'' コマンドを使えば...
munakata@muna-Linux:~/Desktop$ mogrify -resize 60% セレ...
*** [[デスクトップにホームディレクトリの内容が表示されて...
- 1)$HOME/.config/user-dirs.dirsをエディタで開く。※1
- 2)XDG_なんとか_DIRというキーに対する値が、希望のディレ...
- 3)再度ログイン。<- 重要!
で直ると思いますよ。この現象が起きたのは、$HOME/デスクト...
それをやると、$HOMEがデスクトップに表示されてしまう現象が...
*** ターミナル用フォント ( putty など) [#p20d12fe]
- [[inconsolata:http://www.levien.com/type/myfonts/incons...
*** grep で空行とコメント行を削除する [#ra2f7557]
grep -v -e '^$' -e '#' (file_name)
cat (file_name) | grep -v "^\s*$" | grep -v "^\s*#"
*** ディレクトリ以下を再帰的にgrepする (新2) [#v9fccf35]
- ディレクトリとファイルタイプを指定して、再起的に検索
grep -lr (検索文字) --include='*.log' ./app/logs(検索場...
*** ディレクトリ以下を再帰的にgrepする (新) [#b4d45846]
- grep hoge --include='dir' -r
[local] munakata:~/latex/LFS301-JP$ grep size --include=...
CHAPS/memmon/memmon.tex:Hugepagesize: 2048 kB
CHAPS/memmon/memmon.tex: RAM plus the size of the swap...
CHAPS/memmon/memmon.tex: exceed the size of RAM plus s...
CHAPS/memmon/memmon.tex: when the total memory comm...
CHAPS/containers/containers1.tex: \begin{responseva...
CHAPS/processes/processes1.tex: as stack size (\...
CHAPS/processes/libraries.tex: \begin{responsevar}{\no...
CHAPS/processes/libraries.tex: \begin{responsevar}{\sc...
*** ディレクトリ以下を再帰的にgrepする [#a5cdf576]
find ./ -name '*' | xargs grep "hogehoge"
*** R-Car で earlyprintk を使う方法 [#m42feab8]
- R-mobile 系は kernel command line での設定で有効となる
console=tty0 console=ttySC1,115200 earlyprintk=sh-sci.1,...
- R-Car 系の対応 (r-car 系では SCIF が 0xffxxxxx にマッ...
-- setup-r8a7779.c (= H1)に説明が書いてあります
*** stable tree の fetch と差分の確認 [#f49fb857]
- git://git.kernel.org/pub/scm/linux/kernel/git/stable/li...
- git log --oneline v3.4.25..v3.4.47
- git log --oneline v3.4.25..v3.4.47 | wc -l で差分の数を...
*** ディスク容量(=RootFS の構成) のグラフィカル表示 [#...
- [[baobao:http://www.marzocca.net/linux/baobab/index.htm...
-- ubuntu では 「ディスク使用量の解析」
- xdu
- xdiskusage
*** ビデオコンテンツのプロファイルを確認する [#o77894a6]
mediainfo
*** アプリケーション実行時の CPU 関連の動作を検証する [#l...
usr/bin/time --verbose
*** i2c デバイスの検出 i2cdetect [#fbcff204]
# i2cdetect -r -y 3
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
- -y Disable interactive mode. By default, i2cdetect will...
- -a Force scanning of non-regular addresses. Not recomme...
- -q Use SMBus "quick write" commands for probing (by def...
- -r Use SMBus "read byte" commands for probing (by defau...
- -F Display the list of functionalities implemented by t...
- -V Display the version and exit.
- -l Output a list of installed busses.
*** [[Ubuntu 64bit版 で 32bitのライブラリやアプリをコンパ...
- sudo apt-get install ia32-libs lib32gcc1 lib32stdc++6 l...
*** upstream kernel / stable-kernel のソース入手 [#p97122...
- git clone git://git.kernel.org/pub/scm/linux/kernel/git...
- git clone git://git.kernel.org/pub/scm/linux/kernel/git...
*** [[Ubuntu フォント:https://wiki.ubuntulinux.jp/UbuntuT...
- fc-list|less でインストールされているフォントの一覧が表...
*** ディレクトリ以下の全ファイルの文字コードを UTF-8 に一...
find . -type f | xargs -n 10 nkf -w --overwrite
*** 複数ファイルから文字列を一括置換 [#p4f56390]
find ./path/to/file -type f | xargs sed -i "s/hoge/hage/g"
*** bashのタブ補完で余分なスペースが入るようになった場合...
rm /etc/bash_completion.d/acroread.sh
*** dd イメージファイルからパーティション情報を読み出す [...
munakata@muna-E420:~/volumio/image$ sfdisk -l -uS Volumio...
ディスク VolumioBeta1.3BBB.img: ジオメトリを取得できません
ディスク VolumioBeta1.3BBB.img: シリンダ数 229、ヘッド数 ...
ユニット = 512 バイトのセクタ、0 から数えます
デバイス ブート 始点 終点 #セクタ Id シス...
VolumioBeta1.3BBB.img1 * 2048 4095 2048...
VolumioBeta1.3BBB.img2 4096 3751935 3747840...
シリンダ 233 にパーティションの終点、ディスクの最後を越え...
VolumioBeta1.3BBB.img3 0 - 0...
VolumioBeta1.3BBB.img4 0 - 0...
*** chorome で README.html などのローカルファイルファイル...
- セキュリティ対策で chorome ver5 以降はそういう仕様にな...
- オーバーライドして強制的に開くようにするには起動パラメ...
-- -allow-file-access-from-files
- [[参考URL(windows と mac の方法が書いてある):http://de...
*** 色々なバージョンの kernel ソースのディレクトリー毎の...
- kernel repo から git clone したソースには v2.6.11 以降...
- git checkout で tag を指定して以前のバージョンのソース...
- find でファイルを再帰的に探して wc で行数を数えたものを...
-- git checkout v2.6.18 -b v2.6.18
-- find . -type f -not -regex '\./\.git.*' -print | xargs...
-- find . -type f -not -regex '\./\.git.*' -print0|xargs ...
*** ファイルの属性変更、確認(書き込み禁止 など) [#lfbfb...
- lsattr [ -RVadv ] [ files... ]
-- -R ディレクトリやその内容の属性を再帰的に表示する。
-- -V プログラムのバージョンを表示する。
-- -a `.' ではじまるファイルも含め、全てのファイルお...
-- -d ディレクトリの内容ではなく、ディレクトリそのも...
-- -v ファイルのバージョン/世代を表示する。
- chattr [ -RV ] [ -v version ] [ mode ] files...
-- `A' 属性が設定されているファイルは、 アクセスされても ...
-- `a' 属性が設定されているファイルは、 書き込み...
-- `c' 属性が設定されているファイルは、 ディスク上に置か...
すと、伸長されたデータが返ってくる。 このファイルに書き...
-- `D' 属性が設定されているディレクトリは、 変更されると...
-- `d' 属性が設定されているファイルは、 dump(8) プログラ...
-- `E' 属性は実験的な圧縮パッチが用いるもので、 圧縮ファ...
-- `I' 属性は htree コードによって用いられ、 ディレクト...
chattr(1) によって設定したり解除したりすることはできない...
-- i' 属性が設定されているファイルは、変更することができ...
*** man ページを日本語表示にする [#p14e6180]
- sudo apt-get install manpages-ja
*** Ubuntu でランレベル毎の自動起動するサービルの指定 [#k...
- sysv-rc-conf
- sysv-rc-conf -list (表示のみ)
*** ディスクパーティションを変更した時の grub の再設定 (...
- まず手動で grub にパラメータを渡して Ubuntu を起動する
grub rescue> ls ← パーティションリストが表示される。/bo...
grub rescue> ls (hd0,msdos6)/boot/grub/i386-pc/normal.mod
grub rescue>set prefix=(hd0,msdos6)/boot/grub
grub rescue>set root=(hd0,msdo6)
grub rescue>insmod (hd0,msdos6)/boot/grub/i386-pc/normal...
grub rescue>normal
- 次に grub を再インストールする
-- 通常は
sudo grub-install /dev/sda
-- 上記でエラーになる場合(パーティションを削除した場合な...
sudo dpkg-reconfigure grub-pc
*** apt-get で保留されるパッケージのアップグレード [#kbb2...
- 再起動が必要であったり依存関係で削除されるファイルや設...
-- $ sudo apt-get -s dist-upgrade で確認て
-- $ sudo apt-get dist-upgrade でインストール
*** Ubuntu には inittab はない。 [#q1248cd7]
- While searching this in various forum, I got to know th...
- It uses /etc/init/rc-sysinit.conf
*** Ubuntu でテキストログイン [#mc833c8d]
- [[「Ubuntu のログインを CUI に変更する」:http://mattint...
-- /etc/default/grub の GRUB_CMDLINE_LINUX_DEFAULT を変更
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo...
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT="quiet text"
GRUB_CMDLINE_LINUX=""
- sudo update-grub
- reboot
*** putty で bash の color_shell(色付け)を有効にする方...
- [接続]-[データ]で端末名を xterm → xterm-256color ...
- このメニューは端末起動前でないと表示されない
- &ref(256color.jpg);
- ちなみに Font は Consolas 14pt がきれい
*** bashrc のカスタマイズ(プロンプト関係) [#k6d4e2b1]
ー &ref(bashrc); <- .bashrc にリネームして使う
- /root にもこの bashrc をコピーする(sudo 時に $HOME(=/r...
if [ "$color_prompt" = yes ]; then
if [ $UID -eq 0 ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;36m\]...
else
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;36m\]...
fi
else
if [ $UID -eq 0 ]; then
PS1='${debian_chroot:+($debian_chroot)}[AWS (sudo)]:\w...
else
PS1='${debian_chroot:+($debian_chroot)}[AWS] \u:\w\$ '
fi
fi
unset color_prompt force_color_prompt
*** Libre Office Impress で PDF 作成時にアニメーションを...
- &ref(ExpandAnimations-0.4.oxt);
-- このファイルを Libre Office Impress で開く → 拡張機能...
-- Libreoffice [ツール]ー[アドオン]ー[Expand Animation]...
→ これで アニメーションを展開した元ファイルを自動生成し、...
*** 半角/全角キーの無効化キーマップ [#ncf3cea6]
- vi 操作中にご入力で日本語入力になるのを回避するためのキ...
- [変換]で IME有効化、 [無変換] で IME 無効化する設定
- キーマップファイルは Mozc プロパティのツール から変更で...
-- 変更後キーマップファイル &ref(keymap_disable_HankakuZ...
-- オリジナルキーマップファイル &ref(keymap_default.txt);
*** Ubuntu 18.04 Natilus (File Manager) で Tree View を利...
- dconf-editor をインストールする
- <org>.<gnome>.<nautilus.list-view>, and here a check-bo...
- &ref(dconf.jpg);
*** Thinkpad E450 Trackpoint チューニング [#s8f59c22]
munakata@muna-E450:/sys/devices/platform$ xinput
⎡ Virtual core pointer id=2 [master ...
⎜ ↳ Virtual core XTEST pointer id=4 [sla...
⎜ ↳ AlpsPS/2 ALPS DualPoint TouchPad id=10 [sl...
⎜ ↳ AlpsPS/2 ALPS DualPoint Stick id=11 [sl...
⎣ Virtual core keyboard id=3 [master ...
↳ Virtual core XTEST keyboard id=5 [sla...
↳ Power Button id=6 [sla...
↳ Video Bus id=7 [sla...
↳ Integrated Camera: Integrated C id=8 [sla...
↳ AT Translated Set 2 keyboard id=9 [sla...
↳ ThinkPad Extra Buttons id=12 [sl...
munakata@muna-E450:/sys/devices/platform$ xinput list-pr...
Device 'AlpsPS/2 ALPS DualPoint Stick':
Device Enabled (142): 1
Coordinate Transformation Matrix (144): 1.000000, 0.000...
libinput Natural Scrolling Enabled (288): 0
libinput Natural Scrolling Enabled Default (289): 0
libinput Scroll Methods Available (292): 0, 0, 1
libinput Scroll Method Enabled (293): 0, 0, 1
libinput Scroll Method Enabled Default (294): 0, 0, 1
libinput Button Scrolling Button (306): 2
libinput Button Scrolling Button Default (307): 2
libinput Middle Emulation Enabled (298): 0
libinput Middle Emulation Enabled Default (299): 0
libinput Accel Speed (300): 0.798561 <---------------...
libinput Accel Speed Default (301): 0.000000 <--------...
libinput Accel Profiles Available (308): 1, 1
libinput Accel Profile Enabled (309): 1, 0
libinput Accel Profile Enabled Default (310): 1, 0
libinput Left Handed Enabled (302): 0
libinput Left Handed Enabled Default (303): 0
libinput Send Events Modes Available (265): 1, 0
libinput Send Events Mode Enabled (266): 0, 0
libinput Send Events Mode Enabled Default (267): 0, 0
Device Node (268): "/dev/input/event4"
Device Product ID (269): 2, 8
libinput Drag Lock Buttons (304): <no items>
libinput Horizontal Scroll Enabled (305): 1
- [[erratic behaviour of trackpoint on thinkpad t420s [UB...
*** ファイル名の一部分を一括変換(Ubuntu での rename コマ...
- ubuntu だけ rename の構文が異なる
rename "s/[変更したい部分,変更前]/[変更後の名前]/;" [...
*** ディスク一覧表示で loop デバイス等を表示しない [#uab3...
- lsblk -e 7
munakata@mvc:~$ lsblk -e 7
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 7.3T 0 disk
├─sda1 8:1 0 7.3T 0 part
│ └─md0 9:0 0 7.3T 0 raid1 /mnt/raid_vol
└─sda2 8:2 0 1007K 0 part
sdb 8:16 0 7.3T 0 disk
├─sdb1 8:17 0 7.3T 0 part
│ └─md0 9:0 0 7.3T 0 raid1 /mnt/raid_vol
└─sdb2 8:18 0 1007K 0 part
sdc 8:32 0 7.3T 0 disk
├─sdc1 8:33 0 7.3T 0 part /mnt/dtv_h264
└─sdc2 8:34 0 1004K 0 part
sdd 8:48 0 2.7T 0 disk
├─sdd1 8:49 0 2.7T 0 part /mnt/dtv_recipe
└─sdd2 8:50 0 1007K 0 part
sde 8:64 1 3.7T 0 disk
├─sde1 8:65 1 3.7T 0 part /mnt/dtv_slave
└─sde2 8:66 1 1007K 0 part
sdf 8:80 1 7.3T 0 disk
├─sdf1 8:81 1 7.3T 0 part /mnt/dtv_h264B
└─sdf2 8:82 1 1007K 0 part
sdg 8:96 1 3.7T 0 disk
├─sdg1 8:97 1 3.7T 0 part /mnt/dtv_recover
└─sdg2 8:98 1 1007K 0 part
nvme0n1 259:0 0 232.9G 0 disk
├─nvme0n1p1 259:1 0 218G 0 part /
├─nvme0n1p2 259:2 0 1K 0 part
└─nvme0n1p5 259:3 0 15G 0 part
- df -t ext4
munakata@mvc:~$ df -t ext4
Filesystem 1K-blocks Used Available Use% Mou...
/dev/nvme0n1p1 224824828 10101216 203280108 5% /
/dev/sdd1 2884152536 879263216 1858359684 33% /mn...
/dev/sdc1 7752326436 4828065860 2533542932 66% /mn...
/dev/sdf1 7751408932 3309782296 4050908992 45% /mn...
/dev/sde1 3845577736 1340366468 2309844052 37% /mn...
/dev/sdg1 3844640564 2819798184 829475120 78% /mn...
/dev/md0 7751235316 3215359744 4145164516 44% /mn...
- df -x squashfs -x tmpfs -x devtmpfs
munakata@mvc:~$ df -x squashfs -x tmpfs -x devtmpfs
Filesystem 1K-blocks Used Available Use% Mou...
/dev/nvme0n1p1 224824828 10101204 203280120 5% /
/dev/sdd1 2884152536 879572224 1858050676 33% /mn...
/dev/sdc1 7752326436 4828065860 2533542932 66% /mn...
/dev/sdf1 7751408932 3309782296 4050908992 45% /mn...
/dev/sde1 3845577736 1340366468 2309844052 37% /mn...
/dev/sdg1 3844640564 2819798184 829475120 78% /mn...
/dev/md0 7751235316 3215359816 4145164444 44% /mn...
*** Ubuntu パスワード再設定(忘れた時 → リカバリーモード...
+ BIOS起動直後にShiftキー連打
+ GRUBメニューが表示されたら &color(red){Advanced option ...
+ リカバリーメニューが表示されるので root を選択するとシ...
+ shell で以下を実行
# mount -o remount,rw / # ファイルシステム全体を読み書き...
# pwconv # /etc/passwdと/etc/shadowの整合性を取るように...
# passwd user # userのパスワードを変更する対話モードに移る
+ 再起動して通常モードでログイン
# shutdown -r now
*** [[HW 情報の表示(HW プロファイラー):https://news.myn...
|コマンド|内容|h
|hwinfo|ハードウェア情報をフル表示|
|lshw|ハードウェア情報をフル表示|
|inxi -Fxz|ハードウェア情報を表示|
|hwinfo --short|ハードウェア情報を表示|
|lshw -short|ハードウェア情報を表示|
|lscpu|CPU情報を表示|
|lshw -C cpu|CPU情報を表示|
|dmidecode -t memory|メモリ情報を表示|
|lshw -short -C memory|メモリ情報を表示|
|lspci | grep -i vga|VGA情報を表示|
|lspci -v -s|デバイス番号 指定したデバイスの情報表示|
|free -m|現在のメモリ使用状況を表示|
|top|現在のメモリ使用状況を表示|
|lshw -short -C disk|ディスク情報を表示|
|hdparm -i|デバイスファイル ディスク情報を表示|
|lsblk|ディスク情報を表示|
|fdisk -l|ディスク情報を表示|
|blkid|ディスク情報を表示|
|df|マウント情報を表示|
|lsusb|USB情報を表示|
|lspci|PCI情報を表示|
|lshw -C network|ネットワーク情報を表示|
|ifconfig -a|ネットワーク情報を表示|
|ip link show|ネットワーク情報を表示|
|netstat -i|ネットワーク情報を表示|
|ip route|ルーティング情報を表示|
|netstat -r|ルーティング情報を表示|
|dmidecode -t bios|BIOS/UEFI情報を表示|
*** apt 実行時に GPG キーエラーが出たとき → エラーとなっ...
- sudo apt-key adv --keyserver keyserver.ubuntu.com --rec...
無視:16 https://repo.mongodb.org/apt/ubuntu bionic/mongo...
パッケージリストを読み込んでいます... 完了 ...
W: GPG エラー: https://repo.mongodb.org/apt/ubuntu bioni...
公開鍵を利用できないため、以下の署名は検証できませんでし...
E: リポジトリ https://repo.mongodb.org/apt/ubuntu bionic...
N: このようなリポジトリから更新を安全に行うことができな...
N: リポジトリの作成とユーザ設定の詳細は、apt-secure(8) m...
[KGB] munakata:~$ sudo apt-key adv --keyserver keyserver...
Executing: /tmp/apt-key-gpghome.dQV3TadTUX/gpg.1.sh --ke...
gpg: 鍵68818C72E52529D4: 公開鍵"MongoDB 4.0 Release Sign...
gpg: 処理数の合計: 1
gpg: インポート: 1
*** [[Linuxカーネルビルド大全:https://qiita.com/progrunne...
*** [[マザーボード情報確認(dmidecode):https://orebibou....
- dmidecode -t BIOS
- dmidecode -t System
- dmidecode -t BaseBoard
*** Linux command line で Markdown を見る方法 [[mdless:ht...
- Ruby で書かれた Markdown ビューワー
- snap でインストール可能
*** Ubuntu でスクリーンキャスト(画面の録画) [#ue3b8a20]
- [CTRL] + [SHIFT] + [ALT] + [R] で録画開始
- 再度 [CTRL] + [SHIFT] + [ALT] + [R] で録画終了
- webm フォーマットで動画ファイルが作成され Videos または...
- デフォルトの録画時間は 10秒で、下記の設定で時間制約を...
gsettings set org.gnome.settings-daemon.plugins.media-ke...
- この方法では、画面キャストは可能だが &color(red){音声は...
- 代替手段として simplescreenrecorder というアプリを利用...
[local] munakata:~$ sudo apt install simplescreenrecorder
*** gedit で画面を左右分割 [#g8619995]
- [CTRL] + [ALT] + N
*** Ubuntu 20.04 でスケジュール Notify のポップアップを無...
- [[How to stop evolution-alarm-notify:https://askubuntu....
munakata@muna--E14G3:~$ cp /etc/xdg/autostart/org.gnome....
munakata@muna--E14G3:~$ sed -i "s/NoDisplay=true/NoDispl...
munakata@muna--E14G3:~$ gnome-session-properties
(gnome-session-properties:201684): Gtk-WARNING **: 09:49...
munakata@muna--E14G3:~$ systemctl --user mask evolution-...
Created symlink /home/munakata/.config/systemd/user/evol...
munakata@muna--E14G3:~$ systemctl --user mask evolution-...
Created symlink /home/munakata/.config/systemd/user/evol...
munakata@muna--E14G3:~$ systemctl --user mask evolution-...
Created symlink /home/munakata/.config/systemd/user/evol...
munakata@muna--E14G3:~$ systemctl --user mask evolution-...
Created symlink /home/munakata/.config/systemd/user/evol...
*** ゲストOS で ping が使えるようにする [#yb184942]
- sudo apt install iputils-ping net-tools
*** ゲストOS とホストOS 間でコピペが使えるようにする [#j9...
- sudo apt install spice-vdagent
*** [[Ubuntu のマウス中央ボタンでのペーストを無効にする:h...
- $ sudo apt-get install xbindkeys xsel xdotool
- $ ~/.xbindkeysrcに以下の二行を記入して保存
-- "echo -n | xsel -n -i; pkill xbindkeys; xdotool click ...
-- b:2 + Release
- $ xbindkeys -p
- ~/.xsessionrc
-- xbindkeys -p
*** [[GNOME shell extentions:]] のインストール [#c2661c79]
- sudo apt install gnome-shell-extension-prefs
*** [[BIZ UD フォント(モリサワ、無償版):https://fonts.g...
*** [[Dropbox CLI (for Ubuntu-server):https://www.dropbox...
- Dropbox デーモンのインストール
cd ~ && wget -O - "https://www.dropbox.com/download?plat...
- 上記コマンドの実行で新規作成される .dropbox-dist フォル...
[KGB2] munakata:~/.dropbox-dist$ ./dropboxd
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
Dropbox ...
https://www.dropbox.com/cli_link_nonce?nonce=86e1ae227f3...
- 最後の行(は、繰り返し表示される)の URL をブラウザーに...
- リンクが成功したら、上記のデーモンは [CTRL+C] で強制終...
- Dropbox CLI (実態は python スクリプト)をダウンロード
[KGB2] munakata:~/Downloads$ wget -O dropbox.py https://...
- CLI の実行 ''python3 dropbox.py コマンド''
[KGB2] munakata:~/Downloads$ python3 dropbox.py
Dropbox command-line interface
commands:
Note: use dropbox help <command> to view usage for a spe...
autostart automatically start Dropbox at login
exclude ignores/excludes a directory from syncing
filestatus get current sync status of one or more files
help provide help
lansync enables or disables LAN sync
ls list directory contents with current sync ...
proxy set proxy settings for Dropbox
puburl get public url of a file in your Dropbox's...
running return whether Dropbox is running
sharelink get a shared link for a file in your Dropbox
start start dropboxd
status get current status of the dropboxd
stop stop dropboxd
throttle set bandwidth limits for Dropbox
update download latest version of Dropbox
version print version information for Dropbox
[KGB2] munakata:~/Downloads$ python3 dropbox.py status
Dropbox isn't running!
[KGB2] munakata:~/Downloads$ python3 dropbox.py lansync
Dropbox isn't running!
[KGB2] munakata:~/Downloads$ python3 dropbox.py start
Starting Dropbox...dropbox: load fq extension '/raid_vol...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
Dropbox isn't running!
Done!
[KGB2] munakata:~/Downloads$ python3 dropbox.py lansync n
[KGB2] munakata:~/Downloads$ python3 dropbox.py update
Dropbox is the easiest way to share and store your files...
In order to use Dropbox, you must download the proprieta...
Downloading Dropbox... 100%
Unpacking Dropbox... 100%dropbox: load fq extension '/ra...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
dropbox: load fq extension '/raid_vol/home/munakata/.dro...
success!
[KGB2] munakata:~/Downloads$ python3 dropbox.py status
開始中...
To link this computer to a Dropbox account, visit the fo...
https://www.dropbox.com/cli_link_nonce?nonce=c03c0bfb6a8...
[KGB2] munakata:~/Downloads$ python3 dropbox.py status
同期中(39,682 件のファイル • 17 分)
39,682 件のファイルをダウンロード中 (0.0KB/秒、17 分)
[KGB2] munakata:~/Downloads$ python3 dropbox.py autostar...
[KGB2] munakata:~/Downloads$ python3 dropbox.py status
同期中(35,890 件のファイル • 1 時間)
35,890 件のファイルをダウンロード中 (0.0KB/秒、1 時間)
*** Thinkpad E14 で vi 編集中に日本語入力ができなくなる [...
- 一旦 vi 終了し Terminal で [変換] キーを押して Mozc ...
*** Ubuntu 22.04 で突然ネットワークが使えなくなった [#jf3...
- 物理的なネットワークは正常(リンクアップしている)
- 物理的なネットワークカードは認識されている(が、lshw で...
munakata@muna-Linux:~$ lspci | grep net
03:00.0 Ethernet controller: Realtek Semiconductor Co., ...
munakata@muna-Linux:~$ sudo lshw
(snip)
*-network UNCLAIMED
詳細: Ethernet controller
製品: RTL8111/8168/8411 PCI Express Gigabit Ethern...
ベンダー: Realtek Semiconductor Co., Ltd.
物理ID: 0
バス情報: pci@0000:03:00.0
バージョン: 11
幅: 64 bits
クロック: 33MHz
性能: pm msi pciexpress msix vpd bus_master cap_list
設定: latency=0
リソース: IOポート:d000(サイズ=256) メモリー:f7100...
- しかし、ネットワークインターフェースが活性化されていな...
munakata@muna-Linux:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue st...
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: nm-bridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500...
link/ether da:8f:a5:ad:aa:0c brd ff:ff:ff:ff:ff:ff
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 ...
link/ether 52:54:00:e3:40:81 brd ff:ff:ff:ff:ff:ff
- システムSWの更新で、必要なドライバーがインストールされ...
- 現在のシステム環境を確認
munakata@muna-Linux:~$ uname -r
6.2.0-26-generic
- ''linux-modules-extra-$(uname -r)'' パッケージを ''http...
-- https://packages.ubuntu.com/jammy/kernel/linux-modules...
- Bootable Ubuntu image (usb) でシステムを起動(すればネ...
- ブラウザーから上記ファイル(linux-modules-extra-6.2.0-2...
- ホストマシン上のディスクをマウントして、書き込み可能エ...
- 再起動後に、上記ファイルをインストールし、再起動
munakata@muna-Linux:~$ sudo apt install ./linux-modules-...
- [[参考ページ:https://askubuntu.com/questions/1437477/22...
*** Ubuntu 22.04 以降の画面キャプチャの方法 [#i3eb0e09]
- shutter の領域を指定してキャプチャ機能が使えなくなった
- そのかわり [PrtSc] キーを押すと OS にバンドルされた画面...
- キャプチャ画面は Picture ホルダーの スクリーンショット ...
*** Ubuntu ホスト名の確認 [#e656109c]
- 以前は hostname コマンドを利用していたが、''hostnamectl...
-- KGB2 サーバー
[KGB2] munakata:~$ hostnamectl
Static hostname: kgb2
Icon name: computer-desktop
Chassis: desktop
Machine ID: ad37e2bbaa134fa18321a14b7b21ae30
Boot ID: 4359753f434d4360930bd9ab267e556c
Operating System: Ubuntu 22.04.3 LTS
Kernel: Linux 5.15.0-92-generic
Architecture: x86-64
Hardware Vendor: BIOSTAR Group
Hardware Model: B550MXC PRO
-- 会社 Linux Desktop
munakata@muna-Linux:~$ hostnamectl
Static hostname: muna-Linux
Icon name: computer-desktop
Chassis: desktop
Machine ID: 30aea48dddb743419e553e95758bddad
Boot ID: ced5ef1d2556421185469de6f335caf9
Operating System: Ubuntu 22.04.3 LTS
Kernel: Linux 6.5.0-14-generic
Architecture: x86-64
*** Ubuntu 22.04 で exFAT を利用するには ''exfat-utils'' ...
[KGB2] munakata:~$ sudo apt install exfat-fuse exfatprog...
*** [[Ununtu 22.04 で「Press 'Ctrl'+'C'” to cancel filesy...
- The key observation here is that normally, there's a lo...
- In my case (and I expect this to be not uncommon), this...
*** Ubuntu Server イメージでシステム修復 [#le6197e8]
- Ubuntu Server ISO で起動した場合、Tryモード(インストー...
-- インストーラープログラム実行中の任意のタイミングで Ctr...
*** Ubuntu で sudo が使えなくなった場合の回避策 [#ja730a9b]
- (例えば visudo の編集に失敗するなどして)sudo が使えな...
-- &color(red){電源 ON 直後に [ESC] キーを連打して GRUB ...
-- recovery モードを選択し、&color(red){root を選ぶ};(と...
-- shell で必要な操作を実行し reboot する。
*** USB 外付け HDD を含むシステムでのスクリプト実行の問題...
- USB 接続のHDDを接続しない状態でバックアップなどのスクリ...
-- &color(red){実際の USB HDD ではなく、そのマウントポイ...
-- 正常にマウントできた場合には、マウントポイント上のファ...
-- 一度アンマウントして、マウントポイント上に誤って書かれ...
-- バックアップスクリプトで、実際にファイルがマウントされ...
--- ChatGPT のスクリプト案(他にも色々方法の提案あり)
#!/bin/bash
MOUNT_POINT="/path/to/mount/point"
if grep -qs "$MOUNT_POINT" /proc/mounts; then
echo "External HDD is mounted."
else
echo "External HDD is not mounted. Exiting script."
exit 1
fi
--- &ref(backup_auto.sh);
*** Ubuntu Firmware 管理 (fwupdmgr) [#p92bd018]
-- ファームウエアアップデートの実行(可能なもの全て)
[KGB2] munakata:~$ sudo fwupdmgr update
Devices with no available firmware updates:
• CT500P1SSD8
No updatable devices
-- コマンド使用方法
[KGB2] munakata:~$ sudo fwupdmgr --help
Usage:
fwupdmgr [OPTION…]
activate [DEVICE-ID|GUID] Activate devices
block-firmware [CHECKSUM] Blocks a specific fi...
clear-results DEVICE-ID|GUID Clears the results f...
device-emulate [FILENAME1] [FILENAME2]
Emulate a device usi...
device-test [FILENAME1] [FILENAME2]
Test a device using ...
device-wait GUID|DEVICE-ID Wait for a device to...
disable-remote REMOTE-ID Disables a given rem...
downgrade [DEVICE-ID|GUID] Downgrades the firmw...
download LOCATION Download a file
emulation-load FILENAME Load device emulatio...
emulation-save FILENAME Save device emulatio...
emulation-tag [DEVICE-ID|GUID] Adds devices to watc...
emulation-untag [DEVICE-ID|GUID] Removes devices to w...
enable-remote REMOTE-ID Enables a given remote
get-approved-firmware Gets the list of app...
get-bios-setting [SETTING1] [SETTING2] [--no-authentic...
get-bios-settingsの...
get-bios-settings [SETTING1] [SETTING2] [--no-authenti...
Retrieve BIOS settin...
get-blocked-firmware Gets the list of blo...
get-details FILE Gets details about a...
get-devices Get all devices that...
get-history Show history of firm...
get-plugins Get all enabled plug...
get-releases [DEVICE-ID|GUID] Gets the releases fo...
get-remotes Gets the configured ...
get-results DEVICE-ID|GUID Gets the results fro...
get-topology get-devicesの別名
get-updates [DEVICE-ID|GUID] Gets the list of upd...
get-upgrades [DEVICE-ID|GUID] get-updatesの別名
inhibit [REASON] Inhibit the system t...
install [DEVICE-ID|GUID] [VERSION]
Install a specific f...
local-install FILE [DEVICE-ID|GUID]
Install a firmware f...
modify-config KEY,VALUE Modifies a daemon co...
modify-remote REMOTE-ID KEY VALUE
Modifies a given rem...
quit Asks the daemon to q...
refresh [FILE FILE_SIG REMOTE-ID]
Refresh metadata fro...
reinstall [DEVICE-ID|GUID] Reinstall current fi...
report-devices Upload the list of u...
report-export Export firmware hist...
report-history Share firmware histo...
security Gets the host securi...
security-fix [APPSTREAM_ID] Fix a specific host ...
security-undo [APPSTREAM_ID] Undo the host securi...
set-approved-firmware FILENAME|CHECKSUM1[,CHECKSUM2][,...
Sets the list of app...
set-bios-setting SETTING1 VALUE1 [SETTING2] [VALUE2]
Sets one or more BIO...
switch-branch [DEVICE-ID|GUID] [BRANCH]
Switch the firmware ...
sync Sync firmware versio...
sync-bkc syncの別名
unblock-firmware [CHECKSUM] Unblocks a specific ...
uninhibit INHIBIT-ID Uninhibit the system...
unlock DEVICE-ID|GUID Unlocks the device f...
update [DEVICE-ID|GUID] Updates all specifie...
upgrade [DEVICE-ID|GUID] updateの別名
verify [DEVICE-ID|GUID] Checks cryptographic...
verify-update [DEVICE-ID|GUID] Update the stored cr...
Help Options:
-h, --help Show help options
Application Options:
-v, --verbose 追加のデバッグ情報を表示します
--version Show client and daemon versi...
--download-retries Set the download retries for...
--offline Schedule installation for ne...
--allow-reinstall Allow reinstalling existing ...
--allow-older Allow downgrading firmware v...
--allow-branch-switch Allow switching firmware bra...
--force Force the action by relaxing...
-y, --assume-yes Answer yes to all questions
--sign Sign the uploaded data with ...
--no-unreported-check Do not check for unreported ...
--no-metadata-check Do not check for old metadata
--no-remote-check Do not check if download rem...
--no-reboot-check Do not check or prompt for r...
--no-safety-check Do not perform device safety...
--no-device-prompt Do not prompt for devices
--no-history Do not write to the history ...
--show-all Show all results
--disable-ssl-strict Ignore SSL strict checks whe...
--p2p Only use peer-to-peer networ...
--filter Filter with a set of device ...
--filter-release Filter with a set of release...
--json Output in JSON format
--no-security-fix Do not prompt to fix securit...
--no-authenticate Don't prompt for authenticat...
This tool allows an administrator to query and control t...
-- 管理対象デバイスの表示
[KGB2] munakata:~$ sudo fwupdmgr get-devices
BIOSTAR Group B550MXC PRO
│
├─AMD Ryzen 5 5600G with Radeon Graphics:
│ │ Device ID: 4bde70ba4e39b28f9eab1628f9dd6e...
│ │ Current version: 0x0a50000d
│ │ Vendor: Advanced Micro Devices, Inc.
│ │ GUIDs: 79759cdc-94db-5098-be7b-eb0252...
│ │ 20b595b0-5892-5870-8e4c-688133...
│ │ Device Flags: • Internal device
│ │
│ └─Secure Processor:
│ Device ID: c54ab0237d7a8db8c717b68e0be78e...
│ Current version: 00.11.02.7b
│ Bootloader Version:00.11.02.7b
│ Vendor: Advanced Micro Devices, Inc. (...
│ GUIDs: 0e8dc554-a0a2-51fb-b439-1eb72b...
│ bd5a5081-60b8-57cb-91d6-78e850...
│ Device Flags: • Internal device
│
├─CT500P1SSD8:
│ Device ID: 8e92eda1ab953dd9f27d11cd320c36...
│ Summary: NVM Express solid state drive
│ Current version: P3CR021
│ Vendor: Micron/Crucial Technology (NVM...
│ Serial Number: 2127300AAAB9
│ GUIDs: 43fd42e8-36d1-5486-9b96-cbac3c...
│ cad63970-876b-50ef-8576-36ffa1...
│ 375730e6-e87b-5a4c-9ee3-034f2d...
│ Device Flags: • Internal device
│ • Updatable
│ • System requires external pow...
│ • Needs a reboot after install...
│ • Device is usable for the dur...
│
├─Cezanne [Radeon Vega Series / Radeon Vega Mobile Serie...
│ │ Device ID: f0c42c4d354e719e9d5cd3366ebe36...
│ │ Summary: Cezanne Generic VBIOS
│ │ Current version: 017.010.000.030.000000
│ │ Vendor: Advanced Micro Devices, Inc. [...
│ │ GUID: abf6849d-1bc5-5941-80f8-babdaf...
│ │ Device Flags: • Cryptographic hash verificat...
│ │
├─Mass storage controller:
│ Device ID: 08740947f5235290dc47990eb8e346...
│ Current version: 02
│ Vendor: ASMedia Technology Inc. (PCI:0...
│ GUIDs: 210819f3-da74-587f-a857-8d4e38...
│ 08903ce1-1a19-53cd-b343-239f3b...
│ 340dec82-fc69-5ccc-8971-dfe6ff...
│ e2758d1c-dbd1-55fe-a571-3596a5...
│ Device Flags: • Internal device
│ • Cryptographic hash verificat...
│
└─TPM:
Device ID: c6a80ac3a22083423992a3cb150189...
Summary: TPM 2.0 Device
Current version: 3.84.0.5
Vendor: Advanced Micro Devices, Inc. (...
GUIDs: 9305de1c-1e12-5665-81c4-37f8e5...
78a291ae-b499-5b0f-8f1d-74e1fe...
65a3fced-b423-563f-8098-bf5c32...
5e704f0d-83cb-5364-8384-f46d72...
Device Flags: • Internal device
• System requires external pow...
• Needs a reboot after install...
• Device can recover flash fai...
• Full disk encryption secrets...
• Signed Payload
*** fail2ban [#dd24732f]
- 設定
-- インストール
sudo apt update
sudo apt install fail2ban
-- 動作確認(インストール後)
sudo systemctl status fail2ban
active (running) になっていればOKです。
-- SSH 用の保護設定(jail.local)
設定ファイルをコピーしてカスタマイズします:
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
sudo vi /etc/fail2ban/jail.local
以下のような項目を編集・確認します([sshd] セクション):
[sshd]
enabled = true
port = ssh
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
bantime = 3600
findtime = 600
|項目|説明|h
|enabled|SSH 用保護を有効に|
|port|SSH ポート(変更してる場合は合わせて)|
|maxretry|失敗回数(3回失敗したら)|
|bantime|BAN する秒数(3600秒 = 1時間)|
|findtime|この秒数内に maxretry 回失敗したら発動|
-- 設定反映(fail2ban 再起動)
sudo systemctl restart fail2ban
- 動作確認
[KGB2] munakata:~$ sudo fail2ban-client status sshd
Status for the jail: sshd
|- Filter
| |- Currently failed: 1
| |- Total failed: 3240
| `- Journal matches: _SYSTEMD_UNIT=sshd.service + _COM...
`- Actions
|- Currently banned: 0
|- Total banned: 38
`- Banned IP lis
*** Ubuntu NotePC (Ubuntu 24.04) から kgb2 のボリューム(...
- あらかじめサーバー側で 192.168.11.x からの NFS 接続を許可
[KGB2] munakata:~/winshare/haicon$ sudo apt install nfs-...
[KGB2] munakata:~/winshare/haicon$ sudo vi /etc/exports
[KGB2] munakata:~/winshare/haicon$ cat /etc/exports
/raid_vol/home/munakata/winshare 192.168.11.0/24(rw,syn...
[KGB2] munakata:~/winshare/haicon$ sudo exportfs -ra
[KGB2] munakata:~/winshare/haicon$ sudo systemctl restar...
[KGB2] munakata:~/winshare/haicon$ systemctl status nfs-...
● nfs-server.service - NFS server and services
Loaded: loaded (/usr/lib/systemd/system/nfs-server....
Active: active (exited) since Sat 2025-12-13 11:23:...
Process: 298135 ExecStartPre=/usr/sbin/exportfs -r (...
Process: 298137 ExecStart=/usr/sbin/rpc.nfsd (code=e...
Main PID: 298137 (code=exited, status=0/SUCCESS)
CPU: 9ms
12月 13 11:23:40 kgb2 systemd[1]: Starting nfs-server.se...
12月 13 11:23:40 kgb2 systemd[1]: Finished nfs-server.se...
[KGB2] munakata:~/winshare/haicon$ exportfs -v
/raid_vol/home/munakata/winshare
192.168.11.0/24(sync,wdelay,hide,no_subt...
- クライアント側で
munakata@muna-E14G3:sudo apt install nfs-common
munakata@muna-E14G3:sudo mkdir /mnt/samba_winshare
munakata@muna-E14G3:sudo mount -t nfs4 192.168.11.20:/ra...
*** scp でリモートファイルをコピーする [#j3361974]
scp -P(ポート)-i(秘密鍵)user@server:file_location/nam...
munakata@muna-U2404:~$ scp -P 8722 -i ~/.ssh/office2025 ...
auth.log.1 ...
195KB 3.0MB/s 00:00
munakata@muna-U2404:~$
*** [[The advanced color palette editor (Pallette App):ht...
ページ名: