Skip to content

Instantly share code, notes, and snippets.

Proxmox GPU Passthrough

Config :

  • Motherboard : ASUS PRIME B450M-A
  • CPU : AMD Ryzen 7 2700x
  • GPU : EVGA AMD RADEON R9 380 Series
  • Ram : DDR4 2133 MHz

Setting it all up

Update packages

@josephchoe
josephchoe / 0. nginx_setup.sh
Created August 13, 2020 02:22 — forked from mikhailov/0. nginx_setup.sh
NGINX+SPDY with Unicorn. True Zero-Downtime unless migrations. Best practices.
# Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed.
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#
import debounce from "lodash/debounce"
let localStorageAvailable = () => {
let test = 'test';
try {
localStorage.setItem(test, test);
localStorage.removeItem(test);
return true;
} catch(e) {
return false;
@josephchoe
josephchoe / encrypt_decrypt.rb
Created May 9, 2020 08:17 — forked from wteuber/encrypt_decrypt.rb
Simply encrypt and decrypt Strings in Ruby.
require 'openssl'
class String
def encrypt(key)
cipher = OpenSSL::Cipher.new('DES-EDE3-CBC').encrypt
cipher.key = Digest::SHA1.hexdigest key
s = cipher.update(self) + cipher.final
s.unpack('H*')[0].upcase
end
@josephchoe
josephchoe / gh-pages-deploy.md
Created March 18, 2020 11:55 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

11 Fallacies of Distributed Computing
1. The network is reliable (Bill Joy, Tom Lyon)
2. Latency isn't a problem (Bill Joy, Tom Lyon)
3. Bandwidth isn't a problem (Bill Joy, Tom Lyon)
4. The network is secure (Bill Joy, Tom Lyon)
5. The topology won't change (Peter Deutsch)
6. The administrator will know what to do (Peter Deutsch)
7. Transport cost isn't a problem (Peter Deutsch)
8. The network is homogeneous (James Gosling)
@josephchoe
josephchoe / identified.rb
Created April 26, 2019 04:55 — forked from bradrobertson/identified.rb
An ID Reservation component
module IdentificationComponent
module Messages
module Events
class Identified
include Messaging::Message
attribute :source_id, String
attribute :common_id, String
end
end
@josephchoe
josephchoe / pg-dev-machine-config-changes.md
Last active April 18, 2019 01:28 — forked from sbellware/pg-dev-machine-config-changes.md
Some useful Postgres configuration changes for a dev machine

Some useful Postgres configuration changes for a dev machine:

log_connections = on
log_disconnections = on
log_statement = 'all'

Optionally, set log timestamps to local time

log_timezone = 'US/Central' # Or whatever your timezone is
@josephchoe
josephchoe / carl_hewitt_actor_model.md
Created March 23, 2019 04:00 — forked from rbishop/carl_hewitt_actor_model.md
Notes from Carl Hewitt on the Actor Model

Carl Hewitt on Actors

Actor - Fundamental unit of computation, a computation model - not just a form of concurrency

An Actor has three essential elements:

  • 1 - Processing - you have to get something done
  • 2 - Storage - you have to be able to remember things
  • 3 - Communication
# Insomnia Configuration
## Run the test query
{
shop {
id
name
}
}
# Query Structure Examples