Skip to content

Instantly share code, notes, and snippets.

View eos87's full-sized avatar

Helmy Giacoman eos87

View GitHub Profile
@eos87
eos87 / decorator
Last active October 11, 2015 13:57
decorator in python
def supercow_powers_required(func):
def wrapped_foo(request, **kwargs):
if request.user.is_someshit:
return func(request, **kwargs)
else:
return 'Denegado'
return wrapped_foo
@eos87
eos87 / countryinfo.py
Created October 13, 2012 22:15 — forked from pamelafox/countryinfo.py
Python list of country codes, names, continents, capitals, and pytz timezones
countries = [
{'timezones': ['Europe/Andorra'], 'code': 'AD', 'continent': 'Europe', 'name': 'Andorra', 'capital': 'Andorra la Vella'},
{'timezones': ['Asia/Kabul'], 'code': 'AF', 'continent': 'Asia', 'name': 'Afghanistan', 'capital': 'Kabul'},
{'timezones': ['America/Antigua'], 'code': 'AG', 'continent': 'North America', 'name': 'Antigua and Barbuda', 'capital': "St. John's"},
{'timezones': ['Europe/Tirane'], 'code': 'AL', 'continent': 'Europe', 'name': 'Albania', 'capital': 'Tirana'},
{'timezones': ['Asia/Yerevan'], 'code': 'AM', 'continent': 'Asia', 'name': 'Armenia', 'capital': 'Yerevan'},
{'timezones': ['Africa/Luanda'], 'code': 'AO', 'continent': 'Africa', 'name': 'Angola', 'capital': 'Luanda'},
{'timezones': ['America/Argentina/Buenos_Aires', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/Tucuman', 'America/Argentina/Catamarca', 'America/Argentina/La_Rioja', 'America/Argentina/San_Juan', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Ushuai
#######################################################################
# Automated Dev Environment Installation for APTrustDPN on Ubuntu 14.04
# Author: Jean M. Lescure
#
# To use:
# *download to home folder
# chmod 777 init.sh
# ./init.sh
#######################################################################
echo -e "\E[0;36m--> 1. Installing rabbitmq ...\E[0m"
@eos87
eos87 / init.sh
Last active August 29, 2015 14:02 — forked from jeanlescure/init.sh
#######################################################################
# Automated Dev Environment Installation for APTrustDPN on Ubuntu 14.04
# Author: Jean M. Lescure
# Contributors: Helmy Giacoman | @eos87
#
# To use:
# *download to home folder
# chmod 777 init.sh
# ./init.sh
#######################################################################
@eos87
eos87 / multiple_ssh_setting.md
Created October 30, 2015 18:08 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@eos87
eos87 / macosx_remove_java9.sh
Created May 8, 2018 17:42 — forked from schnell18/macosx_remove_java9.sh
MacOS X remove Java 9
sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.jdk/
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
@eos87
eos87 / slack_delete.py
Created November 30, 2018 22:09 — forked from jackcarter/slack_delete.py
Delete Slack files older than 30 days. Rewrite of https://gist.github.com/jamescmartinez/909401b19c0f779fc9c1
import requests
import time
import json
token = ''
#Delete files older than this:
ts_to = int(time.time()) - 30 * 24 * 60 * 60
def list_files():
@eos87
eos87 / byobuCommands.md
Last active June 10, 2019 10:55 — forked from jshaw/byobuCommands
Byobu Commands

Byobu Commands

    byobu                              Screen manager

Level 0 Commands (Quick Start)

Create a new window

@eos87
eos87 / mysql-docker.sh
Created July 15, 2019 13:43 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE