Skip to content

Instantly share code, notes, and snippets.

@rain-1
rain-1 / LLM.md
Last active June 21, 2024 08:12
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@hhackbarth
hhackbarth / jetson_hardware_accelerated_opencv_4.5.3_with_ffmpeg_4.2.4.md
Last active January 22, 2024 09:19
Hardware accelerated OpenCV 4.5.3 build with FFMPEG 4.2.4 on NVidia Jetson

OpenCV 4.5.3 and FFMPEG 4.2.4 (with SRT support) hardware accelerated on NVidia Jetson

Unfortunately, NVidia Jetpack 4.5.x for Jetson Nano, Xavier etc. comes with OpenCV 4.1.1 and FFMPEG 3.4.8 compiled without any hardware (GPU, CUDA) acceleration and without SRT support.

Retrieving current OpenCV build information:

$ python3

import cv2
@maciekish
maciekish / resetXcode.sh
Created August 10, 2016 10:13
Reset Xcode. Clean, clear module cache, Derived Data and Xcode Caches. You can thank me later.
#!/bin/bash
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*
open /Applications/Xcode.app
@ngpestelos
ngpestelos / remove-docker-containers.md
Last active May 31, 2024 15:10
How to remove unused Docker containers and images

May 8, 2018

I wrote this four years ago, so instead use this command:

$ docker rmi $(docker images -q -f dangling=true)
@tamoyal
tamoyal / gist:10441108
Created April 11, 2014 04:39
Create super user and database user in Mongo 2.6
# Create your superuser
$ mongo
> use admin
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]})
> exit
# Alias for convenience (optional and at your own risk)
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile
$ source ~/.bash_profile
@arobson
arobson / abstractions.md
Last active October 14, 2021 06:46
Rabbit.MQ + Node.js Notes

Abstraction Suggestions

Summary: use good/established messaging patterns like Enterprise Integration Patterns. Don't make up your own. Don't expose transport implementation details to your application.

Broker

As much as possible, I prefer to hide Rabbit's implementation details from my application. In .Net we have a Broker abstraction that can communicate through a lot of different transports (rabbit just happens to be our preferred one). The broker allows us to expose a very simple API which is basically:

  • publish
  • request
  • start/stop subscription
@mikeboers
mikeboers / results.txt
Last active January 1, 2024 11:44
Comparing speed of reading video frames via a subprocess, or via PyAV
2013-10-05 10:19:59 mikeboers@maxwell: ~/Documents/Python/PyAV
$ time python video_frames_via_pipe.py
real 0m0.564s
user 0m0.729s
sys 0m0.241s
2013-10-05 10:20:01 mikeboers@maxwell: ~/Documents/Python/PyAV
$ time python video_frames_via_pyav.py
@plentz
plentz / nginx.conf
Last active June 21, 2024 14:21
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@ragusa87
ragusa87 / bluetooth-a2dp
Last active January 30, 2020 19:08
Enable bluetooth A2DP on Raspberry-PI via pulseaudio. To install, edit /etc/udev/rules.d/99-input.rules and add the line: SUBSYSTEM=="bluetooth", RUN+="/usr/lib/udev/bluetooth" Then save this script as /usr/lib/udev/bluetooth and set it executable. Bluetooth devices must be linked first.
#!/bin/bash
# This script is called by udev when you link a bluetooth device with your computer
# It's called to add or remove the device from pulseaudio
#
#
# Output to this file
LOGFILE="/var/log/bluetooth_dev"
# Name of the local sink in this computer
@bonty
bonty / DisableNSLogOnReleaseBuild.h
Created August 6, 2013 11:13
ReleaseビルドでNSLog()を無効にする
#ifdef NS_BLOCK_ASSERTIONS
#ifndef NSLog
// NSLogを無効にする
#define NSLog( m, args... )
#endif
#else
#ifndef NSLog