Skip to content

Instantly share code, notes, and snippets.

View fchevitarese's full-sized avatar

Frederico Rodrigues Chevitarese fchevitarese

View GitHub Profile
@fchevitarese
fchevitarese / autoexec.cfg
Created January 30, 2019 12:56 — forked from oswaldoacauan/autoexec.cfg
CS:GO - Useful binds
// Some useful binds for CS:GO
// ===================
// Launch Options: -console -novid -high -tickrate 128 -freq 144 +exec autoexec.cfg
// by Lamarkz
// Show damage given in the console
// ===================
developer "1"
con_filter_text "Damage given"
con_filter_text_out "Player:"
@fchevitarese
fchevitarese / boto_dynamodb_methods.py
Created May 25, 2018 02:50 — forked from martinapugliese/boto_dynamodb_methods.py
Some wrapper methods to deal with DynamoDB databases in Python, using boto3.
# Copyright (C) 2016 Martina Pugliese
from boto3 import resource
from boto3.dynamodb.conditions import Key
# The boto3 dynamoDB resource
dynamodb_resource = resource('dynamodb')
def get_table_metadata(table_name):
@fchevitarese
fchevitarese / mongodb-s3-backup.sh
Created March 29, 2018 15:36 — forked from eladnava/mongodb-s3-backup.sh
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
#!/bin/sh
# Make sure to:
# 1) Name this file `backup.sh` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x backup.sh
# 7) Test it out via ./backup.sh
@fchevitarese
fchevitarese / docker_mint18.sh
Created March 17, 2018 02:31 — forked from mcmaur/docker_mint18.sh
Install Docker on Linux Mint 18 Sylvia
#remove old
sudo apt-get remove docker docker-engine docker.io
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
@fchevitarese
fchevitarese / multiprocessing.py
Created March 2, 2017 15:07 — forked from rcaldwel/multiprocessing.py
python: multiprocessing example
#!/usr/bin/env python
import multiprocessing
import os
import requests
########################################################################
class MultiProcDownloader(object):
"""
Downloads urls with Python's multiprocessing module
@fchevitarese
fchevitarese / estados-cidades.json
Created September 1, 2016 01:59 — forked from letanure/estados-cidades.json
JSON estados cidades
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@fchevitarese
fchevitarese / new_key.sh
Created July 30, 2016 00:10 — forked from Miserlou/new_key.sh
Generate a new Django SECRET_KEY
python -c 'import random; import string; print "".join([random.SystemRandom().choice(string.digits + string.letters + "!#$%&\()*+,-./:;<=>?@[]^_{|}~" ) for i in range(100)])'
@fchevitarese
fchevitarese / 0_reuse_code.js
Created May 3, 2016 16:42
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@fchevitarese
fchevitarese / html_for_international_calling coes.htm
Created January 13, 2016 01:25 — forked from andyj/html_for_international_calling coes.htm
HTML <select> international calling codes for each country
<!-- country codes (ISO 3166) and Dial codes. -->
<select name="countryCode" id="">
<option data-countryCode="GB" value="44" Selected>UK (+44)</option>
<option data-countryCode="US" value="1">USA (+1)</option>
<optgroup label="Other countries">
<option data-countryCode="DZ" value="213">Algeria (+213)</option>
<option data-countryCode="AD" value="376">Andorra (+376)</option>
<option data-countryCode="AO" value="244">Angola (+244)</option>
<option data-countryCode="AI" value="1264">Anguilla (+1264)</option>
<option data-countryCode="AG" value="1268">Antigua &amp; Barbuda (+1268)</option>
@fchevitarese
fchevitarese / git-dropbox-fix.sh
Created January 9, 2016 09:31 — forked from hasantayyar/git-dropbox-fix.sh
Solution if you are using dropbox and git same time and if you get this error "fatal: Reference has invalid format: refs/heads/master conflicted copy"
find . -type f -name "* conflicted copy*" -exec rm -f {} \;
awk '!/conflicted/' .git/packed-refs > temp && mv temp .git/packed-refs