ラベル linux の投稿を表示しています。 すべての投稿を表示
ラベル linux の投稿を表示しています。 すべての投稿を表示

2017年9月19日火曜日

python3.6.2にmysql-connectorのインストール

centos7にソースからビルドしたpython3.6.2を使用。
pip3 install mysql-connector エラーでインストールできない。
protobufが必要らしい。
それっぽいのを探してインストール。

$ yum search protobuf
$ sudo yum install protobuf protobuf-c protobuf-c-devel protobuc-c-compiler
$ pip3 install mysql-connector

まだ駄目。

Requirements
mysql-connector (version >= 2.2.3) requires Protobuf C++ (version >= 2.6.0)
らしい。README.md
centos7のprotobufは2.5.0

ソースからビルドする。

$ wget https://github.com/google/protobuf/releases/download/v3.4.1/protobuf-cpp-3.4.1.tar.gz
$ tar xvzf protobuf-cpp-3.4.1.tar.gz
$ cd protobuf-3.4.1
$ ./autogen.sh
$ ./configure
$ make
$ make check
$ sudo make install
$ sudo ldconfig
$ export MYSQLXPB_PROTOBUF_LIB_DIR=/usr/local/lib
$ export MYSQLXPB_PROTOC=/usr/local/bin/protoc
$ export MYSQLXPB_PROTOBUF_INCLUDE_DIR=/usr/local/include/google/protobuf
$ pip3 install mysql-connector
でインストールできた。

2017年8月7日月曜日

iptables -L

Chain INPUT (policy DROP)
target     prot opt source               destination
DROP       all  --  43.224.249.212       anywhere                                         
DROP       all  --  182.48.0.0/18        anywhere
DROP       all  --  49.212.0.0/16        anywhere
DROP       all  --  59.106.0.0/16        anywhere
DROP       all  --  219.94.128.0/17      anywhere
DROP       all  --  24.4.0.0/15          anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
LOG        all  -f  anywhere             anywhere            LOG level warning prefix `'[FRAGMENT]''
DROP       all  -f  anywhere             anywhere
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:http
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:https
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:55525
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:smtp
ACCEPT     icmp --  anywhere             anywhere
ACCEPT     udp  --  anywhere             anywhere            state NEW udp dpts:60000:61000

Chain FORWARD (policy DROP)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

2014年8月26日火曜日

roxterm キーボードショートカットのカスタマイズ

Keyboard Shortcuts

There is no editor for keyboard shortcuts; instead they can be changed by pressing keys while the mouse is hovering over a menu item in the terminal, provided editable shortcuts are enabled in your desktop session. In GNOME you have to edit a "secret" option, either by running the command:

gconftool --type bool --set /desktop/gnome/interface/can_change_accels true

or by editing the /desktop/gnome/interface/can_change_accels option with gconf-editor ("Configuration Editor").




New Tab のショートカットをを Shift + Ctrl + T から Ctrl + F1 に変更したい。

メニューバーから変更したいコマンドをマウスで選択した状態で、新たに割り当てたいキーを押す。
この画像の状態で Ctrl + F1 を押す。




ショートカットが変更される。

 


2014年3月28日金曜日

rootパスワード設定済み mysql DBD::mysql インストール

cpanm DBD::mysql
rootにパスワード設定済みなのでエラー
DBI->connect(test) failed: Access denied for user: 'root@localhost' (Using password: NO)

perl Makefile.PL --testuser=myname --testpassword=mypasswd
make test
make install

2014年1月15日水曜日

Drop trendmicro.com

トレンドマイクロ嫌い

#iptables -A INPUT -p tcp --dport 80 -s 150.70.0.0/16 -j DROP

fedora20 grub2のデフォルト起動のOSをwindowsに変更

kernelアップデートの度にgrub2のエントリーメニューが変わる

#grub2-mkconfig 2> /dev/null | grep -i windows
menuentry 'Windows 8 (loader) (on /dev/sda1)' --class windows --classs os $menuentry_id_option 'osprober-chain-B0B4CF40B4CF3804' {

#grub2-set-default 'Windows 8 (loader) (on /dev/sda1)'

リブートすればデフォルト起動OSがWindowsになっている。
/boot/grub/grub.cfgの編集なしでいける。

2014年1月11日土曜日

Centos Awstats

URL => .../$ScriptAlias/awstats.pl?config=$SiteDomain

ScriptAlias => /etc/httpd/conf.d/awstats.conf
SiteDomain => /usr/share/awstats/

/etc/awstats/awstats.$SiteDomain.conf
=> AllowToUpdateStatsFromBrowser=1

chown -R apache
=> /var/lib/awstats/
=> /var/log/httpd/

2013年12月18日水曜日

すぐに忘れる sed コマンド

-n 指定した条件だけ表示
,  コンマで範囲指定

パターンマッチした行の削除
sed '/^#/d' .bashrc
sed '/^$/d' .bashrc

指定行を削除
sed '3d' sample.txt
sed '3,10d' sample.txt

指定行を表示
sed -n '3p' sample.txt
sed -n '3,9p' sample.txt
sed -n '4,/Hello/p' sample.txt
sed -n '/Tokyo/,/Osaka/p' sample.txt

grep
sed -n '/[abc]/p' sample.txt

head
sed 10q sample.txt

2013年12月6日金曜日

centos firefoxに日本語入力

centosのrpmパッケージでない、mozilla.orgからダウンロードした32bit firefoxに日本語入力ができない。

/etc/gtk-2.0/x86_64-redhat-linux-gnuより


“/usr/lib64/gtk-2.0/2.10.0/immodules/im-ibus.so”
“ibus” “IBus (Intelligent Input Bus)” “ibus” “” “ja:ko:zh:*”

“/usr/lib64/gtk-2.0/2.10.0/immodules/im-xim.so”
“xim” “X Input Method” “gtk20″ “/usr/share/locale” “ko:ja:th:zh”

i686パッケージをインストール

yum provides im-ibus.so => ibus-gtk-1.3.4-6.el6.i686
yum provides im-xim.so => gtk2-immodule-xim-2.20.1-4.el6.i686
yum install ibus-gtk-1.3.4-6.el6.i686 gtk2-immodule-xim-2.20.1-4.el6.i686

Installing : ibus-libs-1.3.4-6.el6.i686
Installing : ibus-gtk-1.3.4-6.el6.i686
Installing : gtk2-immodule-xim-2.20.1-4.el6.i686

必要パッケージがインストールされる。

無事日本語入力できた。
感謝!参考ページ おたくの日記帳  Firefox 9.0.1 を CentOS 6.2(x86_64) にインストール

date コマンドのフォーマット

date +フォーマット

$date +%Y/%m/%d
2013/12/06