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 python | |
try: | |
from pydocker import DockerFile | |
except ImportError: | |
try: | |
from urllib.request import urlopen | |
except ImportError: | |
from urllib import urlopen | |
exec(urlopen('https://raw.githubusercontent.com/AStupidBear/pydocker/master/pydocker.py').read()) |
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 numpy as np | |
import onnx | |
import sys | |
from onnx import helper, numpy_helper, shape_inference | |
import sympy | |
from packaging import version | |
assert version.parse(onnx.__version__) >= version.parse("1.5.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
#!/bin/bash | |
args=("$@") | |
src=${args[$(($#-2))]} | |
dst=${args[$(($#-1))]} | |
rsyncopt=${@:1:$#-2} | |
if [[ ! $dst == *:* ]]; then | |
mkdir -p $dst | |
fi | |
find $src -mindepth 1 -maxdepth 1 | sort -nr | xargs -n 1 -P 10 -I {} bash -c """ | |
name=\$(basename {}) |
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
#!/bin/bash | |
iface=$(ip addr show | awk '/inet.*brd/{print $NF; exit}') | |
hostip=$(ip addr show $iface | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/') | |
user=${1-$USER} | |
pass=${2-abc1234} | |
root=${3-/BIGDATA1} | |
cat |sudo tee -a /etc/exports << EOF | |
$root *(rw,sync,no_root_squash,no_subtree_check) | |
EOF |
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
using Flux, Random, Statistics | |
Random.seed!(1234) | |
x = randn(Float32, 10, 1, 100) | |
y = mean(x, dims = 1) | |
model = Chain(LSTM(10, 100), LSTM(100, 1)) | |
function loss(x, y) |
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 julia | |
using Pkg | |
if !haskey(Pkg.installed(), "PkgTemplates") | |
pkg"add https://github.com/invenia/PkgTemplates.jl#master" | |
end | |
using PkgTemplates | |
t = Template( |
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
#!/bin/bash | |
iface=$(ip addr show | awk '/inet.*brd/{print $NF; exit}') | |
gateway=$(route -n | grep 'UG[ \t]' | awk '{print $2}') | |
address=$(ip addr show | awk '/inet.*brd/{print $2; exit}') | |
if which netplan &> /dev/null; then | |
yaml=$(ls /etc/netplan/*.yaml | head -n 1) | |
sudo cp $yaml $yaml.bak | |
sudo tee $yaml << EOF | |
network: | |
version: 2 |
OlderNewer