Skip to content

Instantly share code, notes, and snippets.

View tboydar's full-sized avatar
🎯
Focusing

Dar tboydar

🎯
Focusing
View GitHub Profile

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

<html>
<head>
<style>
td{
border: 1px solid #000000;
width:20px;
height:20px;
}
.td_black{
background: black;
@tboydar
tboydar / README.md
Last active August 29, 2015 14:22 — forked from jnovack/README.md

Mosh (mobile shell) is a gift from the Gods(tm). Anyone with spotty internet or wireless connection has suffered the pain of a lost SSH session. Sure, one can fire up screen (or tmux as the kids are using these days), but that's an extra step and you are still using the SSH protocol.

I'm not here to tout the benefits of Mosh, you came here to open it up in your firewall.

  1. Create the following file as /etc/firewalld/services/mosh.xml
  2. firewall-cmd --reload
  3. firewall-cmd --add-service=mosh --permanent

If you tend to have a lot of sessions (not recommended), you can increase the ports, but the default should be fine for most applications.

@tboydar
tboydar / ask-question.md
Created August 29, 2017 10:14 — forked from y2468101216/ask-question.md
如何問( google )問題

分析問題

前言

如果你有在網路找過如何問問題的話,你應該會找到泛用的回答。 而這邊要討論的是如何對 Google 問問題。

會寫這篇是因為我發現很奇妙的有些工程師比我還老,但卻不太用 google,常常問一些 google 就有答案的問題。

問問題的技巧

@tboydar
tboydar / Angular 4 開發環境說明.md
Created September 22, 2017 09:42 — forked from doggy8088/Angular 18 Dev Setup.md
Angular 4 開發環境說明

Angular 4 開發環境說明

為了能讓大家能夠順利的建立起 Angular 4 開發環境,以下是需要安裝的相關軟體與安裝步驟與說明。

[ 作業系統 ]

  • Windows 7 以上版本 (更新到最新 Service Pack 版本)
  • Mac OS X 10.6 以上版本

[ 套件管理器 ( Mac OS X Only ) ]

@tboydar
tboydar / settings.json
Created August 2, 2018 15:30 — forked from doggy8088/settings.json
Will 保哥的 VSCode 使用者設定檔
{
"explorer.openEditors.visible": 0,
"workbench.colorTheme": "Default Light+",
"workbench.iconTheme": "vscode-simpler-icons",
"workbench.sideBar.location": "right",
"editor.wordWrap": "on",
"editor.fontFamily": "'Microsoft YaHei Mono', Consolas, 'Noto Sans CJK TC Medium', 'Courier New', monospace",
"editor.fontLigatures": true,

MicroService Proxy Gateway Solutions

Kong, Traefik, Caddy, Linkerd, Fabio, Vulcand, and Netflix Zuul seem to be the most common in microservice proxy/gateway solutions. Kubernetes Ingress is often a simple Ngnix, which is difficult to separate the popularity from other things.

Github Star Trend:

Github Star History for Kong vs traefik vs fabio vs caddy vs Zuul

This is just a picture of this link from Feb

@tboydar
tboydar / clone-all-twitter-github-repos.sh
Created January 13, 2019 15:55 — forked from caniszczyk/clone-all-twitter-github-repos.sh
Clone all repos from a GitHub organization
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
@tboydar
tboydar / _vultr-snapshot.md
Created March 29, 2019 08:12 — forked from Rhilip/_vultr-snapshot.md
Automatic snapshots using Vultr API (Python3)

Thanks to Automated Snapshots / Backups via Vultr API And this is Python3 version script used to Automatic snapshots using Vultr API


A more customizable alternative to Vultr's backup feature using Vultr API v1. Tested on Ubuntu 16.04. Run this python3 script on Anywhere to create a snapshot of VPS (which you know IP or it's subid) and rotate out the oldest snapshot(s). Use the BACKUP_TAG_PREFIX prefix field to uniquely id a set of snapshots.

Notice: You can only create 11 snapshots by default.


# get total requests by status code
awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rn
# get top requesters by IP
awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head | awk -v OFS='\t' '{"host " $2 | getline ip; print $0, ip}'
# get top requesters by user agent
awk -F'"' '{print $6}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head
# get top requests by URL