17 09/2015

set ubuntu ssh timeout

最后更新: Thu Sep 17 2015 07:57:09 GMT+0800

ssh 客户端

ServerAliveInterval 100

In Linux this could be set globally in /etc/ssh/ssh_config or per-user in ~/.ssh/config. It could also be used in the command line as an argument as in the following example;

临时

ssh -o ServerAliveInterval=100 user@example.com

服务器端

/etc/ssh/sshd_config

ClientAliveInterval 600
TCPKeepAlive yes
ClientAliveCountMax 10

17 06/2015

lighttpd php curl 500

最后更新: Wed Jun 17 2015 08:02:56 GMT+0800

sudo aptitude install curl php5-curl libcurl3 libcurl3-dev

sudo /etc/init.d/lighttpd restart

21 05/2015

batch rename 2 sequential numbers.md

最后更新: Thu May 21 2015 13:03:17 GMT+0800

a=1
for i in *.jpg; do
new=$(printf “%04d.jpg” “$a”) #04 pad to length of 4
mv — “$i” “$new”
let a=a+1
done

21 05/2015

curl post data 2 wordpress

最后更新: Thu May 21 2015 10:54:54 GMT+0800
curl --data curl --data "author=Bob Jones&email=bob@mail.com&url=http://www.bob.com&comment=Great Post!&comment_post_ID=25" http://www.wpexample.com/wp-comments-post.php
14 05/2015

worpdress upload limit

最后更新: Thu May 14 2015 10:04:47 GMT+0800

php.ini

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

functions.php

@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );

.htaccess

php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300

php get url

$actual_link = “http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]”;

13 05/2015

shell backup folder

最后更新: Wed May 13 2015 16:40:05 GMT+0800

cp

$ cp -avr /tmp/conf/ /tmp/backup

  • -a : Preserve the specified attributes such as directory an file mode, ownership, timestamps, if possible additional attributes: context, links, xattr, all.
  • -v : Explain what is being done.
  • -r : Copy directories recursively.

rsync

$ rsync -avz /home/vivek /media/backup

  • -a : Archive mode i.e. copy a folder with all its permission and other information including recursive copy.
  • -v : Verbose mode.
  • -z : With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted — something that is useful over a slow connection.
07 05/2015

mac mount ubuntu server

最后更新: Thu May 07 2015 09:05:39 GMT+0800

mount

mkdir gswork
sshfs guoshuang@guoshuang.com:/home/guoshuang gswork

umount

umount gswork

Mac终端快捷键打开sublime 方法:

ln -s “/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl” /usr/local/bin/sublime

12 04/2015

mobile develop tips

最后更新: Sun Apr 12 2015 12:04:14 GMT+0800

upwards of 44px to comfortably fit within a touch target so design for that.

Standard keyboard | <input type=”text” />

URL parameters | <input type=”url” />

Email-specific keyboard | <input type=”email” />

Numeric keyboard | <input type=”text” pattern=”[0-9]*” />

http://www.mobify.com/mobifyjs/v2/docs/

royalslider.js

http://dimsemenov.com/plugins/royal-slider/royalslider/jquery.royalslider.min.js?v=9.3.6

icons

优化

The key points he make:

  • Images slow things down immensely– get rid of them
  • Avoid text-shadow & box-shadow
  • Hardware-acceleration is quite new… and buggy (concurrent animations is limited)
  • Avoid opacity if possible (sometimes interferes with hardware-accelerated rendering)
  • Use translate3d, not translate (the latter is not hard-accelerated)
  • Some other points that can improve performance significantly:

  • use getImageData as infrequently as possible (major slowdown) [2]

  • combine more than one canvas in order to repaint smaller parts that are changing more frequently

MOBILE ★ BOILERPLATE