日子头上一把刀--DRY&&KISS
wudixiaotie · 共 155 篇文章
erlang gen_server的一个困惑
如果用gen_server,那么必须要在启动的时候给他个名字,这个名字是为了register。可是,如果我要做一个游戏的后端,同时会有几十万上百万的gen_server进程,那么光是名字用到的atom就已经超过atom table的限制了阿(max=1048576),这要怎么办呢??难道不用gen_server??或者在启动的时候扩大atom table的最大容量(erl -t size)??但是每个atom refers 都是需要占用memory的阿??!!怎么办?? 后来带着这个困惑找了一圈,原来这种情况的化就启动gen_server的时候别用local启动,而是global,这样glo…
2015-05-03 13:42 · erlang · 评论(0)
centos crontab
新建crontab: crontab -e 创建当前用户的时间表 输出: crontab: installing new crontab 发现不好使,日志里有输出: /var/log/cron Apr 1 14:18:01 iZ25yiy40hdZ CROND[8679]: (www) CMD (cd /home/www/express && /usr/local/rvm/rubies/ruby-2.2.0/bin/rake RAILS_ENV=production daily:run) 但是实际没执行。 这是什么原因呢,原来new crontab installed之后三分钟之内是不能执行…
2015-04-01 14:33 · Linux · 评论(0)
centos更新web开发相关源
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm sudo yum install epel-release su - cd /etc/yum.repos.d wget http://rpms.famillecollet.com/enterprise/remi.repo yum--enablerepo=remi update redis 如果这个命令还是不能升级redis,则需要手动修改remi.repo,把里面的 enabled=0 全部改成 enabled=1 然后再执行 yum--enablerepo=remi update…
2015-03-27 15:24 · Linux · 评论(0)
linux curl
带参数的post请求 curl -d 'mobile=13412341234' http://192.168.1.1/api/user/sign_in 能看见cookie的post请求 curl -v -d 'mobile=13412341234' http://192.168.1.1/api/user/sign_in
2015-03-26 15:21 · Linux · 评论(0)
给git remote添加ssh的节点
git remote add origin ssh://www@123.1.1.1:3000/home/www/foo/
centOS环境的nginx+unicorn访问socket文件总是报(13 permission denied)
I experienced the same problem and it was due to SELinux . To check if SELinux is running: # getenforce To disable SELinux until next reboot: # setenforce Permissive Restart Nginx and see if the problem persists. If you would like to permanently alter the settings you can edit /etc/sysconfig/selinu…
2015-03-20 10:16 · Linux · 评论(0)
redis设置密码
# 设置密码 redis> CONFIG SET requirepass secret_password # 将密码设置为 secret_password OK redis> QUIT # 退出再连接,让新密码对客户端生效 [huangz@mypad]$ redis redis> PING # 未验证密码,操作被拒绝 (error) ERR operation not permitted redis> AUTH wrong_password_testing # 尝试输入错误的密码 (error) ERR invalid password redis> AUTH secret_password…
2015-03-19 16:19 · 评论(0)
CentOS 使用yum命令安装出现错误提示”could not retrieve mirrorlist http://mirrorlist.centos.or
CentOS 使用yum命令安装出现错误提示”could not retrieve mirrorlist http://mirrorlist.centos.org ***” 刚安装完CentOS,使用yum命令安装一些常用的软件,使用如下命令:yum –y install gcc. 提示如下错误信息: Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile Could not retrieve mirrorlist http://mirrorl…
2015-03-19 13:45 · Linux · 评论(0)
linux查看当前是什么版本的系统
发行版: 发行版: cat /etc/issue linux版本: cat /proc/version
2015-03-19 11:21 · Linux · 评论(0)
git从一台电脑的本地分支clone
git clone root@192.168.1.1:/var/www/fuckyou 如果提示: ssh: connect to host 192.168.1.151 port 22: Connection refused 则要开启目标机器的openssh server sudo apt-get install openssh-server 然后ps -ef | grep sshd 如果启动了就ok了
2015-03-18 10:50 · GitHub · 评论(0)
从外部访问vitrualbox的虚拟机的rails server
在virtualbox的虚拟机中安装ubuntu,从外部访问ubuntu的rails server,发现总是connection refused,原来默认启动server的命令rails s的话绑定的地址是localhost:3000结果,由于是桥接模式,虚拟机的localhost对应的是127.0.0.1,所以外部的系统无法访问到这个地址,桥接的ip没有对应到localhost上。导致问题的出现。 解决办法有两个: 1.修改/etc/hosts:把ip对应到localhost上。 2.启动rails server的时候用下述命令: rails s -b 192.168.1.151
2015-03-16 21:14 · 评论(0)
ubuntu14.10 rails env
sudo apt-get install virtualbox-guest-dkms sudo apt-get install curl \curl -sSL https://get.rvm.io | bash wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo apt-get install vim sudo vim /etc/hosts cd /var/lib/apt/lists/partial/ sudo rm -rf * sudo apt-get update sudo…
(转载)ubuntu apt-get update 失败解决
转载自(http://feifeifather.blog.163.com/blog/static/21342203220140895556458/) 当运行apt-get update后出现如下错误时: E: Some index files failed to download, they have been ignored, or old ones used instead. 可以将目录下/var/lib/apt/lists/partial/所有的文件清掉,再次运行apt-get update即可!自带源在大陆不好。
2015-03-13 18:56 · ubuntu · 评论(0)
(转载)"Cache-control”常见的取值private、no-cache、max-age、must-revalidate及其用意
转自:http://www.cnblogs.com/kaima/archive/2009/10/13/1582337.html 网页的缓存是由HTTP消息头中的“Cache-control”来控制的,常见的取值有private、no-cache、max-age、must-revalidate等,默认为private。其作用根据不同的重新浏览方式分为以下几种情况: (1) 打开新窗口 如果指定cache-control的值为private、no-cache、must-revalidate,那么打开新窗口访问时都会重新访问服务器。而如果指定了max-age值,那么在此值内的时间里就不会重新访问服…
2015-03-01 19:54 · Rails · 评论(0)