Skip to content

Instantly share code, notes, and snippets.

@joeking11829
joeking11829 / ssh-cipher-benchmark.sh
Created December 7, 2021 02:40 — forked from joeharr4/ssh-cipher-benchmark.sh
Check speed of ssh cipher(s) on your system
#!/bin/bash
# ssh-cipher-benchmark.sh - Assesses speed of SSH encryption between specific hosts.
# Usage:
# ssh-cipher-benchmark.sh <remotehost> [ciphers]
# Default ciphers: all we can find...
#
# Note: In some cases, the first cipher tested runs faster than the others, regardless of order.
# Cause of this is not known, but changing the order of testing shows it to be true. Run the
# first one twice if you suspect this. Perhaps it is due to buffering?
@joeking11829
joeking11829 / Documentation.md
Created December 6, 2021 03:06 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@joeking11829
joeking11829 / ddp_example.py
Created September 15, 2021 10:57 — forked from sgraaf/ddp_example.py
PyTorch Distributed Data Parallel (DDP) example
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from argparse import ArgumentParser
import torch
import torch.distributed as dist
from torch.nn.parallel import DistributedDataParallel as DDP
from torch.utils.data import DataLoader, Dataset
from torch.utils.data.distributed import DistributedSampler
from transformers import BertForMaskedLM
@joeking11829
joeking11829 / tmux-cheatsheet.markdown
Created April 26, 2019 09:58 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@joeking11829
joeking11829 / gist:4d4f2a9e5a1af778d3be36c74f37e9e7
Created August 17, 2018 08:31 — forked from sp00ky/gist:3d68e986014d53b3fdfd75fbdd079256
Starting Synergy Client at Boot on Ubuntu 16.04
create /etc/lightdm/lightdm.conf.d/20-ubuntu.conf as follows:
Add to the new file:
[SeatDefaults]
greeter-setup-script=/usr/bin/synergyc --daemon [server address]
user-session=Ubuntu
Set the proper permissions:
$ sudo chmod 600 20-lubuntu.conf
$ ls 20-lubuntu.conf

Convert Binary Data to OpenCV Image Format

在影像處理時,常常會讀取影像資料(binary data)後轉成影像格式(cv::Mat),在進行影像操作。

那我們如何轉成可用的OpenCV影像格式呢?

首先讀取檔案後得到binary data,在進行解碼轉成cv::Mat

當然如果單純讀檔後轉成OpenCV影像格式,OpenCV是有提供cv::imread這個API可以使用。

@joeking11829
joeking11829 / max-cpu.sh
Created May 11, 2016 02:40 — forked from xlz/max-cpu.sh
Jetson TK1 performance max
#!/bin/sh
# Set CPU to full performance on NVIDIA Jetson TK1 Development Kit
if [ $(id -u) != 0 ]; then
echo "This script requires root permissions"
echo "$ sudo "$0""
exit
fi
# To obtain full performance on the CPU (eg: for performance measurements or benchmarking or when you don't care about power draw), you can disable CPU scaling and force the 4 main CPU cores to always run at max performance until reboot:
#!/bin/sh
# Install cuDNN V2 on NVIDIA Jetson TK1
# Register as a NVIDIA developer and download the cuDNN package
# Package is named cudnn-6.5-linux-ARMv7-V2.tgz
# This script and the cuDNN package should be in the same directory, usually ~/Downloads
# This script places the library and include files for cudnn in the CUDA 6.5 directories
# Make sure this is executing as root
if [ $(id -u) != 0 ]; then
echo "This script requires root permissions"
echo "$ sudo "$0""
@joeking11829
joeking11829 / installCaffe.sh
Created October 20, 2015 07:37 — forked from jetsonhacks/installCaffe.sh
Install Caffe on NVIDIA Jetson TK1 LT4 21.2 - CUDA 6.5
#!/bin/sh
# Install and compile Caffe on NVIDIA Jetson TK1 Development Kit
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install libprotobuf-dev protobuf-compiler gfortran \
libboost-dev cmake libleveldb-dev libsnappy-dev \
libboost-thread-dev libboost-system-dev \
libatlas-base-dev libhdf5-serial-dev libgflags-dev \
libgoogle-glog-dev liblmdb-dev -y
@joeking11829
joeking11829 / Caffe + Ubuntu 12.04 64bit + CUDA 6.5 配置说明.md
Created October 20, 2015 07:26 — forked from bearpaw/Caffe + Ubuntu 12.04 64bit + CUDA 6.5 配置说明.md
Caffe + Ubuntu 12.04 / 14.04 64bit + CUDA 6.5 / 7.0 配置说明

Caffe + Ubuntu 12.04 64bit + CUDA 6.5 配置说明

本步骤能实现用Intel核芯显卡来进行显示, 用NVIDIA GPU进行计算。

1. 安装开发所需的依赖包

安装开发所需要的一些基本包

sudo apt-get install build-essential
sudo apt-get install vim cmake git
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev