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 | |
SCRIPT_PATH=$(cd $(dirname $0); pwd) | |
DOCKER_DIR=$SCRIPT_PATH/docker | |
TESTS_DIR=$SCRIPT_PATH/tests | |
DOCKER_NAME=$(basename $SCRIPT_PATH) | |
DOCKER_REV=rev1 | |
function getFileListCheckSum() { | |
(cd $DOCKER_DIR; find . -type f | xargs md5sum) |
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 pandas as pd | |
import numpy as np | |
import datetime | |
df = pd.DataFrame() | |
df1 = pd.DataFrame( | |
{ | |
'col_0': [0, 1, 2], | |
'col_1': np.arange(3, 6), |
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 matplotlib.pyplot as plt | |
import math | |
def valid_convolve(x, y, n): | |
b = np.ones(n)/ n | |
y2 = np.convolve(y, b, mode="valid") | |
return (x[n-1:], y2) | |
def convolve_gradient(x, y, n, dx = 1): |
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
# https://stackoverflow.com/questions/24943991/change-grid-interval-and-specify-tick-labels-in-matplotlib | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.ticker import (AutoMinorLocator, MultipleLocator) | |
fig, ax = plt.subplots(figsize=(10, 8)) | |
x = range(100+1) | |
y = range(100,200+1) | |
ax.plot(x, y, label="test") |
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
# https://stackoverflow.com/questions/24943991/change-grid-interval-and-specify-tick-labels-in-matplotlib | |
import numpy as np | |
import matplotlib.pyplot as plt | |
fig = plt.figure() | |
ax = fig.add_subplot(1, 1, 1) | |
# Major ticks every 20, minor ticks every 5 | |
major_ticks = np.arange(0, 101, 20) |
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
# https://qiita.com/quryu/items/7e281dcb11b0e3db3a99 | |
# https://tonari-it.com/python-openpyxl-cell-size/ | |
# https://stackoverflow.com/questions/54641637/how-to-change-size-of-picture-using-openpyxl | |
import io | |
import openpyxl | |
import matplotlib.pyplot as plt | |
def plot(): | |
fig, ax = plt.subplots(figsize=(4, 3)) |
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 -e | |
function usage () { | |
echo "usage $0 <action> [--cache-dir <cache-dir] [--remote <remote cache url>]" | |
echo "" | |
echo "<action>:" | |
echo " build" | |
echo " update-cache" | |
echo "" | |
echo "<cache-dir>:" | |
echo " The location of local cache" |
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/sh | |
PRECHECK=$(ls /dev/disk/by-id/* | grep usb | wc -l) | |
if [ $PRECHECK -eq 0 ]; then | |
echo No USB block devices are connected. | |
exit 1 | |
fi | |
NUMUSBDEVICES=$(ls /dev/disk/by-id/usb* -1 | xargs readlink -f | grep -E '[a-z]+$' | wc -l) | |
if [ $NUMUSBDEVICES -ne 1 ]; 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
#!/bin/bash | |
# /sys/block/sdb/removable | |
function check_removable() { | |
devicename=$1 | |
removable=$(cat /sys/block/$devicename/removable) | |
if [ x$check_removable = x"1" ] ; then | |
echo $devicename | |
fi |
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/python3 | |
import string | |
import subprocess | |
import os | |
import sys | |
########################################################################### | |
# template for /etc/apt/apt.conf | |
########################################################################### |
NewerOlder