Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View toanalien's full-sized avatar
🎯
Focusing

Thiên Toán toanalien

🎯
Focusing
View GitHub Profile
@toanalien
toanalien / install-tmux.sh
Last active December 19, 2020 15:43 — forked from pokev25/install-tmux.sh
Install tmux 2.8 on centos 7
# Install tmux 2.8 on Centos
# install deps
yum install gcc kernel-devel make ncurses-devel libevent-devel
yum groupinstall "Development Tools"
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -LOk https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
tar -xf libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable
@toanalien
toanalien / vscode-remove-duplicate-lines.md
Created June 14, 2020 12:41 — forked from marcosvpj/vscode-remove-duplicate-lines.md
How to remove duplicate lines in Visual Studio Code?

If the order of lines is not important##

Sort lines alphabetically, if they aren't already, and perform these steps:
(based on this related question: https://stackoverflow.com/q/1573361/3258851)

  1. Control+F

  2. Toggle "Replace mode"

  3. Toggle "Use Regular Expression" (the icon with the .* symbol)

@toanalien
toanalien / docker-compose.yml
Created March 21, 2020 02:37 — forked from cboettig/docker-compose.yml
debugging NGINX configuration for Jupyter
jupyter:
image: jupyter/datascience-notebook
environment:
- PASSWORD=${PASSWORD}
nginx:
image: nginx
links:
- jupyter
@toanalien
toanalien / appsScript_ListFilesFolders_ver.2.js
Created October 12, 2019 18:23 — forked from mesgarpour/appsScript_ListFilesFolders_ver.2.js
[Google Apps Script] List all files & folders in a Google Drive folder, & write into a speadsheet
/*
* Copyright 2017 Mohsen Mesgarpour
*
* 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
@toanalien
toanalien / install_pyenv.sh
Created January 28, 2019 02:55 — forked from jmvrbanac/install_pyenv.sh
Install pyenv on Ubuntu
#!/bin/bash
sudo apt-get install git python-pip make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl
sudo pip install virtualenvwrapper
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
git clone https://github.com/yyuu/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
@toanalien
toanalien / Hadoop_install_osx.md
Last active August 20, 2018 07:21 — forked from viecode09/Hadoop_install_osx.md
This is how to install hadoop on Mac OS

STEP 1: First Install HomeBrew, download it from http://brew.sh

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

STEP 2: Install Hadoop

$ brew search hadoop
$ brew install hadoop
@toanalien
toanalien / a_mongodb_to_s3_backup.sh
Created May 10, 2018 09:21 — forked from lazarofl/a_mongodb_to_s3_backup.sh
MongoDB Automatic Backup to Amazon S3 with Crontab and s3cmd. Red Hat Linux on Amazon EC2
#!/bin/bash
#Force file syncronization and lock writes
mongo admin --eval "printjson(db.fsyncLock())"
MONGODUMP_PATH="/usr/bin/mongodump"
MONGO_HOST="prod.example.com"
MONGO_PORT="27017"
MONGO_DATABASE="dbname"
@toanalien
toanalien / mediaserver.js
Created May 1, 2018 09:33 — forked from mlzxy/mediaserver.js
Node.js Static File + Media Streaming Server
/**
* 1. install nodejs from https://nodejs.org/en/download/
* 2. run `npm install -g serve-static filehandler serve-index` in terminal
* 3. run `node mediaserver.js`
*/
var http = require('http'),
fs = require('fs'),
util = require('util'),
url = require('url'),
path = require('path'),
@toanalien
toanalien / kmskeys10.txt
Created April 7, 2018 09:30 — forked from CHEF-KOCH/kmskeys10.txt
Windows 10 KMS Keys
Windows.10.and.Office.2016.gVLK
#####################################################################
# Install/Uninstall keys #
#####################################################################
1.) Uninstall the current product by entering the “uninstall product key” extension:
slmgr.vbs /upk
2.) Install the key that you obtained above for “Windows Srv 2012R2 DataCtr/Std KMS for Windows 10”
@toanalien
toanalien / gist:0d139a0c287261fc1489fd30d0ae1cb5
Created January 30, 2018 11:04 — forked from bigsnarfdude/gist:b2eb1cabfdaf7e62a8fc
ubuntu 14.04 install scala 2.11.7 and sbt 13.9 and java 8 and git
# scala install
wget www.scala-lang.org/files/archive/scala-2.11.7.deb
sudo dpkg -i scala-2.11.7.deb
# sbt installation
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823
sudo apt-get update
sudo apt-get install sbt