Skip to content

Instantly share code, notes, and snippets.

View rogeriopradoj's full-sized avatar
😀

Rogerio Prado de Jesus rogeriopradoj

😀
View GitHub Profile
@blackgate
blackgate / mbp2011-disable-amd-gpu.md
Last active November 22, 2023 01:23
Macbook Pro 2011 - Disable AMD GPU
@mohamadaliakbari
mohamadaliakbari / ubuntu-run-dhclient-on-startup.md
Last active November 6, 2023 19:33
Run dhclient on Startup in Ubuntu 18.04

dhclient is the Dynamic Host Configuration Protocol (DHCP) Client one would use to allow a client to connect to a DHCP server.

$ sudo nano /etc/rc.local

#!/bin/bash
dhclient
exit 0
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@tenzap
tenzap / Readme.md
Last active October 26, 2023 17:55 — forked from cunneen/Readme.md
Install OpenGApps In Android Emulator (up to API31 / android 12 / S)

Introduction

This works to install OpenGApps into the Android Emulator

Features:

  • uses opengapps installer script (that we patch slightly)
  • linux only because we mount the ext2/4 disk images to modify them. Could be adapted for macos if you use hdiutil instead of kpartx and have installed tools to mount ext2/4 filesystems on macos
  • root permissions mandatory to mount disk images and enter chroot
  • removes verity/verified-boot from the virtual device (so that the AVD can boot, otherwise it would not boot because we didn't update the dm_params)
@ssky87
ssky87 / entware zerotier
Created February 6, 2021 01:40 — forked from cretudorin/entware zerotier
LibreElec / CoreElec ZeroTier
// install entware
installentware // for coreelec
wget -O - http://bin.entware.net/armv7sf-k3.2/installer/generic.sh | sh // for libreelec rasbperry 3
// update && install zerotier
opkg update
opkg install zerotier
// start the daemon
@beancurd1
beancurd1 / autostart.sh
Created March 8, 2020 03:19
CoreELEC or LibreELEC autostart.sh to auto start scripts upon reboot
# this located in /storage/.config/autostart.sh on a CoreELEC box, run chmod +x to make it executable
# use nohup to run the script in the backgroud
# nohup /storage/freemyip/updateDynDNS.sh &
# use this to run once off tasks
(
# pause few seconds to wait for network & time services to start
sleep 5
DT=$(date +"%m-%d-%Y, %r")
echo "Box rebooted on $DT, running tasks in autostart.sh" >> /storage/freemyip/DynDNSUpdate.log
@milolav
milolav / Portable_WhatsApp.md
Last active July 23, 2023 12:58
Making WhatsApp desktop application portable

Portable desktop WhatsApp

You start multiple instances of WhatsApp using --user-data-dir flag providing the full path to the directory. For example:

E:\Temp\Whatsapp>WhatsApp.exe --user-data-dir=E:\Temp\Whatsapp\number1

or by creating a shortcut with the flag.

@splaspood
splaspood / bash_iniparse.sh
Created December 13, 2011 20:34
Parsing INI Files with Bash
cfg.parser () {
fixed_file=$(cat $1 | sed 's/ = /=/g') # fix ' = ' to be '='
IFS=$'\n' && ini=( $fixed_file ) # convert to line-array
ini=( ${ini[*]//;*/} ) # remove comments
ini=( ${ini[*]/#[/\}$'\n'cfg.section.} ) # set section prefix
ini=( ${ini[*]/%]/ \(} ) # convert text2function (1)
ini=( ${ini[*]/=/=\( } ) # convert item to array
ini=( ${ini[*]/%/ \)} ) # close array parenthesis
ini=( ${ini[*]/%\( \)/\(\) \{} ) # convert text2function (2)
ini=( ${ini[*]/%\} \)/\}} ) # remove extra parenthesis
@andrealbinop
andrealbinop / setup-modernie-vagrant-boxes.md
Last active May 28, 2023 01:54
Setup modern.ie vagrant boxes

Setup modern.ie vagrant boxes

Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.

However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.

Pre-requisites

@squeedee
squeedee / 1.Readme.MD
Last active May 12, 2023 19:46
Adding your ssh key to lastpass

Setup

  1. Install lpass, the last pass command line tool
brew install lastpass-cli --with-pinentry
  1. Create a passphrase encrypted key and make sure you put the public key where you need it, eg: github