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
require 'cinch' | |
require 'open-uri' | |
require 'nokogiri' | |
require 'cgi' | |
require 'json' | |
require 'pry' | |
bot = Cinch::Bot.new do | |
configure do |c| | |
c.server = "irc.mdx.la" |
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 | |
function wipe_it() { | |
echo "Alright, here we go. ZEROING EVERYTHING" | |
echo "Yeah right, execute this yourself: sudo dd if=/dev/zero of=/dev/mapper/sick-root bs=1M" | |
} | |
function confirm_it() { | |
read -n1 -p "Are you absolutely SURE you want to zero the drive? (y/n): " | |
echo |
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 | |
target = ARGV[0] | |
known_md5 = "73d2bd14bd37c5877bdc6c1fbfa66dd5" | |
puts "Checking if #{target} has md5 of #{known_md5}" | |
prog = !`which md5sum`.empty? ? 'md5sum' : (!`which md5`.empty? ? "md5" : raise) | |
test_md5 = `#{prog} #{target}` | |
found = test_md5.match(/#{known_md5}/) | |
puts "#{prog} reports positive match: #{found ? "YES" : "NO"}" | |
## Usage: |
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
➜ ~ irb | |
1.9.3p194 :001 > @args = {"foo"=>2} | |
=> {"foo"=>2} | |
1.9.3p194 :002 > :@args | |
=> :@args | |
1.9.3p194 :003 > instance_variable_defined? | |
instance_variable_defined? | |
1.9.3p194 :003 > instance_variable_defined? :@args | |
=> true | |
1.9.3p194 :004 > instance_variable_defined? :@argss |
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 | |
TARGET_IP="xx.xx.xx.xx" | |
TARGET_LOCAL_VNC_PORT=5901 | |
LOCAL_VNC_PORT=31543 | |
TARGET_WAN_SSH_PORT=22345 | |
TARGET_USER="keyvan" | |
ruby secure_vnc_tunnel.rb $LOCAL_VNC_PORT $TARGET_IP $TARGET_LOCAL_VNC_PORT $TARGET_WAN_SSH_PORT $TARGET_USER | |
echo "Entering SSH session ($TARGET_IP:$TARGET_WAN_SSH_PORT)" | |
ssh -p $TARGET_WAN_SSH_PORT $TARGET_USER@$TARGET_IP |
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
[4] pry(main)> CocoaDialog.methods - Object.methods | |
=> [:bubble, :msgbox] | |
[5] pry(main)> CocoaDialog.methods -Object.methods | |
NoMethodError: undefined method `-@' for #<Array:0x007f8e0b26f520> | |
from (pry):4:in `<main>' | |
[6] pry(main)> |
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
11:59 Topic: MiNDYNAMiCS | MOV Format Spec: http://bit.ly/MjTXl8 | Valve Handbook: http://bit.ly/MjTU8S | DUCKY COMMANDS: https://duckduckgo.com/bang.html | COOL BLOG, by jsilver: http://coolbloglala.tumblr.com/ |
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
spec/spec_helper.rb:22:in `block in <top (required)>': uninitialized constant FactoryGirl (NameError) |
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
➜ triangle_lulz ruby triangle.rb | |
Enter base size | |
10 | |
Triangle of base size 10: | |
* | |
** | |
*** | |
**** | |
***** | |
****** |
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
# classes im using for this task lol | |
class SupportAnalyzer | |
end | |
class UnsupportedClip | |
attr_reader :clip, :reasons | |
def initialize(clip) | |
@clip = clip | |
@reasons = [] |