Skip to content

Instantly share code, notes, and snippets.

View stevekm's full-sized avatar

Stephen Kelly stevekm

View GitHub Profile
@stevekm
stevekm / 000-Cheat-Sheets.md
Created May 1, 2024 04:03 — forked from JoshuaEstes/000-Cheat-Sheets.md
Developer Cheat Sheets for bash, git, gpg, irssi, mutt, tmux, and vim. See my dotfiles repository for extra info.
@stevekm
stevekm / ssh.md
Last active May 21, 2026 12:41
SSH login without password

[source]

SSH login without password

Your aim

You want to use Linux and OpenSSH to automate your tasks. Therefore you need an automatic login from host A / user a to Host B / user b. You don't want to enter any passwords, because you want to call ssh from a within a shell script.

How to do it

First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:

@stevekm
stevekm / gist:637897ececa2b493fd9b5b0ab91590dd
Created November 7, 2022 17:05
Python multiprocessing Pool apply_async example
#!/usr/bin/env python3
# do an action in parallel across multiple threads in Python
# example: get the average of lists of numbers
# references;
# https://stackoverflow.com/questions/8533318/multiprocessing-pool-when-to-use-apply-apply-async-or-map
# https://e2eml.school/multiprocessing.html
# https://docs.python.org/3.7/library/multiprocessing.html#multiprocessing.pool.Pool.apply_async
@stevekm
stevekm / igv_test_bat.md
Last active August 21, 2025 16:51
Sample Batch Script for IGV Snapshots
@stevekm
stevekm / SLURM_vs_code_ssh_config.txt
Last active May 31, 2025 07:03
SSH config to allow VS Code Remote SSH to connect to a fresh new SLURM job running on a remote HPC system
# ssh config to use with VS Code Remote SSH
# to launch a VS Code remote ssh session inside of
# a new SLURM compute job running on the remote HPC
# when you start a new ssh session from your LOCAL laptop,
# SLURM will spin up a new srun job and connect to the ssh daemon on the compute node
# your ssh connection will thus tunnel from your LOCAL laptop
# through the head node, to the compute node
# the SLURM job on the compute node will remain active until it expires via time limit
# the SLURM job will terminate when the ssh session is closed
@stevekm
stevekm / RIP.md
Last active May 31, 2025 03:56
remove Sophos from OS X El Capitan, and jamf

Sophos

with Tamper Protection on you cannot normally remove the software, and a password is needed to disable Tamper Protection. However you can also disable it this way

with Tamper protection enabled

/Library/Application Support/Sophos/opm/Installer.app/Contents$ sudo ./MacOS/tools/InstallationDeployer --remove
Password:
Tamper protection check failed. Exiting.
@stevekm
stevekm / run.sh
Created June 15, 2021 19:03
GNU parallel example command
parallel -k -N0 -n 0 -j 4 "echo your command here ; sleep 2" ::: {1..10}
@stevekm
stevekm / gist:53265226545c8920153c906a61335fbf
Created May 7, 2025 15:07
install singularity from ap
apt-get install -y singularity-container=4.1.1+ds2-1ubuntu0.2
@stevekm
stevekm / launchctl_man.md
Last active March 1, 2025 18:11
macOS OS X login items

[source]

This manual page is for Mac OS X version 10.9

If you are running a different version of Mac OS X, view the documentation locally:

    In Terminal, using the man(1) command

Reading manual pages
@stevekm
stevekm / convert_FLAC_to_mp3.sh
Created August 11, 2016 20:05
Use FFMPEG to convert FLAC to MP3
#!/bin/bash
# on OS X, need to install ffmpeg
# so that we can convert FLAC music files
# into mp3 files
# install ffmpeg
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265
brew update && brew upgrade ffmpeg