Skip to content

Instantly share code, notes, and snippets.

View yoandresaav's full-sized avatar
🏠
Working from home

Yoandre Saavedra Gonzalez yoandresaav

🏠
Working from home
View GitHub Profile
@yoandresaav
yoandresaav / check_docker.sh
Created August 9, 2024 16:39
If Docker is not running, Run Docker
#!/bin/bash
# Check if docker is running and start it if it's not
if docker info > /dev/null 2>&1; then
echo "Docker is running"
else
echo "Docker is not running"
open /Applications/Docker.app
@yoandresaav
yoandresaav / gist:5ba5fc011ed0ae18e7e23b477db715c7
Created May 21, 2024 22:20
Process Zombies run as defunct
$ps -ef | grep defunct
$kill -9 <
ps -ef | grep defunct
UID PID PPID C STIME TTY TIME CMD
1000 637 27872 0 Oct12 ? 00:00:04 [chrome] <defunct>
1000 1808 1777 0 Oct04 ? 00:00:00 [zeitgeist-datah] <defunct>
### Python Docs
Correr checkhealt
install pylint
https://github.com/deoplete-plugins/deoplete-jedi/wiki/Setting-up-Python-for-Neovim#using-virtual-environments
Using pyenv
@yoandresaav
yoandresaav / postgres-cheatsheet.md
Created August 27, 2023 17:39
Postgres Cheatsheet

Pull Postgres

$ docker pull postgres

Create a directory for db persistence

$ mkdir -p [db-volume-location-on-machine]
@yoandresaav
yoandresaav / Vim Examples
Last active December 31, 2023 12:56
Vim Examples to Improvement work
### Open in vim all files modified in git
$ nvim $(git status --porcelain | awk '{print $2}')
### Go to next git modification
using https://github.com/lewis6991/gitsigns.nvim
]c and [c
set -g prefix C-s
unbind C-b
bind C-s send-prefix
set -g base-index 1
set -g escape-time 20
bind h select-pane -L
Python3 Encapsulate with sqlite3 Maps (https://stackoverflow.com/questions/19530974/how-can-i-add-the-sqlite3-module-to-python)
Here is an example of a script that will setup an encapsulated version (virtual environment) of Python3 in your user directory with an encapsulated version of sqlite3.
INSTALL_BASE_PATH="$HOME/local"
cd ~
mkdir build
cd build
[ -f Python-3.6.2.tgz ] || wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz
tar -zxvf Python-3.6.2.tgz

python -m grpc_tools.protoc --proto_path=. ./unary.proto --python_out=. --grpc_python_out=.

-Parar o eliminar todos los contenedores docker:

Para pararlos puede usarse: docker stop $(docker ps -a -q)

Y para eliminarlos: docker rm $(docker ps -a -q)