This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# File: publish_jekyll.sh | |
# Description: Compiles Jekyll Website and publishes via rsync | |
# | |
# Copyright 2009 George Ornbo (Shape Shed) | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# File: generate_redirects.sh | |
# Description: Generates redirect rules based on a folder structure | |
# | |
# Copyright 2009 George Ornbo (Shape Shed) | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# File: monitor_df.sh | |
# Description: Monitors disk usage and sends an email if limit reached | |
# | |
# Adapted from http://www.cyberciti.biz/tips/shell-script-to-watch-the-disk-space.html | |
# | |
# Copyright 2009 George Ornbo (Shape Shed) | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# File: ee2_permissions.sh | |
# Description: Sets permssions on a ExpressionEngine Version 2 install | |
# | |
# Copyright 2009 George Ornbo (Shape Shed) | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# File: iptables_firewall.sh | |
# Description: Sets iptables firewall rules (run as root) | |
# | |
# Copyright 2010 George Ornbo (Shape Shed) | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Provides a category link with a count of the number of posts in | |
<ul> | |
{% for category in site.categories %} | |
<li id="{{ category[0] | downcase | replace:' ', '-' }}"><a href="/{{ category[0] }}/">{{category[0] | capitalize }}</a> <span>{{ category[1] | size }}</span></li> | |
{% endfor %} | |
</ul> | |
# .. and the same for tags | |
<dl> | |
{% for tag in site.tags %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'GCal4Ruby' | |
# Instantiate the service | |
service = GCal4Ruby::Service.new | |
# Authentication - your google username and password | |
service.authenticate("USERNAME", "PASSWORD") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# File: batch_pngcrush.sh | |
# Description: Batch processes PNG files using the pngcrush | |
# http://pmt.sourceforge.net/pngcrush/ | |
# | |
# Copyright 2010 George Ornbo (Shape Shed) | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gifts = ['Smelly cheese', 'Pot of Gold', 'Worm in a jar', '$1.32', 'A small goat'] | |
people = ['Willy Wonka', 'Stevie Wonder', 'Winston Churchill'] | |
def give_gifts(gifts,people) | |
result = Hash.new { |h,k| h[k] = [] } | |
gifts = gifts.shuffle | |
people = people.shuffle | |
people_cycle = people.cycle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Changes the prefix of ExpressionEngine tables | |
require 'rubygems' | |
require 'mysql' | |
# Connect to db | |
db = Mysql.real_connect("localhost", "username", "password", "db_name") | |
# Get list of tables |