Skip to content

Instantly share code, notes, and snippets.

View hsed's full-sized avatar

Haaris hsed

View GitHub Profile
@hsed
hsed / vastai.md
Last active December 11, 2023 22:08
Vast.ai VPN Setup Commands

Commands

Remote => Server/GPU Computer Client => You/Dumb Computer

SSH and tunnel a port

This allows you to later run jupyterlab at 8080 on remote pc and its tunneled so u can view stuff in client.

ssh -p <PORT> <REMOTE_USER>@<REMOTE_IP> -L 8080:localhost:8080
let fwdProp (x: Vector<float>) (net : Network) : (NodesVectList * Network) =
let propNetwork (nvectLstAndLayers: NodesVectList * Network) (layer : Layer) : (NodesVectList * Network) =
let nvectLst, layerLst = nvectLstAndLayers
let newSVect = layer.wMatx.Transpose() * CreateVector.Dense((Array.concat [ [|1.0|] ; nvectLst.Head.xVect.ToArray() ]))
let newXVect = (newSVect.Map (Func<float, float> (getActFn layer.actFn)))
({xVect=newXVect ; sVect=newSVect} :: nvectLst , layer :: layerLst) //append to top
(List.fold propNetwork ([{xVect=x ; sVect=x}], []) net)
@hsed
hsed / WUToggle_v0.2.bat
Created April 21, 2017 22:02
Batch script to toggle Windows Update and Trusted Installer services.
@echo off
set /a timeoutsec=3
title WU+TI-Toggle v0.2-a by Haaris
color 0a
echo Description: Script to toggle Windows Update and Trusted Installer services.
echo;
echo Checking status...
sc query "wuauserv" | findstr RUNNING
if %ERRORLEVEL% == 2 goto trouble
if %ERRORLEVEL% == 1 goto stopped
@hsed
hsed / chunkify.js
Created March 18, 2017 15:50 — forked from woollsta/chunkify.js
Fixes an issue with Google Chrome Speech Synthesis where long texts pause mid-speaking. The function takes in a speechUtterance object and intelligently chunks it into smaller blocks of text that are stringed together one after the other. Basically, you can play any length of text. See http://stackoverflow.com/questions/21947730/chrome-speech-sy…
/**
* Chunkify
* Google Chrome Speech Synthesis Chunking Pattern
* Fixes inconsistencies with speaking long texts in speechUtterance objects
* Licensed under the MIT License
*
* Peter Woolley and Brett Zamir
* Modified by Haaris for bug fixes
*/