Skip to content

Instantly share code, notes, and snippets.

@diogoca
diogoca / cidade_estado.sql
Created July 30, 2016 20:02
SQL para cidades e estados brasileiros
CREATE TABLE IF NOT EXISTS `pais` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nome` varchar(60) DEFAULT NULL,
`sigla` varchar(10) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
INSERT INTO `pais` (`id`, `nome`, `sigla`) VALUES (1, 'Brasil', 'BR');
CREATE TABLE IF NOT EXISTS `estado` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nome` varchar(75) DEFAULT NULL,
@-moz-document url-prefix() {
.vertically-centered {
top: 46%;
}
}
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
/* IE10+ CSS styles go here */
@diogoca
diogoca / update.sh
Created June 13, 2016 15:07
How to install Apache 2.4 and PHP 5.6 on Amazon Linux
# AWS EC2
# Remove Apache and PHP old version
# Install Apache 2.4, Mod_SSL and PHP 5.6
#
sudo service httpd stop
sudo yum erase httpd httpd-tools apr apr-util
sudo yum remove php-*
sudo yum install php56
sudo yum install php56-xml php56-xmlrpc php56-soap php56-gd php56-mbstring
sudo yum install php56-mysqlnd
@diogoca
diogoca / diagonal_line.css
Created June 7, 2016 18:52
Yellow Diagonal Line CSS
.yellow-line{
content: ".";
margin-top:10px;
width:100%;
height:84px;
background: rgba(255,207,74,1);
background: -moz-linear-gradient(178.1deg, rgba(255,207,74,1) 0%, rgba(255,207,74,1) 57%, rgba(255,255,255,1) 58%, rgba(255,255,255,1) 100%);
background: -webkit-gradient(left top, right bottom, color-stop(0%, rgba(255,207,74,1)), color-stop(57%, rgba(255,207,74,1)), color-stop(58%, rgba(255,255,255,1)), color-stop(100%, rgba(255,255,255,1)));
background: -webkit-linear-gradient(178.1deg, rgba(255,207,74,1) 0%, rgba(255,207,74,1) 57%, rgba(255,255,255,1) 58%, rgba(255,255,255,1) 100%);
@diogoca
diogoca / Linux Static IP
Created November 20, 2015 15:26 — forked from fernandoaleman/Linux Static IP
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@diogoca
diogoca / gist:a9297dfb9b40e5b38d7b
Created November 20, 2015 14:39
Move /var to another partition
# First, boot into single user mode (edit boot, esc + e), add init=/bin/bash after ro
# Make sure any process writing to /var is stopped. (Check with lsof | grep /var)
mkdir -p /home/var
rsync -va /var /home/var
mv /var /var.old # you can remove /var.old when you are done to reclaim the space
mkdir -p /var
mount -o bind /home/var /var
# update your /etc/fstab to make the bind-mount permanent.
@diogoca
diogoca / redis-server
Last active August 29, 2015 14:19 — forked from tessro/redis-server
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid
@diogoca
diogoca / mount.sh
Created April 26, 2014 17:30
Mount Linux Example
#!/bin/bash
mount --bind -o rw /home/microscope/.meteor /media/sf_meteor/microscope/.meteor
@diogoca
diogoca / rsync_meteor.sh
Created April 26, 2014 17:30
Rsync Linux Example
#!/bin/bash
# EXIBIR COMANDOS EXECUTADOS
set -x
while true;
do
rsync -rtvu --exclude ".*" /media/sf_meteor/microscope/ /home/microscope
rsync -rtvu --exclude "local*" /home/microscope/.meteor/ /media/sf_meteor/microscope/.meteor
sleep 5
done
@diogoca
diogoca / gist:9981086
Created April 4, 2014 19:01
Using Meteor in a Shared Folder Environment
#In your home directory
meteor create newproject
#In your shared folder
meteor create newproject
#Virtual machine location first followed by shared folder location
sudo mount --bind ~/newproject/.meteor /media/sf_Program_Archive/newproject/.meteor