Skip to content

Instantly share code, notes, and snippets.

@dhh
dhh / linux-setup.sh
Last active May 9, 2024 09:47
linux-setup.sh
# CLI
sudo apt update -y
sudo apt install -y \
git curl \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev mupdf mupdf-tools \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils
@nullcline
nullcline / baka_trace.py
Created March 9, 2023 08:20
tsundere error traces
import traceback
import openai
import sys
# list models
models = openai.Model.list()
def baka(error, character="tsundere",):
exc_type, exc_value, exc_traceback = sys.exc_info()
traceback_list = traceback.extract_tb(exc_traceback)
kubectl get --raw /metrics | prom2json | jq '.'

kubectl get --raw /metrics | prom2json | jq '
  .[] | select(.name=="apiserver_requested_deprecated_apis").metrics[]
'
@0xjac
0xjac / private_fork.md
Last active May 9, 2024 09:46
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@s-saens
s-saens / AnimationClipManager.cs
Last active May 9, 2024 09:46
Create/Modify/Delete AnimationClip in AnimatorController
#if UNITY_EDITOR
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.Animations;
public class AnimationClipManager
{
[MenuItem("Assets/Animation/Create Anim Clip", false, 1)]
static void Create()
@mtilson
mtilson / .env
Last active May 9, 2024 09:45
how to rebuild your web app container on every commit with local 'docker-compose' and 'post-commit' git hook [docker] [docker-compose] [git]
APPNAME=myapp
APPVERSION=latest
@BIGBALLON
BIGBALLON / extract_ILSVRC.sh
Created May 13, 2018 20:09
script for ImageNet data extract.
#!/bin/bash
#
# script to extract ImageNet dataset
# ILSVRC2012_img_train.tar (about 138 GB)
# ILSVRC2012_img_val.tar (about 6.3 GB)
# make sure ILSVRC2012_img_train.tar & ILSVRC2012_img_val.tar in your current directory
#
# https://github.com/facebook/fb.resnet.torch/blob/master/INSTALL.md
#
# train/
@dSalieri
dSalieri / index.md
Last active May 9, 2024 09:40
Аргумент resolve внутри Promise и Promise.resolve работают ли они одинаково?

Вопрос: Есть две цепочки promise, которые выводят сообщения в консоль. Первый выводит: tick1, tick2, tick3. Второй: tick3, tick1, tick2

Код 1:

/// Код 1
const p = new Promise(resovle => setTimeout(resovle));

new Promise(resolve => resolve(p)).then(() => {
    console.log("tick 3");
});
@nicc777
nicc777 / k3s-multipass.sh
Last active May 9, 2024 09:37 — forked from lucj/k3s-multipass.sh
Setup a k3s kubernetes cluster using Multipass VMs
#!/usr/bin/env bash
# Refer to https://github.com/k3s-io/k3s/releases for your prefered release
export INSTALL_K3S_VERSION="v1.24.10+k3s1"
for node in node1 node2 node3;do
multipass launch -n $node -c 2 -m 4G
done
# Init cluster on node1

A Few Useful Things to Know about Machine Learning

The paper presents some key lessons and "folk wisdom" that machine learning researchers and practitioners have learnt from experience and which are hard to find in textbooks.

1. Learning = Representation + Evaluation + Optimization

All machine learning algorithms have three components:

  • Representation for a learner is the set if classifiers/functions that can be possibly learnt. This set is called hypothesis space. If a function is not in hypothesis space, it can not be learnt.
  • Evaluation function tells how good the machine learning model is.
  • Optimisation is the method to search for the most optimal learning model.