Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am jecxjo on github.
* I am jeffparent (https://keybase.io/jeffparent) on keybase.
* I have a public key whose fingerprint is B6A6 B447 1912 CA8D 3FF6 0FE8 636E 38D4 22A6 9567
To claim this, I am signing this object:
@jecxjo
jecxjo / passwd.sh
Last active September 23, 2015 02:33
BASH CGI Script for managing Unix Passwords
#!/bin/bash -
#===============================================================================
# Copyright (c) 2015 Jeff Parent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
{-# LANGUAGE OverloadedStrings #-}
--
-- A working example of kqr's "A Gentle Introduction to Monad Transformers"
-- using ExceptT.
--
-- see https://github.com/kqr/gists/blob/master/articles/gentle-introduction-monad-transformers.md
--
import Data.Text
@jecxjo
jecxjo / aes-example.tcl
Created August 25, 2016 21:26
AES File Encryption / Decryption in tcl with automatic base64 encoding
# Requires tcllib
package require aes
package require tcl::transform::base64
package require md5
# Make some sort of key data, 16, 24, or 32 bytes long
set key [string repeat - 16]
# Generate an IV, 16 bytes long. MD5 of clock ticks, the Proc ID, and
# a random value. Take 16 bytes.
@jecxjo
jecxjo / crypto.tcl
Created August 26, 2016 19:28
tcl/tk example AES Encryption with channels and transforms
# crypto.tcl --
#
# This file implements and example Tk applicaiton that uses
# AES encryption, Channels and Transforms.
#
# Copyright (c) 2016 Jeff Parent
#
# This code is licensed under the Creative Commons Attribution-ShareAlike 4.0
# International license (CC BY-SA 4.0).
#
@jecxjo
jecxjo / saltpack.vim
Created September 2, 2016 03:41
Vimscript to Read/Write Keybase's Saltpack encrypted files
" Keybase - saltpack
augroup SALTPACK
au!
" Make sure nothing is written to ~/.viminfo
au BufReadPre,FileReadPre *.saltpack set viminfo=
" No other files with unencrypted info
au BufReadPre,FileReadPre *.saltpack set noswapfile noundofile nobackup
" Reading Files, assumes you can decrypt
au BufReadPost,FileReadPost *.saltpack :%!keybase decrypt
@jecxjo
jecxjo / newdefect.tcl
Created September 6, 2016 16:05
New Defect Utility (todo.txt and Perforce)
# Name: New Defect Automation
# Author: Jeff Parent
# Date: 2016/08/12 20:40:03
# Changes:
# 0.5 - Added P4PORT configuration and using Promises
# 0.3 - Writes to Todo.txt and Perforce
set version "0.5"
package provide app-newdefect $version
@jecxjo
jecxjo / diceware.sh
Last active June 12, 2017 22:56
A simple diceware script that includes a wordlist.
#!/bin/bash
#===============================================================================
# Copyright (c) 2017 Jeff Parent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
@jecxjo
jecxjo / README
Last active August 12, 2020 16:34
SlackBuild: racket 7.8
Racket (formerly named PLT Scheme) is a general purpose, multi-paradigm
programming language in the Lisp/Scheme family. One of its design goals is to
serve as a platform for language creation, design, and implementation. The
language is used in a variety of contexts such as scripting, general-purpose
programming, computer science education, and research. (source: Wikipedia)
racket is the command line version, drracket is the GUI-version
This SlackBuild uses the src + built packages distribution. It builds
faster as it contains platform-independent bytecode. If you wish to build
@jecxjo
jecxjo / sss.sh
Created April 22, 2021 16:26
Secure Shell Script
#!/usr/bin/env bash
usage() {
cat <<EOF
USAGE: sss.sh <script> [<args>]
To encrypt file you'll need openssl cli
$ openssl aes-256-cbc -a -salt -in <script> -out <enc script>