Skip to content

Instantly share code, notes, and snippets.

View alexzhang2015's full-sized avatar
🎯
Focusing

alex alexzhang2015

🎯
Focusing
View GitHub Profile
@alexzhang2015
alexzhang2015 / ioslocaleidentifiers.csv
Created September 20, 2023 08:58 — forked from jacobbubu/ioslocaleidentifiers.csv
iOS Locale Identifiers
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@alexzhang2015
alexzhang2015 / llama2-mac-gpu.sh
Created July 21, 2023 07:59 — forked from adrienbrault/llama2-mac-gpu.sh
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
wget "https://huggingface.co/TheBloke/Llama-2-13B-chat-GGML/resolve/main/${MODEL}"

The reverse turing test

I asked GPT-4 to come up with 10 questions to determine if the answerer was AI or human.

I provided my own answers for these questions and I also asked ChatGPT to answer them.

The result is that GPT-4 was able to correctly differentiate between AI and Human.

@alexzhang2015
alexzhang2015 / docker-compose.yml
Created January 1, 2023 10:12 — forked from adamelliotfields/docker-compose.yml
Docker Compose Mongo with Mongo Express
version: "3.5"
services:
mongo:
image: mongo:latest
container_name: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: admin
ports:
@alexzhang2015
alexzhang2015 / nginx-hello-world-deployment.yaml
Created October 26, 2022 09:49 — forked from sdenel/nginx-hello-world-deployment.yaml
Kubernetes: a simple Nginx "Hello world" deployment file
# To deploy: kubectl create -f nginx-hello-world-deployment.yaml
# Access it with the API as a proxy:
# $ kubectl proxy
# Then in you browser: http://localhost:8001/api/v1/namespaces/default/services/nginx:/proxy/#!/
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
@alexzhang2015
alexzhang2015 / nvme_mount.md
Created December 26, 2021 21:34 — forked from a-maumau/nvme_mount.md
how to mount m.2 ssd/hdd
@alexzhang2015
alexzhang2015 / SSD_optimize_linux.sh
Created May 5, 2021 14:32 — forked from trungnt13/SSD_optimize_linux.sh
Optimize performance for SSD (NVMe) on Linux
sudo cp /etc/fstab /etc/fstab.bak
# Eschewing Access Times
sudo nano /etc/fstab
# add this options, make sure they’re all separated by commas and no spaces.
noatime,nodiratime
# example: UUID=uuid_number / ext4 defaults,noatime,discard,errors=remount-ro 0 1A
# TRIM Fit
discard
@alexzhang2015
alexzhang2015 / testio.sh
Created April 26, 2021 12:17 — forked from hluaces/testio.sh
Disk IO test for linux
#!/bin/bash
# References
# https://devopsideas.com/benchmarking-disk-iops-aws-vs-digitalocean/
# https://wiki.mikejung.biz/Benchmarking#Fio_Test_Options_and_Examples
# https://tobert.github.io/post/2014-04-17-fio-output-explained.html
# Requires linux packages: fio ioping
@alexzhang2015
alexzhang2015 / elasticsearch.yml
Created December 16, 2017 13:30 — forked from reyjrar/elasticsearch.yml
ElasticSearch config for a write-heavy cluster
##################################################################
# /etc/elasticsearch/elasticsearch.yml
#
# Base configuration for a write heavy cluster
#
# Cluster / Node Basics
cluster.name: logng
# Node can have abritrary attributes we can use for routing
@alexzhang2015
alexzhang2015 / gist:5d4bbe924fe056e3df0bf6aae81c2afc
Created May 3, 2017 06:29 — forked from Nerten/gist:399257dba4c36393c063
Aria2c + webui-aria2 to Ubuntu on Odroid-C1
sudo apt-get install -y aria2
sudo mkdir /etc/aria2
sudo touch /etc/aria2/aria2.session
sudo bash -c "cat <<EOT > /etc/aria2/aria2.conf
daemon=true
continue=true
enable-rpc=true
rpc-listen-port=6800
rpc-listen-all=true
check-certificate=false