Skip to content

Instantly share code, notes, and snippets.

@amonakov
amonakov / gist:c65b633f97e5b301f691563ea2f8c636
Created May 7, 2020 08:35
Firmware issue with TSC sync on Acer sf314-42
There seems to be a firmware issue with TSC (timestamp counter) on new
AMD Ryzen CPUs in recently released Acer Swift 3 SF314-42 laptops.
The issue is that different cores of the CPU may have TSC running at
different rates or out of sync with each other. This causes a
performance penalty as the operating system is unable to use the TSC,
and has to fall back to another time source.
The issue can be easily reproduced by booting Linux (Windows should be
affected too, but I'm not sure how to diagnose it there). After
@acj
acj / microk8s_in_lxc.md
Last active April 29, 2024 13:39
Installing microk8s in an LXC container

Installing microk8s in an LXC container

I wanted to run Microk8s on a Proxmox 6 host inside of an LXC container. These are my notes from the journey.

  1. Create a privileged LXC container through the Proxmox web interface
  • Enable nesting and FUSE
    • In Proxmox UI, select container, then Options > Features > Check nesting and FUSE boxes
  1. SSH into the Proxmox host and edit the container's config in /etc/pve/lxc/.conf
    • Add the following lines
  • lxc.apparmor.profile: unconfined
@afanjul
afanjul / install-docker-inside-lxc.txt
Last active June 14, 2023 18:08
Install Docker inside LXC container - Proxmox VE
1.Add “aufs” or “overlay” (or both) to /etc/modules-load.d/modules.conf in your PVE host and reboot. Check it with lsmod | grep -E 'overlay|aufs'
2.Use a LXC image with unprivilege features (you can check them here: https://uk.images.linuxcontainers.org/)
3.Create the container with unprivilege option, and “keyctl=1, nesting=1” features (Options section in proxmox).
4.Maybe you would want to mount an external point into /var/lib/docker (Resources section in proxmox)
5.Check this link (https://docs.docker.com/storage/storagedriver/overlayfs-driver/#configure-docker-with-the-overlay-or-overlay2-storage-driver) to change your storage-driver in docker to use aufs or overlay2.
6.Install portainer: https://portainer.readthedocs.io/en/latest/deployment.html
Voilá…
@rylev
rylev / learn.md
Created March 5, 2019 10:50
How to Learn Rust

Learning Rust

The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.

Warning

Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.

The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.

@william8th
william8th / .tmux.conf
Last active April 30, 2024 17:03
Tmux open new pane in same directory
# Set the control character to Ctrl+Spacebar (instead of Ctrl+B)
set -g prefix C-space
unbind-key C-b
bind-key C-space send-prefix
# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"