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
file transfer | |
rsync -uvr -e ssh Study/* server:/home/me/Study/ | |
scp ~/.ssh/id_rsa.pub darvader@deathstar.empire.gov: | |
sshpass -p "password" scp -r user@example.com:/some/remote/path /some/local/path | |
or | |
sshpass -f "/path/to/passwordfile" scp -r user@example.com:/some/remote/path /some/local/path | |
pscp .\Documents\DummyF\Dummy-d.txt server:DummyFolder/ | |
apt-cache show zim | grep '^Recommends:' | |
find (can execute on files found), locate (easier to use), ln -s targetfile linkname |
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
nvidia-docker run -it --rm -p 8870:8870 -p 8880:8880 -p 8890:8890 -p 5000:5000 --name me.test -v /home/me/Study/:/notebooks tensorflow/tensorflow:1.8.0-gpu-py3 | |
docker exec -ti me.test /bin/bash | |
apt-get update | |
pip install jupyterlab | |
pip install gputil | |
pip install keras==2.0.8 | |
apt-get install git-core | |
apt-get install wget | |
cdls() { cd "$@" && ls -lrt; } |
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
# In case of python_tk error | |
import matplotlib | |
matplotlib.use('agg') | |
import matplotlib.pyplot as plt | |
# Limit the number of GPUs used | |
import tensorflow as tf | |
import numpy as np | |
import GPUtil | |
import os |
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
```ascript.sh | |
#!/bin/bash | |
some script | |
``` | |
```python.py | |
import subprocess | |
print("start") | |
cur_pwd = os.getcwd() | |
os.chdir("path/to/ascript") |
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
# serveraccess.bat | |
@echo off | |
powershell.exe -executionpolicy bypass -windowstyle hidden -noninteractive -nologo -file "ServerAccess.ps1" | |
## ServerAccess.ps1 | |
net use \\server /user:username password |
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
# | |
# Ubuntu Node.js Dockerfile | |
# | |
# https://github.com/dockerfile/ubuntu/blob/master/Dockerfile | |
# https://docs.docker.com/examples/nodejs_web_app/ | |
# | |
# Pull base image. | |
FROM ubuntu:14.04 |
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 | |
find . -type d -print0 | while read -d '' -r dir; do | |
files=("$dir"/*) | |
printf "%5d files in directory %s\n" "${#files[@]}" "$dir" | |
done |
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
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
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
~/.bashrc | |
``` | |
export PATH="/notebooks/webcam/ffmpeg_sources/bin:$PATH" | |
export OPENCV_FFMPEG_CAPTURE_OPTIONS="video_codec;h264_cuvid" | |
export OPENCV_V4L_CAPTURE_OPTIONS="video_codec;h264_cuvid" | |
export OPENCV_V4L2_CAPTURE_OPTIONS="video_codec;h264_cuvid" | |
alias ls='ls -lsrht --color=auto' | |
alias docker='sudo docker' | |
alias nvidia-docker='sudo nvidia-docker' | |
alias cuda-info='cat /usr/local/cuda/version.txt && nvcc --version' |
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 | |
sum=$(ls -l *.dat | wc -l) | |
paste -d" " *.dat | awk -v s="$sum" '{ | |
for(i=0;i<=s-1;i++) | |
{ | |
t1 = 2+(i*2) | |
temp1 = temp1 + $t1 | |
} | |
print $1""temp1/s | |
temp1=0 |
OlderNewer