Skip to content

Instantly share code, notes, and snippets.

@jait
jait / dcimify.py
Created October 24, 2011 16:03
DCIMify
#!/usr/bin/python
import os
INDEX = 0
def get_filename():
global INDEX
name = 'DSC_%04d.JPG' % INDEX
INDEX += 1
@jait
jait / gist:1419765
Created December 1, 2011 20:50
CoffeeScript class demo
class Contact
constructor: (@name) ->
@_type = "org.foo.contacts.Contact"
addPhone: (phone) =>
if not phones?
@phones = []
@phones.push phone
dump: =>
@jait
jait / keybase.md
Created April 15, 2014 16:26
keybase proof

Keybase proof

I hereby claim:

  • I am jait on github.
  • I am jait (https://keybase.io/jait) on keybase.
  • I have a public key whose fingerprint is 5445 7775 ACB5 1AFB A756 4BCB D56A 533B AF7A E3C4

To claim this, I am signing this object:

@jait
jait / metallb-config.yaml
Created March 25, 2019 08:03
k3s-blog / metallb_config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
namespace: metallb-system
name: config
data:
config: |
address-pools:
- name: company-office
protocol: layer2
@jait
jait / service-lb-example.yaml
Created March 25, 2019 08:17
k3s-blog / service-lb-example.yaml
apiVersion: v1
kind: Service
metadata:
name: my-web-app
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 8080
@jait
jait / gist-embed-style.css
Created March 25, 2019 08:27
Gist embed style
.gist .gist-file .gist-meta {
display: none !important;
}
td.js-line-number {
display: none !important;
}
@jait
jait / raspian-boot-cmdline.txt
Created March 25, 2019 08:32
k3s-blog / raspbian-boot-cmdline.txt
cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory
@jait
jait / Dockerfile
Created March 25, 2019 09:02
k3s-blog / Dockerfile.arm
FROM arm32v7/alpine:latest
COPY --from=biarms/qemu-bin /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
# commands to build your app go here…
# e.g. RUN apk add --update <pkgs that you need…>
cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory
curl -sfL https://get.k3s.io | sh -
curl -sfL https://get.k3s.io | K3S_TOKEN=<token_from_server> K3S_URL=https://<server_ip>:6443 sh -
docker run --rm --privileged multiarch/qemu-user-static:register --reset
docker run --rm --privileged multiarch/qemu-user-static:register --reset
docker build -t my-custom-image-arm . -f Dockerfile.arm
@jait
jait / .gitlab-ci.yml
Created March 25, 2019 09:19
k3s-blog / .gitlab-ci.yml
image: docker:stable
stages:
- build
- release
variables:
DOCKER_DRIVER: overlay2
CONTAINER_TEST_IMAGE: ${CI_REGISTRY_IMAGE}/${CI_PROJECT_NAME}-arm:${CI_COMMIT_REF_SLUG}
CONTAINER_RELEASE_IMAGE: ${CI_REGISTRY_IMAGE}/${CI_PROJECT_NAME}-arm:latest