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
| ###Network Policy Server Synchronization Script | |
| #This script copies the configuration from the NPS Master Server and imports it on the secondary server. | |
| #The Account that this script runs under must have Local Administrator rights to the NPS Master. | |
| #This was designed to be run as a scheduled task on the NPS Secondary Servers on an hourly,daily, or as-needed basis. | |
| # Modified from https://deployhappiness.com/two-network-policy-server-tricks-subnets-and-syncing/ | |
| ###Variables | |
| #NPSMaster - Your Primary Network Policy Server you want to copy the config from. | |
| $NPSMaster = "adds0.corp.contoso.com" | |
| $NPSSecondary = "adds1.corp.contoso.com" |
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
| ; Please see https://gist.github.com/Jamesits/6a58a1b08d5cd09a94a02f30ddaf0e13#gistcomment-2081294 | |
| ; for instruction. | |
| ; Author: James Swineson <mactype@public.swineson.me> | |
| [General] | |
| Name=James Profile | |
| ; 【启用 DirectWrite 支持】 | |
| ; [0:Disable] 1:Enable | |
| DirectWrite=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
| # Should work on all Debian based distros with systemd; tested on Ubuntu 16.04+. | |
| # This will by default install all plugins; you can customize this behavior on line 6. Selecting too many plugins can cause issues when downloading. | |
| # Run as root (or sudo before every line) please. Note this is not designed to be run automatically; I recommend executing this line by line. | |
| apt install curl | |
| curl https://getcaddy.com | bash -s personal dns,docker,dyndns,hook.service,http.authz,http.awses,http.awslambda,http.cache,http.cgi,http.cors,http.datadog,http.expires,http.filemanager,http.filter,http.forwardproxy,http.geoip,http.git,http.gopkg,http.grpc,http.hugo,http.ipfilter,http.jekyll,http.jwt,http.locale,http.login,http.mailout,http.minify,http.nobots,http.prometheus,http.proxyprotocol,http.ratelimit,http.realip,http.reauth,http.restic,http.upload,http.webdav,net,tls.dns.auroradns,tls.dns.azure,tls.dns.cloudflare,tls.dns.cloudxns,tls.dns.digitalocean,tls.dns.dnsimple,tls.dns.dnsmadeeasy,tls.dns.dnspod,tls.dns.dyn,tls. |
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
| // High-accuracy square wave generator | |
| // based on ESP8266 | |
| // with runtime adjustable frequency, PWM width and offset | |
| // Output wave at pin 5 (configurable from 0 to 15, but not 16) | |
| // by James Swineson <github@public.swineson.me>, 2017-10 | |
| // https://gist.github.com/Jamesits/92394675c0fe786467b26f90e95d3904 | |
| // See https://blog.swineson.me/implementation-of-6mbps-high-speed-io-on-esp8266-arduino-ide/ | |
| // for more information (article in Chinese) | |
| // Arduino UNO version: https://gist.github.com/Jamesits/8d164818946a65d0cafcd6203e3e5049 |
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
| #!/bin/bash | |
| set -Eeuo pipefail | |
| # Automatic cert requesting and signing for Cisco ASA | |
| # | |
| # Requirements | |
| # - Domain hosted in Aliyun DNS (for other DNS services, adjust the acme.sh arguments) | |
| # - ASA with rest-agent enabled | |
| # - Local computer: openssl, git, ca-certificates | |
| # |
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
| #!/bin/bash | |
| set -Eeuo pipefail | |
| DOCKER_IMAGE="${DOCKER_IMAGE:-hello-world}" | |
| DOCKER_FLAGS="${DOCKER_FLAGS:-}" | |
| function __docker() { | |
| if command -v docker >/dev/null; then | |
| docker "$@" | |
| elif command -v podman >/dev/null; then | |
| podman "$@" |
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 | |
| # Converts MTR result to InfluxDB line protocol. | |
| # Intended to be run from telegraf like this: | |
| # | |
| # [[inputs.exec]] | |
| # commands = ["/path/to/your/mtr_lineprotocol.sh"] | |
| # interval = "120s" | |
| # timeout = "120s" | |
| # data_format = "influx" |
NewerOlder