Skip to content

Instantly share code, notes, and snippets.

View r4um's full-sized avatar

Pranay Kanwar r4um

View GitHub Profile
@r4um
r4um / spawn-cmd.rb
Created April 18, 2012 13:10
spawn a cmd redirect stdout/stder/stdin (helpful in cron)
#!/usr/bin/ruby
require 'optparse'
class SpawnerOptions
def self.parse(args)
options = {}
options[:stdin] = '/dev/null'
options[:stdout] = '/dev/null'
@r4um
r4um / set-io-scheduler.py
Created April 18, 2012 13:13
Set io scheduler for mounts (SCSI devs only)
#!/usr/bin/python
import glob
import optparse
import os
import time
import stat
import string
import sys
@r4um
r4um / nagios-ntfctl.rb
Created April 18, 2012 13:25
Enable/disable nagios host and or service notifications
#!/usr/bin/ruby
#
# Enable/disable host and or service notifications
#
require 'net/http'
require 'optparse'
require 'pp'
require 'socket'
@r4um
r4um / reliance-login.rb
Created April 18, 2012 13:31
Reliance broadband autologin (suitable for run in cron)
#!/usr/bin/ruby
require 'optparse'
require 'net/http'
require 'uri'
class RelianceLogin
def self.login(args)
opt = {}
opt[:host]='220.224.142.229'
@r4um
r4um / steam-servers.rb
Last active February 6, 2018 11:52
Discover steam servers on LAN
#!/usr/bin/ruby
require 'socket'
def print_status(data,from)
data = data[data.index("\\",4)+1...data.length].split("\\")
i=0
a = Hash.new()
while i < data.length-1
a.store(data[i] , data[i+1])
@r4um
r4um / rcons.rb
Last active February 6, 2018 11:56
rcons ? :)
#!/usr/bin/ruby
require 'socket'
require 'readline'
class CSRcon
@@payload="\xff\xff\xff\xffrcon CHN_HERE \"PW_HERE\" CMD_HERE \x00"
@@get_challenge="\xff\xff\xff\xffchallenge rcon\x0a\x00"
@@sock = UDPSocket.new
@password = ""
@r4um
r4um / stbrute.rb
Created April 18, 2012 13:45
brute brute :)
#!/usr/bin/ruby
require 'socket'
class CSBrute
@@payload="\377\377\377\377connect 47 CHN_HERE \"\\prot\\4\\unique\\-1\\raw\\valve\\cdkey"+
"\\1313b42c88918e7adbd5a265bc574768\" \"\\_cl_autowepswitch\\1\\bottomcolor\\6\\c"+
"l_dlmax\\128\\cl_lc\\1\\cl_lw\\1\\cl_updaterate\\45\\model\\gordon\\name\\fooooo"+
"o\\topcolor\\30\\_vgui_menus\\0\\_ah\\1\\dzuid\\DZUID_0:0:39962888\\source_model"+
"s\\0\\quality\\low\\rate\\7999.0737\\*fid\\0\\password\\PW_HERE\"\n\000\000]"+
"\005\023\254\000\035\000\200 \025\374\231\026\036s\e\277\225\375\017\2073n\235G"+
@r4um
r4um / enc-a.rb
Created April 18, 2012 13:47
System::Security::Cryptography example
require 'System'
require 'pp'
dotnet_path = System::Runtime::InteropServices::RuntimeEnvironment.GetRuntimeDirectory()
system_security = dotnet_path + "\\" + "System.Security.dll"
require system_security
include System::Security::Cryptography
@r4um
r4um / enc-b.rb
Created April 18, 2012 13:51
System::Security::Cryptography file enc/dec
require 'System'
require 'pp'
include System
include System::Text
include System::Security::Cryptography
class CredentialStore
def initialize(file)
@r4um
r4um / foxy_proxy_keyconfig.js
Created April 18, 2012 13:54
cycle proxy (use keyconfig)
var fp = Components.classes["@leahscape.org/foxyproxy/service;1"].getService().wrappedJSObject;
fp.cycleMode();