Skip to content

Instantly share code, notes, and snippets.

View eabase's full-sized avatar

eabase

  • Between the radio ether and you.
View GitHub Profile
@bsdayo
bsdayo / pwsh-bash-completion.ps1
Created November 12, 2024 23:47
Make Bash's autocompletion available to PowerShell on Linux.
# Add this snippet to your $PROFILE to make Bash's autocompletion available to PowerShell on Linux.
# Warning: adds ~500ms initialization time.
# References: https://brbsix.github.io/2015/11/29/accessing-tab-completion-programmatically-in-bash/
# https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/register-argumentcompleter
# Find all commands
$commands = bash -c 'source /usr/share/bash-completion/bash_completion && complete' | awk '{ print $NF }'
$commands += ls /usr/share/bash-completion/completions
$commands | ForEach-Object {
@CPPAlien
CPPAlien / pg-pong-pytorch.py
Last active September 22, 2024 23:18 — forked from karpathy/pg-pong.py
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
import torch
import torch.nn as nn
import torch.optim as optim
import gym
import numpy as np
import pickle
# Hyperparameters
H = 200 # Number of hidden layer neurons
batch_size = 10 # Every how many episodes to do a param update?
@Artefact2
Artefact2 / README.md
Last active December 12, 2024 13:17
GGUF quantizations overview
@rvrsh3ll
rvrsh3ll / windows-keys.md
Created February 18, 2024 22:44
Windows Product Keys

NOTE

These are NOT product / license keys that are valid for Windows activation.
These keys only select the edition of Windows to install during setup, but they do not activate or license the installation.

Index

I was wondering why it took so long for my deep learning rig to fully boot up. It literally takes 5 minutes to go from reboot to ssh service start. Unlike desktop motherboards, the ROMED8-2T has two 10G RDMA ethernet controllers and a port for the IPMI interface.

For a while I thought I must have done something wrong - but it turns out when there are free, unmapped ports it will block boot. To fix this, you just need to make the other interfaces optional in your /etc/netplan/*.yaml

network:
  ethernets:
    enoXnpX:
      addresses:
 - ...
@Wra7h
Wra7h / Get-ProcessPipes.ps1
Last active November 28, 2024 22:57
Use PowerShell to get the PIDs associated with Named Pipes
function Get-ProcessPipes{
param(
[Parameter(Mandatory=$false)]
[string]$CSV,
[Parameter(Mandatory=$false)]
[switch]$All
)
Add-Type -TypeDefinition @"
using System;
@rkitover
rkitover / nanosetup.ps1
Last active January 12, 2022 23:11
PowerShell installer script for nano with syntax highlighting on Windows
$erroractionpreference = 'stop'
$releases = 'https://files.lhmouse.com/nano-win/'
ri -r -fo ~/Downloads/nano-installer -ea ignore
mkdir ~/Downloads/nano-installer | out-null
pushd ~/Downloads/nano-installer
curl -sLO ($releases + (
iwr -usebasicparsing $releases | % links |
? href -match '\.7z$' | select -last 1 | % href
@haluptzok
haluptzok / pg-pong.py
Last active February 2, 2024 15:40 — forked from karpathy/pg-pong.py
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@sharavsambuu
sharavsambuu / metatrader5_live.py
Created October 28, 2020 14:22
Template for live algo with MetaTrader5 and Python
# References :
# - https://stackoverflow.com/questions/61776425/logic-for-real-time-algo-trading-expert
import pytz
import pandas as pd
import MetaTrader5 as mt5
import time
from datetime import datetime
from threading import Timer
@mklement0
mklement0 / Out-HostColored.ps1
Last active December 13, 2024 14:56
PowerShell function that colors portions of the default host output that match given patterns.
<#
Prerequisites: PowerShell version 2 or above.
License: MIT
Author: Michael Klement <[email protected]>
DOWNLOAD, from PowerShell version 3 or above:
irm https://gist.github.com/mklement0/243ea8297e7db0e1c03a67ce4b1e765d/raw/Out-HostColored.ps1 | iex