Skip to content

Instantly share code, notes, and snippets.

View muffycompo's full-sized avatar

Mfawa Alfred Onen muffycompo

View GitHub Profile
@muffycompo
muffycompo / README.MD
Created July 10, 2022 13:00 — forked from rama-adi/README.MD
Use hCaptcha with any livewire component

Implement hCaptcha with Livewire Component

This is a simple way to implement hCaptcha with Livewire component.

NOTE: please read this carefully, and adjust variable names, etc to your use case

Setup

Before using this implementation, add their JS library first on your page

<script src="https://js.hcaptcha.com/1/api.js?hl=en" async defer></script>
@muffycompo
muffycompo / server_certificates_to_pem.md
Created October 10, 2018 14:42 — forked from stevenhaddox/server_certificates_to_pem.md
Convert .crt & .key files into .pem file for HTTParty

Two ways to do it, but only worked for me so I'll put it first and the second for reference:

$ openssl pkcs12 -export -in hostname.crt -inkey hsotname.key -out hostname.p12
$ openssl pkcs12 -in hostname.p12 -nodes -out hostname.pem

Other options for this method in comments below:

# Note, the -certfile root.crt appends all CA certs to the export, I've never needed these so it's optional for my personal steps
$ openssl pkcs12 -export -in hostname.crt -inkey hsotname.key -certfile root.crt -out hostname.p12

Note, I've always had my hostname.crt as part of my .pem, so I keep my certs but apparently you may not have to, hence the nocerts flag being an extra option in this sample

@muffycompo
muffycompo / Netfilter-IPTables-Diagrams.md
Created June 10, 2018 08:41 — forked from nerdalert/Netfilter-IPTables-Diagrams.md
Linux NetFilter, IP Tables and Conntrack Diagrams

Linux NetFilter, IP Tables and Conntrack Diagrams

IPTABLES TABLES and CHAINS

IPTables has the following 4 built-in tables.

1) Filter Table

Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.

#!/usr/bin/bash
#title :mkuser.sh
#description :This script will make random password for root, new user, new user as sudo, clear history
#author :Trle94 @ Castlegem SRL
#date :03.04.2018
#version :0.1
#usage :./mkuser.sh
#--------------------------------------------------------------------------------
[ $EUID -eq 0 ] || { echo "This script needs to be ran with SUDO!"; exit 1; }
#!/bin/bash
USER="root"
PASSWORD=""
FILES="/Users/tenold/Backups/MySQL/*"
for f in $FILES
do
echo "Processing $f file..."
@muffycompo
muffycompo / rpm-digital-signature.sh
Created August 22, 2016 19:29 — forked from fernandoaleman/rpm-digital-signature.sh
How to sign your custom RPM package with GPG key
# How to sign your custom RPM package with GPG key
# Step: 1
# Generate gpg key pair (public key and private key)
#
# You will be prompted with a series of questions about encryption.
# Simply select the default values presented. You will also be asked
# to create a Real Name, Email Address and Comment (comment optional).
#
# If you get the following response:
@muffycompo
muffycompo / phpstorm.bat
Created February 18, 2016 18:06 — forked from amnuts/phpstorm.bat
Add context menu to Windows 7 to open file/folder in PhpStorm
@echo off
SET PhpStormPath=C:\Program Files (x86)\JetBrains\PhpStorm 8.0.2\bin\PhpStorm64.exe
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in PhpStorm" /t REG_SZ /v "" /d "Open in PhpStorm" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in PhpStorm" /t REG_EXPAND_SZ /v "Icon" /d "%PhpStormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in PhpStorm\command" /t REG_SZ /v "" /d "%PhpStormPath% \"%%1\"" /f
echo Adding folder entries

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
<?xml version="1.0" encoding="UTF-8"?>
<inspections version="1.0" is_locked="false">
<option name="myName" value="Expert Level PHP" />
<option name="myLocal" value="false" />
<inspection_tool class="BadExpressionStatementJS" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="CallerJS" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="CommaExpressionJS" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="ConstantConditionalExpressionJS" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="ConstantIfStatementJS" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="ContinueOrBreakFromFinallyBlockJS" enabled="false" level="WARNING" enabled_by_default="false" />
# To Build:
#
# sudo yum -y install rpmdevtools && rpmdev-setuptree
#
# wget https://gist.github.com/stuart-warren/8859980/raw/a6ec61ce0c03c69638fa85dcdb8d1f1a5a559e51/tomcat7.spec -O ~/rpmbuild/SPECS/tomcat7.spec
# wget https://raw.github.com/nmilford/rpm-tomcat7/master/tomcat7.init -O ~/rpmbuild/SOURCES/tomcat7.init
# wget https://raw.github.com/nmilford/rpm-tomcat7/master/tomcat7.sysconfig -O ~/rpmbuild/SOURCES/tomcat7.sysconfig
# wget https://raw.github.com/nmilford/rpm-tomcat7/master/tomcat7.logrotate -O ~/rpmbuild/SOURCES/tomcat7.logrotate
# wget http://mirror.ox.ac.uk/sites/rsync.apache.org/tomcat/tomcat-7/v7.0.50/bin/apache-tomcat-7.0.50.tar.gz -O ~/rpmbuild/SOURCES/apache-tomcat-7.0.50.tar.gz
# rpmbuild -bb ~/rpmbuild/SPECS/tomcat7.spec