Skip to content

Instantly share code, notes, and snippets.

View lbrealdev's full-sized avatar
🏠
Selassie is the almighty !

akae lbrealdev

🏠
Selassie is the almighty !
  • High Places Of Anu
View GitHub Profile
@lbrealdev
lbrealdev / python-virtualenv-win.md
Last active June 17, 2023 20:51
Python Virtualenv For Windows

Virtualenv

Install

pip install virtualenv

pip install virtualenvwrapper-win
@lbrealdev
lbrealdev / cli.py
Created October 18, 2022 08:30
Python CLI
import argparse
from dataclasses import dataclass, field, asdict
import requests
import shutil
from datetime import datetime
import logging
class ValidationException(Exception):
pass
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@lbrealdev
lbrealdev / yt-dlp.md
Last active June 22, 2022 21:03
This document contains some commands to use yt-dlp.

yt-dlp

Download the best video quality available:

yt-dlp -f b https://www.youtube.com/$urlvideo

Get all the video quality options available for download:

yt-dlp -F https://www.youtube.com/$urlvideo
@lbrealdev
lbrealdev / desfazendo-push.md
Created March 30, 2020 09:39 — forked from davidalves1/desfazendo-push.md
Desfazendo um git push

Desfazendo um git push

Não é possível desfazer um push diretamente, como é feito com o commit utilizando o comando $ git reset --soft|mixed|hard hash-do-penultimo-commit

Para desfazer um push são necessários 3 passos:

  1. Utilizar o comando $ git reset --mixed hash-do-penultimo-commit e em seguida utilizar o comando $ git stash
  2. Utilizar o comando $ git revert hash-do-ultimo-commit
  3. Utilizar o comando $ git stash apply
@lbrealdev
lbrealdev / terraform-ssh-remote-exec.tf
Created February 21, 2020 00:24 — forked from toshimaru/terraform-ssh-remote-exec.tf
How to connect to server via SSH and use remote-exec provisioner.
resource "digitalocean_droplet" "web" {
image = "ubuntu-16-04-x64"
name = "web-1"
region = "sgp1"
size = "512mb"
ssh_keys = [12345]
connection {
type = "ssh"
user = "root"
@lbrealdev
lbrealdev / cmd-windows.txt
Last active July 17, 2019 10:53
Comandos úteis para o dia a dia Windows CMD.
Comandos Windows CMD
Autor: lbreal dev
# Comando para Windows [cmd] semelhante ao cat Linux/Unix
type test.txt
# Criar arquivo Windows [cmd] semelhante ao vi / touch /nano Linux/Unix
fsutil file createnew testfile.txt 1000
# 2º maneira de criar arquivos