Skip to content

Instantly share code, notes, and snippets.

View KronicDeth's full-sized avatar

Elle Imhoff KronicDeth

View GitHub Profile
@KronicDeth
KronicDeth / postgresql.rb
Created June 15, 2011 18:54
Postgres 8.4.8 Homebrew forumula
require 'formula'
require 'hardware'
class Postgresql <Formula
homepage 'http://www.postgresql.org/'
url 'http://ftp2.uk.postgresql.org/sites/ftp.postgresql.org/source/v8.4.8/postgresql-8.4.8.tar.bz2'
md5 '4603e8ea30cee97189b62b39022f2043'
depends_on 'readline'
depends_on 'libxml2' if MACOS_VERSION < 10.6 # Leopard libxml is too old
@KronicDeth
KronicDeth / descendants.rb
Created June 13, 2013 18:31
Msf::Module::Platform.descendants
Msf::Module::Platform::Cisco
Msf::Module::Platform::Solaris
Msf::Module::Platform::OSX
Msf::Module::Platform::BSD
Msf::Module::Platform::OpenBSD
Msf::Module::Platform::BSDi
Msf::Module::Platform::NetBSD
Msf::Module::Platform::FreeBSD
Msf::Module::Platform::AIX
Msf::Module::Platform::HPUX
@KronicDeth
KronicDeth / translate_refs_to_references_setup.sql
Created June 18, 2013 20:43
Setup metasploit_data_models_development to test TranslateRefsToReferences migrations
DELETE FROM refs;
DELETE FROM vulns;
DELETE FROM vulns_refs;
INSERT INTO refs (name)
VALUES ('URL-http://example.com'),
('CVE-1'),
('FOOBAR-1');
INSERT INTO vulns (name)
#include <iostream> // includes and statements section
using std::cin; // user input
using std::cout; // machine output
using std::endl; // for line breaks
int main () {
int coupons;
cout << "How many coupons did you win?" << endl;
do {
cout << "What is your guess?" << endl;
cin >> guess;
if (guess < magicNumber);
{
cout << "You guessed too low!" << endl;
}
else if (guess > magicNumber);
#include <iostream> // includes and statements section
#include <string> // strings
#include <cstdlib> // c standard library
#include <ctime> // time
using std::cin; // user input
using std::cout; // machine output
using std::endl; // for line breaks
using std::strtol; // convert string to int
using std::string; //string
// Regina Imhoff
// Ecampus CS 161
// Assignment #6
// makes histogram of students' grades as entered by an instructor
#include <iostream> // includes and statements section
#include <string> // strings
#include <cstdlib> //c standard library
#include <stdio.h>
#include <string.h>
@KronicDeth
KronicDeth / module_ancestor_paths.rb
Created October 23, 2014 13:14
File paths for a metasploit-framework module, including staged payloads where the reference name of the payload Class does not match the path to the stage and stager
# 1. Run `msfconsole`
# 2. Select an module `use payload/windows/patchupdllinject/bind_tcp_rc4`
# 2. Enter `irb` mode
# active_module is the module selected with `use`
module_ancestors = active_module.class.ancestors.select { |ancestor|
ancestor.name.try(:start_with?, 'Msf::Modules::')
}
hex_unpacked_module_ancestor_full_names = module_ancestors.map(&:name).map { |name|
name.sub(/^Msf::Modules::Mod/, '')
#include <iostream>
#include <fstream>
#include <string>
//***********************************
// A program to search through 4 different files looking for a number, 5
//***********************************
void insertSort(int arrayToSort[], int arraySize){
@KronicDeth
KronicDeth / Explanation.md
Created January 3, 2015 02:07
CharList vs String in quotes and quoted atoms

When using interpolation, inside single quotes, the contents of the Elixir CharList (Erlang string) are internally represented as an Elixir String (Erlang binary) and only become a CharList at the end with a hidden call to String.to_char_list/1 that you can see in the quoted form, so any CharList with interpolation can be written directly as a String.to_char_list(string_with_interpolation) instead for the same quoted form.

When : is added before either the CharList or the String, the quoted form is the same (the only difference is due to the single or double quotes around the interpolated bar). This can be thought of as either (a) quotes for atoms don't have the same meaning as they do normally or (b) when single quotes are used, the String.to_char_list/1 call is stripped when wrapped in the :erlang.binary_to_atom/1 call.