This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.dcu | |
*.ini | |
*.~* | |
*.bdsproj | |
*.cfg | |
*.dproj | |
*.dproj.local | |
*.bdsgroup | |
*.bdsgroup.local | |
*.bdsproj.local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
function proml { | |
local RED="\[\033[0;31m\]" | |
local LIGHT_RED="\[\033[1;31m\]" | |
local YELLOW="\[\033[0;33m\]" | |
local LIGHT_GREEN="\[\033[1;32m\]" | |
local WHITE="\[\033[1;37m\]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xml.instruct! :xml, :version => "1.0" | |
xml.rss :version => "2.0" do | |
xml.channel do | |
xml.title "Titulo do blog" | |
xml.description "Este é um blog sobre..." | |
xml.link posts_url | |
for post in @posts | |
xml.item do | |
xml.title post.title |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.generators do |g| | |
g.orm :mongoid | |
g.template_engine :erb | |
g.test_framework :rspec | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'nokogiri' | |
require 'find' | |
FIND_PATH = "/Users/warlley/Downloads/nfe" | |
Find.find(FIND_PATH) do |file_path| | |
if File.extname(file_path).downcase == '.xml' | |
nfe = Nokogiri::XML(File.open(file_path)) |
NewerOlder