Skip to content

Instantly share code, notes, and snippets.

@warlley
warlley / gist:5603211
Last active December 17, 2015 11:38
Centos Web Server Setup
# useradd deploy
# passwd deploy
# visudo
// Add line
deploy ALL=(ALL) ALL
$ sudo yum groupinstall "Development Tools"
$ sudo yum install openssl-devel readline-devel curl-devel
@warlley
warlley / nginx
Last active December 17, 2015 11:38
#!/bin/sh
#
# nginx – this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /opt/nginx/conf/nginx.conf
# pidfile: /opt/nginx/logs/nginx.pid
# CentOS 6.3 barebones walkthrough script for a new vps rails server instance
# assumes you already have a personal ssh key locally
# script implements the following security approaches:
# disables root login
# configures ssh setup for sys user
# opens up standard ports
#
# setup includes:
# rvm & ruby-1.9.3-p286
# mysql
select * from (
select pk_codigo_pro, dt_entrada_nfi, preco_unt_nfi,
row_number() over (partition by pk_codigo_pro order by dt_entrada_nfi) as rownumber
from siai.mov_nf_entra_itens
) as a
where a.rownumber = 1
#!/usr/bin/env bash
# login as root and run this script via bash & curl:
apt-get update
apt-get install -y build-essential bison openssl libreadline5 libreadline5-dev curl \
git-core zlib1g zlib1g-dev libopenssl-ruby libcurl4-openssl-dev libssl-dev \
libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libmysqlclient-dev \
mysql-client mysql-server