Tuesday, March 28, 2017

apache ftp server setup

1. Download apache-ftpserver-1.1.0 and unzip
2. Update file ftpd-typical.xml, add encrypt-passwords="clear"
<file-user-manager file="./res/conf/users.properties" encrypt-passwords="clear"/>
3. Edit file users.properties, add new user:
ftpserver.user.peter.userpassword=416308
ftpserver.user.peter.homedirectory=./res/home
ftpserver.user.peter.enableflag=true
ftpserver.user.peter.writepermission=true
ftpserver.user.peter.maxloginnumber=20
ftpserver.user.peter.maxloginperip=2
ftpserver.user.peter.idletime=0
ftpserver.user.peter.uploadrate=0
ftpserver.user.peter.downloadrate=0
4. add "set JAVA_HOME=C:\Java\jdk1.7.0_21" to service.bat and ftpd.bat if there's java version related error
service install (It's OK to get Failed installing 'ftpd' service)
ftpd.bat res/conf/ftpd-typical.xml
5. access ftp://127.0.0.1:2121/

For mac,
cd /Users/peterpeng/apache-ftpserver-1.2.0/bin

./ftpd.sh res/conf/ftpd-typical.xml

Then from Finder, go->connected to server: ftp://127.0.0.1:2121

Sunday, March 12, 2017

Desperate housewives


1. Wisteria
2. hectic
3. quietly polishing my the routine of my life until it gleamed with perfection
4. greef-stricken
5. are you willing to risk that?
6. paella
7. convertible
8. upholster

Saturday, March 11, 2017

健身计划

健身计划:
1. 沙发深蹲->拉力深蹲->面壁深蹲
2. 平板支撑
3. 俯卧撑 (上斜、下斜、击掌)
4. 爬楼梯
5. 倒立

第一阶段:
周一、周三、周五下午爬楼梯(练臀),20*5, 之后吃坚果和香蕉
      晚上俯卧撑(练胸)和平板支撑
周一/周日、周三打篮球
周六下午乒乓球、晚上俯卧撑(练胸)和平板支撑

第二阶段:
周一、周三、周五晚上沙发深蹲、俯卧撑和平板支撑
周二、周四Runtastic练腹肌

爬楼梯方法:
1. 每次两级,背部挺直,提脚的时候,膝盖不能超过脚尖,心中默念:臀部发力
一层快、二层中、三层慢,交替进行
2楼爬到18楼,坐电梯下,3-6次,半小时

热身:标准俯卧撑 10个*3组
正式:击掌俯卧撑 每组力竭*3组
击掌上下斜俯卧撑 15个*4组(上下斜各两组)
若不能做起击掌俯卧撑,可以做标准俯卧撑。话说可以尝试下半击掌俯卧撑或上斜击掌俯卧撑。这两样比较容易。
塑胸形:下斜窄距俯卧撑 15个*3组
上斜宽据俯卧撑 15个*3组
拉伸:手抵住墙,缓缓转体,让胸部被拉伸


做平板支撑时候,一定要肌肉绷紧、发力。比如如果你的腰部塌下去,下背部又不出力绷紧,就可能有机会受伤或劳损。
简单讲,每次平板支撑都要做到力竭。也就是撑不住了为止。但是每次都可以按我说的,快撑不住时,前后左右瞎晃一阵(我要是瞎晃能撑个十几分钟,晚上一局塔防……)一般做3-5组都可以。

俯卧撑和平板支撑:
1. 标准俯卧撑
注意发力是夹紧胸部,而不是伸直肘部,这样能更好的训练到胸,而不是手臂
除了上升阶段要发力,下落的阶段也要缓缓发力下降
训练上胸最好采用下斜窄距俯卧撑,训练下胸最好采用上斜宽距俯卧撑
如果你有俯卧撑架或者有哑铃(能稳定的做啊,别受伤),你可以采用下斜反手俯卧撑,这样训练上胸效果更好。
2. 平板支撑
3. 上斜俯卧撑
4. 平板支撑
5. 下斜俯卧撑
6. 平板支撑

沙发深蹲:
持续1分钟,休息10秒
1. 从站立姿势慢慢坐到沙发上,双手置于脑后
2. 背部挺直微反弓,往深处坐
3. 臀部发力至脚后跟,用爆发力让自己跳起来。落地时柔和



Sunday, March 5, 2017

Mange iPhone photos (Sync only selected Photos)

Object:
Delete all photos  from iPhone and only sync selected Album or favourite photos from Mac's photo application

Steps:
1. Open the pre installed "Image Capture" in Mac and press Command+A to select all photos and then delete.
2. Open iTunes and select "Sync only selected songs and videos"
3. Mark favourite photos in Photos app from Mac
4. Sync with iTunes as below




Saturday, March 4, 2017

北京社保

如果户口是北京:户口所在区人才市场,有专门的窗口负责办理”自由职业者“的社保,可以以个人身份参保;
http://bbs.tianya.cn/post-worldlook-1769132-1.shtml

养老金有两部分构成,一是你退休前一年社平工资的20%,二是你账户里面的银子总额/120(复杂的公式,大约这个数上下),这是你每月的退休金。

  假定我在北京,我账户里面的钱是12万,去年退休的(今年说不清了)

  那么,我的每月退休金是12万/120=1000+6k*20%=2200(约,前年的社平工资大致是6k)
办理手续:
  本人带着户口本、身份证和复印件等材料到户籍所在地劳动保障服务中心办理。
在同一城市,累计缴纳基本养老保险满15年,基本医疗保险20年,退休时,即按缴纳所在城市标准发放最低基本养老金,执行缴纳所在城市医疗保险标准。
  3、在所有城市,基本养老保险与基本医疗保险缴纳均不够年限,则在退休时,按当年度所在地社保缴纳基数,一次性补足规定年限的基本养老与基本医疗。
  4、根据最新的改革放案,从2015年开始,每3年延长一年退休时间,至2030年止,将我国的男性劳动者退休年龄延长至65岁,女性退休年龄延长至60岁。


问题:
1. 是否要补缴社保
2. 如果补缴,补缴多少钱,每月交多少钱

Thursday, February 23, 2017

多伦多更新护照

  • +1 上星期去的总领馆,有投币照相的。 
    • ○  That will be great! Thanks. I also find one close by as backup(537 Bloor St W, Toronto). 
 240 St George St, Toronto, ON M5R 2N5
所需材料 
  2、近期正面免冠、白色背景彩色半身证件照片3(请务必点击查看照片具体要求)。 
  3、护照原件及复印件(包括带照片资料页、曾办理过加注或延期页、来加签证相关页); 
  4、在加拿大的有效居留证件原件和复印件,如枫叶卡、学习许可或工作许可; 

办证时间 
  由于驻加拿大使馆及各领馆受理的护照需由制证中心统一制作,从各馆自受理申请之日开始计算,需15个工作日。


证件组语音电话: 416-964-8861;人工接听:周一至周五下午3:00-5:00(负责护照、签证、公证、认证等有关证件问题咨询和服务。因咨询来电过多,请优先发电邮或传真咨询

\










Wednesday, February 22, 2017

Pragramming ASP.NET web pages

1. Use WebMatrix3
Easy to use, can only access from localhost, not my laptop hostname, replaced by Visual Studio Code (hard to use)
2. Use Visual Studio 2010
Need install ASP.NET MVC 4 as this article (Programming ASP.NET Web Pages (Razor) Using Visual Studio) shows
https://docs.microsoft.com/en-us/aspnet/web-pages/overview/getting-started/program-asp-net-web-pages-in-visual-studio
Accessisble from the laptop hostname


ASP.NET Web Forms (.aspx pages)
The Web Forms framework targets developers who prefer declarative and control-based programming, such as Microsoft Windows Forms (WinForms) and WPF/XAML/Silverlight.
you can quickly build a web application without having expertise in HTML and JavaScript.

ASP.NET MVC
By dividing the application into the model (M), views (V), and controllers (C), ASP.NET MVC can make it easier to manage complexity in larger applications.

ASP.NET Web Pages (.cshtml and .vbhtml files)
ASP.NET Web Pages targets developers who want a simple web development story, along the lines of PHP. In the Web Pages model, you create HTML pages and then add server-based code to the page in order to dynamically control how that markup is rendered.
Like Web Forms, Web Pages is oriented toward rapid development.

the three frameworks are not entirely independent, and choosing one does not preclude also using another.
ASP.NET Core was released in 2016.
ASP.NET Core merges ASP.NET MVC, ASP.NET Web API, and ASP.NET Web Pages into one application framework.

@RenderPage("header.cshtml")
@RenderBody()
@RenderPage("footer.cshtml")
With ASP.NET, files with a name that starts with an underscore cannot be browsed from the web:
_header.cshtml, _footer.cshtml, _Layout.cshtml
With ASP.NET, the common way to hide sensitive information (database passwords, email passwords, etc.) is to keep the information in a separate file named "_AppStart"
To specify the virtual root in programming code, use the ~ operator.
The Server.MapPath method converts a virtual path (/default.cshtml) to a physical path that the server can understand
The Href method converts a path used in the code to a path that the browser can understand