This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.
Step 1 - Enable NBD on the Host
modprobe nbd max_part=8
By default Linux distros are unoptimized in terms of I/O latency. So, here are some tips to improve that.
Most apps still don't do multi-threaded I/O access, so it's a thread-per-app which makes per-app speed always bottlenecked by single-core CPU performance (that's not even accounting for stuttering on contention between multiple processes), so even with NVMe capable of 3-6 GB/s of linear read you may get only 1-2 GB/s with ideal settings and 50-150/100-400 MB/s of un/buffered random read (what apps actually use in real life) is the best you can hope for.
All writes are heavily buffered on 3 layers (OS' RAM cache, device's RAM cache, device's SLC-like on-NAND cache), so it's difficult to get real or stable numbers but writes are largelly irrelevant for system's responsiveness, so they may be sacrificed for better random reads.
The performance can be checked by:
| // This DTS overlay sets up one input and one output pin for use by | |
| // PRU0 via its Enhanced GPIO mode, which will let us access those pins | |
| // by writing to R30 bit 15 or reading from R31 bit 14. | |
| // Save this file wherever you want (but I recommend /lib/firmware), as | |
| // "PRU-GPIO-EXAMPLE-00A0.dts". | |
| // Compile with: | |
| // dtc -O dtb -I dts -o /lib/firmware/PRU-GPIO-EXAMPLE-00A0.dtbo -b 0 -@ PRU-GPIO-EXAMPLE-00A0.dts | |
IMPORTANT: Read this before implementing one of the configuration files below (for either Varnish 3.x or 4.x+).
USE: Replace the contents of the main Varnish configuration file located in /etc/varnish/default.vcl (root server access required - obviously) with the contents of the configuration you'll use (depending on your Varnish version) from the 2 examples provided below.
IMPORTANT: The following setup assumes a 180 sec (3 minute) cache time for cacheable content that does not have the correct cache-control HTTP headers. You can safely increase this to 300 sec (or more) for less busier sites or drop it to 60 sec or even 30 sec for high traffic sites.
This configuration requires an HTTP Header and a user cookie to identify if a user is logged in a site, in order to bypass caching overall (see how it's done for Joomla & WordPress). If your CMS provides a way to add these two requirements, then you can use this configurati
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # original: https://raw.githubusercontent.com/tweksteen/jenkins-decrypt/master/decrypt.py | |
| # detailed explanation: http://thiébaud.fr/jenkins_credentials.html | |
| import re | |
| import sys | |
| import base64 | |
| from hashlib import sha256 | |
| from binascii import hexlify, unhexlify |
| #!/bin/bash | |
| # | |
| # Script based on https://jeremievallee.com/2018/05/28/kubernetes-rbac-namespace-user.html | |
| # | |
| # In honor of the remarkable Windson | |
| # | |
| # Modified by Gabriel Francisco to create cluster-admin users. | |
| username=$1 |
| # config/routes.rb | |
| resources :documents do | |
| scope module: 'documents' do | |
| resources :versions do | |
| post :restore, on: :member | |
| end | |
| resource :lock | |
| end | |
| end |
| def mask n;n.slice(0,6)+"*"*(n.size-10)+n.slice(-4,4);end |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| def archive_to_bytes(archive): | |
| def to_seconds(s): | |
| SECONDS_IN_A = { | |
| 's': 1, | |
| 'm': 1 * 60, | |
| 'h': 1 * 60 * 60, |
| # Postfix stuff based on https://gist.github.com/jbrownsc/4694374: | |
| QUEUEID (?:[A-F0-9]+|NOQUEUE) | |
| EMAILADDRESSPART [a-zA-Z0-9_.+-=:]+ | |
| EMAILADDRESS %{EMAILADDRESSPART:local}@%{EMAILADDRESSPART:remote} | |
| RELAY (?:%{HOSTNAME:relayhost}(?:\[%{IP:relayip}\](?::[0-9]+(.[0-9]+)?)?)?) | |
| POSREAL [0-9]+(.[0-9]+)? | |
| DELAYS (%{POSREAL}[/]*)+ | |
| DSN %{NONNEGINT}.%{NONNEGINT}.%{NONNEGINT} | |
| STATUS sent|deferred|bounced|expired |