Skip to content

Instantly share code, notes, and snippets.

@Trefex
Trefex / OVH_README.md
Last active January 23, 2020 20:11
How I setup my VPS on ovh-com

Config is 2vCPU, 2 GB RAM and running Debian 7 on 64 bits.

apt-get update
apt-get upgrade
apt-get install htop

Add localadmin user

adduser localadmin

apt-get install sudo

@amscotti
amscotti / login.rb
Created November 22, 2011 00:45
Sample of Sinatra authentication
require 'rubygems'
require 'bcrypt'
require 'haml'
require 'sinatra'
enable :sessions
userTable = {}
helpers do
@anujkhare
anujkhare / clone_all.sh
Created December 16, 2018 06:29
Clone all the repositories listed in a text file given as input: useful when setting up a dev env with a lot of repos!
echo "If your SSH key has a passphrase, you might need to enter it each time. Consider using ssh-agent or removing the passphrase";
while read p; do
echo "$p";
git clone "$p";
done < $1
@whjms
whjms / kobold-8bit.md
Last active April 7, 2023 16:35
Instructions for running KoboldAI in 8-bit mode

Running KoboldAI in 8-bit mode

tl;dr use Linux, install bitsandbytes (either globally or in KAI's conda env, add load_in_8bit=True, device_map="auto" in model pipeline creation calls)

Many people are unable to load models due to their GPU's limited VRAM. These models contain billions of parameters (model weights and biases), each of which is a 32 (or 16) bit float. Thanks to the hard work of some researchers [1], it's possible to run these models using 8-bit numbers, which halves the required amount of VRAM compared to running in half-precision. E.g. if a model requires 16GB of VRAM, running with 8-bit inference only requires 8GB.

This guide was written for KoboldAI 1.19.1, and tested with Ubuntu 20.04. These instructions are based on work by Gmin in KoboldAI's Discord server, and Huggingface's efficient LM inference guide.

Requirements

@jwne
jwne / connectionlog.php
Created March 15, 2016 15:13
Log connecting clients' IP, port, user agent, and HTTP referer with a timestamp of the connection. MySQL storage preferred.
<?php
// For now file storage requires that the file specified is created already and chmodded to allow writing.
/**
* Connection info logging script created by Xeru
*
* Website: https://xeru.me
* Twitter: https://twitter.com/Xeru_
* GitHub: https://github.com/exec
@kuang-da
kuang-da / popos-nvidia-docker.md
Last active February 15, 2024 21:04
[Install nvidia-docker2 In Pop!_OS]#popos

Introduction

This gist is a note about install nvidia-docker in Pop!_OS 20.10. nvidia-docker is used to help docker containers compute on GPU.

The basic installcation is in Nvidia's offical documentation. But there are a few tweaks to make it work on Pop!_OS 20.10.

Setting up Docker

No surprise. Follow the offical documentaion should work.

Setting up NVIDIA Container Toolkit

@fpillet
fpillet / scale.js
Created May 26, 2011 12:07
Javascript value scaling between two ranges
/* Scale a value from one range to another
* Example of use:
*
* // Convert 33 from a 0-100 range to a 0-65535 range
* var n = scaleValue(33, [0,100], [0,65535]);
*
* // Ranges don't have to be positive
* var n = scaleValue(0, [-50,+50], [0,65535]);
*
* Ranges are defined as arrays of two values, inclusive
@nucular
nucular / omegle.md
Last active February 20, 2024 21:01
Omegle protocol reverse-engineering

Let's reverse-engineer Omegle. PROPERLY!

I could not find a proper, detailed (and up-to-date) reverse-engineerment of Omegle's text chat protocol on the internet, so here, have one made by analyzing the web app (web requests and source code).
The responses are beautified and the query strings split up and URI-decoded for readability.
Note that "query string" refers to parameters encoded into the URL and "form data" to parameters in the POST body which do not have to be URI-encoded.

TODO:

@gbuesing
gbuesing / ml-ruby.md
Last active February 28, 2024 15:13
Resources for Machine Learning in Ruby

UPDATE a fork of this gist has been used as a starting point for a community-maintained "awesome" list: machine-learning-with-ruby Please look here for the most up-to-date info!

Resources for Machine Learning in Ruby

Gems

@xvitaly
xvitaly / remove_crw.cmd
Last active March 16, 2024 16:12
Remove telemetry updates for Windows 7 and 8.1
@echo off
echo Uninstalling KB3075249 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3075249 /quiet /norestart
echo Uninstalling KB3080149 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3080149 /quiet /norestart
echo Uninstalling KB3021917 (telemetry for Win7)
start /w wusa.exe /uninstall /kb:3021917 /quiet /norestart
echo Uninstalling KB3022345 (telemetry)
start /w wusa.exe /uninstall /kb:3022345 /quiet /norestart
echo Uninstalling KB3068708 (telemetry)