Skip to content

Instantly share code, notes, and snippets.

View jeffreyroberts's full-sized avatar

Jeffrey L. Roberts jeffreyroberts

  • PHP DevOps
  • Miami, Florida
View GitHub Profile
@jeffreyroberts
jeffreyroberts / sysinfo.pl
Last active March 8, 2024 13:48
Eggdrop Sysinfo TCL
#!/usr/bin/perl -w
#
# Copyright (c) 2002-2005 David Rudie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
@jeffreyroberts
jeffreyroberts / str_to_hex.php
Created November 3, 2013 06:31
PHP String to Hex, Javascript Unescape
<?php
// Javascript/HTML hex encode
function encode($input)
{
$temp = '';
$length = strlen($input);
for($i = 0; $i < $length; $i++)
$temp .= '%' . bin2hex($input[$i]);
return $temp;
}
@jeffreyroberts
jeffreyroberts / mysql_db_table_growth_rates.sql
Last active June 11, 2022 10:35
MySQL - Monitor table growth rates in terms of row counts
-- SET GLOBAL event_scheduler = ON;
-- create table growth_history(tbl_name varchar(64), row_count bigint, time_stamp datetime);
DELIMITER $$
CREATE
EVENT `document_growth_history`
ON SCHEDULE EVERY 1 DAY
DO BEGIN
┌─[✗]─[jlroberts@Jeffreys-Mac-Pro-3]─[~/Projects/Shred/Laravel]
└──╼ composer require guzzle/guzzle
Using version ^3.9 for guzzle/guzzle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: don't install guzzle/guzzle v3.9.3
@jeffreyroberts
jeffreyroberts / scraper.py
Created November 11, 2018 19:32
WallPaper Scraper
from requests import get
from requests.exceptions import RequestException
from contextlib import closing
from bs4 import BeautifulSoup
from urllib.request import urlopen
import urllib.request
import ssl
def simple_get(url):
"""
@jeffreyroberts
jeffreyroberts / samples.php
Created December 9, 2017 12:39
Gist for Mohd
public function receive()
{
// https://developer.authorize.net/api/reference/features/webhooks.html#Event_Types_and_Payloads
}
public function createWebHook()
{
$omh_webhook_api_endpoint = 'https://{yourserver.com}/webhooks/receive';
$json = '
@jeffreyroberts
jeffreyroberts / git_push_multiple.sh
Created January 16, 2014 11:12
Push to multiple repos with a single command
[ /jlr/sites/legophp.com/framework ]
[ jlroberts@iMac ] $ git remote set-url --add --push origin ssh://git@bitbucket.org/jeffreylroberts/legophp-com-framework.git
[ /jlr/sites/legophp.com/framework ]
[ jlroberts@iMac ] $ git remote set-url --add --push origin git@github.com:LegoPHP/LegoPHP.git
[ /jlr/sites/legophp.com/framework ]
[ jlroberts@iMac ] $ git remote -v
github git@github.com:LegoPHP/LegoPHP.git (fetch)
github git@github.com:LegoPHP/LegoPHP.git (push)
origin ssh://git@bitbucket.org/jeffreylroberts/legophp-com-framework.git (fetch)
origin ssh://git@bitbucket.org/jeffreylroberts/legophp-com-framework.git (push)
'Twas the night before Christmas, when all through the racks
Not a server was alerting, not even Compaqs.
The backups were written to tapes with care
In hopes that later the data would be there.
The machines were nestled all snug in their sleds
Whilst visions of vengeance danced in their heads;
And oncall in his three-wolf and I in my rack.
Had just settled down for some syn and some ack.
#!/usr/bin/env bash
# repository
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
# system update
yum -y update
yum -y groupinstall "Development Tools"
yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick
#get root access
$su -
$ cd /tmp
#Remove old Ruby
$ yum remove ruby
# Install dependencies
$ yum groupinstall "Development Tools"
$ yum install zlib zlib-devel