Skip to content

Instantly share code, notes, and snippets.

View andreztz's full-sized avatar
🔨
High tech, low life.

André P. Santos andreztz

🔨
High tech, low life.
View GitHub Profile
##
# Script to copy files and compress them and put them in a separate location
# Amit Sengupta, Sep 2015, HYD
# Written in Python 2.7
###
import os
import zipfile
import shutil
import math
def convertSize(size):
if (size == 0):
return '0B'
size_name = ("KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
i = int(math.floor(math.log(size,1024)))
p = math.pow(1024,i)
s = round(size/p,2)
return '%s %s' % (s,size_name[i])
@andreztz
andreztz / vagrant.md
Created September 6, 2016 21:33 — forked from guilhermewop/vagrant.md
vagrant instructions

Vagrant

Instalação do Vagrant

http://files.vagrantup.com/packages/7ec0ee1d00a916f80b109a298bab08e391945243/vagrant_1.2.7_i686.deb
@andreztz
andreztz / tmux.md
Created September 22, 2016 08:01 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@andreztz
andreztz / list2dict.py
Created October 3, 2016 20:29 — forked from f0t0n/list2dict.py
Converts lists of bookmarks in directories to dictionaries.
#!/usr/bin/env python
def list_to_dict(pages):
return {page['name']: page for page in pages}
def convert_bookmarks(bookmarks):
for root, directory in bookmarks['roots'].iteritems():
directory['children'] = list_to_dict(directory['children'])
if __name__ == '__main__':
import pygame
class Player(object):
def __init__(self, localmp3):
self.localmp3 = localmp3
self.play()
def play(self):
@andreztz
andreztz / pytumblr_example.py
Created November 14, 2016 03:17 — forked from 140am/pytumblr_example.py
Example of using the Python Tumblr API v2 Client
""" Tumblr API Example - Python CLI
"""
import oauth2
import urlparse
import pytumblr
REQUEST_TOKEN_URL = 'http://www.tumblr.com/oauth/request_token'
AUTHORIZATION_URL = 'http://www.tumblr.com/oauth/authorize'
ACCESS_TOKEN_URL = 'http://www.tumblr.com/oauth/access_token'
#!/usr/bin/env python
# Module : SysTrayIcon.py
# Synopsis : Windows System tray icon.
# Programmer : Simon Brunning - simon@brunningonline.net
# Date : 11 April 2005
# Notes : Based on (i.e. ripped off from) Mark Hammond's
# win32gui_taskbar.py and win32gui_menu.py demos from PyWin32
'''TODO
For now, the demo at the bottom shows how to use it...'''
https://wxpython.org/Phoenix/snapshot-builds/
wget -c https://wxpython.org/Phoenix/snapshot-builds/wxPython_Phoenix-3.0.3.dev2755+968784d.tar.gz
tar -vzxf wxPython_Phoenix-3.0.3.dev2759+07a7440.tar.gz
sudo pip install -r requirements.txt
sudo python3.6 build.py build install --python=/usr/bin/python3.6

Como instalar o postgresql e o pgadmin3 no archlinux.

$ sudo pacman -S postgresql pgadmin3

$ sudo apt-get install postgresql

$ $ sudo apt-get install postgresql-contrib

Antes de iniciar o postgresql: