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
@lirenlin
lirenlin / gist:9145493
Last active November 4, 2020 17:41
tmux init script
#!/bin/bash
# var for session name (to avoid repeated occurences)
sn=home
# Start the session and window 0 in /etc
# This will also be the default cwd for new windows created
# via a binding unless overridden with default-path.
cd /etc
tmux new-session -s "$sn" -n etc -d
"""
2020, nicholishen
Requires:
Python >= 3.6
pandas
openpyxl
chardet
pip install -U pandas ujson openpyxl chardet
@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
@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
@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
#
@vinceswann
vinceswann / Comments.tmPreferences
Last active March 29, 2022 10:50
Uniface 9 syntax highlighting, code completion and GOLD key macro for Sublime Text 3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>source.Uniface</string>
<key>settings</key>
<dict>
@rwb27
rwb27 / set_picamera_gain.py
Last active April 27, 2023 15:09
Manually setting gain of raspberry pi camera from within python
from __future__ import print_function
import picamera
from picamera import mmal, mmalobj, exc
from picamera.mmalobj import to_rational
import time
MMAL_PARAMETER_ANALOG_GAIN = mmal.MMAL_PARAMETER_GROUP_CAMERA + 0x59
MMAL_PARAMETER_DIGITAL_GAIN = mmal.MMAL_PARAMETER_GROUP_CAMERA + 0x5A
@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:
@fschr
fschr / main.cpp
Last active August 14, 2023 07:36
SDL2 Hello World | SDL2 Getting Started | SDL | OpenGL
// SDL2 Hello, World!
// This should display a white screen for 2 seconds
// compile with: clang++ main.cpp -o hello_sdl2 -lSDL2
// run with: ./hello_sdl2
#include <SDL2/SDL.h>
#include <stdio.h>
#define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 480
@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: