This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.BasicStroke; | |
import java.awt.Color; | |
import java.awt.Component; | |
import java.awt.DisplayMode; | |
import java.awt.Graphics; | |
import java.awt.Graphics2D; | |
import java.awt.GraphicsEnvironment; | |
import java.awt.Insets; | |
import java.awt.Polygon; | |
import java.awt.Rectangle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.grpc.ManagedChannel; | |
import io.grpc.ManagedChannelBuilder; | |
import io.grpc.Server; | |
import io.grpc.ServerBuilder; | |
import io.grpc.stub.StreamObserver; | |
import org.openjdk.jmh.annotations.*; | |
import org.openjdk.jmh.infra.BenchmarkParams; | |
import org.openjdk.jmh.infra.Blackhole; | |
import org.openjdk.jmh.infra.IterationParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.IOException; | |
import java.net.InetSocketAddress; | |
import java.nio.ByteBuffer; | |
import java.nio.channels.FileChannel; | |
import java.nio.charset.Charset; | |
import java.nio.charset.StandardCharsets; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AccessToken='YOUR-ACCESS-TOKEN-HERE' // <= Notice | |
var replaceText = (a) => { | |
let v = a.repoData; | |
let tpl = `[ | |
<span style="color:red;opacity:${Math.max(v.stargazers_count / 500, 0.1)}"> | |
★${v.stargazers_count} | |
</span> | |
🕐${new Date(v.updated_at) | |
.toISOString() | |
.replace(/\..*/, "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uname -a: Linux wener-ubuntu 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 GNU/Linux | |
lspci -knn: 00:00.0 Host bridge [0600]: Intel Corporation 440FX - 82441FX PMC [Natoma] [8086:1237] (rev 02) | |
lspci -knn: 00:01.0 ISA bridge [0601]: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] [8086:7000] | |
lspci -knn: 00:01.1 IDE interface [0101]: Intel Corporation 82371AB/EB/MB PIIX4 IDE [8086:7111] (rev 01) | |
lspci -knn: Kernel driver in use: ata_piix | |
lspci -knn: 00:02.0 VGA compatible controller [0300]: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter [80ee:beef] | |
lspci -knn: 00:03.0 Ethernet controller [0200]: Intel Corporation 82540EM Gigabit Ethernet Controller [8086:100e] (rev 02) | |
lspci -knn: Subsystem: Intel Corporation Device [8086:001e] | |
lspci -knn: Kernel driver in use: e1000 | |
lspci -knn: Kernel modules: e1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# List files | |
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$") | |
if [[ "$STAGED_FILES" = "" ]]; then | |
exit 0 | |
fi | |
# Try find node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# (c) 2019, Ansible by Red Hat, inc | |
# (c) 2019 Kevin Gallagher (@ageis) <kevingallagher@gmail.com> | |
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) | |
# from https://gist.github.com/ageis/face10be67b26e4519662e19290e06ff | |
# fix for busybox and macos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
fail(){ | |
echo "error: $*" | |
echo "usage: ./k3s-new-cert <name> [subject=/O=admin]" | |
exit 1 | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# download firecracker | |
latest=$(basename $(curl -fsSLI -o /dev/null -w %{url_effective} https://github.com/firecracker-microvm/firecracker/releases/latest)) | |
curl -LOJ https://github.com/firecracker-microvm/firecracker/releases/download/${latest}/firecracker-${latest}-$(uname -m) | |
mv firecracker-${latest}-$(uname -m) firecracker | |
chmod +x firecracker | |
# download netbook kernel and initrd | |
curl --remote-name-all -LC- https://mirrors.aliyun.com/alpine/v3.12/releases/x86_64/netboot/{modloop,vmlinuz,config,initramfs}-virt | |
# vmlinux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# download | |
latest=$(basename $(curl -fsSLI -o /dev/null -w %{url_effective} https://github.com/firecracker-microvm/firecracker/releases/latest)) | |
curl -LOJ https://github.com/firecracker-microvm/firecracker/releases/download/${latest}/firecracker-${latest}-$(uname -m) | |
mv firecracker-${latest}-$(uname -m) firecracker | |
chmod +x firecracker | |
# rootfs | |
# ========= | |
# qemu-img create -f raw alpine.rootfs.ext4 1G | |
fallocate -l 1G ubuntu.rootfs.ext4 |