摘要:
sudo systemctl stop iptablessudo sytemctl stop firewalld 阅读全文
摘要:
sudo ifconfig eth1 xxx.xxx.xxx.xxx 阅读全文
摘要:
virtualenv -p /usr/bin/python3 py3envsource py3env/bin/activatepip install package-name 阅读全文
摘要:
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 阅读全文
摘要:
就是virtualbox下先用u盘启动的虚拟机,把U盘的vhdk文件拷贝到本机,然后再启动,就有问题,提示什么uuid already exist找了半天,网上基本都是说windows下如何用的。。。终于在某篇博客的最后一条评论里找到了ubuntu的命令。。。vboxmanage internalcommands sethduuid pathto.vdi这个pathto.vdi就是你的新镜像的路径,搞定 阅读全文
摘要:
curl -s "http://checkip.dyndns.org/"|cut -f 6 -d" "|cut -f 1 -d"<"可能要先下载curl 阅读全文
摘要:
今天遇到了一个奇怪的问题,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 阅读全文
摘要:
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 阅读全文
摘要:
sudo dd if=ubuntu.iso of=/dev/sdb2sudo syslinux /dev/sdb1 阅读全文
摘要:
可以使用信号亮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函数就会在用户登录成功之后被调用 阅读全文