Skip to content

Instantly share code, notes, and snippets.

@X-TRON404
X-TRON404 / cuda_11.7_installation_on_Ubuntu_22.04
Last active April 19, 2024 04:59 — forked from primus852/cuda_11.7_installation_on_Ubuntu_22.04
Instructions for CUDA v11.7 and cuDNN 8.5 installation on Ubuntu 22.04 for PyTorch 1.12.1
#!/bin/bash
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
### to verify your gpu is cuda enable check
@aamiaa
aamiaa / CompleteMokokoQuest.md
Last active April 19, 2024 04:57
Complete Discord Mokoko Quest

Complete Discord Mokoko Quest

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
  2. Join a vc
  3. Stream any window (can be notepad or something)
  4. Press Ctrl+Shift+I to open DevTools
  5. Go to the Console tab
  6. Paste the following code and hit enter:
let wpRequire;
// 安装客户端
apt install -y shadowsocks
// 代理服务器配置, 16.04 tls 上 apt 安装的 ss 客户端仅支持部分加密 method, 比如 aes-256-cfb
// 建一个配置文件,比如 shadowsocks.json ,写入:
{
"server":"代理服务器的ip",
"server_port":10763,
"local_address":"127.0.0.1",
"local_port":1080,
@santaklouse
santaklouse / CrossOver.sh
Last active April 19, 2024 04:55
unlimited CrossOver trial (MacOS)
#!/usr/bin/env bash
# checck if pidof exists
PIDOF="$(which pidof)"
# and if not - install it
(test "${PIDOF}" && test -f "${PIDOF}") || brew install pidof
# find app in default paths
CO_PWD=~/Applications/CrossOver.app/Contents/MacOS
test -d "${CO_PWD}" || CO_PWD=/Applications/CrossOver.app/Contents/MacOS
@vittorioromeo
vittorioromeo / hello_triangle.cpp
Created October 10, 2015 11:07
SDL2 + OpenGL ES 2.0 - "Hello triangle" example that works both on X11 and Emscripten
#include <exception>
#include <functional>
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_ttf.h>
@harkabeeparolus
harkabeeparolus / Typer_cheat_sheet.md
Last active April 19, 2024 04:53
Typer — my attempt at reference documentation
@WebD00D
WebD00D / debounce.ts
Created October 9, 2019 00:17
Debounce React Hook
import React, { useState, useEffect } from 'react';
const debounce = (value, delay) => {
// State and setters for debounced value
const [debouncedValue, setDebouncedValue] = useState(value);
useEffect(
() => {
// Set debouncedValue to value (passed in) after the specified delay
/**************************************************************************/
/*!
@brief Custom lookup tables for full screen updates. Public domain (?) from Waveshare.
@note Video explainer: https://www.youtube.com/watch?v=MsbiO8EAsGw and more info:
https://benkrasnow.blogspot.com/2017/10/fast-partial-refresh-on-42-e-paper.html
@warning YOU CAN PERMANENELY DAMAGE YOUR DISPLAY BY ABUSING THESE LOOKUP TABLES!
Seriously, the controller is incredibly programmable and you can force all
kinds of voltages and timings onto the screen that it wasn't meant to deal
with. TWEAK AT YOUR OWN RISK!
*/
@schmich
schmich / termbin-encrypted-data.md
Last active April 19, 2024 04:47
Sharing encrypted data via termbin.com with only netcat and OpenSSL

Single file

Source

  • cat /foo/bar/file.txt | openssl enc -aes-256-cbc -base64 | nc termbin.com 9999
  • Enter password twice (quickly), note termbin.com URL

Destination

  • curl -s http://termbin.com/{id} | openssl enc -aes-256-cbc -base64 -d &gt; file.txt
@joeycastillo
joeycastillo / grayscale.ino
Created January 21, 2020 15:51
Display grayscale images on a GDEW042T2 e-paper display
// library here: https://github.com/joeycastillo/The-Open-Book/tree/master/src
// convert images with this tool: https://littlevgl.com/image-to-c-array
// options: Indexed 4 colors, output format binary. Do the dithering on your own,
// and make sure your four colors include pure white and pure black.
#include <OpenBook.h>
#include <SD.h>
OpenBook *book;
// or for using your own 4.2" B&W display (substitute your pin assignments):