直接ALT+F2,输入dconf-editor
org>gnome>shell>overrides>button-layout,把值改成 :
;minimize,maximize,close(包括冒号)
要注意一点,dconf-editor这个命令在终端下输入会提示错误警告,而且不能修改,所以得用ALT+F2才行,具体原因我不知道。
直接ALT+F2,输入dconf-editor
org>gnome>shell>overrides>button-layout,把值改成 :
;minimize,maximize,close(包括冒号)
要注意一点,dconf-editor这个命令在终端下输入会提示错误警告,而且不能修改,所以得用ALT+F2才行,具体原因我不知道。
解决方法:
aptitude install alsa-base
echo blacklist snd-pcsp >> /etc/modprobe.d/alsa-base-blacklist.conf
如果alsa-base-blacklist.conf文件里有blacklist snd-pcsp就不必执行echo了
fastboot erase recovery
fastboot flash recovery recovery.img
fastboot reboot
下载ROM与recovery
http://www.clockworkmod.com/rommanager
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等服务
debian
service ssh restart
出现Could not load host key: /etc/ssh/ssh_host_ecdsa_key
解决方法:
dpkg-reconfigure openssh-server
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应该可以科学上网了
按照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 搞定。
执行
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,
“workers”: 1
}
在服务器上运行 ssserver -c /etc/shadowsocks.json 即可。
在本地,用上文的客户端shadowsocks-gui进行相应配置并运行客户端,
shadowsocks-gui下载地址:http://sourceforge.net/projects/shadowsocksgui/files/dist/
最后设置浏览器代理。Chrome 推荐使用 SwitchySharp 切换代理设置。把浏览器代理设为下列参数即可:
协议: socks5
地址: 127.0.0.1
端口: 你填的 local_port
如果要在后台运行, 使用supervisor, supervisor配置如下:
安装完supervisor后创建
vi /etc/supervisor/conf.d/shadowsocks.conf
内容如下:
[program:shadowsocks]
command=ssserver -c /etc/shadowsocks.json
autorestart=true
user=nobody
如果端口 < 1024,把上面的 user=nobody 改成 user=root。保存
在 /etc/default/supervisor 最后加一行:
ulimit -n 51200
执行
service supervisor start
supervisorctl reload
就好了。
如果遇到问题,可以检查日志:
supervisorctl tail -f shadowsocks stderr
如果修改了 shadowsocks 配置 /etc/shadowsocks.json, 可以重启 shadowsocks:
supervisorctl restart shadowsocks
如果修改了 Supervisor 的配置文件 /etc/supervisor/*, 可以更新 supervisor 配置:
supervisorctl update
几个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 LONG_BIT
32
(说明当前CPU运行在32bit模式下, 但不代表CPU不支持64bit)
# cat /proc/cpuinfo | grep flags | grep ‘ lm ‘ | wc -l
8
(结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit)
如何获得CPU的详细信息:
linux命令:cat /proc/cpuinfo
用命令判断几个物理CPU,几个核等:
逻辑CPU个数:
# cat /proc/cpuinfo | grep “processor” | wc -l
物理CPU个数:
# cat /proc/cpuinfo | grep “physical id” | sort | uniq | wc -l
每个物理CPU中Core的个数:
# cat /proc/cpuinfo | grep “cpu cores” | wc -l
是否为超线程?
如果有两个逻辑CPU具有相同的”core id”,那么超线程是打开的。
每个物理CPU中逻辑CPU(可能是core, threads或both)的个数:
# cat /proc/cpuinfo | grep “siblings”
mysql查看表结构命令,如下:
desc 表名;
show columns from 表名;
describe 表名;
show create table 表名;
use information_schema
select * from columns where table_name=’表名’;
顺便记下:
show databases;
use 数据库名;
show tables;
原有一unique索引AK_PAS_Name(PAC_Name)在表tb_webparamcounter中,
执行以下sql修改索引
alter table tb_webparamcounter drop index AK_PAS_Name;
alter table tb_webparamcounter add UNIQUE AK_PAS_Name(PC_ID,PAC_Name);
若发现索引的逻辑不对,还需要再加一个字段进去,执行
alter table tb_webparamcounter drop index AK_PAS_Name;
alter table tb_webparamcounter add UNIQUE AK_PAS_Name(PC_ID,PAC_Name,PAC_Value);
注意:这时的PC_ID,PAC_Name,PAC_Value三个字段不是FOREIGN KEY
否则必需先drop FOREIGN KEY,再重做上一步才行
顺便提下oracle
select * from v$database;
select * from all_users;
select * from user_tables;