Skip to content

Instantly share code, notes, and snippets.

@sergio-gimenez
sergio-gimenez / last_release_docker_compose.sh
Last active March 2, 2023 16:49
Install/update docker-compose to last release
# Reference: https://stackoverflow.com/questions/49839028/how-to-upgrade-docker-compose-to-latest-version
# First, remove the old version:
# - If installed via apt-get
# sudo apt-get remove docker-compose
# - If installed via curl
# sudo rm /usr/local/bin/docker-compose
@sergio-gimenez
sergio-gimenez / sudo_docker
Last active December 19, 2022 14:51
Let docker be used without sudo
sudo usermod -aG docker $(whoami)
sudo reboot # No strictly need to reboot, logging in and out should be enough
@sergio-gimenez
sergio-gimenez / reverse_ssh.md
Last active July 14, 2022 17:03
Access any machine remotely using reverse SSH tunnel

How to access any machine through reverse SSH tunneling.

Things needed:

  • Restricted Machine: Machine unaccessible remotely that we want to have access.
  • Public Machine: A machine that can be accessed from anywhere. That might be because it uses a public IP or because it has a Dynamic DNS service such as DuckDNS or for other whatever reason.
  • Client to access the remote machine: Any machine that has internet access and SSH.

From restricted machine access public machine:

@sergio-gimenez
sergio-gimenez / latest_cmake.sh
Last active July 17, 2024 07:12
Install last CMake version in Ubuntu (16)
# CMake developer team in Kitware Inc provides APT repositiory. It allows you to install latest CMake via apt-get.
#If you are using a minimal Ubuntu image or a Docker image, you may need to install the following packages:
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates gnupg \
software-properties-common wget
# Obtain a copy of our signing key:
@sergio-gimenez
sergio-gimenez / gdb
Last active April 26, 2023 14:07
CMake C Debugging: This allows to debug C programs using cmake as build system in VScode. CMake Tools extension must be installed in VScode.
# Solution and discussion in https://stackoverflow.com/questions/40033311/how-to-debug-programs-with-sudo-in-vscode
# Make sure gdb is installed in the system
# Place this script in your home directory (or wherever, but the launch.json will look to the home dir) to debug programs that require root privileges.
# Make sure the script is made executable. (chmod +x gdb)
# For local development (will open a dialog for entering password)
pkexec /usr/bin/gdb "$@"
# For remote development (add gdb to /etc/sudoers, hence it can be run without password)
@sergio-gimenez
sergio-gimenez / terminator_config
Last active December 27, 2021 10:24
Terminator
# The only plugin I have is the Themes plugin (https://github.com/EliverLara/terminator-themes)
# which its only purpose is to install themes.
# For restore the config file, copy this gist in ${HOME}/.config/terminator/config
[global_config]
always_split_with_profile = True
enabled_plugins = TerminatorThemes, LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
inactive_color_offset = 0.554054054054
title_font = Hack 12
title_use_system_font = False
@sergio-gimenez
sergio-gimenez / .vimrc
Last active September 29, 2023 12:37
My vim configuration backup
call plug#begin()
Plug 'preservim/nerdtree'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'dense-analysis/ale'
Plug 'itchyny/lightline.vim'
Plug 'tpope/vim-fugitive'
call plug#end()
" Colour lightline bar