2013年7月24日
摘要: sudo systemctl stop iptablessudo sytemctl stop firewalld 阅读全文
posted @ 2013-07-24 10:28 andy071001 阅读(278) 评论(0) 推荐(0) 编辑
  2013年7月8日
摘要: sudo ifconfig eth1 xxx.xxx.xxx.xxx 阅读全文
posted @ 2013-07-08 09:34 andy071001 阅读(163) 评论(0) 推荐(0) 编辑
  2013年7月4日
摘要: virtualenv -p /usr/bin/python3 py3envsource py3env/bin/activatepip install package-name 阅读全文
posted @ 2013-07-04 13:52 andy071001 阅读(142) 评论(0) 推荐(0) 编辑
  2013年7月3日
摘要: SSH login without passwordYour aimYou want to use Linux and OpenSSH to automize your tasks. Therefore you need an automatic login from host A / user a to Host B / user b. You don't want to enter any passwords, because you want to call ssh from a within a shell script.How to do itFirst log in on 阅读全文
posted @ 2013-07-03 13:40 andy071001 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 就是virtualbox下先用u盘启动的虚拟机,把U盘的vhdk文件拷贝到本机,然后再启动,就有问题,提示什么uuid already exist找了半天,网上基本都是说windows下如何用的。。。终于在某篇博客的最后一条评论里找到了ubuntu的命令。。。vboxmanage internalcommands sethduuid pathto.vdi这个pathto.vdi就是你的新镜像的路径,搞定 阅读全文
posted @ 2013-07-03 12:02 andy071001 阅读(273) 评论(0) 推荐(0) 编辑
  2013年7月1日
摘要: curl -s "http://checkip.dyndns.org/"|cut -f 6 -d" "|cut -f 1 -d"<"可能要先下载curl 阅读全文
posted @ 2013-07-01 14:59 andy071001 阅读(347) 评论(0) 推荐(0) 编辑
  2013年6月25日
摘要: 今天遇到了一个奇怪的问题,django中formview一直返回200,但是却没有执行form_valid方法,然后在其中加了一个form_invalid方法:class StudentRegisterMixin(generic.FormView): def get_form_class(self): def get_success_url(self): def form_valid(self, form): def form_invalid(self, form): print "form is not valid, errors are: " print form.er 阅读全文
posted @ 2013-06-25 14:53 andy071001 阅读(781) 评论(0) 推荐(0) 编辑
  2013年6月20日
摘要: I believe this occurs when you are trying to checkout a remote branch that your local git repo is not aware of yet. Try:git remote show originIf the remote branch you want to checkout is under "New remote branches" and not "Tracked remote branches" then you need to fetch them fir 阅读全文
posted @ 2013-06-20 17:21 andy071001 阅读(243) 评论(0) 推荐(0) 编辑
  2013年6月17日
摘要: sudo dd if=ubuntu.iso of=/dev/sdb2sudo syslinux /dev/sdb1 阅读全文
posted @ 2013-06-17 15:50 andy071001 阅读(177) 评论(0) 推荐(0) 编辑
  2013年6月14日
摘要: 可以使用信号亮signal,使用方法如下: from django.contrib.auth.signals import user_logged_in from django.dispatch import receiver @receiver(user_logged_in) def record_login_info(sender, request, user, **kwargs): pass这样record_login_info函数就会在用户登录成功之后被调用 阅读全文
posted @ 2013-06-14 14:11 andy071001 阅读(238) 评论(0) 推荐(0) 编辑