Skip to content

Instantly share code, notes, and snippets.

View tiagotele's full-sized avatar

Tiago tiagotele

  • Aquiraz, Ceará - Brazil
View GitHub Profile
@tiagotele
tiagotele / main.go
Created July 25, 2019 09:30
Getting started with github API
// Copyright 2015 The go-github AUTHORS. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// The basicauth command demonstrates using the github.BasicAuthTransport,
// including handling two-factor authentication. This won't currently work for
// accounts that use SMS to receive one-time passwords.
package main
#!/bin/bash
##############################################################################################
# Sample to assign output from command(ls) to a variable(files) and iterate over every file
# and print its name.
##############################################################################################
files=$(ls)
echo "Printing files"
curl -s "http://api.icndb.com/jokes/random" | jq '.value.joke'
After insert cd guest
- Double click on folder created on desktop
- Go to /media/<USER>/VBox_GAs_<VERSION>
- Run autorun.sh
Restart machine(not sure if it is needed)
Follow this steps: https://gist.github.com/estorgio/1d679f962e8209f8a9232f7593683265
@tiagotele
tiagotele / install-apt-vim.sh
Last active April 2, 2020 04:58
Installing apt-vim and nerdtree on Ubuntu distros
# install apt-vim
curl -sL https://raw.githubusercontent.com/egalpin/apt-vim/master/install.sh | sh
# add it to current path
source ~/.bashrc || source ~/.bash_profile' or 'source ~/.zshrc
#install apt-vim
apt-vim install -y https://github.com/preservim/nerdtree.git
@tiagotele
tiagotele / install-nerd-tree-cent-os.sh
Created April 3, 2020 14:36
Install NERDTree on CentOS
sudo yum install git
git clone https://github.com/preservim/nerdtree.git ~/.vim/pack/vendor/start/nerdtree
vim -u NONE -c "helptags ~/.vim/pack/vendor/start/nerdtree/doc" -c q
mkdir -p ~/.vim/autoload ~/.vim/bundle && curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
git clone https://github.com/preservim/nerdtree.git ~/.vim/pack/vendor/start/nerdtree
vim
@tiagotele
tiagotele / update-fork.sh
Created September 25, 2020 11:59
Update fork repository with origin one.
git fetch upstream
git checkout master
#git rebase upstream/master
git merge upstream/master
@tiagotele
tiagotele / set_java_version.sh
Created December 14, 2020 13:50
Get and set java versions
sudo update-alternatives --config java
#There are 2 choices for the alternative java (providing /usr/bin/java).
# Selection Path Priority Status
#------------------------------------------------------------
#* 0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
# 1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
# 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
import re
regex_original = r"^[a-zA-Z0-9]+ ([a-zA-Z0-9]+ *)+$"
regex_latin = r"^[a-zA-ZÀ-ÿ0-9]+ ([a-zA-ZÀ-ÿ0-9]+ *)+$"
names = [ "Nome Sobrenome",
"José Luiz",
"Maria Conceição",
"007 agente",
"Pedro Primeiro",
alias k=kubectl
export do="--dry-run=client -o yaml"
export f="--grace-period=0 --force"
# if you need a curl
k run curl --image=busybox:1.28 -- sleep 4800