Skip to content

Instantly share code, notes, and snippets.

View ivan's full-sized avatar
🕸️

Ivan Kozik ivan

🕸️
View GitHub Profile
@johand
johand / upgrading_pg.md
Last active February 26, 2025 07:38
Upgrading PostgreSQL to a major version in Archlinux

Upgrading PostgreSQL to a major version in Archlinux

# pacman -S postgresql-old-upgrade

# systemctl stop postgresql.service
# mv /var/lib/postgres/data /var/lib/postgres/olddata
@ivan
ivan / upgrade.md
Last active December 24, 2018 10:55
Upgrade NVIDIA Web Driver over SSH / with just command line
@ivan
ivan / gist:c3890bad89bf79b26199192e23e8f951
Created December 18, 2018 02:23
uBlock Origin rule to remove letter-spacing: 0.2px; on gmail
mail.google.com##td:style(letter-spacing: inherit !important)
@ivan
ivan / fix-signal-desktop.patch
Created December 24, 2018 10:50
nixpkgs fix for Signal-Desktop problems
From 07c44f9cee29524f7e82c7d422942b423f4c6f7e Mon Sep 17 00:00:00 2001
From: Ivan Kozik <[email protected]>
Date: Mon, 24 Dec 2018 07:59:33 +0000
Subject: [PATCH] signal-desktop: add flags --disable-smooth-scrolling
--disable-gpu
---
.../instant-messengers/signal-desktop/default.nix | 7 +++++++
1 file changed, 7 insertions(+)
@ivan
ivan / chromium-always-insert-tab-to-the-right-of-current-tab.patch
Last active January 2, 2019 14:01
Chromium: always insert new tabs to the right of the current tab
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -627,12 +627,12 @@ void NewTab(Browser* browser) {
#endif
if (browser->is_type_tabbed()) {
- AddTabAt(browser, GURL(), -1, true);
+ AddTabAt(browser, GURL(), browser->tab_strip_model()->active_index() + 1, true);
browser->tab_strip_model()->GetActiveWebContents()->RestoreFocus();
} else {
@ivan
ivan / wireguard.nix
Created January 8, 2019 11:34
WireGuard configuration generator for NixOS
{ lib }:
rec {
machines = [
{ hostname = "ra"; ip = "10.10.0.1"; publicKey = "qJ+QobVpqLT7F4fafhrvZgjzzeiSlg6OjQMqdX27PXo="; endpoints = { home = "192.168.10.3:904"; internet = "101.21.7.172:906"; }; }
{ hostname = "plato"; ip = "10.10.0.2"; publicKey = "MBcQj0qf4swKzn1Y3md2Vmtk62HZWi2eN/S4Jeif9lE="; endpoints = { home = "192.168.10.4:904"; internet = "101.21.7.172:905"; }; }
{ hostname = "mojave"; ip = "10.10.0.7"; publicKey = "AKv7fMWxRAH/XPixBon+Ye1keJqiEI8ZD2ArhN1i+2k="; endpoints = { work_vmware_nat = "192.168.27.129:904"; }; }
{ hostname = "paris2"; ip = "10.10.0.11"; publicKey = "QAhGefXPglpLHR/NWK9Sl6M2YMJ9m7h3iFx8lfl9HVY="; endpoints = { internet = "6.21.7.51:904"; }; subdomains = [ "grab-site" ]; }
{ hostname = "icvm"; ip = "10.10.0.20"; publicKey = "uJsqDBJNJpeJAkq3+stcmsYd86l+A3pw3RPNkuBMmmE="; endpoints = { work_vmware_nat = "192.168.27.128:904"; }; subdomains = [ "hydra" ]; }
{ hostname = "bhsvps1"; ip = "10.10.0.9"; publicKey = "OKLXA4s6UqnYXrwMD
@ivan
ivan / set-xfce4-panel-bgcolor.sh
Last active May 20, 2021 22:19
Set the background color of xfce4-panel from the command line
#!/usr/bin/env bash
set -eu
# Set the background color of xfce4-panel; takes 4 arguments:
# R G B A, ranging from 0.0 to 1.0.
#
# Tested only with xfce4-panel 4.13.4 which uses four doubles for
# <property name="background-rgba" type="array">
@ivan
ivan / instructions.md
Last active July 30, 2024 01:14
Replace Debian with NixOS on scaleway

Replace Debian install with NixOS on Scaleway

This is based on nixos-infect.

These instructions assume you have x86 scaleway machines that use UEFI and DHCP. You have may have to change /dev/vda15 if your machines are partitioned differently.

First, rsync your configuration to /root/configuration.

Run:

{ config, lib, ... }:
with lib;
{
# Add support for Grub secrets
config = mkIf (config.boot.loader.grub.enable && config.boot.initrd.secrets != {}) {
boot.loader = {
supportsInitrdSecrets = mkForce true;
grub.extraInitrd = "/boot/grub/secrets-initrd.gz";
@ivan
ivan / nixos-mbr-dhcp.md
Last active December 22, 2019 23:25
Replace Debian install with NixOS on MBR/DHCP machine e.g. on SoYouStart

This is based on nixos-infect.

These instructions assume you have a machine using MBR to boot and DHCP for networking.

Run manually:

apt update
apt install curl rsync libfile-slurp-perl xz-utils

mkdir -p -m 0755 /nix