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 | |
function pfprint() { | |
if [ -n "$1" ];then | |
sudo pfctl -a "$2" -s"$1" 2>/dev/null | |
else | |
sudo pfctl -s"$1" 2>/dev/null | |
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
stages: | |
- test | |
- deploy | |
test_job: | |
image: gitlab/dind | |
stage: test | |
only: | |
- tags | |
script: |
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
# Generate Private Key | |
$ openssl genrsa -out server.key 2048 | |
# Generate CSR | |
$ openssl req -new -out server.csr -key server.key -config openssl.cnf | |
# => Fill in info | |
# Check CSR | |
$ openssl req -text -noout -in server.csr | |
# Sign Cert | |
$ openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt -extensions v3_req -extfile openssl.cnf |
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
package main | |
import ( | |
"log" | |
"bufio" | |
"time" | |
"os" | |
"fmt" | |
"io" | |
"net" |
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
"curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
":PlugInstall | |
if empty(glob("~/.vim/autoload/plug.vim")) | |
execute '!curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.github.com/junegunn/vim-plug/master/plug.vim' | |
endif | |
if empty(glob("~/.vim/colors/darcula.vim")) | |
execute '!curl -fLo ~/.vim/colors/darcula.vim --create-dirs https://raw.githubusercontent.com/blueshirts/darcula/master/colors/darcula.vim' | |
endif |
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
// http://stackoverflow.com/questions/42151307/how-to-determine-the-element-type-of-slice-interface#answer-42151765 | |
// Call reflect.MakeSlice(), reflect.SliceOf() and reflect.Copy | |
func doubleSlice(s interface{}) (interface{}, error) { | |
if reflect.TypeOf(s).Kind() != reflect.Slice { | |
err := errors.New("The interface is not a slice.") | |
return nil, err | |
} | |
v := reflect.ValueOf(s) | |
newLength := v.Len() |
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
set -g default-terminal 'screen-256color' | |
set -g mouse on | |
set -g prefix C-x | |
set -g window-style 'fg=colour247,bg=colour236' | |
set -g window-active-style 'fg=colour250,bg=black' | |
set -g pane-active-border-style 'bg=black,fg=cyan' | |
setw -g pane-border-status bottom | |
setw -g pane-border-format '#{pane_tty} | #{pane_current_path}' |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$script = <<SCRIPT | |
echo "Installing packages..." | |
sudo dnf update -y && dnf upgrade -y | |
sudo dnf install -y epel-release | |
sudo dnf install -y git vim wget nc go tmux bcc-tools bison flex python3 cmake cmake3 gcc-c++ llvm-toolset clang clang-devel llvm llvm-devel llvm-static ncurses-devel iperf3 | |
sudo dnf install -y http://repo.iovisor.org/yum/extra/mageia/cauldron/x86_64/netperf-2.7.0-1.mga6.x86_64.rpm |
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 jetbrains/upsource:2020.1.1815 | |
USER root | |
RUN apt-get update -y && apt-get install -y php | |
RUN apt-get install -y vim | |
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ | |
php -r "if (hash_file('sha384', 'composer-setup.php') === 'c31c1e292ad7be5f49291169c0ac8f683499edddcfd4e42232982d0fd193004208a58ff6f353fde0012d35fdd72bc394') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \ | |
php composer-setup.php --install-dir=bin --filename=composer && \ | |
php -r "unlink('composer-setup.php');" |
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
git config --global gpg.program $(which gpg) |
OlderNewer