博文

Debian7 Wheezy Gnome3找回最大化最小化按钮

直接ALT+F2,输入dconf-editor org>gnome>shell>overrides>button-layout,把值改成 : ;minimize,maximize,close(包括冒号) 要注意一点,dconf-editor这个命令在终端下输入会提示错误警告,而且不能修改,所以得用ALT+F2才行,具体原因我不知道。

Debian: dmesg output contains “Error: Driver ‘pcspkr’ is already registered, aborting…”

解决方法: aptitude install alsa-base echo blacklist snd-pcsp >> /etc/modprobe.d/alsa-base-blacklist.conf 如果alsa-base-blacklist.conf文件里有blacklist snd-pcsp就不必执行echo了    

android手机刷机

fastboot erase recovery   fastboot flash recovery recovery.img   fastboot reboot   下载ROM与recovery http://www.clockworkmod.com/rommanager

alert root shell login

vi ~/.bashrc 在最后一行插入: echo ‘ALERT – Root Shell Access (hostname) on:’ `date` `who` | mail -s “Alert: Root Access from `who | cut -d”(” -f2 | cut -d”)” -f1`” admin@youremail.com   1、hostname更换成你的服务器hostname 2、admin@youremail.com更换成自己的接收邮件地址 3、服务器必须有发送邮件的功能。如安装了mailx、exim4等服务  

Could not load host key: /etc/ssh/ssh_host_ecdsa_key

debian service ssh restart 出现Could not load host key: /etc/ssh/ssh_host_ecdsa_key 解决方法: dpkg-reconfigure openssh-server

FreeBSD install shadowsocks-libev

cd /usr/ports/net/shadowsocks-libev make install clean;rehash ee /etc/rc.conf 加入 shadowsocks_libev_enable=”YES” shadowsocks_libev_flags=”-c /usr/local/etc/shadowsocks-libev/config.json” 在/usr/local/etc/shadowsocks-libev/config.json中加入 { “server”:”136.0.16.99″, “server_port”:1234,             //服务端端口 “local_address”: “127.0.0.1”, “local_port”:4321,                 //客户端端口 “password”:”password”,      //客户端连接密码 “timeout”:300, “method”:”aes-256-cfb”     //加密方式 } 然后客户端,在本地,用config.json文件内容对shadowsocks-gui进行相应配置并运行客户端, shadowsocks-gui下载地址:http://sourceforge.net/projects/shadowsocksgui/files/dist/ 最后设置浏览器代理。Chrome 推荐使用 SwitchySharp 切换代理设置。把浏览器代理设为下列参数即可: 协议: socks5 地址: 127.0.0.1 端口: 你填的 local_port service shadowsocks-libev restart ok应该可以科学上网了

Connect To OpenVPN Over Shadowsocks

按照https://github.com/clowwindy/shadowsocks/wiki/Connect-to-OpenVPN-over-Shadowsocks给的教程;我试了一下,步骤如下: 1、之前安装的OPENVPN服务端 server.conf配置文件里的proto udp 改为 proto tcp 2、openvpn客户端proto udp 也是改为 proto tcp 3、openvpn直接在客户端最后面加入 socks-proxy 127.0.0.1 19999 route 123.xxx.xxx.xxx 255.255.255.255 net_gateway 保存,在服务器重启openvpn 搞定。

debian Shadowsocks Supervisor

执行 apt-get install python-pip python-m2crypto supervisor pip install shadowsocks   服务端安装好以后,创建一个配置文件 /etc/shadowsocks.json。 示例:   { “server”:”服务器 IP 地址”, “server_port”:8388, “local_address”: “127.0.0.1”, “local_port”:1080, “password”:”mypassword”, “timeout”:300, “method”:”aes-256-cfb”, “fast_open”: false, “workers”: 1 }  多用户配置文件 { “server”:”your_server_ip”, “local_address”: “127.0.0.1”, “local_port”:1080, “port_password”:{ “8989”:”password0″, “9001”:”password1″, “9002”:”password2″, “9003”:”password3″, “9004”:”password4″ }, “timeout”:60, “method”:”aes-256-cfb”, “fast_open”: false, “w...

linux 下查看机器是cpu是几核的

几个cpu   more /proc/cpuinfo |grep “physical id”|uniq|wc -l   每个cpu是几核(假设cpu配置相同)   more /proc/cpuinfo |grep “physical id”|grep “0”|wc -l   cat /proc/cpuinfo | grep processor   1. 查看物理CPU的个数 #cat /proc/cpuinfo |grep “physical id”|sort |uniq|wc -l   2. 查看逻辑CPU的个数 #cat /proc/cpuinfo |grep “processor”|wc -l   3. 查看CPU是几核 #cat /proc/cpuinfo |grep “cores”|uniq   4. 查看CPU的主频 #cat /proc/cpuinfo |grep MHz|uniq     # uname -a Linux euis1 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686 i686 i386 GNU/Linux (查看当前操作系统内核信息)   # cat /etc/issue | grep Linux Red Hat Enterprise Linux AS release 4 (Nahant Update 5) (查看当前操作系统发行版信息)   # cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c 8 Intel(R) Xeon(R) CPU E5410 @ 2.33GHz (看到有8个逻辑CPU, 也知道了CPU型号)   # cat /proc/cpuinfo | grep physical | uniq -c 4 physical id : 0 4 physical id : 1 (说明实际上是两颗4核的CPU)   # getconf...