Skip to content

Instantly share code, notes, and snippets.

View tiwiex's full-sized avatar

Taiwo Akinosho tiwiex

View GitHub Profile
@tiwiex
tiwiex / backup_lms.sh
Created September 24, 2025 13:38
backup_lms.sh
#!/bin/bash
BACKUP_DIR="/home/frappe/frappe-backups"
DATE=$(date +%Y%m%d_%H%M%S)
DB_NAME="lms"
MAX_BACKUPS=2
BACKUP_FILE="$BACKUP_DIR/lms_backup_$DATE.sql.gz"
ZIP_FILE="$BACKUP_DIR/lms_backup_$DATE.zip"
source $HOME/.mysql_creds
# Backup database and compress immediately
@tiwiex
tiwiex / gist:b3f5a9a158b5a5cd4c227e4873b0c94f
Last active September 24, 2025 13:07
backup_to_git.sh
#!/bin/bash
bash backup_frappe_zip.sh "$@"
backup_dir="$HOME/frappe-backups"
max_cycles=5
log_file="$backup_dir/backup.log"
cd "$backup_dir" || exit 1
echo "🔁 Managing Git backup cycles at $(date)" | tee -a "$log_file"
@tiwiex
tiwiex / frappe_to_zip.sh
Last active September 24, 2025 14:46
Frappe to Zip Backup
#!/bin/bash
# ================================================
# backup_copy_frappe_zip.git
# Backs up all Frappe sites (with files)
# Compresses each backup into a single ZIP per site
# Supports multiple frappe-bench folders as input
# ================================================
backup_dir="$HOME/frappe-backups"
@tiwiex
tiwiex / custom-ubuntu-20.04.sh
Created May 16, 2024 22:58 — forked from dmanning21h/custom-ubuntu-20.04.sh
Customization script for fresh install of Ubuntu 20.04
# Update System
sudo apt update && sudo apt upgrade -y
# Curl
sudo apt-get install wget gpg
sudo apt install apt-transport-https curl
# Clear Favorites
gsettings set org.gnome.shell favorite-apps "['']"
#!/bin/sh
# size of swapfile in megabytes
swapsize=4096
# does the swap file already exist?
grep -q "swapfile" /etc/fstab
# if not then create it
if [ $? -ne 0 ]; then
@tiwiex
tiwiex / create_swap.sh
Created June 11, 2021 07:47 — forked from garystafford/create_swap.sh
From my blog post, Scripting Linux Swap Space: Scripting Linux Swap Space
#!/bin/sh
# size of swapfile in megabytes
swapsize=512
# does the swap file already exist?
grep -q "swapfile" /etc/fstab
# if not then create it
if [ $? -ne 0 ]; then
@tiwiex
tiwiex / bash-to-zsh-hist.py
Created September 22, 2017 17:28 — forked from muendelezaji/bash-to-zsh-hist.py
Convert Bash history to Zsh history
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is how I used it:
# $ cat ~/.bash_history | python bash-to-zsh-hist.py >> ~/.zsh_history
import sys
import time
Using the Drush script found at /home/applemed/drush using pcntl_exec
Phar detected. Proceeding to drush_main().
Cache HIT cid: 8.1.9-commandfiles-0-9ebe5dc8b18a411f1c4341cb010a4ad3 [0.02 sec, 2.22 MB] [debug]
Bootstrap to phase 0. [0.27 sec, 5.45 MB] [bootstrap]
Bootstrap to phase 6. [0.27 sec, 5.45 MB] [bootstrap]
Command pm-list needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to [error]
run this command. [0.27 sec, 5.45 MB]
The drush command 'pml' could not be executed. [0.27 sec, 5.45 MB]
root@panel:/home/applemedx/public_html# drush8 pml
Command pm-list needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to [error]
run this command.
The drush command 'pml' could not be executed.
drush8 on drupal 8
PHP configuration : /etc/php5/cli/php.ini
PHP OS : Linux
Drush script : /home/applemedx/drush
Drush version : 8.1.9