Skip to content

Instantly share code, notes, and snippets.

@ntk148v
ntk148v / container.diff
Last active September 5, 2017 07:33 — forked from anonymous/-
diff --git a/barbican/api/controllers/acls.py b/barbican/api/controllers/acls.py
index d65f87a..a586590 100644
--- a/barbican/api/controllers/acls.py
+++ b/barbican/api/controllers/acls.py
@@ -22,6 +22,7 @@ from barbican.common import validators
from barbican import i18n as u
from barbican.model import models
from barbican.model import repositories as repo
+from barbican import objects
@ntk148v
ntk148v / myappindicator_v5.py
Created December 10, 2017 04:23 — forked from jmarroyave/myappindicator_v5.py
Ubuntu AppIndicator to show Chuck Norris jokes - Updated to python 3
# This code is an example for a tutorial on Ubuntu Unity/Gnome AppIndicators:
# http://candidtim.github.io/appindicator/2014/09/13/ubuntu-appindicator-step-by-step.html
import os
import signal
import json
from urllib import request
from urllib.error import URLError
from urllib.request import urlopen
@ntk148v
ntk148v / xxf.zsh-theme
Created May 6, 2018 02:57 — forked from xfanwu/xxf.zsh-theme
Yet another theme for oh-my-zsh
# Copy and self modified from ys.zsh-theme, the one of default themes in master repository
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background and the font Inconsolata.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
# http://xiaofan.at
# 2 Jul 2015 - Xiaofan
# Machine name.
function box_name {
@ntk148v
ntk148v / installing-arch.md
Created July 10, 2018 08:38 — forked from ChrisTimperley/installing-arch.md
Instructions for installing Arch Linux and i3 onto a Dell Inspiron 7537

Arch Linux

GRUB Installation

Be sure to replace /dev/sda with the name of the drive (n.b. not the partition) containing Arch.

# pacman -S grub-bios intel-ucode
# grub-install /dev/sda
# mkinitcpio -p linux
http://cronus.allowed.org works for me, 2018.1.6
@ntk148v
ntk148v / System Design.md
Created February 22, 2019 06:48 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@ntk148v
ntk148v / main.go
Created March 7, 2019 02:33 — forked from creack/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"strconv"
@ntk148v
ntk148v / main.go
Created March 7, 2019 02:33 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@ntk148v
ntk148v / main.go
Last active October 25, 2019 04:08 — forked from thrawn01/main.go
etcd `concurrency.Election` example with connection interruption detection and initial leadership status reporting
package main
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"
"time"
@ntk148v
ntk148v / linux_memory_control_to_avoid_swap_thrashing.md
Created November 28, 2019 09:41 — forked from JPvRiel/linux_memory_control_to_avoid_swap_thrashing.md
Notes on linux memory management options to prioritize and control memory access using older ulimits, newer cgroups and overcommit policy settings. Mostly as an attempt to keep a desktop environment responsive and avoid swap thrashing under high memory pressure.

Overview

Some notes about:

  • Explaining why current day Linux memory swap thrashing still happens (as of 2016).
  • Mitigating "stop the world" type thrashing issues on a Linux workstation when it's under high memory pressure and where responsiveness is more important than process completion.
  • Prioritizing and limiting memory use.
  • Older ulimit versus newer CGroup options.

These notes assume some basic background knowledge about memory management, ulimits and cgroups.