Skip to content

Instantly share code, notes, and snippets.

View oliveira-andre's full-sized avatar
🖲️
Coding

André Oliveira oliveira-andre

🖲️
Coding
View GitHub Profile
@oliveira-andre
oliveira-andre / .bashrc
Created October 19, 2023 17:08
.bashrc from parrot
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@oliveira-andre
oliveira-andre / clean_cache_docker.md
Created September 17, 2021 13:51
This was created when my containers doesn't build because of not enough space left in cache

How to clean docker cache

Removing simple cache to just free some space in device

sudo docker image prune -f && sudo docker container prune -f

Removing all cache

nginx by docker

simple nginx, with same welcome page

docker run --name static-demo-page -p 80:80 -d nginx

changing welcome pages

docker run --name static-demo-page -v /var/www/html:/usr/share/nginx/html:ro -p 80:80 -d nginx

gitlab via docker

install and run docker:

sudo docker run --hostname gitlab.oliveira-andre.dev --publish 8443:443 --publish 8080:80 --publish 2200:22 --name gitlab --restart always -v logs:/var/log/gitlab -v data:/var/opt/gitlab gitlab/gitlab-ce:latest

show logs

@oliveira-andre
oliveira-andre / easy_webhook_telegram_bot.md
Created August 9, 2021 04:23
in my search i didnt find a simple way to make one telegram bot with sinatra, then i make one very simple

create the route to configure webhook

get '/' do
  require 'telegram/bot'
  TOKEN = 'your token'
  HOOK_URL = 'https://example.com'
  bot = Telegram::Bot::Api.new(TOKEN)
  puts bot.set_webhook(url: HOOK_URL)
@oliveira-andre
oliveira-andre / installing_cacafire.md
Created July 14, 2021 14:21
how to install cacafire in multiple plataforms

how to install cacafire

Macos

brew install libcaca
cacafire
switch_ssh_keys () {
sh $HOME/shell_apps/switch_ssh_keys/ini.sh $1
}

Formating disk

MacOS

first list your disks

diskutil list
brew install v8-315
gem install libv8 -v '3.16.14.19' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8@3.15
bundle install
@oliveira-andre
oliveira-andre / manage_ssh_keys.md
Created March 28, 2021 00:15
Managing SSH keys

Managing SSH keys

generate default key

ssh-keygen

generate the corp key

ssh-keygen -f ~/.ssh/id_rsa_corp