ターミナルで
google-drive-ocamlfuse -cc
と打ち込み実行
ターミナルで
google-drive-ocamlfuse -cc
と打ち込み実行
1.opamを入れる(OCamlという関数型言語のパッケージマネージャ)
yum groupinstall "Development Tools" yum install sqlite-devel fuse fuse-devel libcurl-devel zlib-devel m4 yum install ocaml ocamldoc ocaml-camlp4-devel ncurses-devel cd /etc/yum.repos.d/ wget http://download.opensuse.org/repositories/home:ocaml/CentOS_7/home:ocaml.repo yum install opam
2.google-drive-ocamlfuseのインストール(root以外で行う処理)
opam installすると不足しているyumパッケージを教えてくれるので、それを入れた後もう一度コマンドを実行する opam init opam update opam install google-drive-ocamlfuse
3.認証画面が出るので処理する(root以外で、GUI上の端末から行う)
vim ~/.bashrc PATH=$PATH:$HOME/.opam/system/bin export PATH source ~/.bashrc
4.認証を行う。(ブラウザが立ち上がるため、GUI上の端末で行う)
google-drive-ocamlfuse
■マウント処理
1.rootでスクリプトを作成(usernameは実際に使うユーザに置き換えること)
cd /usr/bin
vim gdfuse
#!/bin/bash su username -l -c "/home/username/.opam/system/bin/google-drive-ocamlfuse -label $1 $*" exit 0
chmod +x /usr/bin/gdfuse
2.マウントポイントの作成($USERになってから行うこと)
sudo mkdir /mnt/gdrive sudo chown $USER.$USER /mnt/gdrive
sudo vim /etc/fstab 次の行を追加(uid,gidは確認する。)
gdfuse#default /mnt/gdrive fuse uid=1000,gid=1000 0 0
3.マウントの実行($USERになってから行うこと)
sudo mount /mnt/gdrive
デスクトップ環境:X-windowとxfce
リモートのサーバ:tigerVNCサーバ
環境:サーバ:さくらVPS 4Gプラン CentOS7 minimal クライアント:Windows10
■xfceを入れる
0.remiリポジトリを入れる(前提のepelを入れるのを忘れないように)
1.epel,remiリポジトリのenabled=0にしておく
2.デスクトップ関連のgroupinstall
yum groupinstall –enablerepo=epel “X Window System” XFCE Desktop Fonts
3.xfce4-terminalのインストール?必要じゃ無いかも
yum install –enablerepo=epel xfce4-terminal xfce-utils
4.iconのインストール
yum install gnome-icon*
■tigervnc
0.tigervncを入れる
yum install tigervnc*
cp /usr/lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:2.service
1.vim /etc/systemd/system/vncserver\@\:2.service を行う
<USER>となっている部分を利用するユーザに変更する
2.自動実行するように変更する
systemctl daemon-reload
systemctl enable vncserver@:2
systemctl restart vncserver@:2
3.ファイアーウォールの設定
firewall-cmd –permanent –zone=public –add-port=5902/tcp
firewall-cmd –reload
■日本語用TTFフォント(Ricty)を入れる
0.gitを入れる
yum install git
1.FontForge のインストール
yum install fontforge
2.Inconsolata(Font) のインストール
git clone https://github.com/google/fonts.git
3.Inconsolataフォントをシステムにコピー
cd fonts/ofl
cp -r inconsolata /usr/share/fonts/inconsolata
4.Migu 1M のインストール
wget https://osdn.jp/projects/mix-mplus-ipa/downloads/63545/migu-1m-20150712.zip
unzip migu-1m-20150712.zip
cd migu-1m-20150712
mkdir /usr/share/fonts/migu-1m
cp migu-1m-*.ttf /usr/share/fonts/migu-1m
5.フォントキャッシュを更新
fc-cache -f -v
6.Rictyスクリプトの入手
git clone https://github.com/yascentur/Ricty.git
7.Rictyスクリプトの実行とインストール
cd Ricty
sh ricty_generator.sh auto
mkdir /usr/share/fonts/Ricty
cp Ricty*.ttf /usr/share/fonts/Ricty
8.フォントキャッシュを更新
fc-cache -f -v
今後の方向として、Python使って機械学習を勉強することを目指す。その途中目的地として、Python使ってTwitterbot建てる。できればマルコフ連鎖とか使って。
んで、その開発環境として。VPSのCentOS7上にvncサーバを立てて、リモートデスクトップを使い接続する。んで、そこでSublimetext3を使ってコーディング。
という感じで進める。進んだら、その状況を記事にする予定。
その際のLogrotateメモ。
vim /etc/logrotate.d/httpd
/var/log/httpd/*log {
daily
missingok
rotate 90
notifempty
sharedscripts
prerotate
`rpm -ql awstats|grep "awstats_updateall\.pl"` now -confdir="/etc/awstats" \
-awstatsprog="`rpm -ql awstats|grep "awstats\.pl"`" >/dev/null
endscript
postrotate
/sbin/service httpd reload > /dev/null 2>/dev/null || true
endscript
}
ということで、さくらVPSのサーバを一個借りた。elggというOpenSourceのSNSプログラムを建てたりする予定。夕飯前にCnetOS7を入れたので、ボチボチ設定して行く予定。
アクセスリストを見ていると、非常に多くてうざいのでrobots.txtではなく、.htaccessで弾くことに。
order allow,deny
order allow,deny
allow from all
SetEnvIfNoCase User-Agent "^MJ12bot/v?1\.[01]\.[0-9]{1,2}" shutout
SetEnvIfNoCase User-Agent "MJ12bot" shutout
SetEnvIfNoCase User-Agent "Baiduspider" shutout
SetEnvIfNoCase User-Agent "Slurp" shutout
Deny from env=shutout
以上のコードを追加した。正規表現は適当なので間違ってるかも。
今までやってなかったのかい!という突っ込みは置いておいて。あんまり酷いので、robots.txtの設置を。
User-agent: Slurp Crawl-delay: 5 User-agent: msnbot Crawl-delay: 300 User-agent: baiduspider Crawl-delay: 300 User-Agent: Teoma Crawl-delay: 300 User-Agent: Ask Jeeves Crawl-delay: 300 User-agent: yetibot Crawl-delay: 300 User-agent: MJ12bot Crawl-delay: 300 User-agent:bingbot Crawl-delay:30
上手く効いてくれると良いんだが。効くにしてもしばらく掛かるそうなので、ちょっと困るけど。
ページを更新すると、鬼のような勢いでアクセスが掛かり、システムが止まる。これでは困るので、DOS攻撃対策のmoduleを入れてみた。
Apache F5攻撃対策 mod_evasiveでDoS攻撃防御
の2つのページを参考にする。上手く行くと良いのだが。