Skip to content

Instantly share code, notes, and snippets.

@aksh-at
aksh-at / jupyter-bore.py
Last active April 5, 2023 13:26
Jupyter on Modal through Bore
# Quick snippet to connect to a Jupyter notebook server running inside a Modal container,
# especially useful for exploring the contents of Modal shared volumes.
# This uses https://github.com/ekzhang/bore to expose the server to the public internet.
#
# Steps
# -----
# 1. (Recommended) Change `JUPYTER_TOKEN` to a different value; default is 1234.
# 2. `modal run jupyter-bore.py`
# 3. Find the `bore.pub` URL printed in the logs, and navigate to it using your browser.

Hang on, I'm not saying flux is dead, or that redux isn't amazing.

Okay ...

Most everybody is familiar with flux by now:

User Interaction --event data-->
  Action Creator --action-->
 Dispatcher --payload-->
@altrive
altrive / PSv5_Preview_Features.md
Last active April 24, 2016 16:45
PowerShell v5 Undocumented Features List
Note: Following features are tested on Windows 10 Preview Build 10074 environment

PSReadLine

Windows 10 Preview contains PSReadLine module at "%ProgramFiles%\WindowsPowerShell\Modules" (WMF 5.0 Preview don't contain this modules)

PSReadLine is automatically loaded when PSConsoleHost launched(if available). This feature can be controlled by following command.

@floehopper
floehopper / install.txt
Created February 27, 2015 16:28
Installing GQRX on Mac OSX Yosemite v10.10.2
# Based on https://github.com/metacollin/homebrew-gnuradio#homebrew-gnuradio and https://github.com/chleggett/homebrew-gqrx#install
$ brew update
$ brew upgrade # may be unnecessary
$ brew tap metacollin/gnuradio
$ brew install gnuradio # took 55 mins on my laptop & installed python via homebrew
$ brew install librtlsdr --HEAD # this installed b4c4e723f3656954f160b3f8df4e8804e4a46acd for me
$ brew tap chleggett/gqrx
$ brew tap chleggett/gr-osmosdr
$ pip install cheetah
@aslushnikov
aslushnikov / download.sh
Last active December 28, 2017 18:27
a simple snippet to pull track url from VK
# rename hashes, setup id3 tags
set -o
track=$(echo "$1" | cut -d'@' -f1)
url=$(echo "$1" | cut -d'@' -f2)
name=$(echo "$1" | cut -d'@' -f3)
artist=$(echo "$name" | cut -d'-' -f1)
song=$(echo "$name" | cut -d'-' -f2)
@smonev
smonev / Persistent command line history in Windows 7
Last active December 30, 2015 04:59
Persistent command line history in Windows 7
Persistent command line history in Windows 7:
You need to have PowerShell 3 installed (http://www.microsoft.com/en-us/download/details.aspx?id=34595).
1. Create powershell profile file, and apply some policy (Set-ExecutionPolicy RemoteSigned).
http://technet.microsoft.com/en-us/library/ff461033.aspx
2. Copy this script and put it into the profile file form #1
https://lopsa.org/content/persistent-history-powershell
@willurd
willurd / web-servers.md
Last active May 6, 2024 09:12
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@19WAS85
19WAS85 / powershell-web-server.ps1
Last active April 2, 2024 00:08
A simple web server built with powershell.
# This is a super **SIMPLE** example of how to create a very basic powershell webserver
# 2019-05-18 UPDATE — Created by me and and evalued by @jakobii and the comunity.
# Http Server
$http = [System.Net.HttpListener]::new()
# Hostname and port to listen on
$http.Prefixes.Add("http://localhost:8080/")
# Start the Http Server
@lukewpatterson
lukewpatterson / gist:4242707
Created December 9, 2012 00:24
squeezing private SSH key into .travis.yml file
Tricks to add encrypted private SSH key to .travis.yml file
To encrypt the private SSH key into the "-secure: xxxxx....." lines to place in the .travis.yml file, generate a deploy key then run: (to see what the encrypted data looks like, see an example here: https://github.com/veewee-community/veewee-push/blob/486102e6f508214b04414074c921475e5943f682/.travis.yml#L21
base64 --wrap=0 ~/.ssh/id_rsa > ~/.ssh/id_rsa_base64
ENCRYPTION_FILTER="echo \$(echo \"-\")\$(travis encrypt veewee-community/veewee-push \"\$FILE='\`cat $FILE\`'\" | grep secure:)"
split --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ~/.ssh/id_rsa_base64 id_rsa_
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: