Skip to content

Instantly share code, notes, and snippets.

@barron9
barron9 / elf.h
Created August 12, 2023 08:13 — forked from mlafeldt/elf.h
elf.h for OSX
/* This is the original elf.h file from the GNU C Library; I only removed
the inclusion of feature.h and added definitions of __BEGIN_DECLS and
__END_DECLS as documented in
https://cmd.inp.nsk.su/old/cmd2/manuals/gnudocs/gnudocs/libtool/libtool_36.html
On macOS, simply copy the file to /usr/local/include/.
Mathias Lafeldt <mathias.lafeldt@gmail.com> */
/* This file defines standard ELF types, structures, and macros.
@barron9
barron9 / llama-7b-m1.md
Created July 28, 2023 18:03 — forked from cedrickchee/llama-7b-m1.md
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.

@barron9
barron9 / go-nginx.md
Created July 6, 2021 14:32 — forked from yosssi/go-nginx.md
Go networking performance vs Nginx

1. Nginx

$ wrk -t12 -c400 -d2s http://127.0.0.1:8080
Running 2s test @ http://127.0.0.1:8080
  12 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     7.71ms    3.16ms  23.05ms   69.17%
    Req/Sec     3.44k     1.98k    7.80k    58.22%
  63697 requests in 2.00s, 17.86MB read
@barron9
barron9 / golang-tls.md
Created July 4, 2021 16:29 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@barron9
barron9 / main.go
Created July 4, 2021 14:50 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@barron9
barron9 / RXLookingGlass.cs
Created May 2, 2021 21:39 — forked from MattRix/RXLookingGlass.cs
This class wraps an internal Unity method that lets you to check if a ray intersects a mesh. Place it in an Editor folder.
using UnityEngine;
using UnityEditor;
using System.Collections;
using System;
using System.Linq;
using System.Reflection;
[InitializeOnLoad]
public class RXLookingGlass
{
using System;
using System.Runtime.InteropServices;
// ReSharper disable SuspiciousTypeConversion.Global
// ReSharper disable InconsistentNaming
namespace VideoPlayerController
{
/// <summary>
/// Controls audio using the Windows CoreAudio API
/// from: http://stackoverflow.com/questions/14306048/controling-volume-mixer
@barron9
barron9 / iller.json
Last active July 5, 2019 22:49 — forked from serong/iller.json
JSON formatında Türkiye'nin illeri.
{"01":"ADANA","02":"ADIYAMAN","03":"AFYONKARAHİSAR","04":"AĞRI","05":"AMASYA","06":"ANKARA","07":"ANTALYA","08":"ARTVİN","09":"AYDIN","10":"BALIKESİR","11":"BİLECİKK","12":"BİNGÖL","13":"BİTLİS","14":"BOLU","15":"BURDUR","16":"BURSA","17":"ÇANAKKALE","18":"ÇANKIRI","19":"ÇORUM","20":"DENİZLİ","21":"DİYARBAKIR","22":"EDİRNE","23":"ELAZIĞ","24":"ERZİNCAN","25":"ERZURUM","26":"ESKİŞEHİR","27":"GAZİANTEP","28":"GİRESUN","29":"GÜMÜŞHANE","30":"HAKKARİ","31":"HATAY","32":"ISPARTA","33":"MERSİN","34":"İSTANBUL","35":"İZMİR","36":"KARS","37":"KASTAMONU","38":"KAYSERİ","39":"KIRKLARELİ","40":"KIRŞEHİR","41":"KOCAELİ","42":"KONYA","43":"KÜTAHYA","44":"MALATYA","45":"MANİSA","46":"KAHRAMANMARAŞ","47":"MARDİN","48":"MUĞLA","49":"MUŞ","50":"NEVŞEHİR","51":"NİĞDE","52":"ORDU","53":"RİZE","54":"SAKARYA","55":"SAMSUN","56":"SİİRT","57":"SİNOP","58":"SİVAS","59":"TEKİRDAĞ","60":"TOKAT","61":"TRABZON","62":"TUNCELİ","63":"ŞANLIURFA","64":"UŞAK","65":"VAN","66":"YOZGAT","67":"ZONGULDAK","68":"AKSARAY","69":"BAYBURT","70":"KARAM