Skip to content

Instantly share code, notes, and snippets.

@AwokeKnowing
AwokeKnowing / cupy_gl_interop.py
Created March 20, 2024 21:46 — forked from keckj/cupy_gl_interop.py
CuPy/OpenGL interop example
import sys
from cuda import cudart
import numpy as np
import cupy as cp
import pyrr
import glfw
@AwokeKnowing
AwokeKnowing / Comm.gd
Created September 25, 2023 20:37 — forked from rcurtis/Comm.gd
extends Node
var client
var wrapped_client
var connected = false
var message_center
var should_connect = false
func _ready():
@AwokeKnowing
AwokeKnowing / Install_OpenCV4_CUDA11_CUDNN8.md
Created November 12, 2021 01:22 — forked from raulqf/Install_OpenCV4_CUDA11_CUDNN8.md
How to install OpenCV 4.5 with CUDA 11.2 in Ubuntu 20.04

How to install OpenCV 4.5.2 with CUDA 11.2 and CUDNN 8.2 in Ubuntu 20.04

First of all install update and upgrade your system:

    $ sudo apt update
    $ sudo apt upgrade

Then, install required libraries:

/* Helper buddy for removing async/await try/catch litter 🗑 */
function O_o(promise) {
return promise.then(data => {
if (data instanceof Error) return [data]
return [null, data]
}).catch(err => [err])
}
/* Look ma, no try/catch */
async function usageExample(params) {
@AwokeKnowing
AwokeKnowing / foobar.py
Created October 30, 2020 19:02 — forked from jacquerie/foobar.py
How to decode the message at the end of Google Foobar
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
MESSAGE = '''
EUYQGhMMSx0cU0FIU1MCFAQPG01NQ0gTAEICChUGBxZTRVxBSQoZFQYKHQpKSUNURhcVEgoUFR1I
SltDSBkBTRwKEAgQHxFCSkFJDgkJCgoGCkMLAQBGUklUQhMPAgAJCgYLV0MOSR0VAxAaABZBQVRP
TRICCRVIAk5IEg4dVFRfRkYZBgRARBI=
'''
import sys
import re
import uuid
def literal_uuid(m):
return str(uuid.uuid4())
unfixed=""
with open(sys.argv[1],'r') as sqlfile:
unfixed = sqlfile.read()
import sys
import re
import uuid
def literal_uuid(m):
return str(uuid.uuid4())
unfixed=""
with open(sys.argv[1],'r') as sqlfile:
unfixed = sqlfile.read()
@AwokeKnowing
AwokeKnowing / make_docker_ssl_php_apache_server.md
Last active September 21, 2018 21:25
Docker set up a front end website with ssl on blank server (with port 443 open)

Easily set up a front end website with ssl on blank server (with port 443 open)

before you start, you need

  1. install docker

  2. get my.pub.lic.ip (curl https://wtfismyip.com/text)

  3. place the certificate files

/etc/ssl/certs/__mydomain_com.crt
@AwokeKnowing
AwokeKnowing / mysql-docker.sh
Created September 21, 2018 19:48 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@AwokeKnowing
AwokeKnowing / blti-launch.php
Created June 26, 2018 22:36 — forked from matthanger/blti-launch.php
Sample code for Basic LTI Consumer in PHP
<?php
# ------------------------------
# START CONFIGURATION SECTION
#
$launch_url = "http://www.imsglobal.org/developers/BLTI/tool.php";
$key = "12345";
$secret = "secret";
$launch_data = array(