2015年8月15日星期六
2015年7月15日星期三
shadowsocks在centos下使用chacha20加密方式
yum install gcc
tar -xvf name.tar.gz
cd name
./configure
make
make install
编辑 /etc/ld.so.conf
加入一行
/usr/local/lib
然后退出编辑器,终端运行
ldconfig
2015年7月14日星期二
【转】VMware 移动过来的虚拟机报:设备VMnet0 上的网桥当前未运行。此虚拟机无法与主机或网格中的其他计算机通信
今天克隆了一个win7的虚拟机,移动到我的本地。打开时发现虚拟机网格连接图标出现X断开连接,于是网上收了一堆答案无一个可用的,决定自己解决这个问题,解决过程如下:
1、报错图如下:设备VMnet0 上的网桥当前未运行。此虚拟机无法与主机或网格中的其他计算机通信。

2、关闭虚拟机后(下面要恢复默认设置前需要关机),打开 编辑菜单》虚拟网络编辑器

3、打开后恢复默认设置或修改VMnet0为“自动桥接”,直到与步骤2结果一样,点确定关闭设置窗口。

4、开机前先“虚拟机设置》网格适配器》设置状态:勾选 “已连接”“启动时连接”,网格连接为”桥接模式(B)“
5、开机后,图标显示已连接,恭喜你可以使用了。如果发现图标还是黄色叹号,不要急将IP设置为固定地址,设置好DNS,这样就连接成功了。

2015年6月26日星期五
使用Windows Live Writer在Blogger上写博客
启用了两步验证的话,只要在https://security.google.com/settings/security/apppasswords里为Windows Live Writer申请一个新的应用密码就行了。select app选择others,名字起为Windows Live Writer,点击generate,将产生的密码作为登陆密码就行了。
使用私钥ssh登陆centos
首先下载PuTTY:
http://the.earth.li/~sgtatham/putty/latest/x86/putty.zip
解压之后运行PuTTYge.exe:
Type of key to generate 选择SSH-2 RSA, Number of bits in a generated key选择2048或者4096 。然后点击Generate。
在上面的空白区域滑动鼠标直到进度条满。然后密钥就生成了。
Key comment可以填一下密钥的标识信息,随便填。
Key passphrase可填可不填,如果填了,使用密钥ssh登陆时还要输入它。填了安全性更好,而且要记住。
然后点击Save private key,命名可以为privatekey.ppk一定要存在一个安全的地方,别弄丢了,最好做好备份。公钥可以不保存。
将Public key for pasting into OpenSSH authorized_keys file文本框里的文字全部选择,复制,待会儿会用到。
之后以root身份ssh到centos上:
cd ~
mkdir .ssh
cd .ssh
touch authorized_keys
vi authorized_keys
将刚才复制的内容粘贴进去,保存。之后更改权限:
chmod 600 authorized_keys
cd ..
chmod 700 .ssh
restorecon -Rv /root/.ssh
再修改/etc/ssh/sshd_config文件:
PermitRootLogin yes
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication no #这个最好密钥登陆成功后再修改
保存之后重启sshd服务:
service sshd restart
之后就是设置PuTTY了,打开PuTTY.exe
填好ip和端口
填好自动登陆用户名
导入私钥。
之后记得保存设置:
vps修改SSH端口和禁止Root远程登陆
先添加一个普通用户:
useradd username
passwd username
之后
vi /etc/ssh/sshd_config
将port 22前的#号删除,并且将22修改成其他端口,1234之类的。
将PermitRootLogin yes前的#号删除并将yes改为no。
保存之后重启sshd:
service sshd restart
centos下安装配置shadowsocks-libev教程
/etc/yum.repos.d/:
cd
/etc/yum.repos.d/
接着输入下列命令:
centos6: wget
https://copr.fedoraproject.org/coprs/librehat/shadowsocks/repo/epel-6/librehat-shadowsocks-epel-6.repo
centos7: wget
https://copr.fedoraproject.org/coprs/librehat/shadowsocks/repo/epel-7/librehat-shadowsocks-epel-7.repo
然后使用yum安装:
yum update
yum install shadowsocks-libev
安装好之后进行配置:
vi
/etc/shadowsocks-libev/config.json
需要修改密码,端口,和加密方式,注意加密方式要加双引号,推荐aes-128-cfb。
之后就可以运行了:
/etc/init.d/shadowsocks-libev
start
2015年6月5日星期五
编译安装shadowsocks-libev过程中出现configure: error: OpenSSL header files not found.
The OpenSSL library is usually already installed, but you have to install the header files. Depending on your Linux distribution, you'll need these packages:
- Red Hat, Fedora, CentOS -
openssl-devel
- Debian, Ubuntu -
libssl-dev
- Arch -
openssl
2015年6月4日星期四
emui3.0 换字体(全局)
1、下载自己想要的字体
2、复制3份,分别重命名为:
DroidSansChinese.ttf
DroidSansFallback.ttf
slim.ttf
3、拷贝到手机,用RE复制到 SYSTEM/fonts下(最好先备份原有的字体),重启。 OK
2015年6月2日星期二
生成firefox user.js的简单shell脚本
printf "user_pref(\"%s\",%s);\n" ` cat filename`
你可以新建一个文本将要修改的项目和参数以下列格式写下来:
a true b false c 100 d 0
然后保存,之后在shell下运行上面的命令,将filename改成文本名。
转:解决yum thread.error: can't start new thread 错误
编辑 /etc/yum/pluginconf.d/fastestmirror.conf
将enabled=1修改为enabled=0
firefox39 user.js
//禁止自动刷新
user_pref("accessibility.blockautorefresh",false);
//浏览器动画
user_pref("browser.download.animateNotifications",false);
user_pref("browser.fullscreen.animateUp",0);
user_pref("browser.panorama.animate_zoom",false);
user_pref("browser.preferences.animateFadeIn",false);
user_pref("browser.tabs.animate",false);
user_pref("layout.animated-image-layers.enabled",false);
//搜索结果新标签页显示
user_pref("browser.search.openintab",true);
//url栏格式
user_pref("browser.urlbar.trimURLs",false);
user_pref("browser.urlbar.formatting.enabled",false);
//扩展兼容性检查
user_pref("extensions.checkCompatibility",false);
//拼写检查
user_pref("layout.spellcheckDefault",2);
//ctrl+tab预览
user_pref("browser.ctrlTab.previews",true);
//在网页中显示一个插入符号,home和end会失灵,f7键控制
user_pref("accessibility.browsewithcaret",true);
user_pref("accessibility.browsewithcaret_shortcut.enabled",true);
user_pref("accessibility.warn_on_browsewithcaret",false);
//
user_pref("accessibility.delay_plugins",true);
user_pref("accessibility.delay_plugin_time",1000);
//即时搜索
user_pref("accessibility.typeaheadfind",false);
//浏览器加速
user_pref("nglayout.initialpaint.delay",100);
user_pref("content.notify.ontimer",true);
user_pref("content.notify.interval",100000);
user_pref("content.interrupt.parsing",true);
user_pref("content.max.tokenizing.time",300000);
user_pref(" content.switch.threshold",100000);
user_pref("network.http.pipelining",true);
user_pref("network.http.proxy.pipelining",true);
//插件防止崩溃
user_pref("dom.ipc.plugins.enabled",false);
user_pref("extensions.blocklist.enabled",false);
//快进快退
user_pref("browser.sessionhistory.max_total_viewers",5);
security.dialog_enable_delay",0);
//弹出窗口数目
user_pref("dom.popup_maximum",2);
//保存dns条目
user_pref("network.dnsCacheEntries",20);
//代理连接
user_pref("network.http.max-persistent-connections-per-server",32);
user_pref("network.http.max-persistent-connections-per-proxy",32);
//tracemonkey
user_pref("javascript.options.jit.content",true);
user_pref("javascript.options.jit.chrome",true);
2015年5月16日星期六
华为荣耀6怎样从官方升级包做自己的rom
1.首先,用HuaweiUpdateExtractor对update.app解包,提取出system.img,cust.img和boot.img三个文件。
2.把system.img和boot.img移动到厨房的originnal_update文件夹里(提取出来的文件名是大写的,改为小写,不然厨房识别不了),运行厨房,创建工作文件夹,然后进入高级设置,选择19,因为官方包的boot.img不能直接用,所以我们要对它进行修改,再选择w,之后你会发现工作文件夹里的boot.img小了4KB,这就表示boot.img已经修改好了。
3.使用ext4_unpacker解包cust.img,提取出来的东西都放在工作文件夹下的cust文件夹里,这个文件夹需要自己建。
4.之后就可以对rom进行各种操作了,删除预装等等,还可以使用厨房进行各种优化。
5.修改过后,从一个可以刷的第三方rom里(可以从论坛获得)提取META-INF文件夹里的updater-script和update-binary代替工作文件夹下的。
6.打包rom,可以不签名。
7.刷机。
2015年5月11日星期一
iptables基本操作
centos如何保存alias添加的别名命令
在最下面添加:
alias rd = 'rm -rf';
alias
保存后,
#source .bashrc
2015年5月10日星期日
centos下安装配置shadowsocks教程
yum install python-setuptools && easy_install pip
pip install shadowsocks
2.配置
首先创建配置文件:vim /etc/shadowsocks.json
把下面的配置粘贴进去(包括大括号):
{
"server":"::",
"server_port":8388,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"mypassword",
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false
}
粘贴之后,修改server_port(端口),password(密码)和method(加密方式)。改好之后保存。
加速加密:
yum install m2crypto
3.运行
输入:
ssserver -c /etc/shadowsocks.json -d start --log-file ~/shadowsocks.log
就开始运行了。然后查看日志:
cat ~/shadowsocks.log
如果没有错误那就可以配置客户端了。
如果出现already in use错误,换server_port试试。
如果log正常,客户端出现504:
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport SERVER_PORT_NUMBER -j ACCEPT
service iptables save
service iptables restart
或者直接禁用iptables(不建议):
service iptables stop
chkconfig iptables off
限制每个ip的连接数:
iptables -A INPUT -p tcp --syn --dport ${SHADOWSOCKS_PORT}
-m connlimit --connlimit-above 32 -j REJECT --reject-with
tcp-reset
让shadowsocks支持ipv6
server_ip ipv6.shadowsocks.com
然后在shadowsocks.exe里添加服务器时填 ipv6.shadowsocks.com就好了。
更新:是我自己弄错了,影梭原本就支持ipv6的,上面的多此一举了。
2015年5月8日星期五
麻的法克,终于找到adb device not found的解决方法了
1) On your Windows desktop, Go to your Control Panel then Device Manager.
2) You should see Android Phone under Other Devices with a Yellow ! mark on it.
3) Right click on it and choose "Update Driver Software"
4) Choose "Browse my computer", then "Let me pick from a list."
5) If you see categories, select "Android Device", then select "Android ADB Interface".
6) The driver will install and you can now run the update with ADB.
2015年5月7日星期四
代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-cn" />
<style type="text/css">
img{width:240px;height:180px}
form{position:absolute;top:48%;left:40.5%}
table{width:100%;height:100%}
.p1,.p4,.p5,.p8{margin-left:50px}
.p1,.p4{margin-top:55px}
.p5,.p8{margin-bottom:55px}
.p3,.p2{margin-top:1px,margin-left:50px}
.p6,.p7{margin-bottom:1px,margin-left:50px}
.p4,.p8{margin-left:50px}
</style>
</head>
<body class="bo_dy" background="bg.jpg">
<table border="0">
<tr>
<td>
<p class="p1" >
<a href="http://music.163.com/">
<img src="2.png">
</a>
</p>
</td>
<td>
<p class="p2" >
<a href="http://www.acfun.tv">
<img src="3.png">
</a>
</p>
</td>
<td>
<p class="p3">
<a href="http://www.bilibili.com/">
<img src="4.png">
</a>
</p>
</td>
<td>
<p class="p4">
<a href="http://bt.byr.cn/index.php">
<img src="1.png">
</a>
</p>
</td>
</tr>
<tr>
<td>
<p class="p5">
<a href="http://www.twitch.tv/directory/game/League%20of%20Legends">
<img src="5.png">
</a>
</p>
</td>
<td>
<p class="p6">
<a href="http://www.douyutv.com/directory/game/LOL">
<img src="6.png">
</a>
</p>
</td>
<td>
<p class="p7">
<a href="https://www.youtube.com">
<img src="7.png">
</a>
</p>
</td>
<td>
<p class="p8">
<a href="https://plus.google.com/">
<img src="8.png">
</a>
</p>
</td>
</tr>
</table>
<form action="http://www.baidu.com/baidu" target="_blank">
<table border="0"><tr><td>
<input name=tn type=hidden value=baidu>
<a href="http://www.baidu.com/"></a>
<input type=text name=word size=30 baiduSug=1>
<input type="submit" value="搜索" style="display:none">
</td></tr></table>
</form>
</body>
</html>
效果:
2015年4月30日星期四
荣耀6,emui3.0 root
2.刷第三方recovery。
3.到root权限包下载页面下载.zip包。
4.进入recovery刷zip包。reboot时选择no。
5.安装supersu,更新即可。
系统更新后重复2~5即可。