Skip to content

Instantly share code, notes, and snippets.

@inductor
inductor / kubeadm-ha.sh
Last active April 12, 2022 11:22
kubeadm-ha.sh
#/bin/bash -eu
# Set global variables
KUBE_API_SERVER_VIP=192.168.0.100
NODE_IPS=( 192.168.0.11 192.168.0.12 192.168.0.13 )
# Install HAProxy
apt-get install -y --no-install-recommends software-properties-common
add-apt-repository ppa:vbernat/haproxy-2.4 -y
sudo apt-get install -y haproxy=2.4.\*

Proxmox with LVM-thin and why we should use Trim/Discard

Excerpts from the Proxmox VE Administration Guide]

LVM normally allocates blocks when you create a volume. LVM thin pools instead allocates blocks when they are written. This behaviour is called thin-provisioning, because volumes can be much larger than physically available space.

8.10.2. Trim/Discard It is good practice to run fstrim (discard) regularly on VMs and containers. This releases data blocks that the filesystem isn’t using anymore. It reduces data usage and resource load. Most modern operating systems issue such discard commands to their disks regularly. You only need to ensure that the Virtual Machines enable the disk discard option.

@KisaragiEffective
KisaragiEffective / 整地鯖の歩み.md
Last active November 8, 2020 11:50
せーちさばのれきし

1代目 (Unchama's MC server)

2代目 (Koron server)

  • 13/11/?? 運営開始

3代目 (旧整地鯖)

2015年

  • 2/2 運営開始
@koyopro
koyopro / amazon-calc.min.js
Last active December 20, 2023 05:52
Amazonで一年間に使った金額と、注文履歴のTSVを出力するブックマークレット【2015年版】( https://gist.github.com/yoshida-k/a480a45712ccf1bf239c ) のminify
javascript:(function()%7Bfunction%20t(t)%7Bconsole.log(t);t.date.match(e);var%20n=RegExp.$1;var%20r=RegExp.$2;if(r.length%3C=1)r=%220%22+r;var%20i=RegExp.$3;if(i.length%3C=1)i=%220%22+i;var%20s=%22%22+n+%22/%22+r+%22/%22+i;var%20o=%5Bs,t.name,t.author,t.url%5D;return%20o.join(%22%5Ct%22)+%22%5Cn%22%7Dfunction%20n(e)%7Bvar%20t=window.open(%22%22,%22name%22,%22height=250,width=700%22);t.document.write(%22%3Chtml%3E%3Chead%3E%3Ctitle%3EAmazon%20to%20TSV%3C/title%3E%22);t.document.write(%22%3C/head%3E%3Cbody%3E%22);t.document.write(%22%3Cpre%3E%22);t.document.write(e);t.document.write(%22%3C/pre%3E%22);t.document.write(%22%3C/body%3E%3C/html%3E%22);t.document.close();return%20t%7Dfunction%20u(e)%7Bif(typeof%20e!==%22number%22)%7Bvar%20e=0;$(%22%3Cdiv/%3E%22).css(%7Bposition:%22fixed%22,left:0,top:0,width:%22100%25%22,height:%22100%25%22,zIndex:1e3,backgroundColor:%22rgba(0,0,0,.7)%22,color:%22%23fff%22,fontSize:30,textAlign:%22center%22,paddingTop:%2215em%22%7D).attr(%22id%22,%22___overlay%22).text(%22Amazon%E3%8
@polamjag
polamjag / amazon-calc.js
Last active September 7, 2022 11:23 — forked from arcatdmz/amazon-csv.js
Amazon で使った金額の合計を出す奴 (2014-2016 年バージョン)
// Amazon で使った金額の合計を出す奴
//
// 使い方:
// 1. 全部コピーする (右上の Raw をクリックした先でやるのが楽)
// 2. Amazon の注文履歴ページ ( https://www.amazon.co.jp/gp/css/order-history/ ) を開く
// 3. F12 または 右クリ→要素の検証 とかで出てくる開発者ツールのコンソール (JavaScript REPL) にペースト
// 4. エンターで実行
// (Firefox はなんか allow pasting とタイプしろみたいなことを言われるので従う)
// 5. しばらく待つと alert で合計金額を表示
//
@kkotaro0111
kkotaro0111 / dl_yt_audio_lib.js
Last active April 22, 2020 10:51
Youtubeのオーディオライブラリに登録されている曲を全部ダウンロードするアレ
// モジュールロード
var http = require('http');
var request = require('request');
var fs = require('fs');
var EventEmitter = require('events').EventEmitter;
var domain = require('domain');
var d = domain.create();
d.on("error", function(err){
console.error("cws error", err);
@ktx2207
ktx2207 / Git_ファイルの履歴を完全に削除する.md
Last active February 17, 2024 05:32
Git ファイルの履歴を完全に削除する

Git ファイルの履歴を完全に削除する

秘密鍵など誤ってコミットしてしまった場合に履歴を完全に削除する手順
参考:6.4 Git のさまざまなツール - 歴史の書き換え

動作確認用にブランチを作成して試す

$ git checkout -b clean-key-file

動作確認用にブランチでgit filter-branchを実行

@nacookan
nacookan / gist:5644601
Created May 24, 2013 16:14
Google Apps Scriptで掲示板作ってみた
// data source
var book = SpreadsheetApp.openById('xxxxxxxx');
var sheet = book.getSheets()[0];
function doGet() {
var app = UiApp.createApplication();
app.add(app.createLabel('掲示板へようこそ'));
// form
var panel = app.createVerticalPanel().setStyleAttribute('border', 'solid 2px #000000');