This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
#! /usr/bin/expect -f | |
certtool --generate-privkey --outfile $1-key.pem | |
sed -i "1ccn = "${1}"" client.tmpl | |
sed -i "3cemail = ${1}@abc.org" client.tmpl | |
certtool --generate-certificate --load-privkey $1-key.pem --load-ca-certificate ca-cert.pem --load-ca-privkey ca-key.pem --template client.tmpl --outfile $1-cert.pem | |
openssl pkcs12 -export -inkey $1-key.pem -in $1-cert.pem -name "$1 VPN Client Cert" -certfile ca-cert.pem -out $1.cert.p12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var aa =$('.chk[node-type="chk"]'); | |
var pos = 0; | |
var MaxPos = aa.length;//分享页面的一级文件夹数量 | |
var timer; | |
function saveItem(){ | |
$(aa[pos]).trigger('click'); | |
window.setTimeout(function(){$('.btn.saveToDisk-btn').click()},1000); | |
timer = window.setInterval(function(){ | |
if($('.b-panel.b-dialog.move-dialog').css('display') == "block"){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
新入了一个白色的Kindle 3 WIFI+3G,买来的时候, 在店家处已经安装了多看系统, 本来不想再折腾了, 但每次插拔USB同步书籍就觉得太方便,还是折腾一下, 用个usbNetwork进行WIFI传输吧。 | |
主要过程就不写了,Kindle 3 jailbreak + usbNetwork 破解流程 这个贴子写的比较详细了~ | |
几点说明: | |
kindle3的3.2.1jailbreak固件, 也可以越狱3.3版本的 | |
B006开头的SN是US地区的Kindle | |
usbNetwork其实就是在Kindle里面开个免密码登陆的SSH,跟我之前写的博文原理是一样的。 | |
书籍传输到/mnt/us/documents目录下, 这样kindle原系统和多看都能认出这些书籍, 不需要传输2次. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
在Mac SnowLeopard下经常登陆VPS, 需要手工输入密码, 非常的不方便(在WIN下用PUTTY已经设置了PublicKey登陆),所以花点时间折腾一下。 | |
1. 修改/etc/ssh_config文件 | |
原始的设置是 | |
#Host * #ForwardAgent no | |
修改为 | |
Host * ForwardAgent yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mac版的MonoDevelop能显示中文, 前提是字体包含中文, 但是平时用惯的Lucida Console不带汉字, 导致IDE的文本区, 汉字都是挤在一起的乱码。 在网上找了一下, 汉字等宽字体, 终于找到一个, 用下来感觉还行, 就先这么凑合吧。 | |
http://wenq.org/?FontGuide 中介绍的“兼顾中英文对齐的等宽开源字体:文泉驿等宽正黑” | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
这个TouchPad不能用键盘上的启动/关闭来控制, 非常的影响正常鼠标使用。 | |
解决方案来自: | |
http://askubuntu.com/questions/14178/how-to-disable-touchpad-on-dell-latitude-e-series-e5510-e6510 | |
To disable: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
在grub2中,修改这个要复杂一些, | |
具体方法是,首先打开 | |
1、gedit /boot/grub/grub.cfg | |
参看要被设置成默认启动的系统的序号是多少,注意,这个顺序是从0开始的是, | |
(这里手动数出来自己要设置的系统是第几个需要多注意一些) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imageView = new ImageView(mContext); imageView.setLayoutParams(new GridView.LayoutParams(45, 45)); imageView.setAdjustViewBounds(false); imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); imageView.setPadding(8, 8, 8, 8); | |
setScaleType的ScaleType.CENTER_CROP, 从图片的中央开始裁剪, 具体的ScaleType说明可以参考http://blog.sina.com.cn/s/blog_407abb0d0100mao1.html setAdjustViewBounds必须设置为false, 而且需要指定ImageView的layout_height, layout_width |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
用instanceof来判断是否是指定的控件类型 | |
TableLayout myLayOut = (TableLayout)findViewById(R.id.tableLayout1); | |
for (int i = 0; i < myLayOut.getChildCount(); i++) { | |
View v = myLayOut.getChildAt(i); | |
if ( v instanceof ImageView){ | |
ImageView myImageView = (ImageView)myLayOut.getChildAt(i); | |
myImageView.setOnClickListener(new myOnclickListener()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Persistent #NoEnv | |
v_Enable=0 $F12:: { Winget, wowid, list, 魔兽世界 WinSetTitle, ahk_id%wowid1%, , 魔兽世界1# WinSetTitle, ahk_id%wowid2%, , 魔兽世界2# v_Enable:=!v_Enable If (v_Enable=0) SetTimer, Label0, Off Else SetTimer, Label0, 1 } Return | |
Label0: { | |
ControlSend,, {F11}, ahk_id %wowid1% sleep, 200 ControlSend,, {F11}, ahk_id %wowid2% sleep, 200 } Return |