Skip to content

Instantly share code, notes, and snippets.

@thangdc94
thangdc94 / cvsignore2git.sh
Created June 16, 2017 11:10 — forked from xkr47/cvsignore2git.sh
cvsignore -> gitignore converter
#!/bin/sh
if [ ! -d .git ]; then
echo ERROR: Please run this in the root of the git repository
exit 1
fi
cat > .gitignore <<'EOF'
# CVS global ignores
RCS
@thangdc94
thangdc94 / SampleImpl.java
Created March 27, 2018 02:48 — forked from patrickseda/SampleImpl.java
Java ShutdownHook registration class for managing controlled shut downs.
/**
* Sample implementation of a Shutdownable object.
*/
public class SampleImpl implements Shutdownable {
public static void main(String[] args) {
SampleImpl sample = new SampleImpl();
// Make the JVM call our shutdown() method upon exit.
ShutdownHook.registerForShutdownHook(sample);
@thangdc94
thangdc94 / bump-version.sh
Created September 27, 2018 02:26 — forked from mareksuscak/bump-version.sh
Bump version shell script.
#!/bin/bash
# Thanks goes to @pete-otaqui for the initial gist:
# https://gist.github.com/pete-otaqui/4188238
#
# Original version modified by Marek Suscak
#
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3" or even "1.2.3-beta+001.ab"
@thangdc94
thangdc94 / crc16_slottable.h
Created February 19, 2019 11:12 — forked from dvirsky/crc16_slottable.h
A table of the shortest possible alphanumeric string that is mapped by redis' crc16 to any given cluster slot. the
#ifndef _CRC16_TABLE_H__
#define _CRC16_TABLE_H__
/* A table of the shortest possible alphanumeric string that is mapped by redis' crc16
* to any given redis cluster slot.
*
* The array indexes are slot numbers, so that given a desired slot, this string is guaranteed
* to make redis cluster route a request to the shard holding this slot
*/
@thangdc94
thangdc94 / install-cuda-10-bionic.sh
Created April 30, 2020 15:40 — forked from bogdan-kulynych/install-cuda-10-bionic.sh
Install CUDA 10 on Ubuntu 18.04
# WARNING: These steps seem to not work anymore!
#!/bin/bash
# Purge existign CUDA first
sudo apt --purge remove "cublas*" "cuda*"
sudo apt --purge remove "nvidia*"
# Install CUDA Toolkit 10
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb