Skip to content

Instantly share code, notes, and snippets.

View damms005's full-sized avatar

Damilola Emmanuel Olowookere damms005

View GitHub Profile
#!/bin/bash
# Run like:
# sudo create-secure-site.sh site-url
sample_run="sudo create-secure-site.sh <website name e.g. sample-website.local>"
site=$1
site_name=$(echo $site | sed -E "s/\..*//")
apache_doc_dir=/opt/lampp/htdocs/hidden-laravel-backends/${site_name}/public
#We should make user specify deo as argument to this script. The user must be in the same group with the
#username, so that we can do stuff like `chown deo:deo...`
@damms005
damms005 / american-king-james-version.json
Last active October 1, 2021 15:27
American King James Version of the Holy Bible as obtained from https://getbible.net/v2/translations.json
{
"translation": "American King James Version",
"abbreviation": "akjv",
"discription": "American King James Version",
"lang": "en",
"language": "English",
"direction": "LTR",
"encoding": "",
"books": [
{
@damms005
damms005 / PeaceFirstAward.php
Last active August 28, 2020 16:00
Peace First Code Sample - Best Award Project
<?php
/**
* Hypothetical case: Peace First wants to select a project from the PEACE FIRST CHALLENGE for a special award.
* This selection is intended to be purely based on merit, without any bias.
*
* Assumption: For scalability reasons, the Peace First Challenge projects are hosted on another server linked to a subdomain
* via CNAME DNS entry. Hence, the endpoint to fetch all of these projects is https://api.peacefirst.org/projects/index.
* The allowed request type is GET, and fetching all available projects in one request does not
* constitute any performance issues. The payload response from this endpoint is an array of
* project objects, like below:
@damms005
damms005 / mysql-database-backup.sh
Last active August 25, 2020 19:05
Bash script to backup MySQL db using mysqldump utility
#!/bin/bash
# original source Lyman Lai
# http://002.yaha.me/item/22728a58-c967-46d5-93eb-2649d684a9aa/
# edited by damms005 on 2020-08-25
STORE_FOLDER="/backups-custom-moodle-database"
TODAY=$(date +"%Y-%m-%d")
#!/usr/bin/env bash
##########
## Name: battery-notification.sh
## Author: Adapted from the original script by Nicholas Neal (nwneal@kisoki.com)
## Description:
## This is a small script that will install itself to cron
## and run every minute, and check if your battery level is
## low, and send an alert to your desktop as appropriate
##