Skip to content

Instantly share code, notes, and snippets.

View josenicomaia's full-sized avatar

José Nicodemos Maia Neto josenicomaia

  • NicoMaia
  • São José dos Campos
View GitHub Profile
@josenicomaia
josenicomaia / opkg-upgrade-all.sh
Created November 12, 2022 22:11
Script to upgrade all OPKG's packages
#!/bin/bash
TEMPORARY_FOLDER="/tmp/opkg-upgrade-all"
TEMPORARY_UPGRADABLE_FILE=$TEMPORARY_FOLDER"/upgradable-packages.txt"
TEMPORARY_LOGFILE_PREFIX=""
TEMPORARY_LOGFILE_FOLDER=$TEMPORARY_FOLDER"/logs"
echo "# Updating package list"
opkg update
echo "# Retrieving packages to upgrade..."
@josenicomaia
josenicomaia / magic_operators_for_static_members.groovy
Created April 6, 2021 22:08
Groovy magic operators for static members
class M {
static Map m = [:]
static $static_propertyMissing(String name) {
m[name]
}
static $static_propertyMissing(String name, value) {
m[name] = value
}
}
M.x = 1
# Redis cert
cd c:/Softwares/certs
openssl genrsa -out key.pem 4096
openssl req -new -x509 -key key.pem -out cert.pem -subj "/CN=localhost" -days 1826
# Redis with SSL
docker run --name some-redis -d -p 6380:6379 -v c:/Softwares/certs:/certs --name some-redis-tls madflojo/redis-tls
@josenicomaia
josenicomaia / elementary_os_restart.sh
Created September 18, 2019 14:21
Restart ElementaryOS components
#!/bin/bash
killall wingpanel
killall plank
gala --replace &
#!/bin/bash
BASE="$HOME/.proxySelector"
CONFIG="$BASE-"$1
([ -z "$1" ] || [ ! -f $CONFIG ] ) && \
echo "Perfil invalido. Perfis disponiveis: " && \
for i in $(ls $HOME/.proxySelector-* | awk -F- '{print $2}'); do
echo "- $i"
done && \
exit 0
#!/bin/bash
CONFIGURACOES=($(ls $HOME/.proxySelector-* | awk -F- '{print $2}'))
for i in ${!CONFIGURACOES[@]}; do
echo $(($i + 1))" - ${CONFIGURACOES[$i]}"
done
echo -n "Selecione uma opcao [1-${#CONFIGURACOES[@]}]: "
read -n 1 SELECIONADO
echo
#!/bin/sh
# @FIX-1: Disables Alt + F7 to move window
gsettings set org.gnome.desktop.wm.keybindings begin-move "['']"
# @FIX-2: Pressing Super open the App Launcher
gsettings set org.pantheon.desktop.gala.behavior overlay-action "wingpanel --toggle-indicator=app-launcher"
# @FIX-3: Register IBUS to run at startup (solves accents problem at IntelliJ)
[ ! -f "$HOME/.config/autostart/ibus.desktop" ] && \
cat << EOF >> $HOME/.config/autostart/ibus.desktop && \
#!/bin/bash
# Get password to be used with sudo commands
# Script still requires password entry during rvm and heroku installs
echo -n "Enter password to be used for sudo commands:"
read -s password
# Function to issue sudo command with password
function sudo-pw {
echo $password | sudo -S $@
@josenicomaia
josenicomaia / doc.md
Created February 5, 2016 16:26 — forked from themasch/doc.md
unofficial docs of the LoL Spectator API

REST Service for LoL spectators

This is an unofficial, uncomplete and (pretty sure) wrong documentation of the RESTful service which powers the League of Legends spectator mode.

This documentation is desgined to be community driven and should be extended by everyone. If you find things missing, add them please!

How it works

Riot's spectator mode works by requesting replay data via HTTP form a service. The data is split in chunks which usually contain about 30 seconds of gameplay. Additionally there are key frames which seem to contain more information then a single chunk. They seem to be used to support

##################################
# ~/.ssh/config
##################################
Host bitbucket.org
Hostname altssh.bitbucket.org
Port 443