2015-12-27
Use github webhooks to automatically update hexo post

I used dropbox to sync my blog posts so that I can write my blog anywhere, instead of logging on to my vps. But dropbox’s instant sync makes it hard to control post event. Github is a great version control tool, if server side can automatically pull changed posts when pushing events happened on other device, then the github push event is kind of like posting your blogs to remote server. This should be a better way to using hexo. Luckily github’s webhooks service makes this possible to implement.

Read More

2013-08-02
Error using textread in matlab under linux

Ok, I was using this function textread, It’s weird that the file path can not start with ‘~’, the path must start with the full path, like /home/user/bla/blabla.sift, or matlab will just give you the error note: “Error using dataread, file not found or permission denied”.

I google this for a little while to get the solution, so just take a note here. Even though matlab suggest to use textscan other than textread, I’m just too lazy to change…

Read More

2013-07-18
Useful linux commands

记录一下linux下面一些比较有用的commands

  • Screen

Screen在远程登录服务器并要长时间运行程序时很有用,一般来说用putty直接登录的时候,一段时间没有活动,打开的session就会失效,VNC viewer是一个解决办法,但是对于我来说,一般不需要界面,所以Xforwardding是不需要的。此时Screen就十分有效了,使用Screen可以单独创建一个独立于你当前session的一个窗口,在Screen下运行程序,可以不受外部登录Session的限制,还可以同时运行多个程序。具体用法是:

Read More

2013-05-13
mysql的一些使用方法

mysql的一些用法就记录在这个地方了,随时更新。

  • 初始化用户

    1
    sudo mysqladmin -u username password pwd
  • 登陆

    1
    mysql -u username -p
  • 创建新用户

    1
    insert into mysql.user(Host,User,Password) values('localhost','test',password('testpwd'));
Read More

2013-05-11
fedora安装apache+mysql+php

安装apache

1
sudo yum install httpd

配置apache随系统启动

1
sudo chkconfig --levels 235 httpd on

apache启动,停止,重启操作

1
2
sudo service httpd start
sudo service httpd stop

此步start也许会出错,原因是因为改过hosts的原因,localhost被去掉了,所以就跪了,在hosts文件中添加localhost就可以了。至此apache就算是安装好了,配置后面再说。

Read More