Skip to content

Instantly share code, notes, and snippets.

View himinseop's full-sized avatar

Minseop Ahn himinseop

View GitHub Profile
@himinseop
himinseop / nginx
Created February 22, 2017 02:07
NGINX init.d script
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /usr/local/nginx/conf/nginx.conf
# pidfile: /usr/local/nginx/logs/nginx.pid
@himinseop
himinseop / php-fpm
Last active February 22, 2017 02:08
PHP-FPM init.d script
#! /bin/sh
### BEGIN INIT INFO
# Provides: php-fpm
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts php-fpm
# Description: starts the PHP FastCGI Process Manager daemon
@himinseop
himinseop / pushState.js
Last active February 22, 2017 02:06
add browser history
history.pushState('', document.title, '?page='+page+'&limit='+pageSize)
SELECT SQL_CALC_FOUND_ROWS * FROM article limit 10;
SELECT FOUND_ROWS();
@himinseop
himinseop / angular-ui-grid-bug-fix.js
Created December 21, 2016 12:51
angular-ui-grid with angular-1.6x bug fix
// fix : Possibly unhandled rejection: canceled
// for angularjs >= 1.6.0
// https://github.com/angular-ui/ui-grid/issues/5890
app.config(['$qProvider', function ($qProvider) {
$qProvider.errorOnUnhandledRejections(false);
}]);
@himinseop
himinseop / swap_memory.sh
Created November 1, 2016 08:37
swap memory manage
# check memory size
free
# make space 1GB
dd if=/dev/zero of=/var/swapfile bs=1024 count=1000000
# make swap file format
mkswap /var/swapfile
# activate
$sql =<<<SQL
SELECT
COUNT(*)
, id
FROM
example_table
SQL;
@himinseop
himinseop / remove_file_by_filename.sh
Created March 27, 2014 08:08
remove file by filename
find . -name '*DS_Store' -exec rm -rf {} \;