間違いだらけの備忘録

このページの内容は無保証でありこのページの内容によって直接、または間接に損害を受けられたとしても私は責任を取りません。

Linux

ユーザのプロセスを全てkill

http://d.hatena.ne.jp/rx7/20120313/p1 $ kill -9 -1とかやると、自分が持つプロセス全てにシグナル(SIGKILL)を送信できる めも

UTF-8処理プログラムでの注意点

https://tools.ietf.org/html/rfc3629 http://www.akanko.net/marimo/data/rfc/rfc3629-jp.txt UTF-8 の実装者は、どのようにそれらが不正なUTF-8文字列を扱うかというセキュリティ面を考慮する必要がある。 (中略) 攻撃者が、UTF-8構文により許されないオク…

firewalld

http://itpro.nikkeibp.co.jp/atcl/column/14/072400026/080500003/ 現在のゾーンを確認 # firewall-cmd --get-active-zone public interfaces: enp2s0ゾーンの状態確認 # firewall-cmd --zone=public --list-all public (default, active) interfaces: enp2…

3種類の Infrastructure as Code の領域

Infrastructure as Code と Configuration as Code http://simplearchitect.hatenablog.com/entry/2016/02/18/165917 Infrastructure as Code:「VMや、PaaS、Network」などの 生成の自動化:ARM(Azure Resource Manager), Azure / AWS SDK, Chef-Provision C…

repository are already installed but they are not correct for this package.

日本語でOK The GPG keys listed for the "CentOS-6 - Debuginfo" repository are already installed but they are not correct for this package. debuginfo-install時に発生。 # cat /etc/yum.repos.d/CentOS-Debuginfo.repo [base-debuginfo] name=CentOS…

RPMコマンドのqueryformatオプション

# rpm --querytags # rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}:%{BUILDHOST}:%{VENDOR}\n" めも

「Backspace」キーで前の文字を削除

http://www.itmedia.co.jp/help/tips/linux/l0133.html $ stty -a (中略) 「erase=^?」の項目である。「^?」は「Delete」キーを指す http://sakusakuit.blog.fc2.com/blog-entry-95.html .profileファイルや.bash_profile等,ログイン時に実行されるファイル…

RHEL7世代のシングルユーザログイン

http://qiita.com/yunano/items/0297d81459d9237c48ed GRUB2の起動画面のカーネル選択時にeを押して起動オプションの編集モードに入る linux, linux16, linuxefiのいずれかで始まる行があるので、この行のrhgbを削除し(さもないとキーボード入力が反映され…

sg_inq: SCSI INQUIRYコマンドで取り出したデータを出力する

# sg_inq /dev/sda standard INQUIRY: PQual=0 Device_type=0 RMB=0 LU_CONG=0 version=0x05 [SPC-3] [AERC=0] [TrmTsk=0] NormACA=0 HiSUP=0 Resp_data_format=2 SCCS=0 ACC=0 TPGS=0 3PC=0 Protect=0 [BQue=0] EncServ=0 MultiP=0 [MChngr=0] [ACKREQQ=0] …

RHEL 6.7でのnkfインストール

# yum --enablerepo=rhel-6-server-optional-rpms install nkf めも 参考 https://access.redhat.com/solutions/392003

yumのレポジトリに一時的にインストールメディアを使用する

#Insert DVD media mkdir /var/tmp/media7 mount /dev/cdrom /var/tmp/media7 cat > /etc/yum.repos.d/media_default.repo <<'EOS' [media_default] name=media_default baseurl=file:///var/tmp/media7 gpgcheck=0 enabled=0 EOS alias yum='yum --disabler…

待ち受けportの確認

CentOS7世代 ss -l -n -t参考 http://lovepeers.org/2014/11/21/centos7-sshd/

apt-get updateでSegmentation fault

最近apt-cloneがSegmentation faultをレポートしているので手動で調査 # apt-get update Segmentation fault #aptitude update Segmentation faultよくある対処法でcacheを削除してみたが、現象変わらず。 # ls -ltr /var/cache/apt/*bin -rw-r--r-- 1 root …

稼働中LinuxのOS丸ごとバックアップ

# tar --one-file-system -cpvf all.tar /参考: http://wikiwiki.jp/disklessfun/?linuxbkup 言うまでもないことですが、/以下を複数パーティションで構成している場合は上のコマンド一発では済みません。適宜工夫して下さい。 めも

kdump取得失敗

kdump/kexec with AACRAID http://www.taitclarridge.com/techlog/2015/02/kdumpkexec-with-aacraid.html I removed the reset_devices from the KDUMP_COMMANDLINE_APPEND variable in /etc/sysconfig/kdump, restarted the kdump service (which rebuilt t…

efibootmgr

http://orumin.blogspot.jp/2013/01/grubefi.html 登録したエントリ番号が0x0008だった時、 $efibootmgr -b 0008 -Bとするとこのエントリを削除できます。 めも

ディスク異常の確認

dmesg | egrep "exception Emask|failed command|Unrecovered read error|I/O error"参考 http://kledgeb.blogspot.jp/2013/07/ubuntu-6-hdd.html cat /etc/cron.daily/chkdmesg.sh #!/bin/bash cd `/usr/bin/dirname $0` dmesg | egrep "exception Emask|fa…

smart情報確認

cat bin/smartchk.sh cd `dirname $0` if [ $# -ne 1 ]; then echo $0" need disk device" exit 1 fi smartctl -A $1 | awk '$2=="Raw_Read_Error_Rate"||$2=="Reallocated_Sector_Ct"||$2=="Reallocated_Event_Count"||$2=="Current_Pending_Sector"||$2=="…

alpine

テキストベースの電子メールクライアント https://packages.debian.org/ja/sid/alpine http://gihyo.jp/admin/serial/01/ubuntu-recipe/0027 めも、未検証

Chaos Monkey

http://www.publickey1.jp/blog/14/netflixchaos_monkeyamazon_ec2.html http://techblog.netflix.com/2014/10/a-state-of-xen-chaos-monkey-cassandra.html Netflixのブログは、「パーシステントレイヤー(データベースのような永続的データを担当するレイ…

btrfs df

http://www.slideshare.net/fj_staoru_takeuchi/btrfs-part1 btrfs filesystem df通常のdf commandは使用不可(結果が信用できない) ほー ssd_spread option(暗にssdも有効化される) 大きな領域から優先的に空き領域を獲得 server向けのSSDの場合、controller…

proxy 認証に対応していないHttp Clientをstoneで通す

http://www.gcd.org/sengoku/stone/Welcome.ja.html stone fwall:8080/proxy 9080 'Proxy-Authorization: Basic c2VuZ29rdTpoaXJvYWtp' めも、未検証

CentOS5系のinitrd再作成

# cp /tftpboot/el5/initrd.img . # mv initrd.img initrd.gz # gunzip initrd.gz (修正) # find . | cpio --create --format='newc' > /tmp/newinitrd # gzip newinitrd # cp newinitrd.gz targetboot/newinitrd.img # vi targetboot/grub.confめも参考 htt…

艦これ

http://togetter.com/li/713911 https://twitter.com/AoiMoe/status/505403935322951680 Linux版FireFoxで艦これ動かしたければ、Adobeのflash playerアーカイブから11.2r202.233を落としてきて、Linux版のtar.gzファイルから(略)取り出して適宜置き換えると…

cdrkit

http://ja.wikipedia.org/wiki/Cdrkit wodim (write optical disk mediaの頭字語): cdrtoolsにおける、光学メディアへの書き込みを行うプログラムcdrecordからのフォーク icedax (incredible digital audio extractorの頭字語): cdrtoolsにおける、音楽CDか…

multipath.conf

https://www.suse.com/ja-jp/documentation/sles11/stor_admin/data/mpionames.html /etc/multipath.confファイルのグローバルマルチパスオプションaliasは、デバイスに名前を明示的に割り当てるために使用されます。別名がマルチパスデバイスに設定されてい…

パーティションを作成した後、multipathデバイスとして認識しない

http://h50146.www5.hp.com/products/software/oe/linux/mainstream/support/faq_soft/soft_multipath.html fdiskで multipathデバイス上にパーティションを作成時、RHEL5の場合には、mpath0p1等のパーティションがオンラインでは自動認識されませんので、別…

mount --rbind

http://d.hatena.ne.jp/tmatsuu/20101225/1293262061 bindだけだと/dev/や/sys/配下にサブマウントされたファイルシステムはマウントされないので、--rbindでマウントしましょう。 (中略) lオプションでlazy unmountを使うとアンマウントできます。 めも、未…

chroot環境下のscript動作失敗

@Debian Wheezy $ script script: openpty failed: No such file or directory Terminated# cd (chrootdir) # mount --bind /dev/pts dev/pts # chroot . # script Script started, file is typescript参考 http://techpatterns.com/forums/about1550.html …

mountの出力(mtab),/proc/mountの出力が違う

mount(およびそれを最終的に呼ぶ)コマンドを使用しないとmtabが更新されないので食い違う。 参考 http://d.hatena.ne.jp/bazuo/20080226/1204025041 dfやmountコマンドでマウントしてるはずのデバイスが表示されない。 http://web.mit.edu/rhel-doc/4/RH-DOC…

このページにはhatena以外のサービスからのコンテンツが埋め込まれています。 hatenaによりGoogle AdSense 広告が埋め込まれています。