Skip to content

Instantly share code, notes, and snippets.

AWS_ACCESS_KEY_ID=Access_Key_To_AWS_Account_With_S3_Bucket
AWS_SECRET_ACCESS_KEY=Secret_Key_To_AWS_Account_With_S3_Bucket
RESTIC_REPOSITORY=s3:https://s3-bucket-here/backup-{server_name}
cd /usr/local/bin
wget https://github.com/restic/restic/releases/download/v0.12.1/restic_0.12.1_linux_amd64.bz2 -q -O restic.bz2
bunzip2 restic.bz2
chmod +x restic
restic generate --bash-completion /etc/bash_completion.d/restic
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "*** This script must be run as root ***"
exit 1
fi
if hash restic 2>/dev/null; then
echo "*** restic is already installed ***";
restic version
exit 0;
# The WAL level should be hot_standby
wal_level = hot_standby# Allow up to 5 standbys and backup processes to connect at a time.
# This should be set to at least 2 connections
max_wal_senders = 5# wal_keep_segments, the minimum number of segments to keep in the pg_xlog directory. Each segment is 16 MB in size.
wal_keep_segments = 1000 # Retain 1000 segments minimum
#!/bin/bash
############################################################################
# This script simply formats a block device and mounts it to the data
# directory in a very safe manner by checking that the block device is
# completely empty
#
############################################################################
set -eu
if [ $# -ne 2 ]
@basilmusa
basilmusa / howto_install_awscli
Created November 13, 2019 15:29
Install awscli in an isolated environment on Ubuntu
apt-get update
apt-get install python3-pip
apt-get install python3-venv
# Upgrade pip to latest version
python3 -m pip install --upgrade pip
# Manually check upgrade worked
pip --version
<?php
////////////////////////////////////////////////////////////////////////////
// VANILLA CONFIGURATION FILE
define ('INSTALL_DIR', dirname(__FILE__));
////////////////////////////////////////////////////////////////////////////
// HTTP IMPORTANT URLS
define('HTTP_SERVER', 'http://localhost/opencart/');
define('HTTPS_SERVER', 'https://localhost/opencart/');
define('HTTP_ADMIN', 'http://localhost/opencart/ad33/');
@basilmusa
basilmusa / 0_reuse_code.js
Created April 26, 2016 06:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@basilmusa
basilmusa / 00. tutorial.md
Created January 31, 2016 15:43 — forked from maxivak/00. tutorial.md
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler
<?php
echo "ARE YOU THERE?";
// Not sure why?
?>