f.lux – 全天候保护眼睛健康软件!自动调整屏幕色温减少蓝光防疲劳

f.lux – 全天候保护眼睛健康软件!自动调整屏幕色温减少蓝光防疲劳,长时间玩电脑必备!

此软件有各种版本,我这里只介绍linux版本, 在我的kali试过成功的,只是在xmonad 要手工启动而已 ! 小胖介绍的这个软件不错

# Install dependencies
sudo apt-get install git python-appindicator python-xdg python-pexpect python-gconf python-gtk2 python-glade2 libxxf86vm1

# Download xflux-gui
cd ~
git clone "https://github.com/xflux-gui/xflux-gui.git"
cd xflux-gui
python download-xflux.py

# EITHER install globally
sudo python setup.py install
# OR, install in your home directory
python setup.py install --user

# Run flux
fluxgui

# To uninstall:
sudo rm -rf /usr/local/lib/python2.7/dist-packages/{fluxgui/,f.lux_indicator*}
sudo rm /usr/local/share/icons/hicolor/scalable/apps/fluxgui.*
sudo rm /usr/local/share/applications/fluxgui.desktop
sudo rm /usr/local/bin/{xflux,fluxgui}
rm -rf ~/.gconf/apps/fluxgui/

github 安装教程

http://www.iplaysoft.com/flux.html

expect

#!/usr/bin/expect
#good on new kali 这个在新的kali 上是ok的
set timeout 30
set sshIP "4.88.1.2"
set keypassword "ZdvV"
set rootPassword "5D"
#spawn ssh -o StrictHostKeyChecking=no -i /root/key evan@$sshIP

expect "Enter passphrase"
send "$keypassword\r"
expect "]$"
send "sudo -i\r"
expect "xxxxx"
send "$rootPassword\r"
expect "]#"
## run command
#send "cat /root/1 && echo 'test was ok .';exit\r"
#send "bash /data/tmp/dbins && echo 'dbins was ok.';exit\r"
#expect "52wan"
#send "exit\r"
#expect eof {exit 0}
interact


#!/usr/bin/expect
# on old kali 这个在老的kali
set timeout 30
set sshIP "4.88.1.2"
set keypassword "Zd"
set rootPassword "5D"
spawn ssh -o StrictHostKeyChecking=no -i /home/key evan@$sshIP
expect "Enter passphrase"
send "$keypassword\r"
expect "52wan"
send "sudo -i\r"
expect "password for 52wan:"
send "$rootPassword\r"
expect "]#"
## run command
#send "cat /root/1 && echo 'test was ok .';exit\r"
#send "bash /data/tmp/dbins && echo 'dbins was ok.';exit\r"
#expect "52wan"
#send "exit\r"
#expect eof {exit 0}
interact

learn

ip
ip add

ping -c 5 baidu.com

netstat -nlptu

host baidu.com

ftp lftp

20161015

mysql批量删除指定前缀或后缀的表

[root@ evan]# mysql -uroot -pKK8,c3Rdt -h127.0.0.1 -P3307 -e " use dk_stat; show tables like 'log_role%'";

log_role_20160801
log_role_20160802
log_role
log_role_201609
log_role_201610
log_role_temp

分析 利用三重循环删除 分别删除 三种类型 单月 log_role_201601,单月加单日 log_role_20160801 和其它 log_role_20160811

#/bin/bash
#mytable=log_statdatas_20160
mytable=log_activate_20160
for tab0 in `seq 01 08`
do
for tab1 in `seq 1 9`
do

for tab2 in `seq 1 30`
do

mysql -uroot -p'KK8' -h127.0.0.1 -P3307 -e "use dk_stat; drop table ${mytable}${tab0}";
mysql -uroot -p'KK8' -h127.0.0.1 -P3307 -e "use dk_stat; drop table ${mytable}${tab0}0${tab1}";
mysql -uroot -p'KK8' -h127.0.0.1 -P3307 -e "use dk_stat; drop table ${mytable}${tab0}${tab2}";

done

done
done

zabbix中文乱码解决方法

zabbix乱码是怎么照成的呢?

zabbix使用DejaVuSan.ttf字体,不支持中文,导致中文出现乱码。解决方法很简单,windows 里面字体文件传到zabbix服务器上。

找到本地C:\Windows\Fonts\simkai.ttf(楷体)上传到服务器zabbix网站目录fonts目录下。

wget linuxchina.net/simkai.ttf

修改zabbix php配置文件
cd /data//zabbix/ # 我zabbix安装目录
cp include/defines.inc.php include/defines.inc.phpbak
sed -i 's/DejaVuSans/simkai/g' ./include/defines.inc.php

通过以上的操作,大部分同学的乱码问题解决了,但是依旧有一些同学还是乱码?初始化数据库的时候未使用utf8编码所致.初始化数据库使用命令
create database zabbix default charset utf8;

或者my.cnf增加如下配置
default-character-set = utf8

http://www.ttlsa.com/zabbix/zabbix-chinese-garbled-ttlsa/

Linux启动或禁止SSH用户及IP的登录

1:Linux启动或禁止SSH root用户的登录

vi /etc/ssh/sshd_config
#yes 就是可以使用SSH方式的root登录
#no就是禁止使用SSH方式的root登录
PermitRootLogin no

2:Linux限制SSH用户

AllowUsers evan

evan是我操作系统的用户,如果没有用户可以手动添加AllowUsers

启动或禁止用户IP登录
/etc/hosts.allow配置文件,设置允许登录的IP
sshd:192.168.220.164

/etc/hosts.deny文件,设置sshd:ALL

参考
http://blog.csdn.net/linghe301/article/details/8211305