Skip to content

Instantly share code, notes, and snippets.

View mertbozkir's full-sized avatar
🔥
Delayed Gratification!

Mert Bozkir mertbozkir

🔥
Delayed Gratification!
View GitHub Profile
@mertbozkir
mertbozkir / upload.md
Last active June 27, 2024 14:11
Uploading model to ollama! 🤙

Push a new model:

ollama pull llama2
echo "FROM llama2" >> Modelfile
echo "SYSTEM You are a friendly assistant." >> Modelfile
ollama create -f Modelfile mertbozkir/test
ollama push mertbozkir/test

or push an existing model:

from langchain_groq import ChatGroq
from langchain_core.prompts import ChatPromptTemplate
from langchain.schema import StrOutputParser
from langchain.schema.runnable import Runnable
from langchain.schema.runnable.config import RunnableConfig
from typing import Dict, Optional
import chainlit as cl
import logging
from chainlit import logger
@mertbozkir
mertbozkir / docs.md
Last active August 23, 2024 08:31
Llama.cpp client for python (fastest way!)

Llama.cpp Client for Python

This Python client allows you to interact with a locally deployed llama.cpp server using an OpenAI-compatible API. It provides a simple interface to send prompts and receive responses from your local language model.

Setup

  1. Start llama.cpp server:

    Navigate to your llama.cpp directory and run:

@mertbozkir
mertbozkir / q2.asm
Created September 2, 2024 06:24
prework
DATA DB 0.9, 2.7, 6.7, 11.5, 16.5, 20.6, 24.2, 24.3, 19.6, 13.9, 7.3, 2.8
MOV CX,12 ; Set counter to 12 months
SUB BX,BX ; Clear BX, used as accumulator
MOV SI,OFFSET DATA ; Set up pointer
BACK: MOV AL,[SI] ; Move byte into AL
CBW ; Convert byte to word, add 1's to AH to extend AL to AX
ADD BX,AX ; Add to BX
INC SI ; Increment pointer
DEC CX ; Decrement counter
JNZ BACK ; Loop if not finished
@mertbozkir
mertbozkir / watch-server.md
Created September 20, 2024 00:21
Showing executed commands and outputs on thinkpad server!

To watch and monitor the Tailscale session commands and their outputs on your ThinkPad (Ubuntu server) without a GUI, you can use a terminal-based monitoring tool. One excellent option for this is tmux (Terminal Multiplexer). Here's how you can set this up:

  1. Install tmux on your ThinkPad:

    sudo apt install tmux
    
  2. Start a new tmux session:

    tmux new -s tailscale_monitor
    
@mertbozkir
mertbozkir / postgres.md
Created October 10, 2024 23:00 — forked from phortuin/postgres.md
Set up postgres + database on MacOS (M1)

Based on this blogpost.

Install with Homebrew:

$ brew install postgresql@14

(The version number 14 needs to be explicitly stated. The @ mark designates a version number is specified. If you need an older version of postgres, use postgresql@13, for example.)

@mertbozkir
mertbozkir / Code.gs
Created August 19, 2025 08:45
60hr workweek
// Discord webhook URL
const DISCORD_WEBHOOK = "Your github hook.";
function sendDiscordMessage(message) {
const payload = JSON.stringify({content: message});
const params = {
headers: {"Content-Type": "application/json"},
method: "POST",
payload: payload,