Skip to content

Instantly share code, notes, and snippets.

View hudsantos's full-sized avatar

Hudson Santos hudsantos

View GitHub Profile
@hudsantos
hudsantos / clean_memory.sh
Created December 2, 2015 10:46
Simple ShellScript to free your memory and cache on Linux systems
#!/bin/sh
before=`free -m| grep -A1 free|tail -1 | awk '{print $4}'`
echo "free memory before: $before Mbytes"
echo "cleaning mem!"
sync; echo 3 > /proc/sys/vm/drop_caches
after=`free -m| grep -A1 free|tail -1 | awk '{print $4}'`
gift=`expr $after - $before`
echo "free memory after: $after Mbytes (gift of $gift Mbytes)"
echo "done."
@hudsantos
hudsantos / LICENSE
Created April 26, 2017 06:23 — forked from faizal2007/LICENSE
Bash Image Optimization for web
The MIT License (MIT)
Copyright (c) 2013 wackoen
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@hudsantos
hudsantos / oauth_bb.js
Last active August 2, 2024 13:42
Como conseguir o token do Banco do Brasil usando JavaScript (nodejs)
// Em BASH puro, usando cURL ficaria assim:
// curl --basic --request POST \
// --url "https://oauth.hm.bb.com.br/oauth/token/?grant_type=client_credentials&scope=cobranca.registro-boletos" \
// --header 'Authorization: Basic your_top_secret_base64_encoded_credentials==' \
// --header 'Content-Type: application/x-www-form-urlencoded' \
// --header 'cache-control: no-cache'
// Thanks to: http://andreybleme.com/2017-05-27/como-funciona-o-protocolo-oauth-20/
@hudsantos
hudsantos / automatically_approve_hangouts_meet_participants.js
Last active April 19, 2020 23:32
This approves someone to join your meeting, and logs it to a http server backend.. without further controls.. use at your own risk
const Http = new XMLHttpRequest();
setInterval(() => {
// Lets find if someone is waiting to join:
// If yes, it would exist an element with the following text inside it:
let string = "Alguém quer participar desta reunião"
ask_for_approval_element = document.evaluate('//*[text()="' + string + '"]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE).snapshotItem(0)