eonbell
eonbell · 共 41 篇文章
linux shell date用法
使用date命令转换基础时间秒为年月日: 命令为: date -d @1281161747 注意一定不要忘记符号“@” #date 获取当前时间 #date -d "-1 week" +%Y%m%d 获取上周日期(day,month,year,hour) #date --date="-24 hour" +%Y%m%d 同上 date_now= date +%s shell脚本里面赋给变量值 %% 输出%符号 %a 当前域的星期缩写 (Sun..Sat) %A 当前域的星期全写 (Sunday..Saturday) %b 当前域的月份缩写(Jan..Dec) %B 当前域的月份全称 (Janu…
2011-09-22 09:53 · 网文收藏 · 评论(0)
VSFTPD全攻略
/etc/vsftpd/vsftpd.conf文件详解,分好类,方便大家查找与学习 #################匿名权限控制############### anonymous_enable=YES #是否启用匿名用户 no_anon_password=YES #匿名用户login时不询问口令 下面这四个主要语句控制这文件和文件夹的上传、下载、创建、删除和重命名。 anon_upload_enable=(yes/no); #控制匿名用户对文件(非目录)上传权限。 anon_world_readable_only=(yes/no); #控制匿名用户对文件的下载权限 anon_mkdir_w…
2011-09-19 17:23 · 网文收藏 · 评论(0)
linux下添加,删除,修改,查看用户和用户组
一,组操作 1,创建组 groupadd test 增加一个test组 2,修改组 groupmod -n test2 test 将test组的名子改成test2 3,删除组 groupdel test2 删除 组test2 4,查看组 a),查看当前登录用户所在的组 groups,查看apacheuser所在组groups apacheuser b),查看所有组 cat /etc/group c),有的linux系统没有/etc/group文件的,这个时候看下面的这个方法 cat /etc/passwd |awk -F '{print $4}' |sort|uniq | getent gr…
2011-09-19 10:44 · 网文收藏 · 评论(0)
VSFTP虚拟用户创建方法
yum -y install vsftpd* yum -y install pam* yum -y install db4* 一、建立一个存放用户名和密码的文件 vi mima.txt (记住路径,后面要用的着) 在文件里输入 用户名一 密码一 用户名二 密码二 用户名三 密码三 保存 二、生成虚拟用户帐户数据库 db_load -T -t hash -f /etc/vsftpd/mima.txt /etc/vsftpd/vsftpd_login.db 生成能被 pam.d认识的数据库vsftpd_login.db mima.txt是前面建立的那个文件,vsftpd_login.db 可自己…
2011-09-19 10:29 · 网文收藏 · 评论(0)
JSON datetime between Python and JavaScript
import json json.dumps(d.isoformat()) var d = new Date("2011-05-25T13:34:05.787000"); As of Javascript 1.8.5, Date objects have a toJSON method, which returns a string in a standard format. To serialize the above Javascript object back to JSON, therefore, the command would be: d.toJSON() Which woul…
2011-09-05 09:56 · 参考手册 · 评论(0)
解决MySQL error 1036: table is read only
改变数据库文件的宿主权限 sudo chown -R mysql:mysql /var/lib/mysql 重启mysql服务 sudo service mysqld restart
2011-05-05 22:37 · Java 学习笔记 · 评论(0)
UI Development using jQueryMobile
Introduction to jQueryMobile Following is an extract from jQueryMobile site - jQuery Mobile: Touch-Optimized Web Framework for Smartphones & Tablets A unified user interface system across all popular mobile device platforms, built on the rock-solid jQuery and jQuery UI foundation. Its lightweight c…
2011-03-20 14:49 · 网文收藏 · 评论(0)
Draw Graph using Graphviz ¶
First Graph Set up Download graphviz from here: http://www.graphviz.org/Download..php (for Mac, use this link: http://www.graphviz.org/Download_macos.php) create a file named "sample.dot", using any text editor: Jenny:~/temp/20100722$cat test.dot digraph g { node A1 -> B1 A1 -> B2 A1 -> B3 } conver…
2011-02-25 13:38 · 评论(0)
FaceBook Setup Issue
First use this url to ask user to add your facebook app(if user not login, facebook will redirect to login page and then go to this url) https://graph.facebook.com/oauth/authorize?redirect_uri=< http://YOUR_FaceBookCallback_SERVLET>&client_id=<YOUR_app_key> Then you can use this url to ask user gra…
2011-02-25 13:37 · 评论(0)
xpath Tricks
how to find the text following " " tag for example: html source code as below: Blood Substitutes (HBOCs): Is There a Downside? Small Animal > Emergency Medicine & Critical Care Tuesday | 8:00 AM - 8:50 AM | Mandalay Bay South Pacific F we can find out the text following by below summar detail = roo…
2011-02-25 13:36 · 评论(0)
SVN Tricks
svn propedit svn:externals . ---import extension package for example: utils2 http://synnex-svn.motherapp.com/svn/synnex/utils2/ svn commit added utils2 svn update svn add svn status svn import testProject repository/testProject for example: svn import -m "comment here" testProject http://synnex-svn…
2011-02-25 13:35 · 评论(0)
Ubuntu Command Line Trick ¶
grep -r mysite * | grep -v svn --- find out all files including "mysite" except svn folder screen -R screenname --create a screen named screenname or entry a screen named screenname tail -f xxx.filename -- realtime to display file content crontab -e -- edit the cron Command about crontab? how to de…
2011-02-25 13:34 · 评论(0)
Update WSGI App without Restart Apache ¶
in the apace configuration page, add the two directives before WsgiScriptAlias? WSGIDaemonProcess bug-reporter threads=25 WSGIProcessGroup bug-reporter WSGIScriptAlias / /app/bug_reporter/django.wsgi restart apache to renew process, just touch the xxxx.wsgi file in the app folder touch django.wsgi
2011-02-25 13:32 · 评论(0)
Set up Admin Page In Apache
Modify the settings in apache, change the media root to the own python path like this: RewriteRule? /(media)($|(/(.*))) /usr/local/lib/python2.6/site-packages/django/contrib/admin/$0
2011-02-25 13:32 · 评论(0)
Set up Brand New Django Server
Set up Brand New Django Server ¶ steps to set up django server (in linux): make sure set up the path of /usr/local/bin before everything install httpd (remember to set mod_rewrite) apt-get install apache2-threaded-dev /etc/init.d/apache2 restart sudo a2enmod rewrite ./configure --enable-rewrite 1b.…
2011-02-25 13:31 · 参考手册 · 评论(0)