Skip to content

Instantly share code, notes, and snippets.

View gegere's full-sized avatar

Jason Gegere gegere

View GitHub Profile
@gegere
gegere / auto-update-server.sh
Created October 8, 2023 06:53
System Update Script / Send to Slack
#!/bin/bash
# Replace 'YOUR_SLACK_TOKEN' with your Slack Bot Token
SLACK_TOKEN="ABC123"
# Replace 'YOUR_CHANNEL_ID' with the ID of the Slack channel where you want to send the message
CHANNEL_ID="C123456789ZYX"
LOG_FILE="/var/log/update_script.log"
# Get the start date
@gegere
gegere / cheap_rsync.sh
Last active April 2, 2023 06:19
Backup process to sync a directory to another system, RSYNC over SSH
#!/bin/bash
# Source directory to be backed up
SOURCE_DIR=/data/MOVIES
# Destination directory for backup
DEST_DIR=/data/samba
# SSH configuration for remote server (if using rsync over ssh)
SSH_HOST=192.168.2.123
gcloud compute instances create www-hg3 \
--machine-type e2-small \
--tags ssh,http-server,https-server \
--image-family=ubuntu-minimal-1804-lts \
--image-project=ubuntu-os-cloud \
--service-account vm-instance-compute@webserv0.iam.gserviceaccount.com \
--zone $ALT_ZONE
# How to run docker-compose up -d at system start up?
# https://stackoverflow.com/a/43672627
#
# crontab -e
#
# Install Compose on Linux systems
# https://docs.docker.com/compose/install/#install-compose
#
#
# Install using the repository
@gegere
gegere / README.md
Last active November 8, 2019 01:10 — forked from oodavid/README.md
Used for automatically deploying websites via github or bitbucket

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/

Keybase proof

I hereby claim:

  • I am gegere on github.
  • I am gegere (https://keybase.io/gegere) on keybase.
  • I have a public key ASCic0OS3dFkVj9gvirvG7W1ak_MXE7XY0_4rsf2p5IgbQo

To claim this, I am signing this object:

@gegere
gegere / cheap_rsync.sh
Created September 19, 2013 05:36
This is the cheapest of cheapo you will find for a script that performs remote backups using simply rsync, a destination host, and a directory on that destination host to store the backups.
#!/bin/bash
#
# Cheap Rsync System for Remote Backups
#
# This is the cheapest of cheapo you will find for a script
# that performs remote backups using simply rsync, a destination
# host, and a directory on that destination host to store the backups.
#
# Author: Jason Gegere
# Date: 11-21-2006, 9:29AM CST
@gegere
gegere / credit_card_helper.php
Created September 19, 2013 02:46
The CodeIgniter Helper handles many credit card checks which can be used to manipulate credit card numbers and related information
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Credit Card Functions
*
* This helper module contains functions which can be used to manipulate credit
* card numbers and related information.
*
* @package CodeIgniter
<?php
class tweet_scroll {
/******************************************************************
** database access constants **
** edit these **
******************************************************************/
private $dbName = 'YOUR MYSQL DATABASE NAME';
private $dbHost = 'YOUR MYSQL DATABASE HOST';
private $dbUser = 'YOUR MYSQL DATABASE USERNAME';
@gegere
gegere / twitter.class.inc.php
Last active December 11, 2015 01:49
Would you like to display your recent tweets? This PHP class will help you get this job done. This class uses the JSON format.
<?php
class RecentTweets{
private $username;
const cache = '/cache/';
public function __construct($username){
$this->username = $username;
}