Skip to content

Instantly share code, notes, and snippets.

View gegere's full-sized avatar

Jason Gegere gegere

View GitHub Profile
@gegere
gegere / gist:73c069ef2c9e9845a3c8
Created December 16, 2014 23:44
Helpful logs around the time of etcd failures...
Dec 14 08:42:04 coreos63.htmlgraphic.com fleetd[14289]: INFO manager.go:89: Triggered systemd unit mysqld.service stop: job=999801
Dec 14 08:42:04 coreos63.htmlgraphic.com fleetd[14289]: INFO manager.go:231: Removing systemd unit mysqld.service
Dec 14 08:42:04 coreos63.htmlgraphic.com fleetd[14289]: INFO manager.go:142: Instructing systemd to reload units
Dec 14 08:42:04 coreos63.htmlgraphic.com fleetd[14289]: INFO reconcile.go:274: AgentReconciler completed task: type=UnloadUnit job=mysqld.service reason="unit loaded but not sche
Dec 14 08:42:09 coreos63.htmlgraphic.com fleetd[14289]: INFO manager.go:89: Triggered systemd unit mysqld-discovery.service stop: job=999805
Dec 14 08:42:09 coreos63.htmlgraphic.com fleetd[14289]: INFO manager.go:231: Removing systemd unit mysqld-discovery.service
Dec 14 08:42:09 coreos63.htmlgraphic.com fleetd[14289]: INFO manager.go:142: Instructing systemd to reload units
Dec 14 08:42:09 coreos63.htmlgraphic.com fleetd[14289]: INFO reconcile.go:274: AgentReconciler completed task
@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
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 / 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.
web-data:
image: ubuntu:latest
volumes:
- /data
tags:
- web
db-data:
image: busybox:latest
volumes:
- /var/lib/mysql
@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
@gegere
gegere / db_session.php
Created February 4, 2011 01:51
This is used to properly stored multiple session objects to the database. This code was enhanced a little from the PHP5 Advanced Book
<?php
// Define the open_session() function:
// This function takes no arguments.
// This function should open the database connection.
function open_session() {
global $dbconn;
// Connect to the database.
$dbconn = mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) OR die ('Cannot connect to the database.');
@gegere
gegere / autofollow.php
Created June 24, 2012 18:36 — forked from 0xnbk/autofollow.php
Twitter autofollow script (PHP)
<?php
// Twitter Auto-follow Script by Dave Stevens - http://davestevens.co.uk
$user = "";
$pass = "";
$term = "";
$userApiUrl = "http://twitter.com/statuses/friends.json";
@gegere
gegere / gist:3162221
Created July 23, 2012 06:15
2-Way Encryption Scheme
class Encryption
{
public function encrypt($plaintext,$key)
{
$td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_CBC, '');
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
mcrypt_generic_init($td, $key, $iv);
$crypttext = mcrypt_generic($td, $plaintext);
mcrypt_generic_deinit($td);
return base64_encode($iv.$crypttext);
@gegere
gegere / gist:3220993
Created July 31, 2012 21:54 — forked from boucher/gist:1750375
Stripe PHP simple example
<?php
require 'path-to-Stripe.php';
if ($_POST) {
Stripe::setApiKey("YOUR-API-KEY");
$error = '';
$success = '';
try {
if (!isset($_POST['stripeToken']))
throw new Exception("The Stripe Token was not generated correctly");