Skip to content

Instantly share code, notes, and snippets.

View gelias's full-sized avatar

Guilherme Elias gelias

View GitHub Profile
@gelias
gelias / gist:46b60f7303b19e8f82d7b66c082dc6ab
Last active September 8, 2017 17:51
BRST - Brazilian Summer Time
Amazon Linux
- yum install tzdata
- vi /etc/sysconfig/clock
America/Sao_Paulo
- sudo ln -sf /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime
- zdump -v /etc/localtime |grep 2017
CentOS
- yum install tzdata
require 'pony'
# GMAIL
Pony.options = {:via => :smtp, :to => 'fulano@domain.com', :via_options => { :address => 'smtp.gmail.com', :port => '587', :enable_starttls_auto => true, :user_name => 'ciclano@domain.com', :password => '******', :authentication => :plain, :domain => 'localhost.localdomain'} }
Pony.mail(:subject => 'subject' ,:body => 'body')
# AWS/SES
Pony.options = {:via => :smtp, :from => 'verified-email@domain.com', :to => 'fulano@domain.com', :via_options => { :address => 'AWS-ENDPOINT', :port => '587', :enable_starttls_auto => true, :user_name => '*****', :password => '******', :authentication => :plain, :domain => 'localhost.localdomain'} }
Pony.mail(:subject => 'subject' ,:body => 'body')
FROM ubuntu:14.04
# SO requeriments
RUN sudo apt-get update -y
RUN apt-get install -y wget curl git python-virtualenv
RUN sudo echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
RUN sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
RUN sudo apt-get update -y
RUN apt-get install -y google-chrome-stable
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
curl -s -o /dev/null -w "%{http_code}" -XPOST 'URL' -d "data=VALUE"
CREATE OR REPLACE FUNCTION do_replication_log(remote_connection_info text, local_connection_info text, schema_name text, last_replication_date_hour timestamp with time zone)
RETURNS timestamp with time zone AS
$BODY$
DECLARE
RegistrosLoop RECORD;
remote_connection_id text;
local_connection_id text;
last_timestamp timestamp with time zone;
has_more_records boolean = false;
</dev/urandom tr -dc '123456789!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c32; echo ""
@gelias
gelias / build.gradle
Created August 17, 2016 12:54 — forked from alexlafroscia/build.gradle
JUnit Testing with Gradle
/*
* This build file was auto generated by running the Gradle 'init' task
* by 'alex' at '1/27/15 7:02 PM' with Gradle 2.2.1
*
* This generated file contains a commented-out sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at http://gradle.org/docs/2.2.1/userguide/tutorial_java_projects.html
*/
// Apply the java plugin to add support for Java
#!/bin/bash
HOST='host'
USER='username'
PASSWD='password'
REMOTE_FOLDER='remote_folder'
ftp -n -v $HOST << EOT
ascii
user $USER $PASSWD
prompt
#!/bin/ruby
full_filename = 'file.log'
text_to_search = 'string_to_search'
fileObj = File.new(full_filename, "r")
while (line = fileObj.gets)
if line.include? text_to_search
puts(line)