Skip to content

Instantly share code, notes, and snippets.

View lira's full-sized avatar
🐢
Working from home

Fernando Lira lira

🐢
Working from home
View GitHub Profile
@lira
lira / gist:6e91b2b74f48515acfaccfa9c77cf69b
Created September 19, 2023 18:29 — forked from davidhemphill/gist:5188894
How to do a Git clone without the .git directory
// Clone the repo
git clone --depth=1 git://someserver/somerepo dirformynewrepo
// Remove the .git directory
rm -rf !$/.git
@lira
lira / ddns-start
Created July 10, 2023 15:26 — forked from greysAcademicCode/ddns-start
Google Domains DDNS registration script
#!/bin/sh
# see: https://github.com/RMerl/asuswrt-merlin/wiki/Custom-DDNS#google-domains
# this script could go into /jffs/scripts of a router running Merlin's asus-wrt firmware
# you must then choose the "Custom" option for DDNS in the router's web interface
# it registers the WAN IP of the router with Google Domains' DDNS system
# get your login info from yout Google Domains dashboard
IP=$1
USER=
PASS=
{
"meta": {
"theme": "elegant"
},
"basics": {
"name": "Fernando Lira",
"label": "Senior Software Engineer",
"image": "https://avatars0.githubusercontent.com/u/1247740?s=460&u=38f220a2c9c658141804f881c334c594eb1642ac&v=4",
"summary": "I'm a Software Engineer at Mercado Livre, a big player of marketplace, with multi-language environment. I'm worked with SysAdmin and SysOp Linux too.",
"website": "https://liraf.dev",
@lira
lira / awscreds_encrypt.sh
Created January 6, 2023 19:05 — forked from benhagen/awscreds_encrypt.sh
BASH script to take your two AWS environment vars, and encrypt them via AES-256. Store these values in a generated shell script which can be sourced to apply the variables when the correct password is given.
#!/bin/bash
read -sp "Enter encryption password: " PASSWORD
echo ""
read -sp "Confirm encryption password: " PASSWORD_CONFIRM
echo ""
if [[ "$PASSWORD" != "$PASSWORD_CONFIRM" ]]; then
echo "ERROR: Passwords do not match!"
exit 1
@lira
lira / mercadopago-iva.php
Created March 10, 2022 19:40 — forked from GiovanniCavallari/mercadopago-iva.php
IVA Customization for mercadopago plugin for woocommerce
/**
* WC_WooMercadoPago_PreferenceAbstract.php
*/
// Declare the taxes variable at the beginning of the file
protected $taxes;
// Set the value on constructor
$this->taxes = 500;
@lira
lira / woo-events.js
Created February 24, 2022 12:11 — forked from bagerathan/woo-events.js
[Woocommerce Javascript events] #woo
//Woocommerce Checkout JS events
$( document.body ).trigger( 'init_checkout' );
$( document.body ).trigger( 'payment_method_selected' );
$( document.body ).trigger( 'update_checkout' );
$( document.body ).trigger( 'updated_checkout' );
$( document.body ).trigger( 'checkout_error' );
//Woocommerce cart page JS events
$( document.body ).trigger( 'wc_cart_emptied' );
$( document.body ).trigger( 'update_checkout' );
@lira
lira / LICENSE
Created January 5, 2021 19:43 — forked from colingourlay/LICENSE
Standalone getScript. This performs the same ability as jQuery.getScript, including the optional callback, but doesn't support the Promises implementation shared with all the other jQuery.ajax methods.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@lira
lira / index.md
Last active December 17, 2020 14:57
Satisfy Chromium/Chrome 58+ strict requirements for self-signed HTTPS/SSL cert

Satisfy Chromium/Chrome 58+ strict requirements for self-signed HTTPS/SSL cert

Create CA key and cert

openssl genrsa -out server_rootCA.key 2048
openssl req -x509 -new -nodes -key server_rootCA.key -sha256 -days 3650 -out server_rootCA.pem

Create server_rootCA.csr.cnf

@lira
lira / bg.sh
Created February 10, 2020 22:24
#!/bin/bash
#RES=$(xdpyinfo | grep dimensions | egrep -o '([0-9]{4}x[0-9]{3,4})')
wget -O /tmp/wallpaper.jpg https://source.unsplash.com/2560x1080/?cityspace,space
wget -O /tmp/screensaver.jpg https://source.unsplash.com/2560x1080/?cityspace,space
gsettings set org.gnome.desktop.background picture-uri file:///tmp/wallpaper.jpg
gsettings set org.gnome.desktop.screensaver picture-uri file:///tmp/screensaver.jpg
// time and time end
console.time("This");
let total = 0;
for (let j = 0; j < 10000; j++) {
total += j
}
console.log("Result", total);
console.timeEnd("This");
// Memory