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 / find | xargs mv
Created March 31, 2011 13:47
find | xargs mv
find . -name "*.avi" -print0 | xargs -0 -I {} mv {} .
@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 / 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
function authme {
ssh $1 'cat >>.ssh/authorized_keys' <~/.ssh/id_dsa.pub
}
@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
@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>
mencoder -endpos 01:00:00 -ovc copy -oac copy input.avi -o first_hour.avi
mencoder -ss 01:00:00 -oac copy -ovc copy input.avi -o remainder.avi
@mlambie
mlambie / gist:581951
Last active September 23, 2015 16:18
# The desired array
frequencies = ["hourly", "daily", "weekly", "monthly"]
# Shorthand conversion into array
frequencies = %w{hourly daily weekly monthly}
# Note the delimiter is not important, but must match
frequencies = %w"hourly daily weekly monthly"
frequencies = %w|hourly daily weekly monthly|
mlambie@prowl:~$ grep mlambie /etc/passwd
mlambie:x:1000:1001:Matthew Lambie,,,:/home/mlambie:/bin/bash
mlambie@prowl:~$ grep mlambie /etc/passwd | sed 's/Matthew/Andrew/'
mlambie:x:1000:1001:Andrew Lambie,,,:/home/mlambie:/bin/bash
@mlambie
mlambie / survey
Created November 1, 2009 13:37 — forked from radar/survey.md
** What did you do to get good at Rails?
ML: The only thing you can do is cut code. You can read all the books,
watch all the screencasts and subscribe to all the blogs in the world,
but until you start writing your own code, you won't get experience and
you won't become proficient in Rails.
** Who taught you what you know?
ML: Railscasts with Ryan Bates is the obvious one, but lately I've really