View ValueId.kt
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 org.jetbrains.exposed.sql.Column | |
import org.jetbrains.exposed.sql.ColumnType | |
import org.jetbrains.exposed.sql.IColumnType | |
import org.jetbrains.exposed.sql.IntegerColumnType | |
import org.jetbrains.exposed.sql.LongColumnType | |
import org.jetbrains.exposed.sql.UUIDColumnType | |
import java.sql.ResultSet | |
import kotlin.reflect.KClass | |
public interface ValueId<T : Comparable<T>> : Comparable<ValueId<T>> { |
View 54-manage-units.pkla
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
cat /etc/polkit-1/localauthority/50-local.d/54-manage-units.pkla | |
[systemd] | |
Identity=unix-user:deploy | |
Action=org.freedesktop.systemd1.manage-units | |
ResultAny=yes | |
ResultInactive=yes | |
ResultActive=yes |
View stack-proxy.yml
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
# this traefik reverse proxy has a bunch of features: | |
# - reverse proxy all 80/443 ingress traffic on a swarm | |
# - dynamic config via each app's swarm service labels | |
# - HA multi-container design for traefik | |
# - runs traefik on host NIC directly, to improve performance | |
# and capture client IP's | |
# - uses consul to store static config for startup | |
# - uses haproxy to allow offloading traefik to worker nodes | |
# - store consul data in a volume on cloud storage with rexray |
View pg_backup.config
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
############################## | |
## POSTGRESQL BACKUP CONFIG ## | |
############################## | |
# Optional system user to run backups as. If the user the script is running as doesn't match this | |
# the script terminates. Leave blank to skip check. | |
BACKUP_USER=postgres | |
# Optional hostname to adhere to pg_hba policies. Will default to "localhost" if none specified. | |
HOSTNAME= |
View docker-cleanup.service
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
[Unit] | |
Description=docker cleanup service | |
Requires=docker.service | |
After=docker.service | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/bin/docker system prune --volumes -f |
View tcp_flags.txt
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
##TCP FLAGS## | |
Unskilled Attackers Pester Real Security Folks | |
============================================== | |
TCPDUMP FLAGS | |
Unskilled = URG = (Not Displayed in Flag Field, Displayed elsewhere) | |
Attackers = ACK = (Not Displayed in Flag Field, Displayed elsewhere) | |
Pester = PSH = [P] (Push Data) | |
Real = RST = [R] (Reset Connection) | |
Security = SYN = [S] (Start Connection) |
View RateLimit.kt
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
fun Application.module(testing: Boolean = false) { | |
val config = RateLimiterConfig.custom() | |
.limitRefreshPeriod(Duration.ofMillis(1)) | |
.limitForPeriod(10) | |
.timeoutDuration(Duration.ofMillis(25)) | |
.build() | |
val rateLimiterRegistry = RateLimiterRegistry.of(config) | |
val testRateLimiter = rateLimiterRegistry | |
.rateLimiter("test") | |
routing { |
View _firewalld
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
#compdef firewall-cmd firewall-offline-cmd | |
local curcontext="$curcontext" name nm="$compstate[nmatches]" | |
local -a state line expl direct args auxargs opargs suf | |
typeset -A opt_args | |
direct=( | |
'--get-all-chains[get all chains]' | |
'--get-chains[get all chains added to the table]:family:(ipv4 ipv6 eb):table:->tables' | |
'--add-chain[add a new chain to the table]:family:(ipv4 ipv6 eb):table:->tables:new chain' |
View tmux.conf
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
set-option -g status-bg colour235 #base02 | |
set-option -g status-fg colour136 #yellow | |
# set window split | |
bind-key v split-window -h | |
bind-key b split-window | |
# pane number display | |
set-option -g display-panes-active-colour colour33 #blue | |
set-option -g display-panes-colour colour166 #orange |
View VueSafeHTML.ts
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 { VueConstructor } from 'vue' | |
// Vue plugin for v-html-safe directive (safe alternative to insecure v-html) | |
const VueSafeHTML = { | |
install: function (vue: VueConstructor) { | |
const doc = document.implementation.createHTMLDocument('') | |
const div = doc.createElement('div') | |
function sanitizeHTML(htmlString: string) { | |
div.innerHTML = htmlString |
NewerOlder