Skip to content

Instantly share code, notes, and snippets.

View muffycompo's full-sized avatar

Mfawa Alfred Onen muffycompo

View GitHub Profile
@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
# 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
<?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" />

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/
@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 / main.js
Created July 13, 2014 16:37
jQuery Textarea Character Counter
$(document).ready(function(){
// Message counter
var message_start = 0;
var sms_start = 1;
$('#message_count').html(message_start);
$('#sms_count').html(sms_start);
$('#sms_message').keyup(function() {
var character_count = $('#sms_message').val().length;
@muffycompo
muffycompo / coova-chilli.spec
Created August 28, 2014 12:28
CoovaChilli RPM Spec file
%define _unpackaged_files_terminate_build 0
Summary: Coova-Chilli is a Wireless LAN Access Point Controller
Name: coova-chilli
Version: 1.3.1.svn
Release: 1
URL: http://www.coova.org/
Source0: %{name}-%{version}.tar.gz
License: GPL
Group: System Environment/Daemons
BuildRoot: %{_tmppath}/%{name}-root
@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
@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 / 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