Skip to content

Instantly share code, notes, and snippets.

View rafael-neri's full-sized avatar
💻
Working from home

Rafael Neri rafael-neri

💻
Working from home
View GitHub Profile
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Example: ./kinfoservices --imagesize=32 --fileout=file.txt
'''
import os, sys
from xdg.DesktopEntry import *
from xdg.IconTheme import *
@rafael-neri
rafael-neri / webapps.py
Created June 18, 2014 00:08
Kaiana Webapps
#!/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
@rafael-neri
rafael-neri / modals.html
Created December 4, 2014 20:36
Resolve Conflicts UI Frameworks - Modal Bootstrap and Semantic
<html>
<head>
<title>Resolve Conflicts UI Frameworks</title>
<!-- styles -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap.min.css" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/1.0.1/semantic.min.css" />
</head>
<body>
@rafael-neri
rafael-neri / post-receive
Created April 28, 2016 19:53 — forked from geekforbrains/post-receive
Git post-receive rsync to remote server
#!/bin/bash
REPO=NAME_HERE
# Dir paths on remote server
# These are associated with branches within a git project
LIVE_BRANCH="master"
LIVE="git@host:/var/www/live/"
STAGE_BRANCH="develop"
STAGE="git@host:/var/www/stage/"
@rafael-neri
rafael-neri / 1-texto.md
Last active June 20, 2016 18:16
padrão fenix

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.

@rafael-neri
rafael-neri / interface_to_internet.sh
Last active July 13, 2016 18:53
Check Default Interface To Internet
#!/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)'
@rafael-neri
rafael-neri / makedeb.sh
Last active June 7, 2025 08:25
Simple script to create debian package
#!/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
@rafael-neri
rafael-neri / reinstall_packages.sh
Last active December 11, 2023 18:03
Reinstall All packages in Linux Arch Based
#!/bin/bash
pacman -Q | awk '{ print $1 }' | sort > /tmp/pacman-installed.tmp
pacman -Qm | awk '{ print $1 }' | sort | comm -3 /tmp/pacman-installed.tmp - > /tmp/pacman-to-reinstall.tmp
pacman -S --noconfirm $(cat /tmp/pacman-to-reinstall.tmp)
rm /tmp/pacman-{to-reinstall,installed}.tmp
@rafael-neri
rafael-neri / install_ionic_yarn.sh
Last active April 10, 2021 09:32
Install Ionic Using Yarn on Ubuntu
# Install Node
sudo apt-get install nodejs
# Link command node
sudo ln -s /usr/bin/nodejs /usr/bin/node
# Install CURL
sudo apt-get install curl