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
@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
#!/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

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]

#!/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)

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
$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
<?php
/*
* Multilingual URLs in Laravel 4
*/
//config/app.php
return array(
...
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
@ruslankonev
ruslankonev / godaddy-ssl-howto
Last active September 8, 2015 11:03 — forked from ideaoforder/godaddy-ssl-howto
GoDaddy + Nginx SSL
openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr
http://support.godaddy.com/help/article/3601/generating-a-certificate-signing-request-nginx
http://support.godaddy.com/help/article/4976/rekeying-an-ssl-certificate
# Be sure to remember to chain them!
cat gd_bundle-g2-g1.crt >> yourdomain.crt
# Move 'em
sudo mv yourdomain.crt /etc/ssl/certs/yourdomain.crt
@ruslankonev
ruslankonev / setup-dev.sh
Created November 9, 2015 08:48
Install homebrew, nginx, mysql, php55, and composer on Mac OS X
#!/bin/bash
# install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install homebrew's official php tap
brew tap josegonzalez/homebrew-php