Skip to content

Instantly share code, notes, and snippets.

View jacobsalmela's full-sized avatar
:octocat:
To all that makes us unique

Jacob Salmela jacobsalmela

:octocat:
To all that makes us unique
View GitHub Profile
@jacobsalmela
jacobsalmela / go-build-all.sh
Created March 13, 2023 11:22 — forked from makew0rld/go-build-all.sh
Cross compile for all possible Golang targets. This script will always be updated, because it uses the `go` command to see what can be built.
#!/usr/bin/env bash
# Based on https://gist.github.com/eduncan911/68775dba9d3c028181e4
# but improved to use the `go` command so it never goes out of date.
type setopt >/dev/null 2>&1
contains() {
# Source: https://stackoverflow.com/a/8063398/7361270
[[ $1 =~ (^|[[:space:]])$2($|[[:space:]]) ]]
@jacobsalmela
jacobsalmela / elf.h
Created November 28, 2022 12:34 — forked from mlafeldt/elf.h
elf.h for OSX
/* This is the original elf.h file from the GNU C Library; I only removed
the inclusion of feature.h and added definitions of __BEGIN_DECLS and
__END_DECLS as documented in
https://cmd.inp.nsk.su/old/cmd2/manuals/gnudocs/gnudocs/libtool/libtool_36.html
On macOS, simply copy the file to /usr/local/include/.
Mathias Lafeldt <mathias.lafeldt@gmail.com> */
/* This file defines standard ELF types, structures, and macros.
@jacobsalmela
jacobsalmela / random_mnemonic.zsh
Created January 8, 2021 20:52 — forked from alexlovelltroy/random_mnemonic.zsh
This script uses the menemonic_wordlist from the mnemonic encoding project to generate a set of word pairs
#!/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 {
#!/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
@jacobsalmela
jacobsalmela / yt
Last active March 20, 2018 00:37
yt
googlevideo.com
r4.snnx5e6n76.googlevideo.com
r14.sn5hnedn76.googlevideo.com
r9.snoguesn76.googlevideo.com
r3.snnx57yn76.googlevideo.com
r9.snn8v7zn76.googlevideo.com
r4.snnx5e6ne6.googlevideo.com
r5.snnx5e6ne6.googlevideo.com
r6.sn4g5e6nl6.googlevideo.com
r13.snoguesnl6.googlevideo.com

Keybase proof

I hereby claim:

  • I am jacobsalmela on github.
  • I am jacobsalmela (https://keybase.io/jacobsalmela) on keybase.
  • I have a public key ASDWvnaeSJAaaXjkQKYASmFVtCkt-3YXrWDCow2zHagRiwo

To claim this, I am signing this object:

@jacobsalmela
jacobsalmela / setFavServers.sh
Created May 15, 2017 14:44
Set favorite servers in newer macOSes
#!/bin/bash
servers=("smb://server/share"
"smb://anotherserver/anothershare")
###### SCRIPT #######
# Run as the user via ARD
for i in "${!servers[@]}"
do
sfltool add-item -n "${servers[$i]}" com.apple.LSSharedFileList.FavoriteServers "${servers[$i]}"
done
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="34b334f6ad355e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ExtendOSPartition>
<Extend>true</Extend>
</ExtendOSPartition>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="34b334f6ad355e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName></ComputerName>
@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 / mergePDFs.py
Last active November 21, 2020 22:44
Merge PDFs using Python
#!/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()