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
import csv | |
import sys | |
import click | |
@click.command() | |
@click.option('--file-name', help='Input file (file is not modified).') | |
@click.option('--index', help='Insert column at this position (starts at 0).') | |
@click.option('--column-name', help='Column name.') | |
def main(file_name, index, column_name): |
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
# adapted from https://web.archive.org/web/20190522110737/https://antergos.com/wiki/uncategorized/create-a-working-live-usb/ | |
# first find out the device of your usb | |
sudo fdisk -l | |
# now that you know the letter, replace the "X" below | |
# typically "X" is replaced by "b" or "c" but it can be different on your system | |
# make sure it's not the device of your hard drive, otherwise you wipe it | |
sudo dd bs=4M if=/path/to/image.iso of=/dev/sdX status=progress | |
sync |
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 bash | |
module purge | |
source /global/work/sonar/python/environment | |
pyenv shell 3.6.7 | |
python --version | |
git clone https://github.com/uit-no/sonar.git github-sources |
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 bash | |
openssl_version="1_1_0f" | |
python_version="3.7.0" | |
_here=$PWD | |
mkdir -p ${_here}/tmp | |
cd ${_here}/tmp | |
wget https://github.com/openssl/openssl/archive/OpenSSL_${openssl_version}.tar.gz |
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 bash | |
# adjust APPVEYOR_TOKEN, username, and projectname | |
APPVEYOR_TOKEN=.................... | |
curl -H "Authorization: Bearer $APPVEYOR_TOKEN" \ | |
-H "Content-Type: application/json" \ | |
-X "DELETE" \ | |
https://ci.appveyor.com/api/projects/username/projectname/buildcache |
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 bash | |
hostname=$1 | |
echo "SSH key fingerprints for hostname: $hostname" | |
echo "hexadecimal format" | |
ssh-keygen -lf <(ssh-keyscan -t rsa $hostname 2> /dev/null) -E md5 | |
ssh-keygen -lf <(ssh-keyscan -t ecdsa $hostname 2> /dev/null) -E md5 |
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
$ xfreerdp /u:youruser /v:yourip /w:2560 /h:1440 /p:yourpassword /cert-ignore & |
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
import sys | |
from math import exp | |
import numpy as np | |
from scipy.interpolate import RectBivariateSpline | |
import random | |
from time import time | |
def f(x, y): | |
return exp(-(2.0*x)**2.0 - (y/2.0)**2.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
import csv | |
import glob | |
from collections import Counter | |
languages = [ | |
'Matlab', | |
'R', | |
'Python', | |
'Perl', | |
'C', |
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
""" | |
Allows to interactively draw a new polygon based | |
on an existing polygon. | |
""" | |
import sys | |
import matplotlib.pyplot as plt | |
in_file = sys.argv[-2] | |
out_file = sys.argv[-1] |