Skip to content

Instantly share code, notes, and snippets.

View holms's full-sized avatar

Roman Gorodeckij holms

View GitHub Profile
@holms
holms / mpnml
Created July 19, 2012 23:59
Mysql, Php-fpm, Nginx, mysql-pdo, pear on OSX Mountain Lion
sudo port -v install mysql5-server
# Don't do any post-install instructions
sudo -u _mysql mysql_install_db5
# if above command produce this error: ERROR: 1004 Can't create file '/var/tmp/#sqle967_1_0.frm' (errno: 9)
# do this:
# sudo chown -R mysql:mysql /opt/local/var/db/mysql5
# sudo chmod u+rwx,go= /opt/local/var/db/mysql5
# sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql
@holms
holms / gist:3216932
Created July 31, 2012 13:09
RVM and ruby 1.9 on debian wheezy
0) login as root (su or sudo -s)
1) After a Debian fresh install you should install those package:
apt-get install autoconf automake autotools-dev build-essential bison bzip2 curl git libreadline5 libsqlite3-0 sqlite3 libsqlite3-dev libxml2-dev libmysqlclient-dev libreadline5-dev libruby openssl libssl-dev zlib1g zlib1g-dev zlibc vim
2) Install rvm
bash < <(curl -BL https://rvm.beginrescueend.com/install/rvm)
3) Add to /etc/profile and /root/.bashrc this script
@holms
holms / nginx_cakephp
Created November 20, 2012 07:51
Nginx rules for cakephp
# If the file exists as a static file serve it
# directly without running all
# the other rewite tests on it
if (-f $request_filename) {
break;
}
if (!-f $request_filename) {
rewrite ^/(.+)$ /index.php?url=$1 last;
break;
@holms
holms / centos-vimrc
Created November 22, 2012 22:41
Centos vimrc
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
set fileencodings=utf-8,latin1
endif
set nocompatible " Use Vim defaults (much better!)
set bs=indent,eol,start " allow backspacing over everything in insert mode
"set ai " always set autoindenting on
"set backup " keep a backup file
set viminfo='20,\"50 " read/write a .viminfo file, don't store more
" than 50 lines of registers
@holms
holms / gist:4252711
Created December 10, 2012 19:24
My freebsd mk.conf
CPUTYPE?=nocona
CFLAGS+=-Os -pipe -fno-strict-aliasing
COPTFLAGS=-Os -pipe -funroll-loops -ffast-math -fno-strict-aliasing
KERNCONF=BSD GENERIC
OPTIMIZED_CFLAGS=YES
WITHOUT_X11=YES
BUILD_OPTIMIZED=YES
WITH_CPUFLAGS=YES
WITH_OPTIMIZED_CFLAGS=YES
#WITHOUT_DEBUG=YES
@holms
holms / gist:4507731
Created January 11, 2013 03:33
FreeBSD: High resolution console
cd /usr/src/sys/amd64/conf
vi GENERIC #:
options VESA # Build VESA module into kernel
options SC_PIXEL_MODE # Allows syscons to act on pixels rather than text
cd /usr/src
make buildkernel KERNCONF=GENERIC
make installkernel KERNCONF=GENERIC
reboot
@holms
holms / gist:4984738
Created February 19, 2013 10:35
git svn multiple trunks
mkdir pkgname
cd pkgname
git svn init https://host/svn/pkgname/trunk/pkgname/src/trunk
git svn fetch
@holms
holms / gist:5005487
Created February 21, 2013 15:31
compare two directories, exclude .svn dir
diff --exclude=".svn" -rq ~/mounts/www.example.com/ /var/www/www.example.com/
@holms
holms / gist:5005629
Last active December 21, 2023 16:10
midnight commander dark color theme
Edit mc’s ini file (either ~/.mc/ini or ~/.config/mc/ini) and look for the line [Colors]. Then, change the line base_color to this:
[Colors]
base_color=linux:normal=white,black:marked=yellow,black:input=,green:menu=black:menusel=white:menuhot=red,:menuhotsel=black,red:dfocus=white,black:dhotnormal=white,black:dhotfocus=white,black:executable=,black:directory=white,black:link=white,black:device=white,black:special=white,black:core=,black:stalelink=red,black:editnormal=white,black
@holms
holms / wheezy.sh
Last active December 14, 2015 08:09
debian wheezy update and basic server setup script
#!/bin/bash
# Text color variables
txtund=$(tput sgr 0 1) # Underline
txtbld=$(tput bold) # Bold
bldred=${txtbld}$(tput setaf 1) # red
bldblu=${txtbld}$(tput setaf 4) # blue
bldwht=${txtbld}$(tput setaf 7) # white
txtrst=$(tput sgr0) # Reset
info=${bldwht}*${txtrst} # Feedback