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 code is to be used with https://turbo.hotwire.dev. By default Turbo keeps visited pages in its cache | |
// so that when you visit one of those pages again, Turbo will fetch the copy from cache first and present that to the user, then | |
// it will fetch the updated page from the server and replace the preview. This makes for a much more responsive navigation | |
// between pages. We can improve this further with the code in this file. It enables automatic prefetching of a page when you | |
// hover with the mouse on a link or touch it on a mobile device. There is a delay between the mouseover event and the click | |
// event, so with this trick the page is already being fetched before the click happens, speeding up also the first | |
// view of a page not yet in cache. When the page has been prefetched it is then added to Turbo's cache so it's available for | |
// the next visit during the same session. Turbo's default behavior plus this trick make for much more responsive UIs (non SPA). | |
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
- In Rancher, edit cluster, then edit Cluster Options as yaml and change the kubelet section as follows if needed: | |
``` | |
kubelet: | |
extra_args: | |
volume-plugin-dir: "/usr/libexec/kubernetes/kubelet-plugins/volume/exec" | |
extra_binds: | |
- "/usr/libexec/kubernetes/kubelet-plugins/volume/exec:/usr/libexec/kubernetes/kubelet-plugins/volume/exec" | |
fail_swap_on: false | |
``` |
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
%w(rubygems sequel fileutils yaml active_support/inflector).each{|g| require g} | |
require File.join(File.dirname(__FILE__), "downmark_it") | |
module WordPress | |
def self.import(database, user, password, table_prefix = "wp", host = 'localhost') | |
db = Sequel.mysql(database, :user => user, :password => password, :host => host, :encoding => 'utf8') | |
%w(_posts _drafts images/posts/featured).each{|folder| FileUtils.mkdir_p folder} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet version="2.0" | |
xmlns:html="http://www.w3.org/TR/REC-html40" | |
xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/> | |
<xsl:template match="/"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>XML Sitemap</title> |
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
#!/usr/bin/env bash | |
# | |
# Shows time in seconds to first byte of a url or urls | |
# | |
# Based on a gist https://gist.github.com/sandeepraju/1f5fbdbdd89551ba7925abe2645f92b5 | |
# by https://github.com/sandeepraju | |
# | |
# Modified by jay@gooby.org, @jaygooby | |
# | |
# Usage: ttfb [options] url [url...] |
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 | |
export LC_ALL=C | |
archive="$1" | |
container_name="root_gitea_1" | |
now=$(date +"%Y%m%d-%H%M%S") | |
# gitea_dir: it's the directory in the volume attached to the container which contains gitesa' data directory | |
gitea_dir="/data/containers/gitea" | |
gitea_data_dir="${gitea_dir}/data" | |
restore_dir="/tmp/gitea-restore-${now}" |
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
------------------------------------------------- | |
nench.sh v2019.07.20 -- https://git.io/nench.sh | |
benchmark timestamp: 2021-11-24 10:17:04 UTC | |
------------------------------------------------- | |
Processor: 11th Gen Intel(R) Core(TM) i9-11900K @ 3.50GHz | |
CPU cores: 4 | |
Frequency: 3504.000 MHz | |
RAM: 7.8Gi | |
Swap: 4.0Gi |
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
------------------------------------------------- | |
nench.sh v2019.07.20 -- https://git.io/nench.sh | |
benchmark timestamp: 2021-11-24 10:17:02 UTC | |
------------------------------------------------- | |
Processor: 11th Gen Intel(R) Core(TM) i9-11900K @ 3.50GHz | |
CPU cores: 4 | |
Frequency: 3504.000 MHz | |
RAM: 7.8Gi | |
Swap: 4.0Gi |
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
------------------------------------------------- | |
nench.sh v2019.07.20 -- https://git.io/nench.sh | |
benchmark timestamp: 2021-11-24 10:17:00 UTC | |
------------------------------------------------- | |
Processor: 11th Gen Intel(R) Core(TM) i9-11900K @ 3.50GHz | |
CPU cores: 4 | |
Frequency: 3504.000 MHz | |
RAM: 7.8Gi | |
Swap: 4.0Gi |
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
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
# Yet-Another-Bench-Script # | |
# v2021-10-09 # | |
# https://github.com/masonr/yet-another-bench-script # | |
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
Wed 24 Nov 2021 10:09:56 AM UTC | |
Basic System Information: | |
--------------------------------- |
NewerOlder