Skip to content

Instantly share code, notes, and snippets.

View ptasker's full-sized avatar
:fishsticks:
Fishsticks FTW

Peter Tasker ptasker

:fishsticks:
Fishsticks FTW
View GitHub Profile
@ptasker
ptasker / gist:5542489
Created May 8, 2013 18:28
CentOS security scan
* Chrootkit && rkhunter -> To search for known trojans and common linux
malware.
* unhide (http://www.unhide-forensics.info/) -> to check for hidden
processes and tcp sockets
* rpm -Va -> To check binary integrity against installed rpms
* If netstat binary looks to be sane, check listening sockets
* If ps binary looks to be sane, check shown running processes
* Check console connections with "last" and "lastb" commands
* Tcpdump on network interfaces avoiding traffic for known running
services (80, 25, 21, etc... depending on the role of the machine) to
@ptasker
ptasker / Facebook OG Meta Tags
Created August 21, 2013 15:10
Facebook OG Meta Tags
<meta property="fb:app_id" content="App ID" />
<meta property="og:site_name" content="" />
<meta property="og:type" content="website" />
<meta property="og:image" content="http://www.fanswithbenefits.ca/img/fb-send-image.png" />
<meta property="og:url" content="http://www.fanswithbenefits.ca" />
<meta property="og:title" content="Fans With Benefits" />
<meta property="og:description" content="American Express is all about opening the door to amazing events - we know who&#039;s playing what, and what&#039;s on where. We want our fans to get a taste of what we have to offer so we&#039;re giving you a chance to WIN access through the Fans With Benefits program!" />
@ptasker
ptasker / gist:6784225
Created October 1, 2013 20:00
SVN Output filenames from a revision DIFF
svn diff --summarize --revision Rev1:Rev2 > filename.txt
@ptasker
ptasker / gist:7008572
Last active December 25, 2015 16:49
WordPress admin htaccess IP restriction
Order deny,allow
Deny from all
Allow from xx.xx.xx.xx
#range would be
#Allow from xx.xx.xx.0/24
<Files admin-ajax.php>
Order allow,deny
Allow from all
Satisfy any
</Files>
@ptasker
ptasker / gist:7008652
Created October 16, 2013 14:29
WordPress .htaccess protect wp-login.php
<Files wp-login.php>
Order deny,allow
Deny from all
Allow from xx.xx.xx.0/24
#Another IP
Allow from xx.xx.xx.xx
</Files>
@ptasker
ptasker / gist:7158091
Last active December 26, 2015 13:28
Facebook resize canvas (Tab)
//The 100 value can be anything, Facebook will detect the height of the body element
FB.Canvas.setSize({height:100});
@ptasker
ptasker / gist:7467109
Created November 14, 2013 13:52
SVN Revert
svn merge -r rfrom:rto .
@ptasker
ptasker / gist:7473574
Last active December 28, 2015 08:39
Linux - Find biggest files
du -a /var | sort -n -r | head -n 10
@ptasker
ptasker / gist:7679992
Last active December 29, 2015 13:49
Mailgun setup
<?php
require_once 'swiftmailer/lib/swift_required.php';
// Create the Transport
$transport = Swift_SmtpTransport::newInstance ( 'smtp.mailgun.org', 25 )
->setUsername ( '[email protected]' )
->setPassword ( 'rand0mpa55' );
//Helps for sending mail locally during development
@ptasker
ptasker / gist:7680134
Last active August 4, 2017 08:30
Swiftmailer create attachment
<?php
//Using composer to get the Sabre lib
require dirname ( __FILE__ ) . '/../vendor/autoload.php';
use Sabre\VObject\Component\VCalendar;
// Create a message
$message = Swift_Message::newInstance ( 'Message Title' )
->setFrom ( array( '[email protected] ' => 'John Doe' ) )
->setTo ( array( $email ) )
->setSubject ( "Cool message subject" )