Skip to content

Instantly share code, notes, and snippets.

View NoahDragon's full-sized avatar
I may be slow to respond.

Abner Chou NoahDragon

I may be slow to respond.
View GitHub Profile
@NoahDragon
NoahDragon / 0. Synology RAID Expansion-Resync Performance.md
Created July 19, 2022 02:49 — forked from fbartho/0. Synology RAID Expansion-Resync Performance.md
Walkthrough of what I did to increase performance on my Synology NAS box during an expansion, and afterwards.

Performance on Synology RAIDs

(especially while expanding)

Warning: The exact commands may not match for your particular linux OS / Synology(NAS) device. I had to customize the commands after exploring my particular system's setup.

If you're new to linux, or this is a new piece of hardware / a new synology device, jump down to the section called "Inspecting a setup"

Contents

@NoahDragon
NoahDragon / venv_cheat_sheet.md
Created July 12, 2022 00:15 — forked from bbengfort/venv_cheat_sheet.md
My virtualenv and virtualenv wrapper cheat sheet. I alias the commands of virtualenv and virtualenv wrapper for my own development environment.

Ben's VirtualEnv Cheatsheet

This cheat sheet describes my usage/implementation of virtualenv with virtualenv wrapper and the bash foo that I added with the help of many blogs to make it all tick together in fun land.

Quick Reference

$ echo $WORKON_HOME
/Users/benjamin/.virtualenvs

$ echo $PROJECT_HOME
@NoahDragon
NoahDragon / gist:8dc832e7b4bf81573c3449450c81c7b8
Created October 31, 2020 17:04 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@NoahDragon
NoahDragon / little_schemer.rkt
Last active June 29, 2018 19:52
Functions in "The Little Schemer" book.
#lang scheme
(define atom?
(lambda (x)
(and (not (pair? x)) (not (null? x)))))
(define lat?
(lambda (l)
(cond
((null? l) #t)
((atom? (car l)) (lat? (cdr l)))

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@NoahDragon
NoahDragon / InstallLinuxKernelAndEnableBBR.sh
Last active April 23, 2019 05:48
Update Ubuntu Linux Kernel to 4.9 Which Includes the BBR Algorithm, It Can Significantly Improve the TCP Connection Performance. (Like ServerSpeeder)
#! /bin/sh
wget http://in4serv.com.br/backup/kernel-4.9-stable && sudo chmod +x ./kernel-4.9-stable && ./kernel-4.9-stable
# After reboot, turn on BBR
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p # Save the changes
sysctl net.ipv4.tcp_available_congestion_control # Check if BBR is turned on
lsmod | grep bbr # Check if BBR is running
var result = [];
function isArray (value) {
return value.constructor === Array;
}
function extract (value) {
if (isArray(value)) {
@NoahDragon
NoahDragon / article.ejs
Created August 12, 2016 23:41
Work around to disable comments for Hexo yinwang theme. (Replace it with the same file under yinwang/layout/_partial/)
<% if (post && index){ %>
<li class="list-group-item title">
<a target="_blank" href="<%- url_for(post.path)%>"><%= post.title%></a>
</li>
<% } else { %>
<%- post.content %>
<% } %>
@NoahDragon
NoahDragon / GetServerName.sql
Created May 12, 2016 18:33
Check server name, host name, instance name, and etc. on SQL server .
SELECT HOST_NAME() AS 'host_name()',
@@servername AS 'ServerName\InstanceName',
SERVERPROPERTY('servername') AS 'ServerName',
SERVERPROPERTY('machinename') AS 'Windows_Name',
SERVERPROPERTY('ComputerNamePhysicalNetBIOS') AS 'NetBIOS_Name',
SERVERPROPERTY('instanceName') AS 'InstanceName',
SERVERPROPERTY('IsClustered') AS 'IsClustered'