Skip to content

Instantly share code, notes, and snippets.

View muffycompo's full-sized avatar

Mfawa Alfred Onen muffycompo

View GitHub Profile
# 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 / 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 / Keybase.md
Created March 13, 2017 20:24
Keybase proof

Keybase proof

I hereby claim:

  • I am muffycompo on github.
  • I am muffycompoqm (https://keybase.io/muffycompoqm) on keybase.
  • I have a public key ASCGpd9St3Rok3b7qV1oKDssp9-IZmM_N8ze-8XkabKAbgo

To claim this, I am signing this object:

#!/bin/sh
#
# chilli - CoovaChilli
#
# chkconfig: 2345 65 35
# description: CoovaChilli
# Source function library.
. /etc/chilli/functions
. /lib/lsb/init-functions
START_CHILLI=0
CONFFILE="/etc/chilli.conf"
HS_USER="chilli"