Skip to content

Instantly share code, notes, and snippets.

View jay-johnson's full-sized avatar

Jay jay-johnson

View GitHub Profile
@younesbelkada
younesbelkada / finetune_llama_v2.py
Last active April 24, 2024 02:14
Fine tune Llama v2 models on Guanaco Dataset
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@mikedilger
mikedilger / Cargo.toml
Last active May 10, 2022 01:49
Using hyper and rustls
[package]
name = "example"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = { version = "1.0", features = [ "backtrace" ] }
futures = "0.3"
@VigneshChennai
VigneshChennai / variance.rs
Last active July 26, 2022 15:40
Covariant and Invariant - Rust Example
struct CovariantExample<'a, T> {
a: &'a T
}
struct InvariantExample<'a, T> {
a: &'a mut T
}
fn covarient() {
@trisberg
trisberg / local-registry.md
Last active January 26, 2024 17:47
Using a Local Registry with Minikube

Using a Local Registry with Minikube

Install a local Registry

These instructions include running a local registry accessible from Kubernetes as well as from the host development machine at registry.dev.svc.cluster.local:5000.

  1. Use the docker CLI to run the registry:2 container from Docker, listening on port 5000, and persisting images in the ~/.registry/storage directory.
@jimmychu0807
jimmychu0807 / string-conversion.rs
Created November 21, 2019 10:20
Conversion between String, str, Vec<u8>, Vec<char> in Rust
use std::str;
fn main() {
// -- FROM: vec of chars --
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}'];
// to String
let string1: String = src1.iter().collect::<String>();
// to str
let str1: &str = &src1.iter().collect::<String>();
// to vec of byte
@pahud
pahud / main.workflow
Last active July 24, 2023 08:20
Github Actions with Amazon EKS CI/CD
workflow "Demo workflow" {
on = "push"
resolves = ["SNS Notification"]
}
action "Build Image" {
uses = "actions/docker/cli@c08a5fc9e0286844156fefff2c141072048141f6"
runs = ["/bin/sh", "-c", "docker build -t $IMAGE_URI ."]
env = {
IMAGE_URI = "xxxxxxxx.dkr.ecr.ap-northeast-1.amazonaws.com/github-action-demo:latest"
@steebchen
steebchen / 1-install-ceph-helm.sh
Last active February 24, 2019 01:03
Set up ceph with kubernetes
# Requirements: an existing and running k8s cluster
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init
# taken from http://docs.ceph.com/docs/master/start/kube-helm/
helm serve &
# wait for helm serve to be ready
@jbcurtin
jbcurtin / nhuntwalker-asyncio.py
Last active June 15, 2019 13:30
A #microtutorial to show how to use asyncio and some other stdlib-tools, https://pugetsoundpython.slack.com/archives/C03LJKBPJ/p1530204386000485
#!/usr/bin/env python
'''
A #microtutorial to show how to use asyncio and some other stdlib-tools,
https://pugetsoundpython.slack.com/archives/C03LJKBPJ/p1530204386000485
Invoke with,
`python nhuntwalker-asyncio.py -m on`
`python nhuntwalker-asyncio.py -m awe`
`python nhuntwalker-asyncio.py`
@jnaulty
jnaulty / virt-install-centos
Created March 18, 2018 00:36 — forked from giovtorres/virt-install-centos
Install CentOS cloud images on KVM using cloud-init
#!/bin/bash
## **Updates to this file are now at https://github.com/giovtorres/kvm-install-vm.**
## **This updated version has more options and less hardcoded variables.**
# Take one argument from the commandline: VM name
if ! [ $# -eq 1 ]; then
echo "Usage: $0 <node-name>"
exit 1
fi
@fjammes
fjammes / 10-kubeadm.conf
Last active March 13, 2019 07:56
Set up a kubernetes 1.9.1 cluster on Centos7
# Comment line 9 in /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf"
Environment="KUBELET_SYSTEM_PODS_ARGS=--pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true"
Environment="KUBELET_NETWORK_ARGS=--network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin"
Environment="KUBELET_DNS_ARGS=--cluster-dns=10.96.0.10 --cluster-domain=cluster.local"
Environment="KUBELET_AUTHZ_ARGS=--authorization-mode=Webhook --client-ca-file=/etc/kubernetes/pki/ca.crt"
Environment="KUBELET_CADVISOR_ARGS=--cadvisor-port=0"
# Environment="KUBELET_CGROUP_ARGS=--cgroup-driver=systemd"
Environment="KUBELET_CERTIFICATE_ARGS=--rotate-certificates=true --cert-dir=/var/lib/kubelet/pki"