Skip to content

Instantly share code, notes, and snippets.

@juliendkim
juliendkim / Install unbound dns cache on Mac.sh
Last active April 25, 2024 04:56
unbound dns cache server on Mac
$ brew install unbound
$ unbound-anchor -a /usr/local/etc/unbound/root.key
$ unbound-control-setup -d /usr/local/etc/unbound
$ unbound-checkconf /usr/local/etc/unbound/unbound.conf
$ sudo brew services start unbound
@efrecon
efrecon / run.tpl
Last active April 25, 2024 04:55
`docker inspect` template to regenerate the `docker run` command that created a container
docker run \
--name {{printf "%q" .Name}} \
{{- with .HostConfig}}
{{- if .Privileged}}
--privileged \
{{- end}}
{{- if .AutoRemove}}
--rm \
{{- end}}
{{- if .Runtime}}
@cedrickchee
cedrickchee / llama-7b-m1.md
Last active April 25, 2024 04:54
4 Steps in Running LLaMA-7B on a M1 MacBook with `llama.cpp`

4 Steps in Running LLaMA-7B on a M1 MacBook

The large language models usability

The problem with large language models is that you can’t run these locally on your laptop. Thanks to Georgi Gerganov and his llama.cpp project, it is now possible to run Meta’s LLaMA on a single computer without a dedicated GPU.

Running LLaMA

There are multiple steps involved in running LLaMA locally on a M1 Mac after downloading the model weights.

@jigneshkhokhani
jigneshkhokhani / Dockerfile
Created April 11, 2023 14:35
angular-new-docker-app-creator : Create new angular app from docker it-self. It will create full angular directory without installing anything in local system.
FROM node:16-alpine
WORKDIR /front-app
COPY package*.json ./
RUN npm install
# Mentioned exposed port for documentation
EXPOSE 4200
@worldOneo
worldOneo / main.zig
Created October 15, 2023 11:41
Epoll based Event Loop chat application
const std = @import("std");
// primitive of the event loop.
// Ctx is typically a pointer to *This and data a pointer to the Users data.
// destroyData is called after the event has finished and must clean up the event to avoid leaks.
const Event = struct {
ctx: *anyopaque,
data: *anyopaque,
name: []const u8,
destroyData: *const fn (*anyopaque, *anyopaque) void,
@denguir
denguir / cuda_install.md
Last active April 25, 2024 04:51
Installation procedure for CUDA & cuDNN

How to install CUDA & cuDNN on Ubuntu 22.04

Install NVIDIA drivers

Update & upgrade

sudo apt update && sudo apt upgrade

Remove previous NVIDIA installation

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Canvas Game</title>
<style>
canvas {
border: 1px solid black;
}
@shamil
shamil / mount_qcow2.md
Last active April 25, 2024 04:43
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@thesamesam
thesamesam / xz-backdoor.md
Last active April 25, 2024 04:43
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],