- Create
UNLOGGED
table. This reduces the amount of data written to persistent storage by up to 2x. - Set
WITH (autovacuum_enabled=false)
on the table. This saves CPU time and IO bandwidth on useless vacuuming of the table (since we neverDELETE
orUPDATE
the table). - Insert rows with
COPY FROM STDIN
. This is the fastest possible approach to insert rows into table. - Minimize the number of indexes in the table, since they slow down inserts. Usually an index
on
time timestamp with time zone
is enough. - Add
synchronous_commit = off
topostgresql.conf
. - Use table inheritance for fast removal of old data:
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
function fzf-ssh () { | |
local selected_host=$(grep "Host " ~/.ssh/ssh_config | grep -v '*' | cut -b 6- | fzf --query "$LBUFFER" --prompt="SSH Remote > ") | |
if [ -n "$selected_host" ]; then | |
BUFFER="ssh ${selected_host}" | |
zle accept-line | |
fi | |
zle reset-prompt | |
} |
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
--- | |
- hosts: | |
- all | |
remote_user: root | |
tasks: | |
- name: update everything | |
apt: upgrade=dist force_apt_get=yes autoclean=yes | |
- name: check if a reboot is necessary | |
register: reboot_required_file | |
stat: path=/var/run/reboot-required get_md5=no |
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 python3 | |
import sys | |
import tempfile | |
import os | |
import sphinx.ext.autodoc | |
from textwrap import dedent | |
from types import SimpleNamespace | |
_d = SimpleNamespace(result='') |
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
--- drivers/platform/x86/thinkpad_acpi.c.bak 2021-06-28 00:21:11.000000000 +0200 | |
+++ drivers/platform/x86/thinkpad_acpi.c 2022-05-18 04:07:06.814390699 +0200 | |
@@ -8883,31 +8883,22 @@ | |
quirks = tpacpi_check_quirks(fan_quirk_table, | |
ARRAY_SIZE(fan_quirk_table)); | |
- if (gfan_handle) { | |
- /* 570, 600e/x, 770e, 770x */ | |
- fan_status_access_mode = TPACPI_FAN_RD_ACPI_GFAN; | |
- } else { |
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
// Full article: https://medium.com/@disserman/api-call-tracing-in-high-loaded-asynchronous-rust-applications-bc7b126eb470 | |
// | |
// Cargo.toml: | |
// [package] | |
// name = "rct" | |
// version = "0.1.0" | |
// edition = "2021" | |
// | |
// [dependencies] | |
// hyper = { version = "0.14.23", features = ["server", "tcp", "http1"] } |