Skip to content

Instantly share code, notes, and snippets.

View FiXato's full-sized avatar

Filip H.F. "FiXato" Slagter FiXato

View GitHub Profile
@FiXato
FiXato / get_nicks_by_hosts.rb
Created October 2, 2009 11:43
get a list of nicknames used by a series of hosts from the UnrealIRCd connects log.
#!/usr/bin/env ruby
# A simple script to get a list of nicknames used by a series of hosts from the UnrealIRCd connects log.
require 'set'
CONNECTS_LOG_PATH = File.expand_path('~/UnrealIRCd/logs/connects.log')
hosts = ARGV
if hosts.size == 0
puts('Get a list of nicknames used by a series of hosts from the UnrealIRCd connects log.')
abort('Usage: get_nicks_by_hosts host1 [host2] [..] [hostn]')
end
@FiXato
FiXato / get_details_by_identified_nicks.rb
Created October 2, 2009 17:50
Get list of hosts and details from the Anope services logs based on successful nickserv identifies.
#!/usr/bin/env ruby
# get_details_by_identified_nicks.rb
# A script to get a list of hosts and details from the Anope services logs based on successful nickserv identifies.
require 'set'
SERVICES_LOGS_PATH = File.expand_path("~/services/data/logs/services.log*")
nicks = ARGV
if nicks.size == 0
puts('Get a list of hosts and details from the Anope services logs based on successful nickserv identifies.')
@FiXato
FiXato / get_details_by_nick_registrations.rb
Created October 2, 2009 18:30
Gets list of hosts and other details from the Anope services logs based on successful nickserv registrations.
#!/usr/bin/env ruby
# get_details_by_nick_registrations.rb
# Gets a list of hosts and other details from Anope services logs based on successful nickserv registrations.
require 'set'
require 'yaml'
SERVICES_LOGS_PATH = File.expand_path("~/services/data/logs/services.log*")
nicks = ARGV
if nicks.size == 0
@FiXato
FiXato / get_hosts_by_identified_nicks.rb
Created October 3, 2009 00:16
Gets list of hosts from the Anope services logs based on successful nickserv identifies.
#!/usr/bin/env ruby
# get_hosts_by_identified_nicks.rb
# Gets a list of hosts from the Anope services logs based on successful nickserv identifies.
require 'set'
SERVICES_LOGS_PATH = File.expand_path("~/services/data/logs/services.log*")
DEBUG = false
if ARGV.size > 0
DEBUG = true if ARGV.include?('--debug')
nicks = ARGV
@FiXato
FiXato / get_identified_nicks_by_hosts.rb
Created October 3, 2009 00:31
Gets a list of nicks from the Anope services logs that have successfully been identified for by the given hosts.
#!/usr/bin/env ruby
# get_identified_nicks_by_hosts.rb
# Gets a list of nicks from the Anope services logs that have successfully been identified for by the given hosts.
require 'set'
SERVICES_LOGS_PATH = "~/services/data/logs/services.log*"
if ARGV.size > 0
hosts = ARGV
else
@FiXato
FiXato / gist:232808
Created November 12, 2009 10:57 — forked from Jonnotie/gist:225016
# Install kicker on osx: sudo gem install kicker --source http://gemcutter.org\
#
# Place a `.kick' file with this code in the root of your project, which contains the file to watch.
# Then start running kicker from the project root: $ kicker
FILE_TO_WATCH = 'mockup-1.psd'
counter = nil
if File.exist?('output')
#!/usr/bin/env ruby
# Retrieves all National Geographic Photo-contest wallpapers from 2008 and 2009
# Original scripts from: http://www.webupd8.org/2009/11/automatically-download-all-wallpapers.html
require 'net/http'
class WallpaperRetriever
attr_reader :destination_folder,:urls
def initialize(destination="~/Pictures/Wallpapers/NationalGeographic/")
@FiXato
FiXato / greetings.rb
Created December 8, 2009 12:52
Holiday Greetings
require 'yaml'
class Array
def random
self[Kernel.rand(size)]
end
end
class Hash
def random
@FiXato
FiXato / random_img.php
Created March 8, 2010 15:48
Random image script I wrote years ago. GISTed because someone asked for it.
<?php
/* Random Image Generator
* Base code & Inspiration by : Maciek "Tularis" Sokolewicz
* ReWritten and enhanced by : Filip H.F. "FiXato" Slagter
* Contact : fixato@gmail.com
* Uses privately adapted version of Directory Listing Script found at : http://php.net/readdir (created by php@silisoftware.com on 31-Jan-2003 04:16)
*/
if(!function_exists('image_type_to_mime_type')) { //check if function exists...
//Alternate version of Image_Type_To_Mime_Type()-function, if that function is absent
@FiXato
FiXato / weather_grabber.rb
Created March 16, 2010 18:37
Fetches weather info from Google Weather API and Weather Underground API.
#!/usr/bin/env ruby
# Fetches weather info from Google Weather API and Weather Underground API.
# Syntax:
# ./weather_grabber.rb [location]
#
# (c) 2010 Filip H.F. "FiXato" Slagter
# Licensed under Creative Commons Attribution-Share Alike 3.0 Unported License, http://creativecommons.org/licenses/by-sa/3.0/
['rubygems','nokogiri','open-uri','yaml', 'iconv'].each {|lib| require lib}
if ARGV.size > 0
location = ARGV.join(" ")