- HPC User Support Tools
- hust16.github.io
This file contains hidden or 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
function logdate() { | |
date +"%Y-%m-%d %H:%M:%S %Z" | |
} | |
function msg() { | |
if [[ "$#" -ne 2 ]]; then | |
printf "[%s] %s: (%s) %s" "$(logdate)" "$0" "fatal" "incorrect number of arguments provided to msg function" | |
exit 1 | |
fi |
This file contains hidden or 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
#!/bin/bash | |
food=banana | |
bash -c 'echo ${food:-(no value)}' | |
export food | |
bash -c 'echo ${food:-(no value)}' |
This file contains hidden or 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
In case it's relevant, the code in the file `qog` in | |
the same Github gist as this file should be treated | |
as being released under the CC-0 1.0 license, as described | |
at the following link: | |
https://creativecommons.org/publicdomain/zero/1.0/legalcode |
This file contains hidden or 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 bash | |
function callstack() { | |
echo --- Trace: --- | |
local i | |
# These arrays start at index 0, but 0 is this callstack function, so skip it. | |
for ((i=1; i<${#FUNCNAME[*]}; i++)) do | |
if [ $i -ne 1 ]; then | |
echo -n " " | |
fi |
This file contains hidden or 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 <stdio.h> | |
typedef union { | |
double d; | |
unsigned long long i; | |
struct { | |
unsigned long long mantissa : 52; | |
unsigned int exponent : 11; | |
unsigned int sign : 1; | |
} parts; | |
} double_cast; |
This file contains hidden or 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/bash -l | |
# Request 10 minutes of runtime | |
#$ -l h_rt=4:00:00 | |
# Request 32 cores | |
#$ -pe mpi 32 | |
# Don't share nodes: managing Spark core allocation within a node is fiddly and this is easier | |
#$ -ac exclusive |
This file contains hidden or 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
\documentclass{standalone} | |
\usepackage{pgfplots} | |
\begin{document} | |
\pgfplotsset {width=15cm, compat=1.12} | |
\begin{tikzpicture} | |
%\pgfplotsset {small} | |
\pgfplotsset{every tick label/.append style={font=\small}} | |
\matrix [column sep=5mm] { |
This file contains hidden or 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
/* Tiny web server in Golang for sharing a folder | |
Copyright (c) 2010-2014 Alexis ROBERT <[email protected]> | |
Alterations to be able to serve files from /proc by Ian Kirker <[email protected]> | |
Contains some code from Golang's http.ServeFile method, and | |
uses lighttpd's directory listing HTML template. */ | |
package main | |
import ( |
This file contains hidden or 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/perl | |
use strict; | |
use warnings; | |
no warnings qw/uninitialized/; | |
use File::stat; | |
use Cwd; | |
use Env qw(SGE_ROOT); |
NewerOlder