Skip to content

Instantly share code, notes, and snippets.

View anthonysomerset's full-sized avatar

Anthony Somerset anthonysomerset

View GitHub Profile
@anthonysomerset
anthonysomerset / .bashrc
Created November 8, 2011 10:50
bashrc fragment for mac users
myssh-copy-id()
{
cat ~/.ssh/id_rsa.pub | ssh $1 "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"
}
alias ssh-copy-id=myssh-copy-id
@anthonysomerset
anthonysomerset / fastcgi_params
Created November 10, 2011 11:08
nginx https if statement for fastcgi_params
set $ssl off;
if ($ssl_protocol != "" ) {
set $ssl on;
}
fastcgi_param HTTPS $ssl;
@anthonysomerset
anthonysomerset / functions.php fragment
Created November 10, 2011 11:18
wordpress theme function to disable CDN loading on SSL pages (requires w3 total cache plugin)
add_action('wp_head','nocdn_on_ssl_page');
function nocdn_on_ssl_page() {
if ($_SERVER['HTTPS'] == "on") {
define('DONOTCDN', true);
}
}
@anthonysomerset
anthonysomerset / gist:1607737
Created January 13, 2012 17:47
sendmail mailstats parsing for zabbix
UserParameter=sendmail.msgsfrom,/usr/sbin/mailstats | grep esmtp | awk '{print $$2}'
UserParameter=sendmail.msgsto,/usr/sbin/mailstats | grep esmtp | awk '{print $$4}'
UserParameter=sendmail.msgsreject,/usr/sbin/mailstats | grep esmtp | awk '{print $$6}'
UserParameter=sendmail.msgsdiscard,/usr/sbin/mailstats | grep esmtp | awk '{print $$7}'
UserParameter=sendmail.msgsquarantine,/usr/sbin/mailstats | grep esmtp | awk '{print $$8}'
UserParameter=sendmail.bytesfrom,/usr/sbin/mailstats | grep esmtp | awk '{print $$3}' | tr -d [:alpha:] | tr -d [:punct:]
UserParameter=sendmail.bytesto,/usr/sbin/mailstats | grep esmtp | awk '{print $$5}' | tr -d [:alpha:] | tr -d [:punct:]
@anthonysomerset
anthonysomerset / iam.perms.txt
Created January 14, 2012 14:10
IAM allow all access to AWS for iam user
{
"Statement": [
{
"Effect": "Allow",
"Action": "*",
"Resource": "*"
}
]
}
@anthonysomerset
anthonysomerset / custom-sirportly-wp.php
Created March 29, 2012 13:09
WP function for gravity forms to allow the submission of a gravityform to sirportly via the remote forms feature
<?php
//edit this to match the form id matching the form you want to post to sirportly for me it was form_id 3
add_action("gform_post_submission_3", "post_to_sirportly", 10, 2);
function post_to_sirportly($entry, $form){
//numbers in here should match the field ID's in your gravity form
$post_data['name'] = $entry["1"];
$post_data['email'] = $entry["2"];
@anthonysomerset
anthonysomerset / gist:3654655
Created September 6, 2012 10:39
apc clear cache - for apc.stat=0
<?php
if ($_GET['token'] != 'somesecretpass') {
header("HTTP/1.0 404 Not Found");
exit;
}
apc_clear_cache();
apc_clear_cache('opcode');
echo json_encode(array('success' => true));
dd bs=1M count=512 if=/dev/zero of=testds conv=fdatasync
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 10.1862 s, 52.7 MB/s
hdparm -tT /dev/xvda1
/dev/xvda1:
Timing cached reads: 13090 MB in 1.99 seconds = 6586.22 MB/sec
Timing buffered disk reads: 142 MB in 3.03 seconds = 46.93 MB/sec
root@test1:~# apt-get update
Get:1 http://security.debian.org squeeze/updates Release.gpg [836 B]
Ign http://security.debian.org/ squeeze/updates/main Translation-en
Ign http://security.debian.org/ squeeze/updates/main Translation-en_US
Get:2 http://mirrors.kernel.org squeeze Release.gpg [1,672 B]
Ign http://mirrors.kernel.org/debian/ squeeze/main Translation-en
Ign http://mirrors.kernel.org/debian/ squeeze/main Translation-en_US
Get:3 http://mirrors.kernel.org squeeze-updates Release.gpg [836 B]
Ign http://mirrors.kernel.org/debian/ squeeze-updates/main Translation-en
Ign http://mirrors.kernel.org/debian/ squeeze-updates/main Translation-en_US
After searching for the appropriate software esp (FREEwares), the internet at times seems to disapoint. Most software programmes are paid for or the free version comes with a trial period only.
The best way is just to pay for the right software that you want and you will not stress out but if you still want it for free.For most Zimbabweans, the software is quiet affordable but due to some problems or lack of payment systems online, there are many ways out there.
On the currently available payment systems i Zimbabwe please read this part.
One place you can get almost anything is through torrents!
This is a Distributed file sharing system which enables downloads from various computers simultaneously and it has the advantage of improved speeds. For one to be able to download files using torrents you need to install an application called Torrent Client that enables you to get data from various links on the internet. uTorrent, Vuze Bittorrent and Swarm Torrent client are examples of the Torrent Client Software.
Th