Skip to content

Instantly share code, notes, and snippets.

Daniel Hilst dhilst

Block or report user

Report or block dhilst

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
View draft.sh
mkdir -p /opt/versatushpc/{etc,xcat}
mkdir -p /opt/versatushpc/xcat/post{install,scripts}
copycds CentOS-7-x86_64-DVD-1810.iso
cat <<'EOF' > /opt/versatushpc/xcat/postinstall/add-cluster-key
#!/bin/bash
pubkey=$(cat ~/.ssh/id_ed25519.pub)
authorized_keys="$IMG_ROOTIMGDIR/root/.ssh/authorized_keys"
if [ ! -f $authorized_keys ]; then
View gist:d3a979b4f662e5c3e9479c617f101dbf
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /root/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 62: Applying options for *
debug1: Executing proxy command: exec /usr/bin/sss_ssh_knownhostsproxy -p 22 node001
debug1: key_load_private_type: No such file or directory
debug1: permanently_drop_suid: 0
debug1: key_load_private_cert: No such file or directory
debug1: key_load_private_cert: No such file or directory
debug1: key_load_private_cert: No such file or directory
View gist:a99e4df17375a0ed8e3a4ce2286482fb
[root@headnode postinstall]# ssh -v node001
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /root/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 62: Applying options for *
debug1: Executing proxy command: exec /usr/bin/sss_ssh_knownhostsproxy -p 22 node001
debug1: permanently_drop_suid: 0
debug1: key_load_private_type: No such file or directory
debug1: key_load_private_cert: No such file or directory
debug1: key_load_private_cert: No such file or directory
View draft.sh
mkdir -p /opt/versatushpc/{etc,xcat}
mkdir -p /opt/versatushpc/xcat/post{install,scripts}
copycds CentOS-7-x86_64-DVD-1810.iso
cat <<'EOF' > /opt/versatushpc/xcat/postinstall/add-cluster-key
#!/bin/bash
pubkey=$(cat ~/.ssh/id_ed25519.pub)
authorized_keys="$IMG_ROOTIMGDIR/root/.ssh/authorized_keys"
if [ ! -f $authorized_keys ]; then
View gist:308b4b26599b13c20a8ff46603b0fc27
_xcat_complete() {
COMPREPLY=()
if [[ "${COMP_LINE}" =~ ^(ls|rm|ch|mk)def ]] || [[ "$COMP_LINE" =~ ^nodeset ]]; then
if [[ "${COMP_LINE}" =~ "-t network" ]]; then
local networks=$(lsdef -t network | cut -f1 -d' ' | paste -sd ' ')
COMPREPLY=( $(compgen -W "$networks" -- ${COMP_WORDS[-1]}) )
return 0
elif [[ "${COMP_LINE}" =~ "-t osimage" ]] || [[ "$COMP_LINE" =~ "osimage=" ]]; then
COMPREPLY=( $(compgen -W "$(lsdef -t osimage | cut -f1 -d' ' | paste -sd ' ')" -- ${COMP_WORDS[-1]#*=}) )
return 0
View gist:d7f4b0f9624c746bc238c33fad511949
class HasIter:
def __iter__(self):
return iter(range(10))
def foo(value):
try:
for i in value:
print(i)
except TypeError:
View gist:22eaf6089cc35fb8d43b4a49b680a5a4
#!/usr/bin/env python3
import sys
import re
def jobs_line(string):
return re.match(
r"^\[(?P<id>\d+)\]\s+(?P<default>\+|-)?\s+(?P<state>.*?)\s+(?P<rest>.*)", string
).groupdict()
View .emacs.el
(package-initialize)
(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
View gist:af9d5c15df94e0b36a8787c42ffab0ca
In [1]: for q2 in range (1, len(board)-q1):
...: if board[q1] == board[q1+q2] or board[q1+q2] == board[q1]+q2
...: or board[q1+q2] == board[q1]-q2:
...: return False
...: return True
...:
...: def n_queens_solutions(n):
...: board = []
...: return n_queens_helper(0, board, n)
...:
View foo.py
activity_level = [None, 1.2, 1.375, 1.55, 1.725, 1.9]
...
if gender == 'male':
bmr = (66 + (6.3*int(weight)) + (12.9*int(height)) - (6.8*int(age)))
calorie = bmr * ativity_levels[activity_level]
...
You can’t perform that action at this time.