Skip to content

Instantly share code, notes, and snippets.

View johnantoni's full-sized avatar

John Griffiths johnantoni

  • Toronto, Ontario
View GitHub Profile
@johnantoni
johnantoni / nginx_gzip.conf
Created May 15, 2012 14:59
nginx gzip configuration
gzip on;
gzip_comp_level 9;
gzip_min_length 1400;
gzip_types text/plain text/css image/png image/gif image/jpeg application/x-javascript text/xml application/xml application/x
ml+rss text/javascript;
gzip_vary on;
gzip_http_version 1.1;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
@johnantoni
johnantoni / nginx.org.txt
Created May 18, 2012 18:59
nginx install from official repo
sudo nano /etc/apt/sources.list
# add repo's:
#
# deb http://nginx.org/packages/debian/ squeeze nginx
# deb-src http://nginx.org/packages/debian/ squeeze nginx
# then....
wget http://nginx.org/keys/nginx_signing.key
@johnantoni
johnantoni / mysql.remote.access.txt
Created May 18, 2012 21:20
mysql remote access
mysql -u root -p
CREATE USER 'db_user'@'%' IDENTIFIED BY 'PASSWORD';
FLUSH PRIVILEGES;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP ON `db_name` . * TO 'db_user'@'%';
FLUSH PRIVILEGES;
@johnantoni
johnantoni / sftp.synology.txt
Created May 18, 2012 21:34
sftp on synology disk station - ds411-ii
ssh root@nas.mybox.com
vi /etc/ssh/sshd_config
# override default of no subsystems
#Subsystem sftp /usr/libexec/sftp-server
Subsystem sftp internal-sftp
# restart ssh
@johnantoni
johnantoni / ace-editor.html.haml
Created July 9, 2012 20:25
ace editor + haml + sass
- f.field_container :content do
= f.label :content, "Content"
%br/
= f.text_area :content, :class => ''
= f.error_message_on :content
#ace-editor
:javascript
$(function() {
@johnantoni
johnantoni / wkhtmltopdf-osx
Created July 16, 2012 15:39
wkhtmltopdf osx lion 10.7.4
Homebrew only has wkhtmltopdf-0,9,9 and it fails with QT patched options by default. So if you need HEAD version with fully suppoorted options just
Grab yourself a copy of fresh wkhtmltopdf
Open it and drag to Your Applications
then...
ln /Applications/wkhtmltopdf.app/Contents/MacOS/wkhtmltopdf /usr/local/bin/wkhtmltopdf
@johnantoni
johnantoni / unicorn.rb
Created August 2, 2012 15:48
unicorn + nginx setup + ssl
unicorn.rb
-----------------------------------
application = "jarvis"
remote_user = "vagrant"
env = ENV["RAILS_ENV"] || "development"
RAILS_ROOT = File.join("/home", remote_user, application)
worker_processes 8
timeout 30
@johnantoni
johnantoni / unicorn.pill
Created August 2, 2012 17:36
unicorn + bluepill
#! /usr/bin/env ruby
app_name = 'jarvis'
user = 'vagrant'
group = 'vagrant'
rails_env = ENV["RAILS_ENV"] || "development"
RAILS_ROOT = File.join("/home", user, app_name)
@johnantoni
johnantoni / mysql.txt
Created August 7, 2012 18:57
mysql + vagrant + remote access
username: vagrant
password: vagrant
sudo apt-get update
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev
sudo aptitude install mysql-server mysql-client
sudo nano /etc/mysql/my.cnf
@johnantoni
johnantoni / .vimrc.before
Created August 9, 2012 17:43
janus without nerdtree
# disable nerdtree + netrw when loading MacVim,
# as we can use alloy's build with the sidebar
# https://github.com/alloy/macvim
if has("gui_running")
call janus#disable_plugin('nerdtree')
let g:loaded_netrw = 1 " Disable netrw
let g:loaded_netrwPlugin = 1 " Disable netrw
end