Skip to content

Instantly share code, notes, and snippets.

@rlandas
rlandas / .htaccess
Last active August 29, 2015 14:22 — forked from ericmagnuson/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule (.*\.min.css) less.php?min=yes&path=$1
RewriteRule (.*\.css) less.php?min=no&path=$1
</IfModule>
@rlandas
rlandas / gist:64a284e7bd6609a1318e
Last active August 29, 2015 14:09
CRON create cron jobs for Apache web server
# logged in as root/admin
crontab -u www-data -e
# logged in as any other user
sudo su -c "crontab -e" www-data
@rlandas
rlandas / gist:cbf1033c652d7ed685cb
Created November 11, 2014 05:18
GIT show all tags and their commit hashes
git log --oneline --decorate --tags --no-walk
@rlandas
rlandas / git checkout latest tag
Created October 30, 2014 03:16
Automatically checkout the latest tag of a Git repository
# Get new tags from the remote
$ git fetch --tags
# Get the latest tag name
$ latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
# Checkout the latest tag
$ git checkout $latestTag
@rlandas
rlandas / gist:020fc3940a8f8ca73bdf
Created October 22, 2014 04:56
Linux change permission of the "public" folder recursively
find . -type d -name "public" -exec echo {} \; -exec chmod -fR 0775 . \; -exec chown -fR www-data:www-data . \;
@rlandas
rlandas / Makefile
Last active November 11, 2015 10:13 — forked from h4cc/Makefile
UBUNTU Install packages
#
# Ubuntu 14.04 LTS (Trusty Tahr)
#
# Basic packages i usually install
#
# Author: Julius Beckmann <[email protected]>
#
.PHONY: all update upgrade graphics darktable networking google_chrome dropbox archives media pandoc system harddisk docker filesystem apache2 php mysql memcached mongodb tools encfs_manager nautilus httpie erlang elixir openoffice owncloud
@rlandas
rlandas / api.php
Last active August 29, 2015 14:07
<?php
function array_orderby() {
$args = func_get_args();
$data = array_shift( $args );
if ( ! is_array( $data ) ) {
return array();
}
; Sample supervisor config file.
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
;chmod=0700 ; sockef file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
;[inet_http_server] ; inet (TCP) server disabled by default
@rlandas
rlandas / .htaccess
Last active August 29, 2015 14:06 — forked from ericmagnuson/.htaccess
Using LESS with Apache2
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule (.*\.min.css) less.php?min=yes&path=$1
RewriteRule (.*\.css) less.php?min=no&path=$1
</IfModule>
@rlandas
rlandas / ubuntu_14_04.sh
Last active August 29, 2015 14:06 — forked from h4cc/Makefile
#--- Ubuntu 14.04 LTS (Trusty Tahr)
#-
#- Basic packages i usually install
#
# - Run with:
# sudo apt-get -y install git ; git clone https://gist.github.com/7be7f940325614dc59fb.git provision ; cd provision ; sh ubuntu_14_04.sh
# Update and Upgrade
sudo apt-get update
sudo apt-get upgrade