Skip to content

Instantly share code, notes, and snippets.

View jackdalton's full-sized avatar

Jack Dalton jackdalton

View GitHub Profile
@jackdalton
jackdalton / update.sh
Last active January 10, 2019 14:57
update script
#!/bin/bash
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
SCRIPTNAME=`basename "$0"`
# if not root then run as root
if (( $EUID != 0 )); then
sudo $SCRIPTPATH/$SCRIPTNAME
exit
fi
#!/usr/bin/env python
# coding=utf-8
from __future__ import division
import sys
alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
def letter_makeup(file_name):
#!/usr/bin/env python
# coding=utf-8
## Brute force a string encrypted with Caesar's Cipher
from caesar import caesar_d
keymap = {
"a": 0,
"b": 1,
@jackdalton
jackdalton / sqlmap-easy.py
Created May 22, 2016 03:32
An sqlmap simplification script
#!/usr/bin/env python
# coding=utf-8
from os import system
version = "v1.0.0"
config = {
"target": None,
"flags": ""
}
@jackdalton
jackdalton / cat.hs
Created May 16, 2016 22:33
The "cat" command line utility, implemented in Haskell.
import System.Environment
main :: IO ()
main = do
args <- getArgs
let fileName = head args
fcontents <- readFile fileName
print fcontents
@jackdalton
jackdalton / rock-paper-scissors.hs
Last active March 24, 2016 03:24
Haskell rock paper scissors game
import System.IO.Unsafe
import System.Random
-- take user input for their choice
-- random number for computer choice
-- return outcome
moves :: [String]
moves = [ "rock"
@jackdalton
jackdalton / .bashrc
Last active February 6, 2016 20:50
My .bashrc file (Arch Linux)
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
alias la="ls -a"
archey3 -c red
@jackdalton
jackdalton / example-log.txt
Created December 26, 2015 08:14
Update GitHub repo links in a directory
[jack@arch]$ ls -R testdir
testdir:
a.txt testdir2
testdir/testdir2:
b.txt
[jack@arch]$ cat testdir/a.txt
def
[jack@arch]$ cat testdir/testdir2/b.txt
def123
@jackdalton
jackdalton / main.c
Last active November 28, 2015 20:14
Auto apt-get update
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *msg_usage = "Usage: agui <package1...package2> [options]";
int main(int argc, char *argv[]) {
char command[1024];
strcat(command, "apt-get update; apt-get install");
if (argc < 2) {
@jackdalton
jackdalton / LICENSE
Last active November 28, 2015 01:59
Expression evaluater
Copyright (c) 2015 Jack Dalton
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: