This file contains hidden or 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
terraform { | |
required_providers { | |
azurerm = { | |
source = "hashicorp/azurerm" | |
} | |
} | |
} | |
variable "sku_name" { | |
type = string |
This file contains hidden or 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
-- database | |
CREATE DATABASE "app" WITH OWNER = "azure_pg_admin"; | |
\c app | |
-- app user (just as an example) | |
CREATE ROLE "appuser" LOGIN ENCRYPTED PASSWORD '114514' ADMIN azure_pg_admin; | |
GRANT ALL PRIVILEGES ON DATABASE "app" TO "appuser"; | |
GRANT ALL ON SCHEMA public TO "appuser"; | |
-- PgHero user |
This file contains hidden or 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
# Memory usage | |
# https://blog.cloudflare.com/the-story-of-one-latency-spike/ | |
# https://cloud.google.com/architecture/tcp-optimization-for-network-performance-in-gcp-and-hybrid/ | |
# https://zhensheng.im/2021/01/31/linux-wmem-and-rmem-adjustments.meow | |
# https://github.com/redhat-performance/tuned/blob/master/profiles/network-throughput/tuned.conf | |
# ReceiveBuffer: X - (X / (2 ^ tcp_adv_win_scale)) = RTT * Bandwidth / 8 | |
# SendBuffer: RTT * Bandwidth / 8 * 0.7 | |
net.core.netdev_max_backlog = 262144 | |
net.ipv4.tcp_max_syn_backlog = 8192 | |
net.core.rmem_max = 67108864 |
This file contains hidden or 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
groups { | |
ri_vr_defaults { | |
routing-instances { | |
<*> { | |
instance-type virtual-router; | |
routing-options { | |
static { | |
defaults { | |
install; | |
resolve; |
This file contains hidden or 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
# set -e (errexit) | |
$ErrorActionPreference = 'Stop' | |
$PSNativeCommandUseErrorActionPreference = $True | |
$ExecutionContext.InvokeCommand.PostCommandLookupAction = { | |
param([string]$command, [System.Management.Automation.CommandLookupEventArgs]$eventArgs); | |
if ($eventArgs.CommandOrigin -ne [System.Management.Automation.CommandOrigin]::Runspace) {return} | |
if ($eventArgs.Command.CommandType -eq [System.Management.Automation.CommandTypes]::Application) { | |
$cmd = $eventArgs.Command.Path | |
$eventArgs.CommandScriptBlock = { | |
Param([parameter(Position=0,ValueFromRemainingArguments=$true)][string]$arg); |
This file contains hidden or 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 bash | |
# convert a text file to a patch file | |
set -Eeuo pipefail | |
# usage: file2patch "source/file" "relative/destination/path" "patch/file" | |
file2patch() { | |
local SRCFILE="$1" | |
local PATCHPATH="$2" | |
local OUTFILE="$3" | |
local FILEMODE="$(stat -c '%a' "${SRCFILE}")" |
This file contains hidden or 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 bash | |
# Revert `git submodule absorbgitdirs`. | |
# Source: https://stackoverflow.com/a/51763718 | |
# Notes: | |
# - Nested submodules must be moved first, so if you are specifying submodules manually, make sure the dependencies are correct | |
# - Assuming latest version of Git and GNU coreutils has been installed in the $PATH | |
gitextractsubmodules() { | |
set -e | |
pushd -- "$(git rev-parse --show-superproject-working-tree)" >/dev/null 2>&1 |
This file contains hidden or 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
Ruijie#reload | |
Reload system?(Y/N)y | |
Press RETURN to get started | |
*Jan 1 00:02:28: %DP-3-RESET_DEV: Reset device 1 due to reload command. | |
*Jan SysRq : Resettin | |
Boot SPL 1.2.41-f94ff99 (Feb 04 2021 - 19:27:36) | |
NAND: Detected flash |
This file contains hidden or 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 -Eeuo pipefail | |
# Build a new Debian bullseye image which works around the problem that | |
# when cloud-init is fed a static IPv6 config, ifup/ifdown will fail with: | |
# "/etc/network/if-pre-up.d/cloud_inet6: 12: IF_TRY_DHCP: parameter not set" | |
# | |
# Requirements: | |
# - wget | |
# - qemu-utils |
This file contains hidden or 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
#| Welcome to RouterOS! | |
#| 1) Set a strong router password in the System > Users menu | |
#| 2) Upgrade the software in the System > Packages menu | |
#| 3) Enable firewall on untrusted networks | |
#| ----------------------------------------------------------------------------- | |
#| Switch mode: | |
#| * all interfaces switched; | |
#| LAN Configuration: | |
:global defconfMode; |
NewerOlder