main.cf
alias_maps = hash:/etc/aliases,regexp:/etc/postfix/aliases.reg
/etc/postfix/aliases.regで正規表現でマッチさせればOK。(ユーザー名がhoge)
/^[0-9a-z\-]+(@.*)?$/ hoge
alias_maps = hash:/etc/aliases,regexp:/etc/postfix/aliases.reg
/^[0-9a-z\-]+(@.*)?$/ hoge
title CentOS (2.6.18-194.3.1.el5) root (hd0,0) kernel /vmlinuz-2.6.18-194.3.1.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet divider=10 initrd /initrd-2.6.18-194.3.1.el5.img
{
missingok
notifempty
sharedscripts
postrotate
#/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
/sbin/service httpd reload > /dev/null 2>/dev/null || true
endscript
}
export GIT_SSL_NO_VERIFY=true
VBoxManage clonevdi コピーされる.vdi コピー先.vdi
vi mysql-backup.sh
#!/bin/bash
PATH=/usr/local/sbin:/usr/bin:/bin
# バックアップ先ディレクトリ
BACKDIR=/backup/mysql
# MySQLrootパスワード
ROOTPASS=xxxxxxxx
# バックアップ先ディレクトリ再作成
rm -rf $BACKDIR
mkdir -p $BACKDIR
# データベース名取得
DBLIST=`ls -p /var/lib/mysql | grep / | tr -d /`
# データベースごとにバックアップ
for dbname in $DBLIST
do
table_count=`mysql -u root -p$ROOTPASS -B -e "show tables" $dbname|wc -l`
[ $table_count -ne 0 ] &&
mysqlhotcopy $dbname -u root -p $ROOTPASS $BACKDIR | logger -t mysqlhotcopy
done
chmod 700 mysql-backup.sh echo "0 5 * * * root /root/mysql-backup.sh" > /etc/cron.d/backup
/bin/cp -Rf /backup/mysql/test/ /var/lib/mysql/
% sudo port install w3m
wget http://doc.okkez.net/archives/201106/ruby-refm-1.9.2-dynamic-20110629.tar.gz tar zxvf ruby-refm-1.9.2-dynamic-20110629.tar.gz mv ruby-refm-1.9.2-dynamic-20110629 rubyrefm sudo vi /opt/local/bin/refe
#!/bin/sh exec ruby -Ke -I ~/Documents/Reference/rubyrefm/bitclust/lib ~/Documents/Reference/rubyrefm/bitclust/bin/refe.rb -d ~/Documents/Reference/rubyrefm/db-1_8_7 "$@"
sudo chmod 755 /opt/local/bin/refe
$ git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundleset nocompatible " be iMproved filetype off " required! set rtp+=~/.vim/bundle/vundle/ call vundle#rc() " let Vundle manage Vundle " required! Bundle 'gmarik/vundle' " My Bundles here: " " original repos on github Bundle 'tpope/vim-fugitive' Bundle 'Lokaltog/vim-easymotion' Bundle 'rstacruz/sparkup', {'rtp': 'vim/'} " vim-scripts repos Bundle 'L9' Bundle 'FuzzyFinder' Bundle 'rails.vim' " non github repos Bundle 'git://git.wincent.com/command-t.git' " ... filetype plugin indent on " required!
Bundle 'Shougo/neocomplcache' Bundle 'Shougo/unite.vim' Bundle 'thinca/vim-ref' Bundle 'thinca/vim-quickrun' "Ruby Bundle 'rails.vim' "Html Bundle 'mattn/zencoding-vim'
yum install -y mysql mysql-server
vim /etc/my.cnf下記を追記
default-character-set=utf8
/etc/rc.d/init.d/mysqld start chkconfig mysqld on
create database wordpress; grant all privileges on wordpress.* to wordpress@localhost identified by 'パスワード';
wget http://ja.wordpress.org/wordpress-3.1-ja.zip unzip wordpress-3.1-ja.zip mv wordpress-3.1-ja /var/www/ chown -R apache:apache /var/www/wordpress/ cp /var/www/wordpress/wp-config-sample.php /var/www/wordpress/wp-config.php vim /var/www/wordpress/wp-config.php
yum install sendmail /etc/rc.d/init.d/sendmail start chkconfig sendmail on
ssh root@xxx.xxx.xxx.xxx -p ポート番号パスワードを入力で接続OK
yum update新しいユーザーを作成してログインを許可
useradd user passwd user vim /etc/group
wheel::10:root,userrootでのログインをなしに
vim /etc/ssh/sshd_config
PermitRootLogin no AllowUsers userSSHの再起動
/etc/init.d/sshd restart exit参考:http://d.hatena.ne.jp/deeeki/20100530/serversman_user_ssh
$ whoami (ユーザー名) $ ssh-keygen -t rsa //カギを作成する Generating public/private rsa key pair. Enter file in which to save the key (/home/(ユーザー名)/.ssh/id_rsa): Created directory '/home/(ユーザー名)/.ssh'. Enter passphrase (empty for no passphrase): //パスワードを入力 Enter same passphrase again: //もう一度パスワードを入力 Your identification has been saved in /home/(ユーザー名)/.ssh/id_rsa. Your public key has been saved in /home/(ユーザー名)/.ssh/id_rsa.pub. The key fingerprint is: ff:8a:6b:d8:eb:ad:68:90:33:eb:2c:6c:d8:ea:98:41 (ユーザー名)@(PC名) $ ls -la ~/.ssh //確認 合計 16 drwx------ 2 xxx xxx 4096 Feb 2 13:53 ./ drwx------ 22 xxx xxx 4096 Feb 2 13:53 ../ -rw------- 1 xxx xxx 951 Feb 2 13:53 id_rsa //秘密鍵 -rw-r--r-- 1 xxx xxx 236 Feb 2 13:53 id_rsa.pub //公開鍵 $ mv ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys //authorized_keysにリネーム
#!/bin/sh
$ chmod u+x ファイル名.sh
#!/bin/sh
TEST_TXT=/users/user/test.txt
TEST01=test01
echo replace test01.txt
cp ${TEST_TXT}.${TEST01} $TEST.TXT
$ crontab -e設定項目は左から「分」「時」「日」「月」「曜日」となっています。
45 6 10 * * ファイル名「/」の後に実行したい間隔の値を設定することで、その間隔を設定可能。
mysql > FLUSH LOGS;
nohup コマンド内容
行いたい処理の最初にnohupをつけるだけでログアウト後も実行をし続けてくれます。nohup コマンド内容 &
最後にアンパサンド(&)をつけるとコマンド内容で指定した処理がバックグラウンドで実行され、割り込みも無視されます 。