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
document.querySelectorAll("pre code").forEach((element) => | |
{ | |
let html = element.outerHTML | |
let pattern = html.match(/\s*\n[\t\s]*/) | |
element.outerHTML = html.replace(new RegExp(pattern, "g"),'\n') | |
} | |
) |
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 | |
# This script has been tested on Ubuntu 20.04 | |
# For other versions of Ubuntu, you might need some tweaking | |
echo "[TASK 1] Install containerd runtime" | |
apt update -qq >/dev/null 2>&1 | |
apt install -qq -y containerd apt-transport-https >/dev/null 2>&1 | |
mkdir /etc/containerd | |
containerd config default > /etc/containerd/config.toml |
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
config: | |
limits.cpu: "2" | |
limits.memory: 3500MB | |
limits.memory.swap: "false" | |
linux.kernel_modules: ip_tables,ip6_tables,nf_nat,overlay,br_netfilter | |
raw.lxc: "lxc.apparmor.profile=unconfined\nlxc.cap.drop= \nlxc.cgroup.devices.allow=a\nlxc.mount.auto=proc:rw | |
sys:rw" | |
security.privileged: "true" | |
security.nesting: "true" | |
description: LXD profile for Kubernetes |
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=Dynamic IP for HOST timer | |
[Timer] | |
OnBootSec=1min | |
OnUnitActiveSec=6h | |
[Install] | |
WantedBy=timers.target |
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=Dynamic IP for HOST | |
[Service] | |
Type=oneshot | |
ExecStart=/root/config/ddnss.sh |
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
[sshd] | |
enabled = true | |
maxretry = 3 | |
findtime = 1d | |
bantime = 8w | |
ignoreip = 127.0.0.1/8 |
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
# Resume rufus-scheduler (v3.6) jobs once after pause/resume: | |
def self.scheduler | |
Rufus::Scheduler.singleton | |
end | |
def self.resume | |
scheduler.resume # to change the paused? status | |
scheduler.jobs.each do |job| | |
paused_duration = EtOrbi.now - job.paused_at |
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
class TrailblazerFoo::Create < Trailblazer::Operation | |
extend Contract::DSL | |
contract TrailblazerFoo::Contract::Create | |
step :log_params | |
step Model(TrailblazerFoo, :new) | |
step Contract::Build() | |
# TODO: actually get properties set on model | |
step Contract::Validate() |
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
# FIXME: find cause for error (circular dependency?), use: ab -c 50 -n 500 http://localhost:3000/ for burn in | |
if Rails.env.development? | |
require 'active_support/core_ext/module/attribute_accessors' | |
require 'active_support/logger_silence' | |
require 'active_support/logger_thread_safe_level' | |
require 'logger' | |
module ActiveSupport | |
class Logger < ::Logger |
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
GEM | |
remote: https://rubygems.org/ | |
remote: https://rails-assets.org/ | |
specs: | |
actionmailer (4.2.7.1) | |
actionpack (= 4.2.7.1) | |
actionview (= 4.2.7.1) | |
activejob (= 4.2.7.1) | |
mail (~> 2.5, >= 2.5.4) | |
rails-dom-testing (~> 1.0, >= 1.0.5) |