Linuxで削除ファイルを復元する

12 月 13th, 2009

まずはphotorecを使用して削除ファイルを復活させます。
この際元のファイル名ではなく、適当な文字の羅列で復元されるため、
下のjheadなどを利用した処理が必要になります。
※復元したい領域とは別の領域にファイルを書き出してください。
そうしないと上書きされてしまい復元率が下がってしまいます。

apt-get install testdisk
photorec
以下のページなどを参照してください。

http://pctrouble.lessismore.cc/software/photorec.html

http://www.emxas.co.jp/itblog/item_187.html

apt-get install jhead
Exif情報を利用して、ファイルを探し出し、ファイル名を変更します。
jhead -exonly -model E-410 -nE-410-%Y%m%d-%H%M%S recup_dir.*/*.jpg
E-410-YYYYMMDD-HHMMSSというファイル名に変更される

特定のファイルを別ディレクトリに移動します。
find ./ -name “E-410*.jpg” -print0 | xargs -0 /bin/mv -t /home/taka/

おわり


英辞郎をmouseover dictionaryで使用する場合

6 月 19th, 2009

PDIC1行テキストの文字コードをUTF16からSJISに変更する必要あり。

$ cat eijiro.txt |iconv -f utf-16 -t cp932 > eijiro2.txt

NetBeansでRuby on Railsのプロジェクトを作成すると Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please ‘gem update –system’ and try again.

6 月 10th, 2009

NetBeansでRuby on Railsのプロジェクトを作成すると
Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please ‘gem update –system’ and try again.
のエラーが。。
コマンドプロンプトから
gem update –system
しても
Nothing to update

以下のように解決
ツール > Ruby Gems より
rubygems-updateをインストール
その後コマンドプロンプトで
C:\Program Files\NetBeans 6.5.1\ruby2\jruby-1.1.4\bin>update_rubygems

IBM System x3550上のRedHat Enterprise LinuxへBroadcom NetXtreme2 driverを入れる

5 月 28th, 2009

mkdir tmp

mv brcm_dd_nic_netxtreme2-1.8.2b_1.46.12_rhel4_32-64.tgz.gz tmp/

tar xzvf brcm_dd_nic_netxtreme2-1.8.2b_1.46.12_rhel4_32-64.tgz.gz

cd SRPM

rpm -ivh brcm_dd_nic_netxtreme2-1.8.2b_1.46.12_rhel4_32-64.12-1.src.rpm

cd /usr/src/redhat/

rpmbuild -bb SPECS/netxtreme2.spec

rpm -ivh RPMS/x86_64/brcm-netxtreme2-smp-1.8.2b_1.46.12_2.6.9_5.EL-1.x86_64.rpm

modprobe bnx2

ethtool -i eth0

ifup eth0

ISUSPM.exeとagent.exeが暴走

5 月 6th, 2009

DELL Vostro 220sのISUSPM.exeとagent.exeが時々暴走するので
マイ コンピュータ\HKEY_LOCAL_USER\Software\Microsoft\Windows\CurrentVersion\Run
のISUSPM.exeを起動している箇所を削除。

VirtualBox上のUbuntuの解像度を変更

5 月 1st, 2009

VirtualBox上のUbuntuの解像度を変更
デバイス > Guest Additionsのインストール
# su -
# cd /media/cdrom
# ./VBoxLinuxAdditions-x86.run
# reboot
これでウィンドウの大きさに合わせて、解像度を変更することができます。

Ubuntu 9.04 で Tracker Index corrupted

5 月 1st, 2009

Tracker
There was an error while performing indexing:

Index corrupted

というエラーが大量に出るようになった。
これは既知のバグだそうで。
tracker-processes -r
を実行すると直る。
tracker-processes コマンドがない場合は
sudo apt-get install tracker-utils
を実行。

Ubuntu Xen domain0起動時rc.localで止まってしまった場合

4 月 16th, 2009

* Running local boot scripts (/etc/rc.local)    [ OK ]

で止まってしまった場合

/etc/event.d/tty1

exec /sbin/getty 38400 xvc0

exec /sbin/getty 38400 tty1

に書き換える。

大量のファイルを移動

4 月 8th, 2009

find ./docs -name *.wiki -print0|xargs -0 mv -t wiki/

CentOS に php 5.2系

4 月 8th, 2009

894  sudo yum list installed php*
895  cd /usr/local/src/
896  wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-2.noarch.rpm
897  wget http://rpms.famillecollet.com/el5.i386/remi-release-5-4.el5.remi.noarch.rpm
898  rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
899  sudo rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
900  sudo yum –enablerepo=remi update php*
901  php –version