- 浏览: 131975 次
- 性别:
- 来自: 北京
最新评论
文章列表
方案1:
从原始地址clone一份bare仓库
?
1
git clone --bare https://github.com/bartaz/impress.js.git (例子)
在Git@OSC上创建一个项目(http://git.oschina.net/projects/new),这里注意,不要勾选使用Readme初始化项目,不要选择项目的授权协议和.gitignore 文件,因为这些会导致项目有第一个提交。
记下新建项目后的地址,推荐使用http或者ssh方式皆可,大项目推荐ssh方式。
?
1
2
cd impress.js.git
git push --mirror git@gi ...
msg: start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connectio
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
出现上述问题, 使用
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
无法解决,因为找不到mysql.sock 这个文件
解决方 ...
SET FOREIGN_KEY_CHECKS = 0;
SET FOREIGN_KEY_CHECKS = 1;
Linux的时间分为System Clock(系统时间)和Real Time Clock (硬件时间,简称RTC)。
系统时间:指当前Linux Kernel中的时间。
硬件时间:主板上有电池供电的时间。
设置时区的命令: tzselect
http://www.cnblogs.com/QuLory/archive/2013/03/24/2978366.html
设置localtime的命令: sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
查看系统时间的命令: #date
设置系统时间的命令: #date –set(月 ...
http://blog.sina.com.cn/s/blog_7cbe44af01019jk4.html
python 排序,分页
- 博客分类:
- python
排序:
https://wiki.python.org/moin/HowTo/Sorting/
http://gaopenghigh.iteye.com/blog/1483864
关键字:
python列表排序 python字典排序 sorted
List的元素可以是各种东西,字符串,字典,自己定义的类等。
sorted函数用法如下:
Python代码 收藏代码
sorted(data, cmp=None, key=None, reverse=False)
其中,data是待排序数据,可以使List或者iterator, cmp和key都是函数,这两个函数作用与data ...
edX 学习一:了解 edX 相关组件
http://batizhao.github.io/2014/04/11/learning-edx-one/
edx 部署:
http://idefs.com/reprintedx-ubuntu-12-04-64-bit-installation.html/comment-page-1
http://blog.csdn.net/txdb/article/details/17616803
http://www.kankanews.com/ICkengine/archives/171843.shtml
sudo apt-get install openssh-server
ssh出现permission denied (publickey)问题:
修改/etc/ssh/sshd-config文件.
将其中的PermitRootLogin no修改为yes
PubkeyAuthentication yes修改为no
AuthorizedKeysFile .ssh/authorized_keys前面加上#屏蔽掉,
PasswordAuthentication no修改为yes就可以了。
重启sshd即可:service sshd restart
/etc/init.d/ssh r ...
方法一:
cat /etc/issue
返回结果:
Ubuntu 6.06.2 LTS \n \l
方法二:
sudo lsb_release -a
返回结果:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 6.06.2 LTS
Release: 6.06
Codename: dapper
方法三:
cat /etc/lsb-release
返回结果:
DISTRIB_ID=Ubuntu
DISTRIB_RELE ...
需要3个东西
1. 安装expect
2. autossh
3. 执行脚本
sudo apt-get install expect
====================================================
# autossh
#!/usr/bin/expect -f
set timeout 30
set server [lindex $argv 0]
set user [lindex $argv 1]
set pass [lindex $argv 2]
set rpass [lindex $argv 3]
send_user "connecting ...
备份数据库
./mongodump -d edxapp
[root@HuanCun3 dump]# cd edxapp/
[root@HuanCun3 edxapp]# ls
calendar.bson fs.chunks.bson fs.files.bson modulestore.bson modulestore.location_map.metadata.json system.indexes.bson
calendar.metadata.json fs.chunks.metadata.json ...
1.首先用命令free查看系统内 Swap 分区大小。
free -m
total used free shared buffers cached
Mem: 2012 1960 51 0 748 950
-/+ buffers/cache: 260 1751
Swap: 255 0 255
可以看到 Swap 只有255M,下面我们来扩大到2G。
2.创建一个 Swap 文件。 ...
# 更新代码
sudo git pull
# 修复mongodb
sudo mongod -f /etc/mongodb.conf --repair
# 重启服务
sudo /edx/bin/supervisorctl -c /edx/etc/supervisord.conf restart edxapp:
#编译:
sudo -H -u edxapp bash
source /edx/app/edxapp/edxapp_env
rake lms:gather_assets:aws
rake cms:gather_assets:aws
#国际化
msgunfmt django.mo -o ...