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
@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 March 9, 2024 20:55
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 <mklement0@gmail.com>
DOWNLOAD, from PowerShell version 3 or above:
irm https://gist.github.com/mklement0/243ea8297e7db0e1c03a67ce4b1e765d/raw/Out-HostColored.ps1 | iex
@mklement0
mklement0 / Get-CharInfo.ps1
Last active December 9, 2023 23:02
PowerShell function that retrieves information about Unicode characters and categories.
<#
Prerequisites: PowerShell v3+
License: MIT
Author: Michael Klement <mklement0@gmail.com>
DOWNLOAD and DEFINITION OF THE FUNCTION:
irm https://gist.github.com/mklement0/25694cbb8e10a7044b36a310e1243959/raw/Get-CharInfo.ps1 | iex
"""
2020, nicholishen
Requires:
Python >= 3.6
pandas
openpyxl
chardet
pip install -U pandas ujson openpyxl chardet
@mgeeky
mgeeky / Download-Cradles-Oneliners.md
Last active January 8, 2024 14:06
Various Powershell Download Cradles purposed as one-liners

Download Cradles

0) Extra goodies

  • Obfuscated FromBase64String with -bxor nice for dynamic strings deobfuscation:
$t=([type]('{1}{0}'-f'vert','Con'));($t::(($t.GetMethods()|?{$_.Name-clike'F*g'}).Name).Invoke('Yk9CA05CA0hMV0I=')|%{$_-bxor35}|%{[char]$_})-join''
  • The same as above but for UTF-16 base64 encoded strings:
@elibroftw
elibroftw / investing.py
Last active July 2, 2023 02:33
A Python script and tool for speeding up stock market research.
"""
Investing Analytics
Author: Elijah Lopez
Version: 2.1
Created: April 3rd 2020
Updated: July 1st 2023
https://gist.github.com/elibroftw/2c374e9f58229d7cea1c14c6c4194d27
Resources:
Black-Scholes variables:
@JPMinty
JPMinty / Get-ProcessTree.ps1
Last active February 3, 2022 10:18 — forked from atifaziz/Get-ProcessTree.ps1
PowerShell 2.0 script to get processes tree
# Modified to include support for CommandLine, File Hashes, File Paths, Signing Certificates
# Copyright (c) 2020 Jai Minton. All rights reserved.
# Copyright (c) 2014 Atif Aziz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@rwb27
rwb27 / socks.md
Created February 14, 2020 09:08
Internet access for a Raspberry Pi on a hidden network

Setting up a SOCKS proxy on a Raspberry Pi

My problem: I have a bunch of Raspberry Pi computers, all connected via a network switch and USB ethernet port to a "gateway" Raspberry Pi. However, I don't particularly want them all to be internet-connected all of the time, because (1) it's possible there is a slight security risk and (2) my IT folk at work might not like it. OK, I should also mention (3) I tried and failed to get NAT and dnsmasq to work, and don't have time to finish debugging it.

My solution: I SSH in to my "gateway" Pi (is it ok to call it a gateway even though it's resolutely failing to route any traffic? Never mind...), and from there I can connect to my hidden Pi(s), let's say for arguments sake it's called hiddenpi.local.

ssh pi@hiddenpi.local

Now, I can SSH back again, setting up a SOCKS proxy: