This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DETERMINATE NIX CONFIG | |
# do not modify! this file will be replaced! | |
# user modification can go in nix.custom.conf | |
!include nix.custom.conf | |
extra-experimental-features = nix-command flakes | |
netrc-file = /nix/var/determinate/netrc | |
post-build-hook = /nix/var/determinate/post-build-hook.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs). | |
# So here's a minimal Gist which worked for me as an install on a new M1 Pro. | |
# Inspired by https://github.com/malob/nixpkgs I highly recommend looking at malob's repo for a more thorough configuration | |
# | |
# Some people are coming directly to this Gist from search results and not the original post[1]. If that sounds like you, you should also know there is a video[2] that accompanies this. | |
# | |
# [1] https://discourse.nixos.org/t/simple-workable-config-for-m1-macbook-pro-monterey-12-0-1-with-nix-flakes-nix-darwin-and-home-manager/16834 | |
# [2] https://www.youtube.com/watch?v=KJgN0lnA5mk | |
# | |
# Let's get started |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Given a list of numbers, return whether any two sums to k. | |
// | |
// For example, given [10, 15, 3, 7] and k of 17, return true since 10 + 7 is 17. | |
// | |
// Bonus: Can you do this in one pass? | |
package main | |
import "fmt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
annotations: | |
scheduler.alpha.kubernetes.io/critical-pod: "" | |
creationTimestamp: null | |
labels: | |
component: kube-scheduler | |
tier: control-plane | |
name: kube-scheduler |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@kubernetes:~# kubectl get nodes -o json | jq '.items[].metadata.annotations' | |
{ | |
"flannel.alpha.coreos.com/backend-data": "null", | |
"flannel.alpha.coreos.com/backend-type": "host-gw", | |
"flannel.alpha.coreos.com/kube-subnet-manager": "true", | |
"flannel.alpha.coreos.com/public-ip": "192.168.1.20", | |
"node.alpha.kubernetes.io/ttl": "0", | |
"volumes.kubernetes.io/controller-managed-attach-detach": "true" | |
} | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[ -z "$EMACS_VERSION" ] && echo "Usage: EMACS_VERSION=25.2 install-emacs.sh" && exit 1 | |
[ -z "$EMACS_URL" ] && EMACS_URL="http://mirror.aarnet.edu.au/pub/gnu/emacs/" | |
# I've assign 12G memory to /tmp as ramdisk | |
[ -z "$EMACS_TMP" ] && EMACS_TMP="/tmp" | |
# configure: WARNING: unrecognized options: --without-gtk3, --without-aqua, --without-alsa, --without-aqua | |
echo "curl $EMACS_URL/emacs-$EMACS_VERSION.tar.gz" | |
curl $EMACS_URL/emacs-$EMACS_VERSION.tar.gz | tar xvz -C $EMACS_TMP | |
# @see http://wiki.gentoo.org/wiki/Project:Emacs/GNU_Emacs_developer_guide |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Find a problem at projecteuler.net then create the solution. Add a | |
// comment beneath your solution that includes a description of the | |
// problem. Upload your solution to github. Tweet me a link to your | |
// solution. | |
// | |
// https://projecteuler.net/problem=4 | |
// A palindromic number reads the same both ways. The largest palindrome | |
// made from the product of two 2-digit numbers is 9009 = 91 × 99. | |
// | |
// Find the largest palindrome made from the product of two 3-digit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# === INFO === | |
# altnetworking.sh | |
# Description: Run the specified application in a custom networking environment. | |
# Uses cgroups to run process(es) in a network environment of your own choosing (within limits!) | |
VERSION="0.1.0" | |
# Author: John Clark | |
# Requirements: Debian 8 Jessie (plus iptables 1.6 from unstable) | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum -y update && \ | |
yum -y install yum-utils && \ | |
service rsyslog stop && \ | |
service auditd stop && \ | |
package-cleanup --oldkernels -y –count=1 && \ | |
yum clean all && \ | |
logrotate -f /etc/logrotate.conf | |
rm -f /var/log/*-???????? /var/log/*.gz | |
rm -f /var/log/dmesg.old |
NewerOlder