Skip to content

Instantly share code, notes, and snippets.

View thauanz's full-sized avatar
💭
🤓 🍻

Thauan Zatta thauanz

💭
🤓 🍻
View GitHub Profile
DULL=0
BRIGHT=1
FG_BLACK=30
FG_RED=31
FG_GREEN=32
FG_YELLOW=33
FG_BLUE=34
FG_VIOLET=35
FG_CYAN=36
{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 2,
# install missing libraries (if any)
cd ~
sudo yum update
yum install java-1.7.0-openjdk.x86_64
yum install unzip
yum install mc
yum install wget
yum install curl
# get and unpack elasticsearch zip file
@thauanz
thauanz / blacklist.rb
Last active September 24, 2015 01:16
Blacklist
module Blacklist
extend ActiveSupport::Concern
module ClassMethods
def where_blacklist(query)
where(query)
end
end
def self.included(r)
@thauanz
thauanz / uninstall.sh
Created August 10, 2016 11:49
Remove all gems with grep
$ gem list | grep 5.0.0 | cut -f1 -d' '
actioncable
actionmailer
actionpack
actionview
activejob
activemodel
activerecord
activesupport
railtie
@thauanz
thauanz / Dockerfile
Created September 6, 2016 21:14
Dockerfile for newspaper python3
FROM python:3.5
RUN apt-get install libxml2-dev libxslt-dev
RUN pip3 install newspaper3k && \
curl https://raw.githubusercontent.com/codelucas/newspaper/master/download_corpora.py | python3
@thauanz
thauanz / deploy.sh
Created December 5, 2016 19:16
Deployment for Marathon/Mesos
#!/bin/bash
ENVIRONMENT=$1
if [[ $ENVIRONMENT == '' ]]; then
echo "Specific ENVIRONMENT name like => ./deploy.sh production"
exit 0
fi
if [[ $IS_BUILD == '' ]]; then
@thauanz
thauanz / links.txt
Created January 27, 2018 09:27
Some links to study English
@thauanz
thauanz / ssh_config_generate.py
Created June 23, 2019 23:30
Generates SSH config from AWS instances
#!/usr/bin/env python
try:
import boto3
except ImportError:
print("Package boto3 not found")
env_name = input("Enter the environment variable name: ")
ec2 = boto3.client('ec2')
@thauanz
thauanz / jumpcloud.sh
Created May 7, 2020 07:52
JumpCloud Script to configurate and login
#!/usr/bin/env bash
set -euo pipefail
set -o allexport
# https://github.com/Versent/saml2aws#install
# https://anunknown.dev/articles/connecting-to-aws-using-saml
CMD=saml2aws