This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <assert.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stddef.h> | |
/* | |
* You can get the offset of a member on a struct by dereferencing that member on | |
* address 0 of such structure. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package content | |
import ( | |
"fmt" | |
"net/http" | |
"github.com/ponzu-cms/ponzu/management/editor" | |
"github.com/ponzu-cms/ponzu/system/item" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X POST 'http://localhost/xcatws/tokens?pretty=1' -H 'Content-type: application/json' --data "{ \"userName\": \"root\", \"userPW\": \"$(/opt/xcat/sbin/tabdump passwd | grep '^"system' | cut -f3 -d, | sed 's/"//g')\" }" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HasIter: | |
def __iter__(self): | |
return iter(range(10)) | |
def foo(value): | |
try: | |
for i in value: | |
print(i) | |
except TypeError: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() |