sudo apt-get install autoconf automake libtool curl make g++ unzip -y
git clone https://github.com/google/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
./configure
make
make check
sudo make install
View check-gpu-access-tensorflow.py
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 tensorflow as tf | |
from tensorflow.python.client import device_lib | |
print(tf.test.is_gpu_available()) | |
print(tf.config.experimental.list_physical_devices('GPU')) | |
print(device_lib.list_local_devices()) | |
View cpp.json
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
{ | |
// Place your snippets for cpp here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
// same ids are connected. | |
// Example: | |
// "Print to console": { | |
// "prefix": "log", | |
// "body": [ | |
// "console.log('$1');", |
View dim.sh
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 "Enter brightness percentage: " | |
read x | |
xrandr --output eDP-1 --brightness ${x} | |
echo "Brightness has been changed to ${x}" | |
echo "Exiting..." |
View python-version.py
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
def get_python_version(): | |
from platform import python_version | |
print("python_version: ", python_version()) |
View Python - Vectorization - Triple For Loop.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Python - Vectorization - Double For Loop.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Python - Vectorization - Single For Loop.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View run-commands-without-history.sh
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/10307280/how-to-define-a-shell-script-with-variable-number-of-arguments | |
run(){ | |
my_cmd=$1; | |
# cmd_str='history -d $((HISTCMD)) && $my_cmd'; | |
shift | |
#echo $my_cmd "$@" | |
history -d $((HISTCMD-1)) && $my_cmd "$@" | |
} |
View rename-terminal-tab.sh
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
# directly taken from: https://unix.stackexchange.com/questions/177572/how-to-rename-terminal-tab-title-in-gnome-terminal | |
function set-title() { | |
if [[ -z "$ORIG" ]]; then | |
ORIG=$PS1 | |
fi | |
TITLE="\[\e]2;$*\a\]" | |
PS1=${ORIG}${TITLE} | |
} |
View install-latest-protobuf-ubuntu-18-04.md
NewerOlder