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
sudo dkms status | |
# list nvidia installs | |
ls -l /var/lib/dkms/nvidia | |
# install for kernel version 535.154.05 | |
dkms install nvidia/535.154.05 -k 6.7.3-060703-generic |
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
#include <opencv2/opencv.hpp> | |
#include <opencv2/calib3d/calib3d.hpp> | |
#include <opencv2/core/core.hpp> | |
#include <opencv2/highgui/highgui.hpp> | |
#include <iostream> | |
#include <sstream> | |
#include <string> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <sys/ioctl.h> |
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
# vim:ft=zsh ts=2 sw=2 sts=2 | |
rvm_current() { | |
rvm current 2>/dev/null | |
} | |
rbenv_version() { | |
rbenv version 2>/dev/null | awk '{print $1}' | |
} | |
evil_git_untracked_files() { |
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 | |
# ca | |
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 \ | |
-nodes -keyout ca.key -out ca.pem -subj "/C=US/ST=CA/O=Lab/OU=Engineering/CN=ca.johnhardy.io" \ | |
-addext "subjectAltName=DNS:ca.johnhardy.io,IP:10.0.0.1" | |
# server csr | |
openssl req -new -newkey rsa:4096 -nodes \ |
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 | |
# Copyright (C) 2012 - 2018 Jason A. Donenfeld <[email protected]>. All Rights Reserved. | |
# This file is licensed under the GPLv2+. Please see COPYING for more information. | |
umask "${PASSWORD_STORE_UMASK:-077}" | |
set -o pipefail | |
GPG_OPTS=( $PASSWORD_STORE_GPG_OPTS "--quiet" "--yes" "--compress-algo=none" "--no-encrypt-to" ) | |
GPG="gpg" |
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 ( | |
"crypto" | |
"crypto/ecdsa" | |
"crypto/rsa" | |
"crypto/tls" | |
"crypto/x509" | |
"encoding/pem" | |
"fmt" | |
"io/ioutil" |
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 parseJwt (token) { | |
var base64Url = token.split('.')[1]; | |
var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/'); | |
var jsonPayload = decodeURIComponent(atob(base64).split('').map(function(c) { | |
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); | |
}).join('')); | |
return JSON.parse(jsonPayload); | |
}; |
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 | |
# | |
# Description: Auto test download & I/O speed script | |
# | |
# Copyright (C) 2015 - 2020 Teddysun <[email protected]> | |
# Thanks: LookBack <[email protected]> | |
# URL: https://teddysun.com/444.html | |
# | |
trap _exit INT QUIT TERM |
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
echo -n "Open VPN Volume name: " | |
read volname | |
echo -n "Client/User name: " | |
read client | |
export OVPN_DATA="${volname}" | |
docker volume create --name $OVPN_DATA |
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 | |
read -r -d '' USAGE <<'USAGEEND' | |
tblick - Launch tunnelblick and connect to VPN | |
Examples: | |
Launch tunnelblick and connect to VPN | |
$ tblick [TUNNELBLICK-VPN-NAME] | |
Options: |
NewerOlder