Skip to content

Instantly share code, notes, and snippets.

View luceos's full-sized avatar
👨‍🎨
Painting web

Daniël Klabbers luceos

👨‍🎨
Painting web
View GitHub Profile
@luceos
luceos / install_nginx_w_spdy.sh
Last active August 29, 2015 13:55
Install nginx and compile with speedy from commandline, use parameter to select version, image_filter requires php5-gd/php_gd and libgd2-xpm-dev
#!/bin/sh
#
# Obsolete; nginx 1.5.10 has in-built option for spdy, with compilation option: --with-http_spdy_module
#
# use ./install_nginx_w_spdy.sh <version>
NGINX_VERSION=$1
TMP_PATH=/tmp
@luceos
luceos / hostname validation
Created January 14, 2015 08:32
hostname validation
^([a-z0-9](-?[a-z0-9])*)+(\.[a-z0-9](-?[a-z0-9])*)*(\.[a-z0-9](-?[a-z0-9])+)+$
@luceos
luceos / ExtendedValidator.php
Created February 13, 2015 09:26
extending laravel 4 validation
<?php namespace Vendor\Package;
use Illuminate\Validation\Validator;
class ExtendedValidator extends Validator
{
// use validation rule "foo" to use
public function validateFoo($attribute, $value, $parameters)
{
return $value == "foo";
@luceos
luceos / AuthenticatedTrait.php
Created May 22, 2015 11:05
Route Authentication Middleware laravel 5
<?php
trait AuthenticatedTrait
{
/**
* The check to see whether access is allowed to some route
* @return bool
*/
public function allowedToAccessRoute()
{
@luceos
luceos / fixes.sh
Created June 10, 2015 13:02
linux rights fixes
find . -type d -print0 | xargs -0 chmod 0755
find . -type f -print0 | xargs -0 chmod 0644
@luceos
luceos / rollout.sh
Last active September 3, 2015 08:22
update script for laravel 4/5 creating a backup of files and database, while asking for approval along the way
#!/bin/bash
#
# Laravel update tool
#
#
# use: ./rollout.sh
#
# date: 2015-09-01
# by D. Klabbers / HostingXS B.V.
@luceos
luceos / update.sh
Created September 23, 2015 14:41
flarum updater
#!/usr/bin/env bash
base=${PWD}
release=${base}
# Install all Composer dependencies
cd ${release}/flarum
composer require flarum/core:dev-master@dev --prefer-dist --update-no-dev
composer update --prefer-dist --optimize-autoloader --ignore-platform-reqs --no-dev
@luceos
luceos / svn-commands
Created March 14, 2012 15:29
Most used svn commands
# zie alle openstaande beschikbare commits
svnmerge.py avail -l
# commit een bepaalde revisie
svnmerge.py merge -r .xxx
# commit deze revisie direct terug naar de huidige branche
svn commit -F svn<tab> (commit message)
# ignore files from svn
svn propset svn:ignore <file> .
@luceos
luceos / slanger-ubuntu
Created December 6, 2012 08:45
Installing slanger on ubuntu
install rvm (rvm.io) and at least the 1.9.3-head by using the code: rvm install 1.9.3-head
Test whether this version is installed with rvm -v
If not try rvm reinstall 1.9.3-head
Now install the ruby gem daemons: gem install daemons
Also install the slanger gem, even though you are using the git repo, this ensures all dependencies are auto-loaded: gem install slanger
Now run your server
Installation of RVM in /usr/local/rvm/ is almost complete:
* First you need to add all users that will be using rvm to 'rvm' group,
and logout - login again, anyone using rvm will be operating with `umask u=rwx,g=rwx,o=rx`.
* To start using RVM you need to run `source /etc/profile.d/rvm.sh`
in all your open shell windows, in rare cases you need to reopen all shell windows.
# Luceos,
#