Skip to content

Instantly share code, notes, and snippets.

View lesstif's full-sized avatar

KwangSeob Jeong lesstif

View GitHub Profile
@lesstif
lesstif / tomcat-runas-user.sh
Last active August 29, 2015 14:02
RHEL/CentOS tomcat running script for user
#!/bin/bash
# Source function library.
. /etc/init.d/functions
## tomcat installation directory
PROCESS_NAME=tomcat-caservicename
CATALINA_HOME="/home/lesstif/apache-tomcat-7.0.54/"
@lesstif
lesstif / .vimrc
Last active August 29, 2015 14:05
vimrc
" To use it, copy it to
" for Unix : ~/.vimrc
" Windog : $VIM\_vimrc
if &t_Co > 2
syntax on
endif
set hlsearch
@lesstif
lesstif / gitlab
Created September 23, 2014 14:07
gitlab init.d script for CentOS 6
#!/bin/bash
#
# GitLab
# Contributors : @elvanja, @troyanov, @eiyaya, @foyo23, @nielsbasjes, @relip, @JasonMing, @andronat, @axilleas, @mdirkse
# App Version : 6.x - 7.x
# chkconfig: 2345 82 55
# processname: unicorn
# processname: sidekiq
# description: Runs unicorn and sidekiq for nginx integration.
@lesstif
lesstif / gitlab.conf
Last active August 29, 2015 14:06
/etc/httpd/conf.d/gitlab.conf for CentOS apache httpd
#This configuration has been tested on GitLab 6.0.0 and GitLab 6.0.1
#Note this config assumes unicorn is listening on default port 8080.
#Module dependencies
# mod_rewrite
# mod_ssl
# mod_proxy
# mod_proxy_http
# mod_headers
NameVirtualHost *:443
@lesstif
lesstif / redmine_unicorn.sh
Last active August 29, 2015 14:06
redmine start/stop/status using unicorn web server
#!/bin/sh
export RAILS_ENV=production
USER=`whoami`
PIDS=""
getpids() {
local procname=$1
if [ "$#" = 0 ] ; then
echo $"Usage: getpids {procname} "
@lesstif
lesstif / pre-commit.sh
Created September 28, 2014 14:43
subversion pre-commit hook for redmine issue tracking system integration
#!/usr/bin/php<?php
# comment 가 10자 미만이면 커밋 거부
$minchars = 10;
$svnlook = 'svnlook';
#--------------------------------------------
$repos = $argv[1];
$txn = $argv[2];
@lesstif
lesstif / echo-server.php
Created February 16, 2015 05:47
PHP echo socket server. To run "php echo-server.php -h 0.0.0.0 -p 30022 -b 192.168.0.4,192.168.10.2"
<?php
// PHP echo server
$host = "0.0.0.0";
$port = "30022";
$blacklists = array();
$options = getopt("h:p:b:");
if (isset($options["h"])) {
$host = $options["h"];
@lesstif
lesstif / dom-parse.php
Created August 12, 2015 15:56
modify html dom object using php
<?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use PHPHtmlParser\Dom;
use PHPHtmlParser\Dom\Tag;
class HtmlTest extends TestCase
@lesstif
lesstif / nginx php-fpm config
Created March 8, 2016 00:57
nginx + php7.0-fpm site configuration
server {
listen 80;
## edit this
server_name myhost.com;
## edit this
root "/var/www/myhost.com/public/";
index index.php index.html index.htm;
@lesstif
lesstif / ubuntu14-laravel-deply
Last active May 14, 2016 16:36
ubuntu 14 LTS server 에서 라라벨 배포 환경 구성하기 위해 nginx, php7, mysql 5.7, redis 설치
#!/usr/bin/env bash
# 패키지 목록 업데이트
sudo apt-get update
# 시스템 패키지 업데이트
sudo apt-get -y upgrade
# PPA 설치
sudo apt-get install -y software-properties-common curl