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
FROM golang:1.9 | |
# Install Jupyter Notebook | |
# `hash -r pip` is a workaround of pip v10 related issue (https://github.com/pypa/pip/issues/5221#issuecomment-382069604) | |
RUN apt-get update && apt-get install -y libzmq3-dev python3-pip && rm -rf /var/lib/apt/lists/* | |
RUN pip3 install --upgrade pip && hash -r pip && pip3 install -U jupyter jupyterlab && jupyter serverextension enable --py jupyterlab --sys-prefix | |
# Install lgo Jupyter lab extension to support code formatting. | |
# Please remove this line if you do not use JupyterLab. | |
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \ |
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
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=VMware/" | |
sudo /usr/src/linux-headers-`uname -r`/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vmmon) | |
sudo /usr/src/linux-headers-`uname -r`/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vmnet) | |
sudo mokutil --import MOK.der | |
reboot |
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
FROM ubuntu:19.10 as build-env | |
RUN sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list | |
RUN apt-get update | |
RUN apt-get install wget -y \ | |
&& apt-get build-dep nmap -y | |
RUN wget https://nmap.org/dist/nmap-7.80.tar.bz2 \ | |
&& bzip2 -cd nmap-7.80.tar.bz2 | tar xvf - \ | |
&& cd nmap-7.80 \ | |
&& ./configure \ | |
&& make |
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
function read_env() { | |
if builtin cd "$@"; then | |
local env="$PWD/.zenv" | |
if [ -f "$env" ]; then | |
if [ -z "$CURRENT_ENV" ]; then | |
builtin source "$env" | |
export CURRENT_ENV="$env" | |
elif [ ! "$CURRENT_ENV" = "$env" ]; then | |
if [ "$(type -t deactivate)" = "function" ]; then | |
deactivate |
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
$date = Get-Date -Format "yyyy-MM-dd_HH:mm:ss" | |
if (! $args ) { | |
$msg = $date | |
} else { | |
$msg = $args | |
} | |
git add . | |
git commit -m "$msg" |
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 | |
c=0 | |
for f in *.zip; do | |
x="$(zipinfo -t "$f" | awk '{print $1}')" | |
c=$(( $c + $x )) | |
done | |
echo "The total file count is:" $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
from os import walk, path | |
def get_folder_size(start_path): | |
""""Output size of folder in bytes""" | |
total_size = 0 | |
for dir_path, dir_names, file_names in walk(start_path): | |
for f in file_names: | |
fp = path.join(dir_path, f) | |
# skip if it is symbolic link | |
if not path.islink(fp): |
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
--- | |
- hosts: all | |
remote_user: root | |
tasks: | |
- name: Update the apt package index | |
become: yes | |
apt: | |
name: "*" | |
state: latest |
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
from sys import argv | |
from json import dump | |
file = argv[1] | |
url_list = [] | |
with open(file) as f: | |
for line in f: | |
url_list.append(line.strip("\n")) |
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
String dockerHubUser = "philipwold" | |
String repo = "mpd" | |
node ("master") { | |
try { | |
stage ("checkout scm") { | |
checkout scm | |
} | |
stage ("run dos2unix") { |