Skip to content

Instantly share code, notes, and snippets.

# An example of calculating least-squares linear regression fit in Ruby
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
@ajosanchez
ajosanchez / FO4_terminal_hack.rb
Last active December 16, 2020 13:11
This will help you crack those tricky terminals in the Fallout series. Just run this ruby script and enter each word separated only with a slash and no spaces (ex: kid/cat/pop/dog). It will display each words' total matches minus any words that had no matches. Then once you guess enter in the guess word with the likeness returned from the termin…
class Hack
def initialize words
@words = words.downcase.split(/\/|\s|,\s|\,/)
@splitwords = []
@words.each { |w| @splitwords << w.split('') }
show_likely
end
def deduct
require 'rinda/tuplespace'
class ChannelSpace
include DRbUndumped
class ChannelError < RuntimeError
def initialize(str, handle)
@channel = handle
super(str)
end
@seki
seki / channel.rb
Last active August 29, 2015 14:02
# -*- coding: utf-8 -*-
require 'rinda/tuplespace'
module Channel
class ChannelSpace
class Any
def initialize(ary)
@ary = ary
end
@somic
somic / udp_hole_punch_tester.py
Created November 3, 2009 04:13
UDP Hole Punching test tool
#!/usr/bin/env python
#
# udp_hole_punch_tester.py - UDP Hole Punching test tool
#
# Usage: udp_hole_punch_tester.py remote_host remote_port
#
# Run this script simultaneously on 2 hosts to test if they can punch
# a UDP hole to each other.
#
# * remote_port should be identical on 2 hosts.