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
ARCH_CANON=$(uname -m | sed 's/arm64/aarch64/g' | sed 's/amd64/x86_64/g') && \ | |
ARCH_ALT=$(uname -m | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g') && \ | |
ARCH_PROTO=$(echo "${ARCH_CANON}" | sed 's/aarch64/aarch_64/g') && \ | |
apt update && \ | |
apt install -y build-essential git vim curl unzip --no-install-recommends && \ | |
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v25.2/protoc-25.2-linux-${ARCH_PROTO}.zip && \ | |
unzip protoc-25.2-linux-${ARCH_PROTO}.zip && \ | |
git clone https://github.com/protocolbuffers/protobuf --single-branch --branch=v25.2 && \ | |
curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-${ARCH_ALT} > bazel && \ | |
chmod u+x bazel && \ |
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 | |
[[ $# -lt 1 ]] && { echo "Usage: $0 <emoji-keyword>"; exit -1; } | |
command -v jq >/dev/null 2>&1 || { echo "Install jq first (mac: brew install jq)."; exit -1; } | |
[[ ! -f "db.json" ]] && { curl -L "https://slackmojis.com/emojis.json" > db.json; } | |
emojis="$(jq -c 'map(select(.name | contains("'$1'"))) | map({"name": .name, "url": .image_url | split("?") | .[0]})' < db.json)" | |
echo ${emojis} | |
[[ ! -d "downloads-$1" ]] && { | |
mkdir -p "downloads-$1" |
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 | |
. /etc/lsb-release | |
OS_VERSION="$(echo "${DISTRIB_RELEASE}" | tr -d '.')" | |
CUDA_VERSION="10.1" | |
CUDA_VERSION_MINOR="10.1.105-418.87.00" | |
CUDNN_VERSION="v7.6.3" |
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
command -range Ghistory :!git log -L <line1>,<line2>:% |
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 | |
if [ $# -lt 2 ]; | |
then | |
echo "Usage: ./$0 MODIFIED-OGL-DIRECTORY ORIGINAL-OGL-DIRECTORY [option]"; | |
echo " option: {BOTH(default), LEFT, FULL}"; | |
echo " BOTH: show files existing in both directories only" | |
echo " LEFT: show files existing in modified directory only" | |
echo " FULL: BOTH | LEFT (show full diff)" | |
exit; |
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 | |
# **Untested** Guide for Ubuntu 14.04 | |
# by lucent(http://lucent.me ; gkcy1019@gmail.com) | |
sudo apt-get -y install build-essential configure-debian xorg-dev libncurses-dev | |
sudo apt-get -y install xorg x11-common | |
# Patched version of bochs ; CAUTION: this is NOT a permanent link(since it's my private server). | |
wget --no-check-certificate http://lucent.me/cs330/bochs-2.2.6.tar.gz |
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<queue> | |
#include<cstdio> | |
#include<cassert> | |
#include<cstring> | |
#include<algorithm> | |
using namespace std; | |
#define ALL(X) X.begin(),X.end() | |
template<int MAXN = 50000, int INF = 1 << 30> | |
struct MaxFlow { |
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 python | |
#-*-coding: utf-8-*- | |
""" | |
CVE-2013-6955 Vulnerability Exploit | |
Usage: | |
python CVE-2013-6955.py [HOST] [COMMAND] | nc [HOST] [PORT] | |
e.g. | |
python CVE-2013-6955.py 1.2.3.4 'echo `date +"%Y-%m-%d %H:%M:%S"`' | nc 1.2.3.4 5000 | |
""" | |
import sys |
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
const fs = require('fs') | |
const mt = require('jsmediatags'); | |
const filter = function(l, f) { | |
const r = []; | |
for (let i = 0 ; i < l.length; i++) | |
if (f(l[i])) r.push(l[i]); | |
return r; | |
}; |