Skip to content

Instantly share code, notes, and snippets.

@wgm89
wgm89 / gist:5657576
Last active December 17, 2015 18:59
ubuntu 配置
字体
------------------------------------------------------------------------------------
http://damieng.com/blog/2008/05/26/envy-code-r-preview-7-coding-font-released
https://github.com/adobe/source-code-pro
----------------------------------------------------------------------------------------
vim 插件: emmet-vim c-p
----------------------------------------------------------------------------------------
vimrc 配置
可参考 https://github.com/fisadev/fisa-vim-config/blob/master/.vimrc
@wgm89
wgm89 / gist:5942191
Created July 7, 2013 03:42
slim nginx rewrite
server {
listen 80;
root /var/www/slim;
index index.html index.htm index.php;
# Make site accessible from http://localhost/
#
server_name test.com;
if (!-f $request_filename) {
@wgm89
wgm89 / gist:5975417
Last active December 19, 2015 15:19
fix mysql how to fix Access denied for user 'root'@'localhost'
php 可以连接 mysql , 但 cli 下 不能使用密码登录 ,空密码可登录,应该是权限在作怪.
skip-grant-tables下 不能 分配mysql 用户权限 .
只能这样 : mysql_query(GRANT ALL ON mydb.* TO 'someuser'@'somehost';);
通常以下就可解决:
Follow steps below
1.Start the mysql server instance or daemon with the --skip-grant-tables option. (security setting)
@wgm89
wgm89 / gist:5990128
Created July 13, 2013 09:13
sphinx.conf 加载多个子配置文件
#!/usr/bin/php
<?php
$files = scandir(dirname(__FILE__) . "/conf.d/");
foreach($files as $key => $file) {
if($file != "." && $file != ".." && preg_match('/.conf$/iU', $file) ) {
include(dirname(__FILE__) . "/conf.d/$file");
}
}
?>
@wgm89
wgm89 / gist:6001874
Last active December 19, 2015 18:49
upgrade php5.3 to php 5.4
sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
sudo apt-get install php5
upgrading PHP to 5.4 gives 502 Bad Gateway errors.
fix:
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
@wgm89
wgm89 / gist:6034727
Created July 19, 2013 02:45
solve nginx 413
client_max_body_size 20m;
@wgm89
wgm89 / gist:6327409
Created August 24, 2013 10:47
django笔录
更改admin 密码
---------------------------------------------
./manage.py changepassword admin
---------------------------------------------
django-admin.py changepassword admin
You can also change a password programmatically:
---------------------------------------------
from django.contrib.auth.models import User
admin = User.objects.get(username='admin')
admin.set_password('mynewpassword')
@wgm89
wgm89 / gist:6534631
Created September 12, 2013 08:49
codeigniter nginx rewrite
server {
listen 8089; ## listen for ipv4; this line is default and implied
#listen [::]:80 default ipv6only=on; ## listen for ipv6
root /var/www/;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
@wgm89
wgm89 / gist:6596172
Created September 17, 2013 15:44
test.c
#include "stdio.h"
#include "time.h"
#include "string.h"
void main(){
int * month;
int no;
time_t timer;
char timebuf[128];
struct tm * current;
@wgm89
wgm89 / gist:6749968
Created September 29, 2013 06:51
截图
python:python-webkit2png
已编译好:http://code.google.com/p/wkhtmltopdf/downloads/list
http://phantomjs.org/