Skip to content

Instantly share code, notes, and snippets.

View vulcansmithy's full-sized avatar

VulcanSmithy vulcansmithy

View GitHub Profile
@vulcansmithy
vulcansmithy / prime_time.rb
Created July 22, 2022 15:36
Calculate Prime Number
=begin
Prime Time
Have the function PrimeTime(num) take the num parameter
being passed and return the string true if the parameter is
a prime number, otherwise return the string false. The
range will be between 1 and 2^16.
Examples
Input: 19
Output: true
@vulcansmithy
vulcansmithy / factorial.rb
Created July 22, 2022 15:27
ruby code to calculate the factorial of a num
def FirstFactorial(num)
iteration = 1
factorial = 1
while iteration <= num do
factorial *= iteration
iteration += 1
end
return factorial
end
@vulcansmithy
vulcansmithy / base64_encode.rb
Created June 23, 2021 19:38 — forked from bkenny/base64_encode.rb
Quickly encode a file in ruby to base64
require 'base64'
# Open the file you wish to encode
data = File.open('/Users/bkenny/Desktop/d3cce16ee41411e296c022000a1f980f_101.mp4').read
# Encode the puppy
encoded = Base64.encode64(data)
# Spit it out into one continous string
puts encoded.gsub(/\n/,"")
@vulcansmithy
vulcansmithy / docker-pry-rails.md
Created March 10, 2020 05:25 — forked from briankung/docker-pry-rails.md
Using pry-rails with Docker

First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails

gem 'pry-rails', group: :development

Then you'll want to rebuild your Docker container to install the gems

### Keybase proof
I hereby claim:
* I am vulcansmithy on github.
* I am ulegaspi (https://keybase.io/ulegaspi) on keybase.
* I have a public key ASCe3Ge3qRrDdi5N_QNWhWKhPgpiu1ktAQyYka-g0X-RGgo
To claim this, I am signing this object:
@vulcansmithy
vulcansmithy / Rakefile
Created November 15, 2018 16:05 — forked from schickling/Rakefile
Activerecord without Rails
require "active_record"
namespace :db do
db_config = YAML::load(File.open('config/database.yml'))
db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'})
desc "Create the database"
task :create do
ActiveRecord::Base.establish_connection(db_config_admin)
@vulcansmithy
vulcansmithy / MySQL_macOS_Sierra.md
Created November 15, 2018 14:48 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

Multiple MySQL Versions with Homebrew

For homebrew version 0.9.5.

brew -v # => Homebrew 0.9.5

Install the current version of mysql.

# Install current mysql version

brew install mysql

From: http://redteams.net/bookshelf/
Techie
Unauthorised Access: Physical Penetration Testing For IT Security Teams by Wil Allsopp.
Social Engineering: The Art of Human Hacking by Christopher Hadnagy
Practical Lock Picking: A Physical Penetration Tester's Training Guide by Deviant Ollam
The Art of Deception: Controlling the Human Element of Security by Kevin Mitnick
Hacking: The Art of Exploitation by Jon Erickson and Hacking Exposed by Stuart McClure and others.
Nmap Network Scanning: The Official Nmap Project Guide to Network Discovery and Security Scanning by Fyodor
The Shellcoder's Handbook: Discovering and Exploiting Security Holes by several authors