Skip to content

Instantly share code, notes, and snippets.

View viirre's full-sized avatar

Victor Eliasson viirre

View GitHub Profile
@viirre
viirre / install_laravel.sh
Last active August 29, 2015 13:58
Installation bash for new Ubuntu server, use: install.sh project-name mysql-pass
#!/bin/bash
sudo apt-get update
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
sudo apt-get install -y vim curl python-software-properties
sudo add-apt-repository -y ppa:ondrej/php5
sudo apt-get update
@viirre
viirre / Vagrantfile
Last active August 29, 2015 13:58
Vagrantfile for new Ubuntuserver
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :private_network, ip: "192.168.33.21"
@viirre
viirre / default
Last active August 29, 2015 13:58
Default Nginx vhost
server {
listen 80; ## listen for ipv4; this line is default and implied
listen [::]:80 default ipv6only=on; ## listen for ipv6
root /var/www;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name _;

Keybase proof

I hereby claim:

  • I am viirre on github.
  • I am viirre (https://keybase.io/viirre) on keybase.
  • I have a public key whose fingerprint is F71F 8CE7 1AB5 89C6 5425 6AD3 58B0 5694 125D 226B

To claim this, I am signing this object:

@viirre
viirre / .bash_profile
Created May 22, 2014 20:25
Bash profile #1
# Load in the git branch prompt script.
source ~/.git-prompt.sh
export LSCOLORS="ExGxBxDxCxEgEdxbxgxcxd"
#Aliases
alias vm='ssh vagrant@127.0.0.1 -p 2222'
alias ll="ls -lahG"
# Colors
# bash/zsh git prompt support
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see repository status in your prompt.
#
# To enable:
#
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).
@viirre
viirre / .bash_profile
Last active August 29, 2015 14:05
Bash profile #2
# From https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh
source ~/.git_prompt.sh
PS1='\n\[\e[1;37m\]|-- \[\e[1;32m\]\u\[\e[0;39m\]@\[\e[1;36m\]\h\[\e[0;39m\]:\[\e[1;33m\]\w\[\e[0;39m\]\[\e[1;35m\]$(__git_ps1 " (%s)")\[\e[0;39m\] \[\e[1;37m\]--|\[\e[0;39m\]$ '
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
@viirre
viirre / nginx.conf
Created September 17, 2014 14:05
Basic nginx.conf for Ubuntu 12.04 64-bit, 2 CPUs, around 2 GB RAM
# nginx Configuration File
# http://wiki.nginx.org/Configuration
# Run as a less privileged user for security reasons.
user www-data www-data;
# How many worker threads to run;
# "auto" sets it to the number of CPU cores available in the system, and
# offers the best performance. Don't set it higher than the number of CPU
# cores if changing this parameter.
@viirre
viirre / install_sslmate_forge.md
Last active September 18, 2015 15:03
Install new certificate with SSLmate and Forge

1. Install SSLmate on the server

sudo wget -P /etc/apt/sources.list.d https://sslmate.com/apt/ubuntu1404/sslmate.list
sudo wget -P /etc/apt/trusted.gpg.d https://sslmate.com/apt/ubuntu1404/sslmate.gpg
sudo apt-get update
sudo apt-get install sslmate

2. Buy the certificate

@viirre
viirre / pre-push
Last active April 27, 2017 13:06
Pre-push git hook to avoid errors in prod
#!/bin/sh
function allTestsShouldPass(){
echo "Running tests..."
vendor/bin/phpunit
if [ $? -ne 0 ]; then
echo " -> ERROR. Tests did not pass, fix them!"
exit 1
fi
}