Skip to content

Instantly share code, notes, and snippets.

View henriquecarv's full-sized avatar

Henrique Carvalho da Cruz henriquecarv

View GitHub Profile
@henriquecarv
henriquecarv / gcp_registry_clean.sh
Last active July 24, 2020 13:13
Remove multiple GCP Docker registry images
#!/bin/bash
GOOGLE_PROJECT_ID="example-id"
GCLOUD_SERVICE_KEY="serviceAccount.json content"
# eu.grc.io, etc...
ZONE="gcr.io"
SERVICE_ACCOUNT_FILE_NAME="google_service_account.json"
function gcp_auth {
echo "${GCLOUD_SERVICE_KEY}" | base64 -d > $SERVICE_ACCOUNT_FILE_NAME
@henriquecarv
henriquecarv / ubuntu_setup.bash
Last active March 12, 2020 16:24
Bene Studio - Ubuntu setup - bash script
#!/bin/bash
LIST_OF_APPS="ubuntu-restricted-extras curl gparted neovim mysql-workbench vim gedit p7zip-full p7zip-rar shutter libfreerdp-plugins-standard chromium-browser libnss3-tools vlc firefox libpng-dev net-tools apt-transport-https ca-certificates software-properties-common"
# Update app repository, upgrade installed application
sudo apt update && sudo apt upgrade -y
# ttf-mscorefonts-installer
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt install ttf-mscorefonts-installer -y
@henriquecarv
henriquecarv / aws_certificate.config
Last active October 17, 2019 15:31
AWS_EB_Certificate config file
# Dont forget to set the env variable "certdomain", and either fill in your email below or use an env variable for that too.
# Also note that this config is using the LetsEncrypt staging server, remove the flag when ready!
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]}
IpProtocol: tcp
ToPort: 443
@henriquecarv
henriquecarv / PC_Boxstarter.ps1
Last active March 16, 2019 17:27
Basic Windows 10 setup
#Open CMD and execute START http://boxstarter.org/package/url? FOLLOWED BY THIS GIST'S URL
function SetPowerPlan([string]$PreferredPlan)
{
Write-Host "Setting Powerplan to $PreferredPlan"
$guid = (Get-WmiObject -Class win32_powerplan -Namespace root\cimv2\power -Filter "ElementName='$PreferredPlan'").InstanceID.tostring()
$regex = [regex]"{(.*?)}$"
$newpowerVal = $regex.Match($guid).groups[1].value
# setting power setting to high performance
powercfg -S $newpowerVal
@henriquecarv
henriquecarv / l2tp.bash
Created February 25, 2019 15:44
VPN L2TP Connections
#!//bin/bash
# VPN L2TP Connections
sudo add-apt-repository ppa:nm-l2tp/network-manager-l2tp
sudo apt update
sudo apt install network-manager-l2tp
# Name the new VPN connection something
# Put the hostname or address in the Gateway field.
# Put username in the Username field.
@henriquecarv
henriquecarv / update_homolog_link.bash
Last active November 12, 2018 14:00
Bash script for homolog environment link update
@henriquecarv
henriquecarv / keybindings.json
Last active March 7, 2019 16:57
Visual Studio Code - Key Bindings
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "shift+alt+a",
"command": "editor.action.formatDocument",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "shift+alt+s",
"command": "extension.prettierDocument"
@henriquecarv
henriquecarv / ubuntu_setup.bash
Last active March 8, 2021 07:54
Ubuntu 18.04 - Development environment setup (NodeJS, VirtualBox, Docker, Git, Slack, Skype, VSCode, Vim, Chromium, Chrome, .NET Core SDK)
#!/bin/bash
LIST_OF_APPS="ubuntu-restricted-extras synaptic gnome-shell-extensions chrome-gnome-shell playonlinux curl gparted neovim mysql-workbench vim gedit p7zip-full p7zip-rar shutter libfreerdp-plugins-standard chromium-browser libnss3-tools vlc firefox libpng-dev net-tools apt-transport-https ca-certificates software-properties-common"
# Update app repository, upgrade installed application
sudo apt update && sudo apt upgrade -y
# ttf-mscorefonts-installer
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt install ttf-mscorefonts-installer -y
@henriquecarv
henriquecarv / settings.json
Last active June 6, 2019 11:33
Visual Studio Code Settings
{
"workbench.iconTheme": "vscode-icons",
"workbench.colorTheme": "One Dark+ (Sublime)",
"workbench.startupEditor": "newUntitledFile",
"breadcrumbs.enabled": true,
"prettier.eslintIntegration": true,
"prettier.stylelintIntegration": true,
"prettier.tslintIntegration": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"explorer.confirmDelete": false,
@henriquecarv
henriquecarv / install_warsaw.bash
Last active October 3, 2018 19:14
Itau Warsaw Guardian Installer - Ubuntu 18.04
#!/bin/bash
sudo apt update
cd ~/Downloads
wget https://guardiao.itau.com.br/warsaw/warsaw_setup_64.deb
dpkg-deb -x ~/Downloads/warsaw_setup_64.deb /tmp/warsaw
dpkg-deb --control warsaw_setup_64.deb /tmp/warsaw/DEBIAN/
sudo sed -i -e 's/python-gpgme,//g' /tmp/warsaw/DEBIAN/control
sudo sed -i -e 's/libcurl3/libcurl4/g' /tmp/warsaw/DEBIAN/control
sudo apt -y install python-pip