Skip to content

Instantly share code, notes, and snippets.

View valmayaki's full-sized avatar
🤠
Happy to be of service to you!

Valentine Ubani Mayaki valmayaki

🤠
Happy to be of service to you!
View GitHub Profile
@valmayaki
valmayaki / netsh.txt
Created March 5, 2025 16:21 — forked from alirezanet/netsh.txt
netsh ip/port forwarding sample
add forwarding interface:
netsh interface portproxy add v4tov4 listenport={srcPort} listenaddress={srcIp} connectport={DesPort} connectaddress={DesIp}
show interface:
netsh interface portproxy show v4tov4
delete interface:
netsh interface portproxy delete v4tov4 listenport={srcPort} listenaddress={srcIp}
-----------------------------
@chr15m
chr15m / .bashrc
Last active June 26, 2025 20:29
My Direnv setup for Python & JS isolated development
# You can put these in your .bashrc (or .profile or other shell setup) to setup direnv, pyenv, nvm.
# pyenv setup hook (install it first)
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
# nvm setup hook (install it first)
export NVM_DIR="$HOME/.nvm"
@rvrsh3ll
rvrsh3ll / windows-keys.md
Created February 18, 2024 22:44
Windows Product Keys

NOTE

These are NOT product / license keys that are valid for Windows activation.
These keys only select the edition of Windows to install during setup, but they do not activate or license the installation.

Index

@poacosta
poacosta / create_admin_user.sql
Last active April 10, 2025 06:57
Create users and grant permissions in PostgreSQL
-- The below query is used to fetch all the role names from the 'pg_roles' system catalog table.
-- It will return a list of all user (role) names in the current PostgreSQL database.
SELECT rolname FROM pg_roles;
-- This command is used to create a new PostgreSQL user with the specified username and password.
-- In this case, the newly created username is 'username' and the password is 'P@55w0rd'.
CREATE USER username WITH PASSWORD 'P@55w0rd';
-- This command grants all privileges to the user 'username' on the database 'dbname'.
-- These privileges include SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER, CREATE, CONNECT, TEMPORARY, EXECUTE, and USAGE
@rain-1
rain-1 / llama-home.md
Last active June 24, 2025 11:12
How to run Llama 13B with a 6GB graphics card

This worked on 14/May/23. The instructions will probably require updating in the future.

llama is a text prediction model similar to GPT-2, and the version of GPT-3 that has not been fine tuned yet. It is also possible to run fine tuned versions (like alpaca or vicuna with this. I think. Those versions are more focused on answering questions)

Note: I have been told that this does not support multiple GPUs. It can only use a single GPU.

It is possible to run LLama 13B with a 6GB graphics card now! (e.g. a RTX 2060). Thanks to the amazing work involved in llama.cpp. The latest change is CUDA/cuBLAS which allows you pick an arbitrary number of the transformer layers to be run on the GPU. This is perfect for low VRAM.

  • Clone llama.cpp from git, I am on commit 08737ef720f0510c7ec2aa84d7f70c691073c35d.
@BalazsGyarmati
BalazsGyarmati / scroll_to_plusminus_macos.swift
Last active August 13, 2024 18:45
Use cmd + scroll wheel to zoom inside apps in MacOS
//
// main.swift
// scroll_to_plusminus
//
// Created by uniqueidentifier on 2021-01-08.
// Modified by alex on 2022-07-08 to use modifiers for scrolling
// Modified by BalazsGyarmati on 2023-01-04 to use command instead of control + respect any keyboard layout for + and -
//
import Foundation
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>CreationDate</key>
<real>658773622.62719798</real>
<key>Macros</key>
@megahirt
megahirt / Docker with XDebug.md
Last active May 13, 2025 09:29
Debugging PHP with XDebug v3 inside Docker using VSCode

Debugging PHP with XDebug v3 inside Docker using VSCode

Assumptions / Prerequisites

  • XDebug v3+ inside Docker (e.g. php:7.3-apache Docker image)
  • Running Docker v20.10+
  • VSCode with PHP Debug Extension (Felix Becker)
  • Using Docker Compose for orchestration

Objective

@ivastly
ivastly / run_xhprof_viewer.sh
Last active November 23, 2020 17:13
Run Dockerized XHProf Viewer oneliner
# dumps must be in ./xhprof folder, named like uniqid() . 'appname.xhprof';
# use tideways_xhprof extension to generate them https://github.com/tideways/php-xhprof-extension
docker run --rm -p 81:8080 -v $(pwd)/xhprof:/mnt/files/private/xhprof -d --name xhprof wodby/xhprof
@szepeviktor
szepeviktor / Wistia-download-videos.md
Last active July 1, 2025 03:21
Download Wistia videos - Please do not misuse it!

Download Wistia videos

  1. right-click on the playing video, select Copy link
  2. find Wistia video ID in the copied link e.g. wvideo=tra6gsm6rl
    • alternative: look for e.g. hashedId=tra6gsm6rl in the page source
  3. load http://fast.wistia.net/embed/iframe/ + video ID in your browser
  4. look for "type":"original" in the page source and copy the URL from the next line e.g. "url":"http://embed.wistia.com/deliveries/129720d1762175bcd8e06dcab926ec76ad38ff00.bin"
  • alternative: look for "type":"hd_mp4_video"