Skip to content

Instantly share code, notes, and snippets.

@Jeimerson
Jeimerson / gist:04c88f82b8d29eb4421179c6d9ec5368
Created December 12, 2020 16:21 — forked from michoelchaikin/gist:fc4db078c0f64f6f5d35
Backup a mySQL database to Google Drive
#! /usr/bin/perl
# Backups and compresses a SQL database, and uploads to Google Drive
# Make sure ~/.my.cnf is set with mySQL login credentials
# Follow instructions at https://developers.google.com/drive/web/auth/web-server to generate a client id and secret
# Use bash script at https://github.com/soulseekah/bash-utils/blob/master/google-oauth2/google-oauth2.sh to create refresh token
# Configuration Options
my $HOST = ''; # mySQL server host
#!/usr/bin/env bash
# require: git version > 2.3
# require: `db/letsencrypt` existed in git repo
if [[ -z "$CERTBOT_DOMAIN" ]] || [[ -z "$CERTBOT_VALIDATION" ]]; then
echo '$CERTBOT_DOMAIN and $CERTBOT_VALIDATION environment variables required.'
fi
source /etc/letsencrypt/dns-auth.conf
@Jeimerson
Jeimerson / WipeTapes.sh
Created May 25, 2021 08:17 — forked from lpaseen/WipeTapes.sh
Script to Erase all tapes loaded in a tape loader.
#!/bin/bash
#
# Description:
# Erase all tapes loaded in a tape loader.
# If FULL is given as parameter a full erase is done otherwise it just do a quick one.
# BUGS:
# It should count how many drives and do that part automagically
# but it's hard to pair up drives with loaders when other tape drives exists also.
# Haven't tested FULL
#
@Jeimerson
Jeimerson / zimbra-all-accounts-and-domains.sh
Created May 27, 2021 13:40 — forked from filippo/zimbra-all-accounts-and-domains.sh
Zimbra remove all accounts TODO: find a better way to automate this
# as zimbra user
$ zmprov -l gaa |grep -v admin-domain.com >/tmp/accounts.zmp
$ zmprov -l gad |grep -v admin-domain.com >/tmp/domains.zmp
@Jeimerson
Jeimerson / letra.css
Created August 23, 2021 14:40 — forked from JuniorLima/letra.css
Holyrics + Navegador
.screen-custom {
}
.text-custom {
position: relative;
}
.text-custom span:not(:empty) {
background-color: rgba(67, 50, 42, 0.7);
display: grid;
@Jeimerson
Jeimerson / jogo da velha.c
Created November 10, 2021 16:02 — forked from Alequine/jogo da velha.c
Jogo da velha
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
int main ( ){
int i, j, linha, coluna, contador;
char matriz[3][3];
setlocale(LC_ALL,""); /*Acentuação*/
@Jeimerson
Jeimerson / backup-db.sh
Last active March 23, 2022 14:38 — forked from mikedamoiseau/backup-db.sh
Script to backup a MySQL database and send the dump by email and/or scp
#!/bin/bash
# ----------------------------------
# DEFINED - Global variables
# ----------------------------------
# defined temporary folder
DBBACKUP="dbbackup"
# database configure
@Jeimerson
Jeimerson / ssl_fix.sh
Created April 5, 2022 12:57 — forked from mamedshahmaliyev/ssl_fix.sh
Self-signed certificate issues, disable SSL verification, ignore SSL related errors etc.
####### installation of self-signed certificate into CentOS7 (RHEL) #######
mkdir -p /etc/pki/ca-trust/source/anchors
cp /path/to/self_signed_cert.crt /etc/pki/ca-trust/source/anchors/self_signed_cert.crt
chmod +x /etc/pki/ca-trust/source/anchors/self_signed_cert.crt
sudo update-ca-trust
####### installation of self-signed certificate into Ubuntu (Debian) #######
mkdir -p /usr/local/share/ca-certificates/
cp /path/to/self_signed_cert.crt /usr/local/share/ca-certificates/self_signed_cert.crt
chmod +x /usr/local/share/ca-certificates/self_signed_cert.crt
@Jeimerson
Jeimerson / clean-up-boot-partition-ubuntu.md
Created April 21, 2022 08:47 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@Jeimerson
Jeimerson / backup.sh
Created January 3, 2023 15:50 — forked from GiovanniK/backup.sh
Linux backup script (local + ftp + sftp)
#!/bin/bash
archiveLocation=/backups
archiveTempPath=/backups/tmp_backup
archiveName=$(date '+%d-%m-%Y_%H:%M');
archiveFullName=$archiveName.tar.gz
archivePath=$archiveLocation/$archiveFullName
deleteLocalArchive=false
backupPath=/var/www
backupToRemoteServer=false