Skip to content

Instantly share code, notes, and snippets.

View brpaz's full-sized avatar

Bruno Paz brpaz

View GitHub Profile
@brpaz
brpaz / html5-starter.html
Last active August 29, 2015 14:08 — forked from grevory/html5-starter.html
#html5 #boilerplate
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML5 Starter Template</title>
<meta name="description" content="Starter Template">
<meta name="author" content="Gregry Pike">
<link rel="stylesheet" href="css/styles.css?v=1.0">
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
@brpaz
brpaz / CSS3 Media Queries Template
Last active August 29, 2015 14:08
#css #responsive #media-query
/*
* Author: http://stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries/
*/
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
@brpaz
brpaz / heroku_export_env.sh
Created November 2, 2014 10:33
Copies all the env variables from heroku to .env file. This file can be read locally by foreman. #heroku #env
heroku config -s >> .env
@brpaz
brpaz / mysql_export_csv.sh
Created November 2, 2014 10:38 — forked from JoshuaEstes/gist:6831131
mysql export table into CSV file #mysql #csv
mysql -u USERNAME -p DATABASE -e "select * from TABLE;" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g'
@brpaz
brpaz / deploy_user.sh
Last active August 29, 2015 14:08 — forked from JoshuaEstes/user.sh
creates a deploy user #linux #deploy
# Remote Server
useradd www-deploy -c "Deployment User" -d /home/www-deploy -G www-data -m -s /bin/bash
sudo su - www-deploy
# Localhost
ssh-keygen -t rsa
# Append your key to the Remote host authorized keys file
cat id_rsa.pub >> ~/.ssh/authorized_keys
@brpaz
brpaz / doctrine.distance_function.php
Last active August 29, 2015 14:08 — forked from Koc/gist:3016704
Doctrine2 DISTANCE function #doctrine #function
<?php
namespace Myako\Geographical\Functions;
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
/**
* "DISTANCE" "(" LatitudeFrom, LongitudetFrom, LatitudeTo, LongitudeTo ")"
*
@brpaz
brpaz / php.openssl_crypt.php
Created November 4, 2014 21:53 — forked from WietseWind/crypt.php
Private Key descryption, Cert encryption using PHP #php
<?php
/**
* openssl genrsa -des3 -out server.key 2048
* -- Optioneel (anders: passphrase gebruiken) openssl rsa -in server.key -out server.key.insecure
* openssl req -new -key server.key -out server.csr
* openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
*/
function EncryptData($source){
@brpaz
brpaz / rsync example.sh
Last active August 29, 2015 14:08 — forked from fduran/rsync example
#rsync
# www.fduran.com
# sync (copy) local to remote server directory
# take out dry-run after test
rsync --dry-run -azvrh -e 'ssh -p 2022' --exclude 'donotcopy' /var/www/ [email protected]:/var/www/
# options:
a: archive, preserve metadata
z: compression
v: verbose
@brpaz
brpaz / git_ignore_filemode.sh
Created November 10, 2014 22:02
tells git to ignore filemode changes #git
git config core.fileMode false
@brpaz
brpaz / change_hostname.md
Created November 15, 2014 10:15
chnage hostname #hostname #sysadmin #hostname

Change hostname of Linux machine

*Edit /etc/hostname, make the name change, save the file.

*You should also make the same changes in /etc/hosts file

  • Run sudo /etc/init.d/hostname restart or sudo service hostname restart