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 / setup.sh
Last active March 10, 2021 09:49
How to add swap to CentOS 7
# Check if we already have swap
swapon -s
# Second Check
free -m
# Check available space
df -h
# Generate the file (4GB)
@clivewalkden
clivewalkden / OHN-351-88432.patch
Last active April 27, 2018 14:32
Fix for Amasty GoogleInvisible ReCAPTCHA 2.1.4
Index: app/design/frontend/base/default/template/amasty/aminvisiblecaptcha/captcha.phtml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- app/design/frontend/base/default/template/amasty/aminvisiblecaptcha/captcha.phtml (revision 4a453745274c5b47515d72496ca05465be86f6bc)
+++ app/design/frontend/base/default/template/amasty/aminvisiblecaptcha/captcha.phtml (revision )
@@ -73,7 +73,9 @@
tokenInput.type = 'hidden';
tokenInput.name = 'amasty_invisible_token';
@clivewalkden
clivewalkden / 2.1.12_directory_resolver_v1.patch
Created April 10, 2018 12:44
Magento 2.1.12 Directory Resolver Patch
Index: magento/vendor/magento/framework/App/Filesystem/DirectoryResolver.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- magento/vendor/magento/framework/App/Filesystem/DirectoryResolver.php (date 1521531005000)
+++ magento/vendor/magento/framework/App/Filesystem/DirectoryResolver.php (date 1521561205000)
@@ -39,7 +39,7 @@
public function validatePath($path, $directoryConfig = DirectoryList::MEDIA)
{
@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
@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 / 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 / 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 = 'root@bommaritollc.com'
adminEmail = 'michael@bommaritollc.com'
@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