CREATE DATABASE {table name};
CREATE USER '{user name}'@'localhost' IDENTIFIED BY '{pass}';
curl https://raw.githubusercontent.com/creationix/nvm/v0.10.0/install.sh | bash | |
source ~/.bashrc #.bash_profile,whatever | |
nvm install 0.10 | |
nvm alias default 0.10 | |
npm install -G nodejs | |
#complete and happy |
# Expire rules for static content | |
# No default expire rule. This config mirrors that of apache as outlined in the | |
# html5-boilerplate .htaccess file. However, nginx applies rules by location, | |
# the apache rules are defined by type. A concequence of this difference is that | |
# if you use no file extension in the url and serve html, with apache you get an | |
# expire time of 0s, with nginx you'd get an expire header of one month in the | |
# future (if the default expire rule is 1 month). Therefore, do not use a | |
# default expire rule with nginx unless your site is completely static |
location \/ { | |
try_files $uri $uri/ /index.php$is_args$args; | |
} | |
# pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock | |
location ~ \.php$ { | |
try_files $uri \/index.php =404; | |
fastcgi_pass unix:/srv/web/etc/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
#!/bin/bash | |
function upgrade_os { | |
echo 'Upgrading the OS' | |
sudo apt-get update > /dev/null | |
sudo apt-get upgrade -y > /dev/null | |
} | |
function essentials { | |
echo 'Installing essentials' |
<?php | |
$timeTarget = 0.2; | |
$cost = 9; | |
do { | |
$cost++; | |
$start = microtime(true); | |
password_hash("test", PASSWORD_BCRYPT, ["cost" => $cost]); | |
$end = microtime(true); | |
} while (($end - $start) < $timeTarget); |
Laravel has an awesome command called "tinker". This is just a really quick way for you to interact with your application in the command line. It has a great use for debugging new models. Let's check out a quick example:
php artisan tinker
You are now dropped into a PHP terminal. Here you can input whatever you want to execute, like the following.
$user = new User;
$user->first_name = Adam;