Skip to content

Instantly share code, notes, and snippets.

View mlambie's full-sized avatar
🇦🇺
$ iex -S mix

Matt Lambie mlambie

🇦🇺
$ iex -S mix
View GitHub Profile
@mlambie
mlambie / gist:784178
Created January 18, 2011 09:14
Apache redirect remove www
<VirtualHost *:80>
ServerName www.domain.com
ServerSignature Off
RewriteEngine On
RewriteRule ^(.*)$ http://domain.com$1 [L,R=301]
</VirtualHost>
@mlambie
mlambie / crontab updates
Created January 24, 2011 07:29
crontab entry to force update checks on Ubuntu
# Every hour force an update check
0 * * * * root /usr/lib/update-notifier/update-motd-updates-available --force > /dev/null 2>&1
function authme {
ssh $1 'cat >>.ssh/authorized_keys' <~/.ssh/id_dsa.pub
}
@mlambie
mlambie / gist:847017
Created February 28, 2011 06:46
Check exposed SNMP services
mlambie@blaster:/root/bin$ snmpwalk -v1 -c public localhost 1.3.6.1.4.1.8072.1.3.2.4.1 -On
.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.112.102.115.101.110.115.101.1 = STRING: /var/backups/pfsense/config-snarl-20110228.xml
.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.112.102.115.101.110.115.101.2 = STRING: Mon Feb 28 10:00:01 +0800 2011
.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.112.102.115.101.110.115.101.3 = STRING: 17320
.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.117.112.100.97.116.101.115.1 = STRING: 0
.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.117.112.100.97.116.101.115.2 = STRING: 0
.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.117.112.100.97.116.101.115.3 = STRING: 0
.1.3.6.1.4.1.8072.1.3.2.4.1.2.8.105.114.111.110.112.111.114.116.1 = STRING: /var/backups/ironport/C160-00219BFB6D96-88YJDH1-20110228T115752.xml
.1.3.6.1.4.1.8072.1.3.2.4.1.2.8.105.114.111.110.112.111.114.116.2 = STRING: Mon Feb 28 11:57:52 +0800 2011
.1.3.6.1.4.1.8072.1.3.2.4.1.2.8.105.114.111.110.112.111.114.116.3 = STRING: 10249
@mlambie
mlambie / gist:875556
Created March 18, 2011 03:14
Mailman headers
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <list.ruxcon.org.au>
List-Unsubscribe: <https://ruxcon.org.au:9754/cgi-bin/mailman/options/list>, <mailto:list-request@ruxcon.org.au?subject=unsubscribe>
List-Archive: <https://ruxcon.org.au:9754/cgi-bin/mailman/private/list>
List-Post: <mailto:list@ruxcon.org.au>
List-Help: <mailto:list-request@ruxcon.org.au?subject=help>
List-Subscribe: <https://ruxcon.org.au:9754/cgi-bin/mailman/listinfo/list>, <mailto:list-request@ruxcon.org.au?subject=subscribe>
Sender: list-bounces@ruxcon.org.au
Errors-To: list-bounces@ruxcon.org.au
@mlambie
mlambie / find | xargs mv
Created March 31, 2011 13:47
find | xargs mv
find . -name "*.avi" -print0 | xargs -0 -I {} mv {} .
@mlambie
mlambie / gist:1000197
Created May 31, 2011 08:58
search.feature
Feature: thefrontiergroup.com.au
It should be up
And I should be able to search for things
Scenario: Searching for things
When I go to "http://blog.thefrontiergroup.com.au/"
And I fill in "s" with "json_decode"
And I press "searchsubmit"
Then I should see "Search Results for &lsquo;<span>json_decode</span>&rsquo;"
And I should see "json_decode\(\) Not Working in PHP?"
@mlambie
mlambie / gist:1000198
Created May 31, 2011 08:58
search.feature
Feature: thefrontiergroup.com.au
It should be up
And I should be able to search for things
Scenario: Searching for things
When I go to "http://blog.thefrontiergroup.com.au/"
And I fill in "s" with "json_decode"
And I press "searchsubmit"
Then I should see "Search Results for &lsquo;<span>json_decode</span>&rsquo;"
And I should see "json_decode\(\) Not Working in PHP?"
@mlambie
mlambie / env.rb
Created May 31, 2011 09:04
Additional webrat configuration
#!/usr/bin/env ruby
$: << File.expand_path(File.dirname(__FILE__))
require 'cucumber/nagios'
require 'webrat/adapters/mechanize'
require 'webrat_logging_patches'
class ResponseHelper
def response
@mlambie
mlambie / inflections.rb
Created June 1, 2011 05:15
Manual inflections
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end