Skip to content

Instantly share code, notes, and snippets.

arriqaaq /
Created Sep 9, 2021
Network namespaces [Bridge + VETH]
#!/usr/bin/env bash
if [[ $EUID -ne 0 ]]; then
echo "You must be root to run this script"
exit 1
View cronjob.go
Copyright 2022 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
View turing
// Input: a binary number n
// Ouput: accepts if n mod 3 == 0
// Example: accepts 110 (=6)
// ------- States -----------|
// q0 - mod3 == 0 |
// q1 - mod3 == 1 |
// q2 - mod3 == 2 |
// qaccept - accepting state |
arriqaaq /
Last active Nov 23, 2021
Golang Design Patterns in Kubernetes [WIP]

Design patterns are typical solutions to common problems in software design. The most universal and high-level patterns are architectural patterns. Developers can implement these patterns in virtually any language. Unlike other patterns, they can be used to design the architecture of an entire application.

In addition, all patterns can be categorized by their intent, or purpose. We covers two main groups of patterns:

  • Creational patterns provide object creation mechanisms that increase flexibility and reuse of existing code.
  • Structural patterns explain how to assemble objects and classes into larger structures, while keeping the structures flexible and efficient.
  • Behavioral patterns take care of effective communication and the assignment of responsibilities between objects.

Creational Patterns

arriqaaq /
Created Sep 10, 2021
setting up ubuntu bionic vagrant image
vagrant init ubuntu/bionic64
vagrant up
vagrant ssh


Pseudo file systems

The command ‘uname‘ displays the information about the system.


uname [OPTION]

View error-1.go
type error interface {
Error() string
View Dependency-layer
FROM mockingbird/application-go-image
RUN git clone
WORKDIR /badger
WORKDIR /badger
RUN make VERBOSE=1 && make install
View gist:9cc948c0c57fcfa6dca49a80d1b809b3
FROM mockingbird/base-image
RUN curl -LO \
&& chown root:root go1.12.2.linux-amd64.tar.gz \
&& tar -xzf go1.12.2.linux-amd64.tar.gz \
&& rm go1.12.2.linux-amd64.tar.gz \
&& mv go /usr/local
View mysql-dependency-layer
FROM mockingbird/base-image
ENV MYSQL_VERSION 5.6.44-1debian9
RUN echo "deb stretch mysql-${MYSQL_MAJOR}" > /etc/apt/sources.list.d/mysql.list
# the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql)
# also, we set debconf keys to make APT a little quieter
RUN { \