Skip to content

Instantly share code, notes, and snippets.

View solicomo's full-sized avatar

Soli Como solicomo

View GitHub Profile
@solicomo
solicomo / solarized_for_xshell.xcs
Last active February 11, 2022 18:27
Solarized Light/Dark Theme of XShell
[Names]
count=2
name1=Solarized Dark
name0=Solarized Light
[Solarized Light]
text(bold)=586e75
magenta(bold)=6c71c4
text=657b83
white(bold)=fdf6e3
green=859900
# yum install php
# yum install php-fpm
# yum install php-pecl-apc
# yum install php-pdo
# yum install php-mysqlnd.x86_64
# service php-fpm restart
@solicomo
solicomo / test-mysql.php
Created January 3, 2014 10:36
test mysql/sqlite/pdo
<?php
mysql_connect("host","username","password") or die("Unable to Connect");
mysql_select_db("dbname") or die("Could not open the db");
$sql="select * from tablename";
$result=mysql_query($sql);
while($row = mysql_fetch_array($result))
{
echo $row[0].' => '.$row[1]."\n";
}
@solicomo
solicomo / install-nginx-on-centos-6.4
Created January 3, 2014 04:35
Install nginx on CentOS 6.4
http://wiki.nginx.org/Install
To add nginx yum repository, create a file named /etc/yum.repos.d/nginx.repo and paste one of the configurations below:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
#include <event.h>
#include <evhttp.h>
#include <pthread.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <iostream>
@solicomo
solicomo / Installing RHEL EPEL Repo on Centos 5.x, 6.x or 7.x
Last active December 20, 2015 16:39
Installing RHEL EPEL Repo on Centos 5.x, 6.x or 7.x
```
sudo yum install epel-release
```
Centos 7.x
==========
```
wget http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-1.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
@solicomo
solicomo / php-fpm
Created May 25, 2013 11:35
CentOS 下 php-fpm 的启动脚本
#!/bin/sh
#
# php-fpm - this script starts and stops the php-fpm daemon
#
# chkconfig: - 85 15
# description: PHP-FPM
# processname: php-fpm
# config: /usr/local/php/etc/php-fpm.conf
# pidfile: /var/run/php-fpm.pid
@solicomo
solicomo / sqlite-delete-records-before-one-year.sql
Last active December 17, 2015 14:39
SQLite 删除一年前的数据
SQLite 没有 datediff() ,所以要删除一年前的数据需要如下语句:
1. 删除(从今天零点算起的) 365 天前的数据:
delete from tb_load_info where julianday(strftime('%Y-%m-%d',datetime('now','localtime'))) - julianday(strftime('%Y-%m-%d', created_at)) > 365;
2. 删除(从此时此刻算起的) 365 天前的数据:
delete from tb_load_info where julianday(datetime('now','localtime'))-julianday(created_at) > 365;
@solicomo
solicomo / donate-buttons.htm
Created April 26, 2013 16:53
精简过的PayPal捐赠按钮和OKPay捐赠按钮。前者是基于“立即购买”按钮修改的,因为中国的PayPal账户不能接收捐赠。
<center>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="soli@cbug.org">
<input type="hidden" name="item_name" value="Support cbug.org">
<input type="hidden" name="amount" value="">
<input type="hidden" name="currency_code" value="USD">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" style="border:0px;background:none;" name="submit" alt="PayPal - The safer, easier way to pay online">
</form>
</center>
@solicomo
solicomo / install-php
Last active December 16, 2015 03:39
CentOS 5.x 安装PHP(php-fpm)
# yum install bzip2 bzip2-devel libuuid-devel
# yum install curl-devel gd gd-devel.x86_64 gmp-devel pcre-devel.x86_64 libjpeg-devel.x86_64 libpng-devel.x86_64 libXpm-devel.x86_64 expat-devel freetype-devel.x86_64 libxml2 libxml2-devel
# yum install libmcrypt-devel.x86_64
# yum install mysql-devel.x86_64 mysql-server.x86_64 (可选)
# ./configure --prefix=/usr/local/php --enable-fpm --with-zlib --enable-bcmath --with-bz2 --with-curl --with-libxml-dir --enable-exif --enable-ftp --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-mysql --with-mysqli --with-mysql-sock=/tmp/mysql.sock --with-libdir=lib64 --with-mcrypt