Skip to content

Instantly share code, notes, and snippets.

View VictorGob's full-sized avatar

Víctor VictorGob

View GitHub Profile
@VictorGob
VictorGob / docker-compose_jupyter.yml
Created February 19, 2022 23:35
Jupyter docker with data persistence
version: "3.9"
services:
# From https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#core-stacks
jupyterlab:
image: jupyter/base-notebook
container_name: jupyter
user: root
ports:
- "8888:8888"
@VictorGob
VictorGob / install_oh_my_zsh.sh
Created December 24, 2021 23:05
Install oh-my-zsh with plug-ins
sh -c "$(curl -fsSL \
https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Plugin: zsh-completions
git clone https://github.com/zsh-users/zsh-completions.git \
~/.oh-my-zsh/custom/plugins/zsh-completions
# Plugin: zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \
~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
# Plugin: zsh-autosuggestions
@VictorGob
VictorGob / ClearWinUpdateCache.bat
Created November 10, 2021 17:56
Clear windows update cache (win7, win10)
net stop wuauserv
CD %Windir%
CD SoftwareDistribution
DEL /F /S /Q Download
net start wuauserv
PAUSE
@VictorGob
VictorGob / check_wifi_status.ps1
Last active November 3, 2021 12:29
Script powershell para comprobar estado del wifi cada x segundos
# Check status
Write-Host "Checkeando wiffi"
while($true)
{
$output = ""
$red = ""
$fecha = Get-Date
$red = netsh wlan show interfaces | select-string -Pattern '\sSSID','\sSeñal','\sEstado ' | Out-String
@VictorGob
VictorGob / py.Dockerfile
Created March 4, 2020 07:18
Slim Debian image for python contributions.
FROM debian:buster-slim
RUN apt update -y && apt upgrade -y && apt install git build-essential -y
ENTRYPOINT ["tail", "-f", "/dev/null"]
@VictorGob
VictorGob / getMiniconda.sh
Last active February 5, 2020 14:15
Get last Minicoda version (for Anaconda too)
#!/bin/bash
#* It gets last Miniconda3 Linux version and install it
CONDA_INSTALLER_URL='https://repo.anaconda.com/miniconda/'
OUTPUT_INSTALLER='/tmp/Miniconda3-latest-Linux-x86_64.sh'
echo "*** Descargando instalador de Anaconda --> Miniconda3-latest-Linux-x86_64.sh"
curl "$CONDA_INSTALLER_URL"Miniconda3-latest-Linux-x86_64.sh --output $OUTPUT_INSTALLER
INSTALLER_MD5=$(curl -s $CONDA_INSTALLER_URL 2>&1 | awk '$1=$1' ORS=' ' | perl -n -e'/href="Miniconda3-latest-Linux-x86_64.sh.*?([a-f0-9]{32})/ && print $1' )
GET_MD5=$(md5sum $OUTPUT_INSTALLER | awk '{ print $1 }')
@VictorGob
VictorGob / remove_old_snaps.sh
Last active December 5, 2019 07:35
Remove old snaps
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi
@VictorGob
VictorGob / update_script.sh
Created November 25, 2019 10:32
Bash script: updating Ubuntu and snaps
#!/bin/bash
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi
echo -e ""
echo -e "\e[1;31m****************Update & dist-upgrade!!\e[0m"
echo -e ""
@VictorGob
VictorGob / dockerInstall.sh
Last active November 25, 2019 10:33
Bash script: install docker and docker-compose
#!/bin/bash
echo "Installing Docker!"
sudo apt update
sudo apt install -y \
sudo apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common jq
@VictorGob
VictorGob / Dockerfile_postgresql_plpy3
Last active October 30, 2023 08:46
Dockerfile for Postgresql + PLpython3
FROM postgres:12
# Create plpython3u when the db starts.
RUN echo 'CREATE EXTENSION IF NOT EXISTS plpython3u;' > /docker-entrypoint-initdb.d/py3.sql
# Installing last python and plpython3 for current version
RUN apt update && apt install python3 python3-pip postgresql-plpython3-${PG_MAJOR} -y