Skip to content

Instantly share code, notes, and snippets.

View muffycompo's full-sized avatar

Mfawa Alfred Onen muffycompo

View GitHub Profile
#! /bin/sh
### BEGIN INIT INFO
# Provides: chilli
# Required-Start: $remote_fs $syslog $network
# Required-Stop: $remote_fs $syslog $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start CoovaChilli daemon at boot time
# Description: Enable CoovaChilli service provided by daemon.
### END INIT INFO
apt-get update
apt-get install -y g++ automake autoconf libtool libltdl-dev gengetopt make cmake libssl-dev libjson-c2 libjson-c-dev
git clone https://github.com/coova/coova-chilli
./bootstrap
./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info \
--sysconfdir=/etc --localstatedir=/var --enable-largelimits \
@muffycompo
muffycompo / base64_url_safe.php
Created July 10, 2014 23:05
PHP Helper functions for Safe Base64 URL encode
<?php
function base64url_encode($data) {
return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
}
function base64url_decode($data) {
return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT));
}
?>
@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.

@muffycompo
muffycompo / coovachilli.config
Last active April 26, 2019 11:29
Coova-Chilli Config File
HS_WANIF=eth0
HS_LANIF=eth1
HS_NETWORK=172.16.1.0
HS_NETMASK=255.255.255.0
HS_UAMLISTEN=172.16.1.1
HS_UAMPORT=3990
HS_DNS1=208.67.222.222
HS_DNS2=208.67.220.220
HS_UAMUIPORT=4990
HS_NASID=localhost
@muffycompo
muffycompo / coovachilli-build-steps-ubuntu-16.10.txt
Last active September 25, 2018 02:27
Building CoovaChilli 1.4 on Ubuntu 16.10
apt-get update
apt-get install -y g++ automake autoconf libtool libltdl-dev gengetopt make cmake libssl-dev
git clone https://github.com/coova/coova-chilli
git checkout 1.4
./bootstrap
@muffycompo
muffycompo / coova-chilli.spec
Created March 11, 2014 18:44
The SPEC file I use for packaging CoovaChilli as an RPM
Summary: Coova-Chilli is a Wireless LAN Access Point Controller
Name: coova-chilli
Version: 1.3.0
Release: 1
URL: http://www.coova.org/
Source0: %{name}-%{version}.tar.gz
License: GPL
Group: System Environment/Daemons
BuildRoot: %{_tmppath}/%{name}-root
#!/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; }