Skip to content

Instantly share code, notes, and snippets.

@macndesign
Created April 16, 2014 16:07
Show Gist options
  • Save macndesign/10900027 to your computer and use it in GitHub Desktop.
Save macndesign/10900027 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
#--------------------------------------------------------------
# myposconfig.py - *Configuração após instalar Ubuntu 13.04 >
# Autor: Jhonathan Paulo Banczek
# 09-03-2014 - jhoonb.com
# Python 2.7 >
# - *configurações pessoais
#--------------------------------------------------------------
from subprocess import call
def remover_prog():
# lista de programas que serão removidos
progs = ['unity-lens-music', 'unity-lens-video',
'sudo apt-get remove deja-dup', 'sudo apt-get remove empathy*',
'gwibber*','transmission*', 'evolution*', 'thunderbird*', 'rhythmbox*',
'pidgin*']
#privacidade: lentes de shopping pesquisa online
call(['sudo', 'apt-get', 'remove', 'unity-lens-shopping', '-y'])
call(['gsettings', 'set', 'com.canonical.Unity.Lenses', 'remote-content-search', 'none'])
print("Copie o comando abaixo e execute no terminal:")
print("""sudo sh -c 'echo "127.0.0.1 productsearch.ubuntu.com" >> /etc/hosts'""")
input("[Enter]:")
#remove
for i in progs:
print("-" * 20, "Removendo: ", " ", i, "-" * 20)
call(['sudo', 'apt-get', 'remove', i, '-y'])
print("-" * 50)
#purge
for i in progs:
print("-" * 20, "purge: ", " ", i, "-" * 20)
call(['sudo', 'apt-get', 'purge', i, '-y'])
print("-" * 50)
def update_upgrade():
print("-" * 20, "executando Update e Upgrade ", "-" * 20)
call(['sudo', 'apt-get', 'install', 'ubuntu-restrict-extra', '-y'])
call(['sudo', 'apt-get', 'update', '-y'])
call(['sudo', 'apt-get', 'upgrade', '-y'])
def instala_java():
print("-" * 20, "INSTALANDO: ORACLE JAVA JDK7 ", "-" * 20)
call(['sudo', 'add-apt-repository', 'ppa:webupd8team/java'])
call(['sudo', 'apt-get', 'update'])
call(['sudo', 'apt-get', 'install' , 'oracle-jdk7-installer', '-y'])
def instala_flash():
print("-" * 20, "INSTALANDO: Flash Plugin ", "-" * 20)
call(['sudo', 'apt-add-repository', 'ppa:skunk/pepper-flash'])
call(['sudo', 'apt-get', 'update'])
call(['sudo', 'apt-get', 'install', 'pepflashplugin-installer', '-y'])
def instala_ling():
# Lua
print("-" * 20, "INSTALANDO: Lua ", "-" * 20)
call(['sudo', 'apt-get', 'install', 'lua5.2', 'lua5.2-doc', '-y'])
# Go
print("-" * 20, "INSTALANDO: Golang ", "-" * 20)
call(['sudo', 'apt-get', 'install', 'golang', '-y'])
# Haskell GHC
print("-" * 20, "INSTALANDO: Haskell Compiler GHC ", "-" * 20)
call(['sudo', 'apt-get', 'install', 'ghc', '-y'])
#exibe versoes:
print("\n", "----- VERSOES ----- ")
call(['go', 'version'])
print("\n")
call(['lua', '-v'])
print("\n")
call(['ghci', '--version'])
print("\n")
def instala_netflix():
print("-" * 20, "INSTALANDO: Netflix ", "-" * 20)
call(['sudo', 'apt-add-repository', 'ppa:ehoover/compholio', '-y'])
call(['sudo', 'apt-get', 'update'])
call(['sudo', 'apt-get', 'install', 'netflix-desktop', '-y'])
print("-" * 50)
def instala_progs():
# PPA's:
call(['sudo', 'add-apt-repository', 'ppa:ubuntu-wine/ppa', '-y'])
call(['sudo', 'apt-get', 'update', '-y'])
# Lista de Programas
progs = ['liferea', 'vlc', 'synaptic', 'chromium-browser', 'qbittorrent',
'youtube-dl', 'git-core', 'libappindicator1', 'filezilla', 'synapse',
'unity-tweak-tool', 'indicator-datetime', 'wine1.6','vim',
'python-pip']
for i in progs:
print("-" * 20, "INSTALANDO: ", i, " ", "-" * 20)
call(['sudo', 'apt-get', 'install', i, '-y'])
print("-" * 50)
# vlc pack
print("-" * 20, "VLC codecs libdvdread4", "-" * 20)
call(['sudo','/usr/share/doc/libdvdread4/install-css.sh'])
def todos():
remover_prog()
update_upgrade()
instala_progs()
instala_ling()
instala_java()
instala_flash()
instala_netflix()
if __name__ == '__main__':
call(["clear"])
print("\n|------------ myposconfig.py --------------- ")
print("|Opções: ")
print(('| 1 - Remove programas desnecessários e lentes.\n'
'| 2 - Update e Upgrade no S.O.\n'
'| 3 - Instala: Programas uteis.\n'
'| 4 - Instala: Java Oracle.\n'
'| 5 - Instala: Flash Player puppy.\n'
'| 6 - Instala Netflix.\n'
'| 7 - Instala Linguagens: Lua, Go, Haskell.\n'
'| selecione as opcoes(separado por espaço ou 0 para todas)'))
op = str(input("| >>>>> "))
if op.find("1") != -1:
remover_prog()
if op.find("2") != -1:
update_upgrade()
if op.find("3") != -1:
instala_progs()
if op.find("4") != -1:
instala_java()
if op.find("5") != -1:
instala_flash()
if op.find("6") != -1:
instala_netflix()
if op.find("7") != -1:
instala_ling()
if op.find("0") != -1:
todos()
print("-" * 50)
print("FINALIZADO! ")
print("-" * 50)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment