Skip to content

Instantly share code, notes, and snippets.

Avatar
🏚️
Work From Home

Thiên Toán toanalien

🏚️
Work From Home
View GitHub Profile
@toanalien
toanalien / install-tmux.sh
Last active Dec 19, 2020 — forked from pokev25/install-tmux.sh
Install tmux 2.8 on centos 7
View install-tmux.sh
# 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
View most_common_chinese_character.js
// https://sensiblechinese.com/common-chinese-characters/
// paste to Chrome console
cols = jQuery('.column-2')
characters = []
for (i=1; i<cols.length; i++) { // skip table header
characters.append(jQuery(cols[i]).text()));
@toanalien
toanalien / vscode-remove-duplicate-lines.md
Created Jun 14, 2020 — forked from marcosvpj/vscode-remove-duplicate-lines.md
How to remove duplicate lines in Visual Studio Code?
View vscode-remove-duplicate-lines.md

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 / BATBTC.csv
Created May 21, 2020
Fetched from Binance
View BATBTC.csv
Date Open High Low Close Volume
2020-05-19 09:00:00 2.11e-05 2.118e-05 2.106e-05 2.113e-05 324959.0
2020-05-19 10:00:00 2.114e-05 2.119e-05 2.107e-05 2.118e-05 400205.0
2020-05-19 11:00:00 2.119e-05 2.119e-05 2.094e-05 2.11e-05 1004006.0
2020-05-19 12:00:00 2.114e-05 2.133e-05 2.109e-05 2.121e-05 735355.0
2020-05-19 13:00:00 2.121e-05 2.125e-05 2.112e-05 2.116e-05 225666.0
2020-05-19 14:00:00 2.118e-05 2.122e-05 2.102e-05 2.111e-05 200795.0
2020-05-19 15:00:00 2.112e-05 2.132e-05 2.103e-05 2.13e-05 491363.0
2020-05-19 16:00:00 2.128e-05 2.132e-05 2.11e-05 2.124e-05 418583.0
2020-05-19 17:00:00 2.124e-05 2.136e-05 2.122e-05 2.127e-05 420179.0
View ubuntu-1804-xrdp-mate.sh
#!/bin/bash
sudo apt-get update
sudo apt-get install xrdp -y
sudo apt-get install mate-core mate-desktop-environment mate-notification-daemon -y
sudo sed -i.bak '/fi/a #xrdp multiple users configuration \n mate-session \n' /etc/xrdp/startwm.sh
sudo ufw allow 3389/tcp
sudo /etc/init.d/xrdp restart
View clone-all-git.sh
#!/bin/bash
CNTX={users|orgs}; NAME={username|orgname}; PAGE=1
curl "https://api.github.com/$CNTX/$NAME/repos?page=$PAGE&per_page=100" |
grep -e 'git_url*' |
cut -d \" -f 4 |
xargs -L1 git clone
@toanalien
toanalien / Vagrantfile
Created May 5, 2020
centos with redis
View Vagrantfile
$install_redis = <<-'SCRIPT'
sudo yum update -y
sudo yum install epel-release yum-utils -y
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y
sudo yum-config-manager --enable remi -y
sudo yum install redis -y
sudo systemctl status redis
SCRIPT
Vagrant.configure("2") do |config|
@toanalien
toanalien / docker-compose.yml
Created Mar 21, 2020 — forked from cboettig/docker-compose.yml
debugging NGINX configuration for Jupyter
View docker-compose.yml
jupyter:
image: jupyter/datascience-notebook
environment:
- PASSWORD=${PASSWORD}
nginx:
image: nginx
links:
- jupyter
@toanalien
toanalien / appsScript_ListFilesFolders_ver.2.js
Created Oct 12, 2019 — forked from mesgarpour/appsScript_ListFilesFolders_ver.2.js
[Google Apps Script] List all files & folders in a Google Drive folder, & write into a speadsheet
View appsScript_ListFilesFolders_ver.2.js
/*
* 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
View CentOS-Ceph-Hammer.repo
# CentOS-Ceph-Hammer.repo
#
# Please see http://wiki.centos.org/SpecialInterestGroup/Storage for more
# information
[centos-ceph-hammer]
name=CentOS-$releasever - Ceph Hammer
baseurl=http://mirrors.aliyun.com/ceph/rpm-hammer/el7/x86_64/
gpgcheck=1
enabled=1