Skip to content

Instantly share code, notes, and snippets.

@codeopensrc
codeopensrc / k8s-nameservers-fix.md
Last active March 4, 2023 04:31
Fix for kubernetes on DigitalOcean `Nameserver limits exceeded" err="Nameserver limits were exceeded, some nameservers have been omitted`

Fix for kubernetes on DigitalOcean Nameserver limits exceeded" err="Nameserver limits were exceeded, some nameservers have been omitted, the applied nameserver line is: 11.111.11.1 11.111.11.2 11.111.11.1" (example IP addresses used)

After ignoring the error for a bit, I finally had to absolutely solve it due to being unable to deploy a prometheus chart inside my kubernetes cluster.

This isn't really a step-by-step but more an accumulation of resources used/found to finally help solve my problem

TL;DR

  • Modify /etc/netplan/50-cloud-init.yaml removing some entries from IFACE.nameservers.address
    • netplan apply to apply changes
  • resolvctl to see changes to DNS Servers stanza for the IFACE modified
@codeopensrc
codeopensrc / cmds.MD
Last active May 14, 2020 21:14
List and examples of some of my commonly used commands
@codeopensrc
codeopensrc / ls.sh
Created January 25, 2017 20:50
Whitelistable basic `ls` command
PATTERN=*.git
find . -iname '$PATTERN' | sed -e s%./%%g | column
@codeopensrc
codeopensrc / git.MD
Last active January 28, 2017 01:12
Quick notes on Setting up git:// and git user

Note:

This is my personal preference which may be different from yours. I'm choosing to do the following:

  • Let any user within the git group that is NOT the git user, full access to do what they wish with the repositories, including rename, delete, and move.
    • It is possible to only allow the git group to only modify items within the repositories, but I chose not to at this time (its only me anyway). I'll append how to do this at the end at a later time.
  • Let the git user have only enough access to push/pull repositories, list the repositories, and add their public ssh key to git users .ssh/authorized_keys directory.
  • Allow only the repo/root/sys admin to place repos in the location to serve them publically.
  • Allow only specific repo's to be served publically in a seperate folder.
  • Have the shortest url using scp syntax git@serverip:repo.git and git://serverip:repo.git.
  • Make sure all permissions we set perfectly so from inception of creating the repo, to pushing for the 100th time,
@codeopensrc
codeopensrc / gist:98c080388d1f8b892d381b8eea25b2e6
Last active February 22, 2017 00:00
Docker + UFW + Older Linux OS

NOTE:

This solution works however, your containers can no longer connect to the outside world. Currently searching for a solution where I can whitelist ips to specific ports on an external server while blocking all other external ips.

Example: 2-4 web apps accessable to the internet, 1 mongo container. I would like to connect to the mongo container from my ip and from the containers, but disallow anyone else to connect to the mongo container

Currently its possible, but all containers lose ability to ping/connect outside the container with --iptables=false Otherwise all containers are exposed.

@codeopensrc
codeopensrc / Dockerfile
Created November 23, 2016 00:44
Base Dockerfile for React/Webpack/PM2
FROM node
RUN apt-get update && apt-get install -y \
build-essential \
apt-utils \
openjdk-7-jdk \
vim \
git
RUN npm i node-gyp -g
@codeopensrc
codeopensrc / RealmExamples.md
Last active June 10, 2016 19:50
Examples using my RealmWrapper.js and RealmSchema.js

Examples for my RealmWrapper.js and RealmSchema.js

You can find the RealmWrapper here and RealmSchema here

//addRealmListener(fn)
this.realm.addRealmListener(this.updateImgs.bind(this));
@codeopensrc
codeopensrc / RealmSchema.md
Last active June 10, 2016 19:47
Example schema for Realm used in React Native

Schema example to my RealmWrapper.js and RealmExamples.md

You can find the RealmWrapper here and RealmExamples here

'use strict';


class Assigned {}
@codeopensrc
codeopensrc / RealmWrapper.md
Last active April 15, 2019 02:13
A javascript wrapper for the RealmDB node module used in React Native.

My RealmWrapper.js file. Uses RealmSchema.js for the schema.

You can find the "realmSchema.js" here and examples here

'use strict';

import Realm from 'realm';
import Schemas from "./realmSchemas.js";
const version = 51;