Skip to content

Instantly share code, notes, and snippets.

View ntorga's full-sized avatar

Northon Torga ntorga

View GitHub Profile

O presente termo se regerá pelas cláusulas, condições e anexos ao longo de todo este documento, todos celebrados por parte da (1) INFINITE COMPUTAÇÃO EM NUVEM LTDA – ME, e (2) o CONTRATANTE dos seus respectivos serviços, sendo eles:

(1) INFINITE, ou CONTRATADA, a empresa de sede na cidade de Santa Cruz de Minas, Estado de Minas Gerais, na Rua Sete de Setembro, nº 481 - CEP 36328-000, inscrito no CNPJ/MF sob o nº 26.407.618/0001-64.

(2) PESSOA FÍSICA ou PESSOA JURÍDICA identificada no cadastro do banco de dados eletrônico da INFINITE.

DEFINIÇÕES

As palavras e termos abaixo, que se repetirão ao longo do presente Termo, possuem as seguintes definições:

#!/bin/bash
#
# The script will perform most of the steps, however, you must edit a few settings manually AFTER running the script:
#
# 1) a) Replace Menu Lite with Whisker;
# b) All Icons - Search "format-justify-fill";
#
# 2) Settings -> Apparence -> Select Dark Mode;
#
# 3) Settings => Keyboard => App Shortcuts => Add "/usr/bin/flameshot gui" => Print Screen => Keep Flameshot.
@ntorga
ntorga / humanReadableBytesAdapter.ts
Created April 5, 2024 18:14
A human readable bytes adapter for TypeScript/JavaScript that is actually (and finally) readable.
function humanReadableBytesAdapter(rawBytesQuantity: number): string {
const bytesUnits = ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];
let unitSuffixIndex = 0;
const isQuantityNegative = rawBytesQuantity < 0;
const rawBytesQuantityAbsolute = Math.abs(rawBytesQuantity);
let shortestBytesNumeral = rawBytesQuantityAbsolute;
while (shortestBytesNumeral >= 1024 && unitSuffixIndex < bytesUnits.length - 1) {
shortestBytesNumeral /= 1024;
#!/bin/bash
#
# The script will perform most of the steps, however, you must edit a few settings manually AFTER running the script:
#
# 1) a) Replace Menu Lite with Whisker;
# b) Panel Preferences => Row Size 48px;
# c) All Icons - Search "format-justify-fill";
# b) Move bar to the top.
#
# 2) a) Settings -> Apparence -> Select Dark Mode;
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
#!/bin/bash
#
# The script will perform most of the steps, however, you must edit a few settings manually AFTER running the script:
#
# 1) Enable "Large Text" on Accessibility menu;
#
# 2) Settings => Keyboard => App Shortcuts => Add "/usr/bin/flameshot gui" => Print Screen => Keep Flameshot.
#
# 3) Configure AutoSSH for proxies.
#
#!/bin/bash
#
# The script will perform most of the steps, however, you must edit a few settings manually AFTER running the script:
#
# 1) a) Menu Whisker (the Start Menu) -> Properties => 90% opacity // Icon -> All Icons - Search "view-list-icons";
# b) Panel -> Panel Preferences => Row Size 48px;
# c) Windows Buttons -> Unmark "Show button labels";
# NOTE: I use 48px icons cause my screen is 4K.
#
# 2) a) Appearance => MacBuntu-Sierra-dark;
@ntorga
ntorga / convert-base64-images.sh
Created April 4, 2019 20:55
Decode base64 images into media files and replace the original file with WordPress upload folder. You need to upload the images into /wp-content/uploads/ after finishing.
#!/bin/bash
file=${1}
for extension in png jpeg jpg gif bmp; do
for image in `grep -ho "data:image/${extension};base64,[A-Za-z0-9+/=]*" ${file}`; do
image_signature=$(echo ${image} | md5sum | awk '{print $1}')
echo ${image} > ${image_signature}.hash
rm -f to-replace.script
echo "s|$(cat ${image_signature}.hash)|/wp-content/uploads/${image_signature}.${extension}|g" > to-replace.script
sed -i -f to-replace.script ${file}
sed -i "s|data:image/${extension};base64,||g" ${image_signature}.hash
@ntorga
ntorga / CSP Header for Fixing Mix Content Issues
Last active August 29, 2018 23:32
Works great on modern browsers, not on IE tho.
<ifModule mod_headers.c>
Header always set Content-Security-Policy "upgrade-insecure-requests;"
</IfModule>
INSERT INTO `users` (`id`, `role_id`, `is_published`, `date_added`, `created_by`, `created_by_user`, `date_modified`, `modified_by`, `modified_by_user`, `checked_out`, `checked_out_by`, `checked_out_by_user`, `username`, `password`, `first_name`, `last_name`, `email`, `position`, `timezone`, `locale`, `last_login`, `last_active`, `online_status`, `preferences`)
VALUES
(2, 1, 1, '2015-04-01 15:15:07', 1, 'Nobody', NULL, NULL, NULL, NULL, NULL, NULL, 'madmin', '$2y$13$VkE7UjFetqAM13oT4v/VYOfRCGrJ4hbr0zuwRZo6KVfDnNb16WFwy', 'Administrator', 'Uuser', 'user@local.host', NULL, NULL, NULL, NULL, NULL, 'offline', 'N;');