Skip to content

Instantly share code, notes, and snippets.

@gotomypc
gotomypc / Dockerfile
Created January 26, 2023 16:51 — forked from mthrok/Dockerfile
TorchAudio 0.10.2 minimum compilation example
View Dockerfile
FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu20.04
ARG PYTHON_VERSION=3.9
ARG CU_VERSION=11.3
ARG PYTORCH_VERSION=1.10.2
ARG TORCHAUDIO_TAG=v0.10.2
RUN apt update && apt install -y -qq git curl && apt autoremove && apt autoclean
RUN git clone https://github.com/pytorch/audio.git
@gotomypc
gotomypc / download.cpp
Created December 25, 2022 03:44 — forked from ericdke/download.cpp
C++: Download a file using HTTP GET and store in in a std::string
View download.cpp
/**
* HTTPDownloader.hpp
*
* A simple C++ wrapper for the libcurl easy API.
*
* Written by Uli Köhler (techoverflow.net)
* Published under CC0 1.0 Universal (public domain)
*/
#ifndef HTTPDOWNLOADER_HPP
#define HTTPDOWNLOADER_HPP
@gotomypc
gotomypc / tensorflow_serving_ubuntu_14.md
Created December 25, 2022 01:22 — forked from gvanhorn38/tensorflow_serving_ubuntu_14.md
TensorFlow Serving Ubuntu 14.04
View tensorflow_serving_ubuntu_14.md

Instructions for installing TensorFlow Serving on Ubuntu 14.04. I am following the instuctions from here.

Install Bazel

Installation instructions can be found here

If you have a previous version of bazel, and you are trying to do a fresh install then you should remove your old version of bazel. If you installed it through apt, then you can do sudo apt-get purge bazel. If you installed it from source, then you probably have a ~/bin directory with the bazel command, which you should delete, and you probably have a ~/.bazel directory that you should delete. Also check your ~/.bashrc file for any links to ~/.bazel.

  1. Install JDK 8 You'll need the add-apt-repository command, which you can get by doing sudo apt-get install software-properties-common
View Tensorflow Serving Tutorial - 01 - Public Inception Model.md

Tensorflow Serving Tutorial - 01 - Public Inception Model

In this tutorial:

  • Start with a blank Ubuntu
  • Install requirements
  • Download code & pre-tranied inception-v3 model from Google
  • Export the downloaded "checkpoint" format to a TF Graph that is servable with Tensorflow Model Serving
  • Query the server with images of a cat and a dog

General Notes

  • Compiling Tensorflow Serving from source (on docker with their official instructions) produces an internal gcc error (probably specific to tensorflow commit / gcc version used when writing this: tf serving commit: c1ec43508ee57a5d6269116aba82d2a16d383c8a)
@gotomypc
gotomypc / audio_effects_demo_directory.cpp
Created December 25, 2022 01:11 — forked from LittleWat/audio_effects_demo_directory.cpp
audio_effects_demo_directory.cpp
View audio_effects_demo_directory.cpp
/*###############################################################################
#
# Copyright 2020 NVIDIA Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
@gotomypc
gotomypc / install_nvidia_driver.md
Created December 25, 2022 01:11 — forked from LittleWat/install_nvidia_driver.md
How I fix this issue NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running
View install_nvidia_driver.md

I had many driver installed I my virtual machine , so It was actually the reason why I was having the error.

To fix it I had first to remove all driver I have installed before using :

  • sudo apt-get purge nvidia-*
  • sudo apt-get update -sudo apt-get autoremove

After that I when a head and installed the latest version of it nvidia driver:

I did :

@gotomypc
gotomypc / config.ts
Created December 10, 2022 03:47 — forked from AmazingTurtle/config.ts
openai client
View config.ts
export const DEFAULT_ENGINE = 'davinci';
export const ENGINE_LIST = ['ada', 'babbage', 'curie', 'davinci', 'davinci-instruct-beta', 'curie-instruct-beta'];
export const ORIGIN = 'https://api.openai.com';
export const DEFAULT_API_VERSION = 'v1';
export const DEFAULT_OPEN_AI_URL = `${ORIGIN}/${DEFAULT_API_VERSION}`;
@gotomypc
gotomypc / VolumeDetect.md
Created December 6, 2022 23:39 — forked from 44213/VolumeDetect.md
Use ffmpeg to detect audio volume level. bat file included for easier interaction.
View VolumeDetect.md

Detect the audio file volume with ffmpeg.

Require tools

  • ffmpeg: [Official site][1], [Download][2]

How to use

  1. Download ffmpeg from [link][2]
  2. Extract the ffmpeg.exe from zip package and copy to the directory contain the audio file
  3. Copy the volumeDetect.bat into the folder. (Just make sure the bat file and ffmpeg.exe are in the same directory)
  4. Doulbe click volumeDetect.bat and drag the file into the window.
  5. Press enter and get the result.
View nginx_improving_ssl_configuration.md

Improving SSL Configuration

  • Documentation:
    • NGINX ssl module
    • Mozilla’s Server Side TLS Documentation
  • Add session caching so that fewer SSL handshakes need to be made.
  • The initial handshake is the most taxing part of the process, and if we can avoid repeating it then we’ll improve our overall performance.
    $ vim /etc/nginx/conf.d/default.conf
    

ssl_certificate /etc/nginx/ssl/public.pem;

@gotomypc
gotomypc / a.js
Created October 23, 2022 08:58 — forked from Dobby233Liu/a.js
my messing w/ msedge dev read aloud. ONLY RUN IN edge dev. i give up, so it wont work properly
View a.js
var ARRAY_LENGTH = 16;
var MIN_HEX_LENGTH = 2;
class UUID {
static createUUID() {
const array = new Uint8Array(ARRAY_LENGTH);
window.crypto.getRandomValues(array);
let uuid = '';