Skip to content

Instantly share code, notes, and snippets.

Install Zsh and Oh-my-zsh on CentOS 7

Based on this article

ALL INSTALLATIONS ASSUME YES WHEN PROMPTED, that's what -y does

This script can be copy paste to ssh as is. No hands installation. :-)

yum install zsh -y
@campoy
campoy / main.go
Created February 12, 2018 17:31
gist 1 for episode 28 of justforfunc
func mergeRec(chans ...<-chan int) <-chan int {
switch len(chans) {
case 0:
c := make(chan int)
close(c)
return c
case 1:
return chans[0]
default:
m := len(chans) / 2
@baymaxium
baymaxium / content.md
Created October 18, 2017 09:11
经典的「服务器最多65536个连接」误解

原文:运维帮

作者:ideawu

转自:http://www.ideawu.net/blog/archives/533.html

"因为TCP端口号是16位无符号整数,最大65535,所以一台服务器最多支持65536个TCP socket连接。" 一个非常经典的误解! 即使是有多年网络编程经验的人, 也会持有这个错误结论。

要戳破这个错误结论,可以从理论和实践两方面来。

@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE