This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
''' | |
Example: ./kinfoservices --imagesize=32 --fileout=file.txt | |
''' | |
import os, sys | |
from xdg.DesktopEntry import * | |
from xdg.IconTheme import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
from PyQt5.QtWidgets import QApplication | |
from PyQt5.QtWebKit import QWebSettings | |
from PyQt5.QtWebKitWidgets import QWebView | |
from PyQt5.QtCore import QUrl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Name=My Applications | |
Name[es]=Mi aplicacione | |
Name[pt_BR]=Meu Aplicativo | |
Comment=My Comment | |
Comment[es]=Mi comentario | |
Comment[pt_BR]=Meu comentário | |
Exec=/usr/bin/app --abc | |
Icon=preferences-desktop-theme | |
Categories=XPTO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# aptinstall.py | |
import apt | |
import sys | |
pkg_name = "firefox" | |
cache = apt.cache.Cache() | |
cache.update() |
Depois do manifesto dos Programadores Que Se Garantem chegou por aqui um novo Padrão de Projeto.
Note que um padrão de projeto é uma arte. Não são todas as pessoas que sabem usá-los, muito menos entendê-los. Esse padrão é especial, "Padrão Fênix", "Exceção Fenix" ou em inglês e mais chic: Phoenix Exception!
A Phoenix Exception consiste em um sistema que nunca morre, pois assim como a Phoenix, ele sempre renasce das cinzas.
Veja um exemplo da Phoenix Exception.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# host we want to "reach" | |
host=google.com | |
# get the ip of that host (works with dns and /etc/hosts. In case we get multiple ipaddresses, we just want one of them | |
host_ip=$(getent ahosts "$host" | head -1 | awk '{print $1}') | |
# only list the interface used to reach a specific host/IP. We only want the part between dev and src (use grep for that) | |
ip route get "$host_ip" | grep -Po '(?<=(dev )).*(?= src)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Distributed under the GNU GPL | |
# Check if user is root | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
# Get path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# paci - install one or more packages | |
# pacu - upgrade all packages to their newest version | |
# pacr - uninstall one or more packages | |
# pacs - search for a package using one or more keywords | |
# pacinfo - show information about a package | |
# pacinstalled - show if a package is installed | |
# paca - list all installed packages | |
# paclo - list all packages which are orphaned | |
# pacdnc - delete all not currently installed package files | |
# pacfiles - list all files installed by a given package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
from PyQt5.QtWidgets import QApplication | |
from PyQt5.QtWebKitWidgets import QWebView | |
from PyQt5.QtGui import QIcon | |
from PyQt5.QtCore import QUrl | |
from PyQt5.QtCore import QSize |
OlderNewer