Skip to content

Instantly share code, notes, and snippets.

View vctrtvfrrr's full-sized avatar
🇧🇷
(╯°□°)╯︵ ┻━┻

Victor Otávio Ferreira vctrtvfrrr

🇧🇷
(╯°□°)╯︵ ┻━┻
View GitHub Profile
@vctrtvfrrr
vctrtvfrrr / best-ubuntu-apt-mirror.sh
Created August 9, 2019 14:41
Oneliner that select best (by download speed) mirror based on mirrors.ubuntu.com for yours ip
# Oneliner that select best (by download speed) mirror based on mirrors.ubuntu.com for yours ip.
curl -s http://mirrors.ubuntu.com/mirrors.txt | xargs -n1 -I {} sh -c 'echo `curl -r 0-102400 -s -w %{speed_download} -o /dev/null {}/ls-lR.gz` {}' |sort -g -r |head -1| awk '{ print $2 }'
@vctrtvfrrr
vctrtvfrrr / elements-inconsistencies.css
Created September 9, 2019 12:19
Easily identify inconsistencies on elements with transparency
* { background-color: rgba(255,0,0,.2); }
* * { background-color: rgba(0,255,0,.2); }
* * * { background-color: rgba(0,0,255,.2); }
* * * * { background-color: rgba(255,0,255,.2); }
* * * * * { background-color: rgba(0,255,255,.2); }
* * * * * * { background-color: rgba(255,255,0,.2); }
* * * * * * * { background-color: rgba(255,0,0,.2); }
* * * * * * * * { background-color: rgba(0,255,0,.2); }
* * * * * * * * * { background-color: rgba(0,0,255,.2); }
@vctrtvfrrr
vctrtvfrrr / docker.sh
Last active September 7, 2020 19:39
Docker commands to run temporary applications quickly
docker run -it --rm -p 80:80 -p 443:443 -w /etc/nginx nginx:alpine --name temp_nginx /bin/sh
docker run --rm -p 3306:3306 -e MYSQL_DATABASE=temp_database -e MYSQL_ROOT_PASSWORD=secret --name temp_mariadb mariadb:latest
docker run --rm -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=secret --name temp_mongo mongo:latest
docker run -it --rm --name temp_node node:lts /bin/bash
docker run -it --rm --name temp_php henesyslab/php:latest /bin/bash
docker run -it --rm -v ${PWD}:/app -w /app --name temp_go golang:latest /bin/bash
@vctrtvfrrr
vctrtvfrrr / backup.sh
Created September 2, 2020 13:17
Backup home folder with rsync
rsync -avh --progress --exclude-from "exclude-list.txt" /home/my_user /mnt/mounts/backups/
@vctrtvfrrr
vctrtvfrrr / ffmpeg.sh
Created September 3, 2020 13:58
Manipulating video files with FFmpeg
# Remove audio from video file
ffmpeg -i INPUT_FILE -c copy -an OUTPUT_FILE
@vctrtvfrrr
vctrtvfrrr / component.js
Created September 11, 2020 17:24
Order for component properties in Vue.js
export default {
name: "",
components: {},
mixins: [],
data () {},
beforeCreate() {},
created() {},
beforeMount () {},
mounted() {},
computed: {},
@vctrtvfrrr
vctrtvfrrr / .aliases
Created January 16, 2021 13:03
Aliases for Bash and ZSH
# APT
alias dpki='sudo dpkg -i'
alias apti='sudo apt install -y'
alias update="sudo apt-get update ; sudo apt-get -y upgrade ; sudo apt-get -y dist-upgrade; aptclean"
alias aptclean="sudo apt-get -y autoremove ; sudo apt-get -y autoclean; sudo apt-get install -f ; sudo apt-get clean"
# Files & folders
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
@vctrtvfrrr
vctrtvfrrr / gist:cc3ff4852e1efbbe6ca62083837f7e37
Created June 7, 2021 23:47
Conventional commits / Feature branch
<build>: Build related changes (eg: npm related/ adding external dependencies)
<chore>: A code change that external user won't see (eg: change to .gitignore)
<docs>: Documentation related changes
<feat>: Introduction of a new feature
<fix>: Resolve an issue directly linked to development (bugfixes)
<hotfix>: Resolve an issue directly linked to production (patches)
<test>: Add/Update test cases
<perf>: Add code that improves performance
<refact>: Update for code for maintainability (clean code)
@vctrtvfrrr
vctrtvfrrr / github_gpg_key.md
Created September 3, 2021 20:38 — forked from ankurk91/github_gpg_key.md
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
@vctrtvfrrr
vctrtvfrrr / gist.md
Created May 28, 2022 21:04
Fix locale error on Ubuntu

microsoft/vscode#110286 (comment)

  1. open the terminal in vscode and type locale and see which language it is
  2. type in the terminal sudo nano /etc/locale.gen and scroll down and remove # in front the language which is
  3. type in terminal sudo locale-gen that it ! it is solved