Skip to content

Instantly share code, notes, and snippets.

View sbellver's full-sized avatar

Sergio Bellver Aliaga sbellver

View GitHub Profile
@sbellver
sbellver / db_backup_restore.sh
Last active September 26, 2022 20:49 — forked from o5/dump.sh
MySQL / MariaDB Dump & Restore
#!/usr/bin/env bash
# FEATURES: Progress bar with ETA, support multiple databases (dump into separated files) and password as argument
# REQUIREMENTS:
# =============
# GNU Core Utilities, mysql, mysqldump, pv (https://github.com/icetee/pv)
set -e
@sbellver
sbellver / gist:d3df4f1f4a3024ebae3adda48e622e2e
Created September 7, 2020 09:11
Errores para actualizar Ubuntu en LXC
1. Tras un do-release-upgrade salen errores de codificación ASCII <-> UTF-8, se puede solventar así:
LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 do-release-upgrade
2. Si no salen versiones compatibles para actualizar, se puede forzar editando el fichero /var/lib/update-manager/meta-release
Eliminando las releases que no son compatibles y poniendo a 1 el campo Supported de la versión a la que queramos actualizar
Dist: eoan
Name: Eoan Ermine
@sbellver
sbellver / proxmox-install-post.sh
Created September 13, 2019 08:45
Post proxmox install
#!/usr/bin/env bash
################################################################################
# This is property of eXtremeSHOK.com
# You are free to use, modify and distribute, however you may not remove this notice.
# Copyright (c) Adrian Jon Kriel :: [email protected]
################################################################################
#
# Script updates can be found at: https://github.com/extremeshok/xshok-proxmox
#
# post-installation script for Proxmox
#!/bin/bash
sudo apt-get install gnupg -y
cd /tmp
wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb
sudo apt-get update
sudo apt-get install mysql-server
echo [mysqld] >> /etc/mysql/my.cnf
echo innodb_dedicated_server = ON >> /etc/mysql/my.cnf
#!/bin/bash
locale-gen es_ES.UTF-8
dpkg-reconfigure locales
apt-get update
apt-get upgrade -y
apt get install gnupg htop vim unzip unattended-upgrades -y
-y
timedatectl set-timezone Europe/Madrid
@sbellver
sbellver / .bash_profile
Last active September 16, 2019 12:50 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
#!/bin/bash
clear
echo
echo " .d8888b. .d88888b. 888b d8888888888b.8888888888 d8888 "
echo " d88P Y88bd88P. .Y88b8888b d8888888 Y88b 888 888 d88888 "
echo " 888 888888 88888888b.d88888888 888 888 888 d88P888 "
echo " 888 888 888888Y88888P888888 d88P 888 888 d88P 888 "
echo " 888 888 888888 Y888P 8888888888P. 888 888 d88P 888 "
@sbellver
sbellver / renombraFotosExif.sh
Created December 29, 2014 10:00
Renombra y rota las fotos en función de los datos EXIF
# Auto rota las imagenes y renombra en función de la fecha de disparo.
# Es necesario jhead http://www.sentex.net/~mwandel/jhead/
# y sudo npm install --global jpegtran-bin
find "$1" -name "*.jpg" -exec jhead -exonly -autorot -nf%Y-%m-%d_%H-%M-%S {} \;
find "$1" -name "*.JPG" -exec jhead -exonly -autorot -nf%Y-%m-%d_%H-%M-%S {} \;
@sbellver
sbellver / gitpull.sh
Created December 10, 2014 12:06
Git Pull all the repos in list
# It's part from my bash_profile
function gitpull {
REPOS=( /route/repo /route/repo2 /route/repo3 )
for R in "${REPOS[@]}"; do
echo "Actualizando repo $R."
pushd "$R" >/dev/null && {
git pull
popd >/dev/null
@sbellver
sbellver / gitstatus.sh
Created December 10, 2014 12:04
Check Git Status from all the repos in list
# It's part from my bash_profile
function gitstatus {
REPOS=( /route/repo /route/repo2 /route/repo3)
for R in "${REPOS[@]}"; do
echo "Comprobando repo $R."
pushd "$R" >/dev/null && {
git status
popd >/dev/null