Skip to content

Instantly share code, notes, and snippets.

@adrienbrault
adrienbrault / llama2-mac-gpu.sh
Last active April 22, 2024 08:47
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM. UPDATE: see https://twitter.com/simonw/status/1691495807319674880?s=20
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
make clean
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
@SanariSan
SanariSan / readme.md
Last active April 13, 2024 07:15
Telegram HTTP bot API via CURL | Send text, photos, documents, etc.

Here are some examples on how to use Telegram bot api via CURL

Prerequisites

For getting messages in private chat with bot

  • Create a bot using @BotFather, get it's token
  • Start conversation with bot
  • Run following curl command
curl https://api.telegram.org/bot/getUpdates | grep -Po '"from":{"id":.+?,'
@danelowe
danelowe / README.markdown
Last active March 14, 2024 22:25
Mopidy and librespot (spotify connect)

Method taken from https://github.com/pimusicbox/pimusicbox

Assuming mopidy and Iris etc are already installed, we need to install mpc, so that we can stop playback on mopidy when we use spotify connect

sudo apt-get install mpc 

Then we install the easiest librespot spotify connect system

@gabonator
gabonator / esp32_oled_wifi.md
Last active August 21, 2023 18:41
esp32 TTGO arduino compatible board with 128x64 pixel oled display and Wifi

esp32 TTGO arduino compatible board with 128x64 pixel oled display and Wifi

Front Back Pinout

Device description on banggood

  1. The main control chip using Le Xin ESP32, Tensilica LX6 dual core processor, clocked at 240MHz, computing capacity of up to 600DMIPS, 520 SRAM, 802.11 KB chip b/g/n HT40 Wi-Fi transceiver, baseband, and LWIP protocol stack, Bluetooth (Bluetooth dual-mode integrated
@peel
peel / gist:ca8c5b25efbe3052fdb5
Last active May 11, 2022 21:17
SJ4000 WIFI Protocol

#Base URL http://192.168.1.254

File Management Panel

GET / file management panel

Configuration options

all options follow the template: /?custom=1&cmd={Command}&par={Option} Command - setting/mode of the device

@probonopd
probonopd / sendandreceive.ino
Last active September 20, 2021 19:53
Send Pronto Hex via an IR LED connected to Arduino Pin D9. Make sure you do not send a blank (" ") as the last character. Applied fix for Leonardo from https://github.com/probonopd/arduino-infrared-pronto/pull/1 to sendandreceive.ino -- TODO: Fix sendRaw to specify length as "sizeof(signal)/sizeof(int)" as in http://forum.arduino.cc/index.php?PH…
#include <IRremote.h>
// http://www.pjrc.com/teensy/td_libs_IRremote.html
// If one keypress results in multiple codes being output, then
// change in IRremoteInt.h:
// #define _GAP 50000
int RECV_PIN = 8;
IRrecv irrecv(RECV_PIN);
decode_results results;