<commit_before>#!/usr/bin/ruby

require 'ipaddr'

#Command and stuff to get the ip address from ifconfig
command = `ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`

i = 1

#Looping until and IP address is assigned
while command == ""
  command = `ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
  puts "no ip on try ##{i}"#For counting failed attempts, could be removed. 
  i += 1
  sleep 2
end

# Getting the IP info setup
ip = command
mac = `ifconfig eth0 | grep 'inet addr:' | cut -d: -f4` #Command to get MAC address

cidr = IPAddr.new(mac).to_i.to_s(2).count("1")

#Auto SSH into Hinkel's VPS
#Have a key for secure connection before running the script
#Edit "<EMAIL>" to be your own server
`autossh -f -R 19999:localhost:22 <EMAIL> -N`

#Doing a scan
#scan = `msfcli auxiliary/scanner/portscan/tcp rhosts=127.0.0.1 E'
scan = `msfconsole -x "db_nmap #{ip}/#{cidr} -A"`

scan
<commit_msg>Update startup.rb<commit_after>#!/usr/bin/ruby

require 'ipaddr'

#Command and stuff to get the ip address from ifconfig
command = `ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`

#Looping until and IP address is assigned
while command == ""
  command = `ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
  puts "no ip on try ##{i}"#For counting failed attempts, could be removed. 
  sleep 2
end

# Getting the IP info setup
ip = command
mac = `ifconfig eth0 | grep 'inet addr:' | cut -d: -f4` #Command to get MAC address

cidr = IPAddr.new(mac).to_i.to_s(2).count("1")

#Auto SSH into Hinkel's VPS
#Have a key for secure connection before running the script
#Edit "<EMAIL>" to be your own server
`autossh -f -R 19999:localhost:22 <EMAIL> -N`

#Doing a scan
#scan = `msfcli auxiliary/scanner/portscan/tcp rhosts=127.0.0.1 E'
scan = `msfconsole -x "db_nmap #{ip}/#{cidr} -A"`

scan

{'fraction_non_alphanumeric': 0.1411637931034483, 'fraction_numerical': 0.02693965517241379, 'mean_word_length': 3.786082474226804, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6757522', 'n_tokens_mistral': 712, 'n_tokens_neox': 681, 'n_words': 259}