Skip to content

Instantly share code, notes, and snippets.

Stephen Kelly stevekm

Block or report user

Report or block stevekm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@stevekm
stevekm / mac.md
Last active Apr 12, 2019
Mac Guide
View mac.md

Programs to install on your MacBook

Essentials

Homebrew

  • Application manager for OS X
  • some homebrew downloads you might need:
brew tap caskroom/cask
@stevekm
stevekm / squeue2json.py
Created Dec 5, 2018
Convert SLURM squeue output to JSON format
View squeue2json.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Convert SLURM squeue output to JSON format
"""
import subprocess as sp
import json
process = sp.Popen(['squeue', '-o', '%all'], stdout = sp.PIPE, stderr = sp.PIPE, shell = False, universal_newlines = True)
proc_stdout, proc_stderr = process.communicate()
@stevekm
stevekm / Preferences.sublime_settings
Last active Jun 28, 2018
Settings for Sublime Text, Atom editor, iTerm, etc
View Preferences.sublime_settings
{
"draw_white_space": "all",
"font_size": 17,
"open_files_in_new_window": false,
"scroll_past_end": true,
"update_check": false
}
@stevekm
stevekm / index.html
Created Jan 11, 2018 — forked from pathunstrom/index.html
Dual Movement
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.box {
height: 100px;
width: 100px;
top: 100px;
@stevekm
stevekm / dumb.R
Created Dec 27, 2017
stupid R error
View dumb.R
> install.packages("ggrepel")
also installing the dependenciesviridisLite’, ‘scales’, ‘ggplot2
trying URL 'https://cran.rstudio.com/bin/macosx/mavericks/contrib/3.3/viridisLite_0.2.0.tgz'
Content type 'application/x-gzip' length 54110 bytes (52 KB)
==================================================
downloaded 52 KB
trying URL 'https://cran.rstudio.com/bin/macosx/mavericks/contrib/3.3/scales_0.5.0.tgz'
Content type 'application/x-gzip' length 336683 bytes (328 KB)
View ggplot_smooth_func.R
stat_smooth_func <- function(mapping = NULL, data = NULL,
geom = "smooth", position = "identity",
...,
method = "auto",
formula = y ~ x,
se = TRUE,
n = 80,
span = 0.75,
fullrange = FALSE,
level = 0.95,
@stevekm
stevekm / launchctl_man.md
Last active Aug 7, 2017
macOS OS X login items
View launchctl_man.md

[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 / extract_flac2mp3.sh
Last active Apr 17, 2017
Extract archives and convert FLAC's to mp3 on OS X / macOS
View extract_flac2mp3.sh
#!/bin/bash
input_dir="$1"
printf "Input dir is:\n%s\n\n" "$input_dir"
# this script will extract all of the archive files it finds with p7zip
# first install p7zip
# brew install p7zip
@stevekm
stevekm / counter.md
Last active Mar 23, 2017
bash for loop with sleep counter
View counter.md

After every third item, sleep [source]

counter=0
limit=3

foo="thing1 thing2 thing34 thing4 thing5 thing6 thing7 thing8 thing9 thing9"
for thing in $foo; do
    ( # start a subshell
    # increment the counter, sleep & reset it if its over the limit
@stevekm
stevekm / ssh.md
Last active Mar 22, 2017
SSH login without password
View ssh.md

[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:

You can’t perform that action at this time.