Skip to content

Instantly share code, notes, and snippets.

Plain Text Password

jason$ PASSWORD="Passw0rD"

Hashed password using md5

Safer: If someone has access to the database, they cannot see the passwords in plaintext and must run them through a hashing algorithm

jason$ echo $PASSWORD | md5
c0e49fa492cf94f8a9eab8b8166f271b
@at1as
at1as / create_file_of_size.py
Created June 9, 2014 20:47
create_file_of_size.py
#!/usr/bin/env python
'''
This script will create a file of a specified size
Usage: ./create_file_of_size.py --filename myfile --filesize 2 --magnitude mb
=> File myfile with size 2mb been created
'''
# Dependencies
import math
@at1as
at1as / ruby_random_class_tester.rb
Last active August 29, 2015 14:03
Just how random is Ruby's Random Class?
# How random is Ruby's Random Class?
require 'descriptive_statistics'
def rand_distribution(iters)
found = Hash.new
100.times { |key| found[key.to_s] = 0 }
iters.times do
rand_num = Random.rand(0..99)
found[rand_num.to_s] += 1
@at1as
at1as / gist:67db7a5507d4a18e626c
Last active August 29, 2015 14:07
Cipher2.rb
# encoding: UTF-8
# Jason M Willems
# github.com/at1as
# 15 September 2014
# 514-746-0452
require 'Base64'
ENCODED = "pr+/trjGu8vDeXmuw8F9y8TT1MPKyYXP2qKJjL7b2tOP5Nnb4dvolsTZ55ry3fCe7eX35/Wk8uvo9v2q//ut+f3/CMCz2gQIt/0P/w0VEQYIDgjCCBAYC9PIHRIQHhLVItD4ISIbIRvl2tkOMCEwIiA54Ss25CbmLjc4LuswLkfvREDyRkNBTDz4SU9VVklDUg4PEA=="
@at1as
at1as / gist:f3eecf2c71bfa02e14d5
Created June 1, 2015 14:31
Publishing Gems & Python Packages
*PyPi Package*
Structure:
├── LICENSE.md
├── README.md
├── hello_world
│   ├── __init__.py
│   ├── hello_world.py
├── hello_world_runner.py
@at1as
at1as / gist:dc3a29d3b68f45d42857
Created June 11, 2015 16:53
Find Necessary Ruby Method for Desired Output
#!/usr/bin/env ruby
## Find necessary method for desired result
## entering:
## jason$ method_find.rb "HELLO" "hello"
## returns:
## HELLO.downcase == hello
## HELLO.swapcase == hello
@at1as
at1as / gist:c8f58e7f5d2370ca7067
Created July 16, 2015 17:52
Rails Basic Commands

Create Controller

  • rails generate controller Users new

Generate Model (also creates a migration)

  • rails generate model User name:string email:string

Create Migration

@at1as
at1as / deobfuscate.js
Last active August 29, 2015 14:26
Federal Election Deobfuscater
/* Paste into your browser console to replace all instances in FaceBook of big 3 Canadian political parties
with "Big Government Party" and their leaders with "Big Government Politician" */
function traverseDOM(node, func) {
func(node);
node = node.firstChild;
while (node) {
traverseDOM(node, func);
node = node.nextSibling;
}
@at1as
at1as / reverseAndAdd.py
Created November 15, 2013 02:51
Add a number to its reverse until a palindrome is found
#!/usr/bin/env python2.7
'''
This program will add a number to its reverse until a palindrome is found
It will try up to 1000 iterations (configurable), or else notify the user a palindrome was not found
'''
count, maxIterations, currentValue = 1, 1000, ''
#Accept integers in range(1,100)
@at1as
at1as / zerosInRange.py
Created November 15, 2013 04:25
Returns the count of zeros contained in the numbers within a specified range
#!/usr/bin/env python2.7
'''
Return the count of zeros contained in the numbers within a specified range
'''
index, increment, count = 1, 2, 0
ceiling = int(raw_input("\nCeiling: "))
oddEven = raw_input("Search through:\nOdd numbers \t- 1 \nEven numbers \t- 2 \nOdd & Even \t- 3\n\nInput(1,2,3)? ")