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

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 / gist:9346a9e3fa8369c50b58
Last active August 29, 2015 14:27
Error: Strange wp-config.php file: wp-settings.php is not loaded directly.
mkdir ~/temp && cd temp
git clone https://github.com/markjaquith/WordPress-Skeleton.git wordpress && cd wordpress
git submodule update --init --recursive
wp plugins list --allow-root
# this works, let's say I edit the database credentials
# move WordPress Core back a directory
mv wp ../
# symlink the directory
web-data:
image: ubuntu:latest
volumes:
- /data
tags:
- web
db-data:
image: busybox:latest
volumes:
- /var/lib/mysql
@gegere
gegere / components
Created January 23, 2015 23:32
HTMLgraphic Components
<?php
/*
Plugin Name: HTMLgraphic Components
Plugin URI: http://www.htmlgraphic.com
Version: 0.2
Date: 2010-10-11
Author: Jason Gegere
Author URI: http://www.htmlgraphic.com
Author Email: jason@htmlgraphic.com
Description: This plugin removes many of the bashboard widgets that are not needed on the admin side. A HTMLgraphic News feed has been added to answer many common WordPress questions.
Dec 15 16:00:52 coreos63.htmlgraphic.com systemd[1]: Starting Generate /run/coreos/motd...
Dec 15 16:00:52 coreos63.htmlgraphic.com systemd[1]: Started Generate /run/coreos/motd.
Dec 15 16:01:06 coreos63.htmlgraphic.com systemd[1]: etcd.service holdoff time over, scheduling restart.
Dec 15 16:01:06 coreos63.htmlgraphic.com systemd[1]: Stopping Announce MySQL Discovery Service...
Dec 15 16:01:06 coreos63.htmlgraphic.com systemd[1]: Stopping Announce Apache@1 Discovery Service...
Dec 15 16:01:06 coreos63.htmlgraphic.com systemd[1]: Stopping Apache Web Server...
Dec 15 16:01:06 coreos63.htmlgraphic.com etcdctl[18364]: Error: Cannot sync with the cluster using peers 127.0.0.1:4001
Dec 15 16:01:06 coreos63.htmlgraphic.com systemd[1]: mysqld-discovery.service: control process exited, code=exited status=2
Dec 15 16:01:06 coreos63.htmlgraphic.com systemd[1]: Unit mysqld-discovery.service entered failed state.
Dec 15 16:01:06 coreos63.htmlgraphic.com systemd[1]: ApacheLinkDiscovery@1.service: control process exited,
@gegere
gegere / gist:bbaf52021a2ba4bd51b5
Created December 17, 2014 00:37
journalctl -u fleet -le for Dec 15th
Dec 15 00:08:54 coreos63.htmlgraphic.com etcd[14288]: [etcd] Dec 15 00:08:54.876 INFO | 7227482757154585bf6608c940e2976a: snapshot of 10012 events at index 12594742 completed
Dec 15 00:44:04 coreos63.htmlgraphic.com etcd[14288]: [etcd] Dec 15 00:44:04.192 INFO | 7227482757154585bf6608c940e2976a: snapshot of 10009 events at index 12604751 completed
Dec 15 01:19:13 coreos63.htmlgraphic.com etcd[14288]: [etcd] Dec 15 01:19:13.567 INFO | 7227482757154585bf6608c940e2976a: snapshot of 10013 events at index 12614764 completed
Dec 15 01:54:22 coreos63.htmlgraphic.com etcd[14288]: [etcd] Dec 15 01:54:22.902 INFO | 7227482757154585bf6608c940e2976a: snapshot of 10002 events at index 12624766 completed
Dec 15 02:05:52 coreos63.htmlgraphic.com etcd[14288]: [etcd] Dec 15 02:05:52.031 INFO | 7227482757154585bf6608c940e2976a: warning: heartbeat time out peer="acb5b7cd84564cf4bb0ab0b7b5c594d8" missed=1 backoff="2s"
Dec 15 02:29:32 coreos63.htmlgraphic.com etcd[14288]: [etcd] Dec 15 02:29:32.312 INFO