Skip to content

Instantly share code, notes, and snippets.

@rogerleite
rogerleite / _install.md
Last active May 19, 2023 16:57
Some scripts to install things

Introduction

Some install scripts. Target to work with Ubuntu 12 or greater.

Table of Scripts

@Xethron
Xethron / MultiUserProvider.php
Last active November 15, 2017 16:51
Laravel 4 Authenticate Multiple User Provider Allows Laravel Auth to login using multiple tables and/or databases/Eloquent User Models... Each User Model can have its own Hasher and Hasher options...
<?php //app/libraries/MultiUserProvider.php
use Illuminate\Auth\UserProviderInterface,
Illuminate\Auth\UserInterface,
Illuminate\Auth\GenericUser;
class MultiUserProvider implements UserProviderInterface {
protected $providers;
# Install dependencies
#
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \
mkdir -p ~/sources/ && \
# Compile against OpenSSL to enable NPN
@dnozay
dnozay / README
Created February 28, 2014 02:05
nginx + php-fpm + x-accel-redirect + ldap
install the packages
# yum install php-fpm php-ldap
then make sure php-fpm can create sessions
and change user and group to be nginx
see /etc/php-fpm.d/www.conf for more details
# sed -i -e 's/apache/nginx/g' /etc/php-fpm.d/www.conf
# sed -i -e 's/;catch_workers_output = yes/catch_workers_output = yes/' /etc/php-fpm.d/www.conf
@sangeeths
sangeeths / github-to-bitbucket
Created March 10, 2014 15:24
Forking a Github repo to Bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone [email protected]:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync [email protected]:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v
@mnshankar
mnshankar / nginx.conf
Last active March 16, 2023 11:17
Nginix config for hosting multiple laravel projects in sibling folders.
server {
listen 80;
root /vagrant;
index index.html index.htm index.php app.php app_dev.php;
# Make site accessible from http://set-ip-address.xip.io
server_name 192.168.33.10.xip.io;
access_log /var/log/nginx/vagrant.com-access.log;
error_log /var/log/nginx/vagrant.com-error.log error;
@vinceyuan
vinceyuan / redis-server-per-project
Last active January 30, 2020 05:21
Init script to start/stop redis-server for CentOS or amazon ec2 linux ami. You can run multiple redis-server on one server with this script. Just copy and replace 'per-project' with your project name in this file for each project.
#!/bin/sh
# From - http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
#
# redis - this script starts and stops the redis-server daemon
# Originally from - https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
# Modified by Vince Yuan https://gist.github.com/vinceyuan/9667435
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
@zackify
zackify / filters.php
Last active August 29, 2015 13:58
Cache Everything in laravel with 4 extra lines of code!
App::before(function($request)
{
$key = Str::slug($request->url());
if(Cache::has($key)) return Cache::get($key);
});
App::after(function($request, $response)
{
$key = Str::slug($request->url());
#!/bin/bash
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Mathias Leppich <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@jokeru
jokeru / compile-nginx-minimal.sh
Created June 27, 2014 19:36
howto compile nginx for static content only - minimal modules loaded
apt-get install build-essential
cd /usr/src/
wget http://nginx.org/download/nginx-1.6.0.tar.gz
tar -xzf nginx-1.6.0.tar.gz
cd nginx-1.6.0/
./configure --help
./configure \
--prefix=/usr/local/nginx \