Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
To all that makes us unique

Jacob Salmela jacobsalmela

:octocat:
To all that makes us unique
View GitHub Profile
@jacobsalmela
jacobsalmela / autoDeployWindows.bat
Last active Sep 30, 2021
Script for WinPE to auto deploy a Windows 10 image.
View autoDeployWindows.bat
echo select disk 0 > diskpart%ID%.txt
echo clean >> diskpart%ID%.txt
echo ** Creating system reserved partition...
echo create partition primary size=500 >> diskpart%ID%.txt
echo select partition 1 >> diskpart%ID%.txt
echo active >> diskpart%ID%.txt
echo format quick fs=ntfs >> diskpart%ID%.txt
echo assign letter="r" >> diskpart%ID%.txt
@jacobsalmela
jacobsalmela / requestMedicalRecords.py
Created Jun 3, 2016
Template script to quickly fill out PDFs
View requestMedicalRecords.py
#!/usr/bin/env python
# Jacob Salmela
# 2016-06-02
# Writes text to a PDF at coordinates. Use for quickly filling out forms that you use regularly.
# This takes some manual setup, but saves a ton of time once done
# http://stackoverflow.com/a/17538003
# Make sure to install the two utilities below first
# sudo easy_install pyPdf
# sudo easy_install reportlab
@jacobsalmela
jacobsalmela / ltsp.conf
Created Apr 21, 2016
dnsmasq config file for iPXE booting with an existing DHCP server
View ltsp.conf
# Sample configuration for dnsmasq to function as a proxyDHCP server,
# enabling LTSP clients to boot when an external, unmodifiable DHCP
# server is present.
# The main dnsmasq configuration is in /etc/dnsmasq.conf;
# the contents of this script are added to the main configuration.
# You may modify the file to suit your needs.
# Don't function as a DNS server:
port=0
@jacobsalmela
jacobsalmela / nc-reverse-shell.sh
Created Aug 13, 2014
(OS X) Reverse shell via netcat
View nc-reverse-shell.sh
#!/bin/bash
#----------AUTHOR------------
# Jacob Salmela
# 9 April 2013
#---------DESCRIPTION--------
# Serves up an unencrypted, reverse-shell when the -e option is unavailable
# Much less reliable (command lag), but useful in a pinch
#----------FUNCTIONS---------
View winpeDeployWindows10
@ECHO OFF
:: Jacob Salmela
:: 2016-03-09
:: Deploy Windows 10
wpeinit
echo ** Selecting first disk and reformatting...
echo select disk 0 > diskpart%ID%.txt
echo clean >> diskpart%ID%.txt
@jacobsalmela
jacobsalmela / random_mnemonic.zsh
Created Jan 8, 2021 — forked from alexlovelltroy/random_mnemonic.zsh
This script uses the menemonic_wordlist from the mnemonic encoding project to generate a set of word pairs
View random_mnemonic.zsh
#!/usr/bin/env zsh
#
# This script uses the menemonic_wordlist from the mnemonic encoding project to generate a set of word pairs
# I use them for software release naming conventions and I like choices
# You can get it for yourself with curl
# curl -Lo menmonic_wordlist.txt http://web.archive.org/web/20091003023412/http://tothink.com/mnemonic/wordlist.txt
#
#
MNEMONIC_FILE="$HOME/Documents/mnemonic_wordlist.txt"
function random_word {
View enable-accessibility.sh
case ${OSTYPE} in
# Snow Leopard through Mountain lion
darwin10*) touch /private/var/db/.AccessibilityAPIEnabled;;
darwin11*) touch /private/var/db/.AccessibilityAPIEnabled;;
darwin12*) touch /private/var/db/.AccessibilityAPIEnabled;;
# Mavericks and Yosemite
darwin13*) sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT INTO access VALUES('kTCCServiceAccessibility','com.apple.systemevents',0,1,1,NULL);";
sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT INTO access VALUES('kTCCServiceAccessibility','com.apple.RemoteDesktopAgent',0,1,1,NULL);";;
darwin14*) sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT INTO access VALUES('kTCCServiceAccessibility','com.apple.systemevents',0,1,1,NULL);";
sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT INTO access VALUES('kTCCServiceAccessibility','com.apple.RemoteDesktopAgent',0,1,1,NULL);";;
@jacobsalmela
jacobsalmela / mergePDFs.py
Last active Nov 21, 2020
Merge PDFs using Python
View mergePDFs.py
#!/usr/bin/env python
# Jacob Salmela
# Make PyPDF2 is installed: sudo easy_install PyPDF2
# https://jacobsalmela.com/2016/08/12/merge-pdfs-natively-with-a-right-click-in-os-x/
import sys
import os
from PyPDF2 import PdfFileMerger, PdfFileReader
merger = PdfFileMerger()
@jacobsalmela
jacobsalmela / convertDOCXtoPDF.sh
Last active Aug 27, 2020
Converts a DOC or DOCX to a PDF with a right-click
View convertDOCXtoPDF.sh
#!/bin/bash
# Jacob Salmela
# 2016-03-12
# Convert annoying DOCX into PDFs with a right-click
# Run this as an Automator Service
###### SCRIPT #######
for f in "$@"
do
# Get the full file PATH without the extension
View batch_download_gb_loops.sh
#!/bin/bash
# Jacob Salmela
# 11 February 2014
# Updated: 2015-05-12
# https://github.com/jacobsalmela
# Copy ALPIndex.app into /Applications on each machine that the script will run on
#----------VARIABLES---------
# Variable to store the location of the ALPIndex binary, which is inside the .app bundle