Skip to content

Instantly share code, notes, and snippets.

View wintersolutions's full-sized avatar

wintersolutions wintersolutions

View GitHub Profile
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')
}
)
#!/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
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
[Unit]
Description=Dynamic IP for HOST timer
[Timer]
OnBootSec=1min
OnUnitActiveSec=6h
[Install]
WantedBy=timers.target
[Unit]
Description=Dynamic IP for HOST
[Service]
Type=oneshot
ExecStart=/root/config/ddnss.sh
[sshd]
enabled = true
maxretry = 3
findtime = 1d
bantime = 8w
ignoreip = 127.0.0.1/8
# 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
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()
# 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
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)