Skip to content

Instantly share code, notes, and snippets.

View mcnemesis's full-sized avatar
💭
v:TEA|h:{know some u:code poetry?}|g!:_*\0/*_

Nemesis Fixx Da JWL mcnemesis

💭
v:TEA|h:{know some u:code poetry?}|g!:_*\0/*_
View GitHub Profile
Telling Exim4 to allow users on external networks to use the mail server as a relay:
So, for example your mail server has local ip:
192.168.1.1
In that case, if you only wish let you local users use the mail server to send mail, then configure the relay host as this:
In `/etc/exim4/update-exim4.conf.conf`, set the relay network to only allow local machines for example (probably filter with a Class C mask)
@mcnemesis
mcnemesis / Install_GLM.sh
Created January 28, 2014 15:11
Basic script (may not port to all *.nix systems though) to install glm (a header only lib for advanced OpenGL Mathematics) - am testing on OpenSuse 12.3
#!/usr/bin/sh
#I use axel, but you might as well use wget
#and you might wish to grab your own uri in case this one is broken...
rm glm*.zip
axel http://downloads.sourceforge.net/project/ogl-math/glm-0.9.5.1/glm-0.9.5.1.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fogl-math%2Ffiles%2F&ts=1390921576&use_mirror=garr
7z x glm*.zip && cd glm && sudo cp -r glm /usr/include/
#if all went well, you are ready to use GLM (e.g you may now proceed to ./configure-make gource :-)
@mcnemesis
mcnemesis / responsive_html_table.html
Created October 2, 2013 15:25
An ingenious way to to hack the ultimate responsive HTML table (using Bootstrap). Instead of one monstrous TABLE, we creatively use smaller tables.
<div class="row panel"> <!-- panel class plays a big role in concealing our trick when it comes to painting the table -->
<div class="col-md-2">
<table class="table">
<thead>
<tr>
<th>CATEGORY</th>
</tr>
</thead>
<tbody>
<tr>
@mcnemesis
mcnemesis / CustomKeyGroup.cs
Created August 27, 2013 08:19
This class allows us to be able to create custom groups, with custom keys, that can be easily consumed by jump lists and used to group items in long list selector controls for Windows Phone 8. Jump-Style Yey!
using System;
using System.Collections.Generic;
using System.Linq;
namespace LongListSelectorUtils
{
/// <summary>
/// This class allows us to be able to create custom groups, with custom keys,
/// that can be easily consumed by jumplists and used to group items in longlist selector controls.
///
@mcnemesis
mcnemesis / RESTAPI.cs
Created August 16, 2013 15:42
1-File Robust RESTful API internal layer for Windows Phone 8
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
namespace RESTAPI
{
/// <summary>
/// Encapsulates functionality to make it possible to make
@mcnemesis
mcnemesis / DataDictionary.cs
Created August 16, 2013 15:39
A Simple, 1-class non-obtrusive No-SQL DB for Windows Phone 8, Windows Store + (RT)
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Storage;
namespace MyCHILD
@mcnemesis
mcnemesis / cups_cheetsheet.txt
Last active January 29, 2025 11:18
A CUPS Cheetsheet (under development) Originally based on the blog post: http://www.mybinarylife.net/2012/06/linux-cups-terminal-printer-quick.html
Linux CUPS terminal printer quick cheatsheet
=============================================
** Adding a new printer without a PPD:
lpadmin -p printer_name -E -v socket://192.168.1.9:9100
** Finding an existing PPD for your printer if required:
lpinfo --make-and-model 'LaserJet 3390' -m
@mcnemesis
mcnemesis / write_endings
Created July 19, 2013 12:50
[Stolen] Interesting Ways to End Letters and Email, until you die.
Normal, Funny, Unique, and Loving ways to end your letters, notes, e-mails, conversations, tweets, posts....
I love lists.....
Normal:
Best/Warm wishes,
Confidently yours,
Kind regards,
Respectfully Yours,
With anticipation,
Hugs,
@mcnemesis
mcnemesis / 350_exim4-config_virtual_aliases
Created July 4, 2013 14:43
Defining an Exim4 Router to allow Exim to route mails for virtual domains using custom virtual domains aliases.
#####################################################
# router/350_exim4-config_virtual_aliases
#####################################################
#---------------------------
# This router is added so that we can use this server for multiple domains
# And also be able to define custom aliases for each of these domains...
# NOTE : this router is placed before the system_aliases router so that virtual domain
# routing takes precedence over system_aliases
#----------------------------
@mcnemesis
mcnemesis / wsgi.py
Created May 24, 2013 19:52
My Django WSGI bootstrap script that is *so generic* it might work as a default replacement in any standard Django project. If you created your project using the default: django-admin.py startproject PROJECT, then just try switching your PROJECT/PROJECT/wsgi.py with this.
import os, sys
base = os.path.dirname(os.path.dirname(__file__))
base_parent = os.path.dirname(base)
sys.path.append(base)
sys.path.append(base_parent)
os.environ['DJANGO_SETTINGS_MODULE'] = '%s.settings' % os.path.basename( os.path.dirname(__file__) )