Skip to content

Instantly share code, notes, and snippets.

View clickfreak's full-sized avatar

Konstantin Novakovskii clickfreak

View GitHub Profile
@bagder
bagder / trrprefs.md
Last active December 27, 2022 05:17
This once held TRR prefs. Now it has moved.

NOTE

This content has moved.

Please go to bagder/TRRprefs for the current incarnation of the docs, and please help us out polish and maintain this documentation!

@jdmar3
jdmar3 / onc_converter.py
Last active September 7, 2018 17:33 — forked from woodrow/onc_converter.py
Convert OpenVPN config files to ChromeOS ONC files
#!/usr/bin/python
import argparse
import json
import re
import sys
import uuid
class OpenVPNNetworkConfiguration(object):
@kekru
kekru / add CA cert on CentOS Debian Ubuntu.md
Last active October 23, 2023 08:21
Add CA cert to local trust store on CentOS, Debian or Ubuntu
  • Open a webpage that uses the CA with Firefox
  • Click the lock-icon in the addressbar -> show information -> show certificate
  • the certificate viewer will open
  • click details and choose the certificate of the certificate-chain, you want to import to CentOS
  • click "Export..." and save it as .crt file
  • Copy the .crt file to /etc/pki/ca-trust/source/anchors on your CentOS machine
  • run update-ca-trust extract
  • test it with wget https://thewebsite.org
@sjenning
sjenning / numa-pinned-kubelets.md
Last active February 7, 2019 19:34
Running multiple kubelets that each schedule to a different NUMA pinned domain

Kubernetes on a NUMA machine

Example Topology

2 scoket (2 node) machine with 4 cores/socket, 0-3 on node0 and 4-7 on node1

kubelet options

kubelet-node0

@jimschubert
jimschubert / Markdown-JavaScript.markdown.js
Last active September 24, 2023 13:31
DataGrip (IntelliJ) output SQL results to Markdown
if (!String.prototype.repeat) {
// polyfill from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat
String.prototype.repeat = function(count) {
'use strict';
if (this == null) {
throw new TypeError('can\'t convert ' + this + ' to object');
}
var str = '' + this;
count = +count;
if (count != count) {
@alexey-milovidov
alexey-milovidov / rounding_time.txt
Created June 20, 2016 21:00
Example of rounding time to 5-second interval in ClickHouse.
:) SELECT toDateTime(intDiv(toUInt32(EventTime), 5) * 5) AS k, count(), uniq(UserID) FROM hits_layer WHERE CounterID = 29761725 AND EventDate = today() AND EventTime >= now() - 600 GROUP BY k ORDER BY k
SELECT
toDateTime(intDiv(toUInt32(EventTime), 5) * 5) AS k,
count(),
uniq(UserID)
FROM hits_layer
WHERE (CounterID = 29761725) AND (EventDate = today()) AND (EventTime >= (now() - 600))
GROUP BY k
ORDER BY k ASC
@nerdalert
nerdalert / Netfilter-IPTables-Diagrams.md
Last active May 9, 2024 03:52
Linux NetFilter, IP Tables and Conntrack Diagrams

Linux NetFilter, IP Tables and Conntrack Diagrams

IPTABLES TABLES and CHAINS

IPTables has the following 4 built-in tables.

1) Filter Table

Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.

@ValdikSS
ValdikSS / donotasktoask_ru.md
Last active December 30, 2022 17:54
Спрашивайте сразу

Вам отправили это сообщение по следующим возможным причинам:

  • Вы поприветствовались и ждете ответа
  • Вы спросили о том, можно ли задать вопрос, и ждете ответа
  • Вы скинули запрос авторизации и ждете ответа

Пожалуйста, не делайте так. Задавайте вопрос сразу, без прелюдий, без запросов авторизации (в том числе и в Jabber), и ждите ответа. Не повторяйте свой вопрос и не спрашивайте, на месте ли я.

Здесь комментарии не пишите, уведомление о них не приходит ни мне, ни вам.

Если вам интересно получить развернутый ответ и аргументы, почему не стоить здороваться и ожидать ответа при общении онлайн:

@wvengen
wvengen / extend.sh
Last active April 22, 2024 14:02
Extend non-HiDPI external display above HiDPI internal display
#!/bin/sh
# extend non-HiDPI external display on DP* above HiDPI internal display eDP*
# see also https://wiki.archlinux.org/index.php/HiDPI
# you may run into https://bugs.freedesktop.org/show_bug.cgi?id=39949
# https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/883319
EXT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^eDP | head -n 1`
INT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^DP | head -n 1`
ext_w=`xrandr | sed 's/^'"${EXT}"' [^0-9]* \([0-9]\+\)x.*$/\1/p;d'`
@shamil
shamil / mount_qcow2.md
Last active May 7, 2024 20:53
How to mount a qcow2 disk image

How to mount a qcow2 disk image

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