Skip to content

Instantly share code, notes, and snippets.

View ruslankonev's full-sized avatar
:octocat:
Make a good things

Ruslan Konev ruslankonev

:octocat:
Make a good things
View GitHub Profile
$script = <<SCRIPT
START_TIME=$SECONDS
# ------------------ ESSENTIALS
apt-get update
apt-get install -y unzip vim git-core curl wget build-essential python-software-properties
# ------------------ INSTALL NGINX
apt-get install -y nginx
sudo service nginx start

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users
#!/bin/bash
#
# Lee Robert's Base Ubuntu Installation script for use on Digital Ocean (Or any other ubuntu install really.)
# Made and tested with Ubuntu 13.04 64bit
#
# USAGE: bash hardenUbuntu.sh
#
# Steps:
# 01. Secure Root User
# 02. Make .bashrc print out pretty colors (and root's prompt will be red)

Setup

  • Add this file to application/libraries (or, if you are already extending the Validator class, add the contents there).
  • Remove Validator alias from config/application.php in order to avoid conflicts.
  • Add "required_if_attribute" => "The :attribute field is required." to application/language/[language]/validation.php.

Usage

Define the rule using:

required_if_attribute:[field],[operator],[value]

#!/usr/bin/env bash
# I recently had to install MySQL 5.6 on Ubuntu 12.04 from a .deb package on the MySQL website. It seems that either the package has been updated recently or nobody uses this method to install so I ended up running into endless problems. Through trial and error I found the following method works for me.
#Install libaio-dev:
sudo apt-get install libaio-dev
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.12-debian6.0-x86_64.deb/from/http://cdn.mysql.com/ -O mysql-server.deb
#Now install your package(mine was enterprise edition, community may have a different filename):
sudo dpkg -i mysql-server.deb
@ruslankonev
ruslankonev / tox.sh
Created February 10, 2014 09:09 — forked from urras/tox.sh
#!/bin/bash
## wget -O tox.sh https://gist.github.com/fr0stycl34r/6690783/raw && chmod +x ./tox.sh && ./tox.sh
# By cl34r and notadecent
rootcheck() {
if [ "id -u $USERNAME" = "0" ]; then
echo "Please do not run this script as root"
exit 1
fi
}
# Check if script is being run as root