Skip to content

Instantly share code, notes, and snippets.

View clivewalkden's full-sized avatar
🤓
Focusing on @golang & @kubernetes

Clive Walkden clivewalkden

🤓
Focusing on @golang & @kubernetes
View GitHub Profile
@clivewalkden
clivewalkden / email_obfuscation.php
Created May 3, 2012 07:36
method of hiding email addresses from harvesters
<?php
function utf_char_to_number($char)
{
$i = 0;
$number = '';
while (isset($char{$i}))
{
$number .= '&#'.ord($char{$i}).';';
$i++;
}
@clivewalkden
clivewalkden / gallery.js
Created May 3, 2012 17:05
gallery code
@clivewalkden
clivewalkden / composer.json
Last active August 29, 2015 14:21
Magento base composer.json file
{
"name": "sozodesign/magento",
"description": "SOZO Design default Magento start new website",
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"require": {
"aydin-hassan/magento-core-composer-installer": "^1.2",
"magento-hackathon/magento-composer-installer": "*",
"magento/magento": "1.9.*@dev",
@clivewalkden
clivewalkden / .gitignore
Last active August 29, 2015 14:22
Magento .gitignore
/.gitignore
/.htaccess
/app/etc/local.xml
/cron.php
/cron.sh
/downloader
/errors/
/includes
/index.php
/index.php.sample
@clivewalkden
clivewalkden / centos-7-package.sh
Last active September 30, 2022 03:13 — forked from fernandoaleman/gist:5083680
How to add VirtualBox Guest Additions for vagrant into minimal install of Cent OS 7.
# Start the old vagrant
$ vagrant init centos-7
$ vagrant up
# You should see a message like:
# Installing Virtualbox Guest Additions 5.0.20 - guest version is unknown
$ vagrant ssh
vagrantup:~$ sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm
vagrantup:~$ sudo yum -y update
@clivewalkden
clivewalkden / check-mysql.py
Created December 9, 2016 11:25 — forked from mjbommar/check-mysql.py
This simple python script checks to see if MySQL is alive based on mysqladmin output. Tested on 5.5.28-0ubuntu0.12.04.3 under ubuntu user. (c) Bommarito Consulting, LLC; http://bommaritollc.com You might want to run in cron every minute: $ EDITOR=emacs crontab -e */1 * * * * /path/to/check-mysql.py
#!/usr/bin/python
#@author Bommarito Consulting, LLC; http://bommaritollc.com
#@date 2012-12-20
import subprocess
import smtplib
from email.mime.text import MIMEText
fromAddress = '[email protected]'
adminEmail = '[email protected]'
@clivewalkden
clivewalkden / jackett
Created January 12, 2017 15:23
Jackett-public init.d script
#! /bin/sh
### BEGIN INIT INFO
# Provides: Jackett
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $network $remote_fs
# Should-Start: $NetworkManager
# Should-Stop: $NetworkManager
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts instance of Jackett
@clivewalkden
clivewalkden / README.md
Last active August 31, 2023 11:12
Magento 2 Clear all tables after testing is complete.

Magento 2 Clear DB for Launch

Includes a basic clear.sql file for removing orders and customers and resetting the base invoice, order, shipment and creditmemo id's back to 0

A customweb_sagepay.sql for clearing out test SagePay orders from the customweb module.

A invoice_starting.sql for setting the start id's of invoices, orders, shipments and credit memos.

A mollie.sql for clearing out test orders using Mollie payment module.

@clivewalkden
clivewalkden / root_dir_size.sh
Last active November 9, 2017 14:42
Track down server disk space hogs
# Get the size of all the directories in the root sorted by size (MB)
du -sm /* | sort -n
# To exclude the /home directory (or other partitions not included in the space calculations) use --exclude=/home/
du -sm /* --exclude=/home/ | sort -n
# Drill down to the offending directories
# These are normally
# /var/log
# /var/lib/mysql