Skip to content

Instantly share code, notes, and snippets.

View jmsdnns's full-sized avatar

Jms Dnns jmsdnns

View GitHub Profile
@jmsdnns
jmsdnns / diffgit.py
Last active January 15, 2024 22:36
A tool that will compare the code in a notebook against the last code checked into the repo. Helpful for when you aren't quite sure what functionality you changed and the diff is full of noise!
#!/usr/bin/env python
# $ python ./scripts/diffgit.py nb/AddLabelsToVAE.ipynb
# 8a9
# > print('hey')
import sys
import shlex
import subprocess
import tempfile

Tips for using Python with VSCode

Open VSCode from Terminal

In VSCode, open the command palette with: Command + Shift + P

Then type: shell command and choose install 'code' command in PATH

Open VSCode in venv

@jmsdnns
jmsdnns / main.rs
Created November 8, 2023 16:47
More elaborate SSH pools
use async_ssh2_tokio::{
Error,
client::AuthMethod
};
mod pools;
#[tokio::main]
async fn main() -> Result<(), Error> {
@jmsdnns
jmsdnns / sshpools.rs
Last active November 8, 2023 14:20
Parallel SSH pools
// Here is the output for this gist
//
// Ok(Client { username: "beez", address: 192.168.122.89:22, connection_handle: "Handle<ClientHandler>" })
// Ok(Client { username: "beez", address: 192.168.122.204:22, connection_handle: "Handle<ClientHandler>" })
// killa-a2
// killa-a1
// killa-a2
// killa-a1
// killa-a1
// killa-a2
@jmsdnns
jmsdnns / scan.rs
Last active November 8, 2023 02:54
a concurrent port scanner, built to help me learn rust
// This was the first draft of something that now exists as a full project, called Eyes
//
// https://github.com/jmsdnns/eyes
use clap::{Command, Arg, ArgAction, ArgMatches, value_parser};
use futures::{stream, StreamExt};
use std::{
net::{IpAddr, SocketAddr},
time::Duration,
};
@jmsdnns
jmsdnns / fahqvsc.py
Created July 17, 2023 22:18
Deassociate VSCode with every mime type it hijacks (like a jerk!)
#!/usr/bin/env python
from gi.repository import Gio
app_name = 'Visual Studio Code'
for mtype in Gio.content_types_get_registered():
launcher = Gio.AppInfo.get_default_for_type(mtype, False)
if not launcher:
@jmsdnns
jmsdnns / mp3s_r_k3wl.md
Last active October 13, 2018 18:25
Vintage Millennial Manifesto

Vintage Millennial Manifesto

by Jms Dnns

i was born in the early 80's

that's why i dont care about vinyl but do care about headphone jacks

that's why i have nes cartridges instead of raspberry pis

@jmsdnns
jmsdnns / curation_biases.md
Last active September 18, 2018 12:35
Rage Against The Machines

Ive spent a few days thinking on this.

I struggle with the idea that algorithms could be so informed as to nail sharing things you dont know you like. We dont give Spotify nearly enough information to know that kind of thing. It's a utility and not a friend we share real shit with.

I like the language of economics for considering these types of things, but Im gonna tweak it too

The Efficient-Curator Hypothesis is a theory in Jamesian Economics that states that curated playlists fully reflect all available information

A direct implication is that it is impossible to "beat the algorithm" consistently on a mood-adjusted basis since curated playlists only react to new information

@jmsdnns
jmsdnns / blabla.md
Created April 13, 2018 19:31
Sapiens

It stands to reason that the ethnic and cultural variety among ancient hunter-gatherers was [impressive], and that 5m to 8m foragers who populated the world on the eve ofthe agrictural revolutiom were divided into thousands of separate tribes with thousands of different languages and cultures.

This, after all, was one of the main legacies of the cognitive revolution.

Thanks to the appearance of fiction, even people with the same genetic makeup, who lived under similar ecological conditions, were able to crrate very different, imagined realities, which manifested themselves in different norms and values.

For example, there is every reaosn to belueve that a forager band that lived 30,000 years ago in the spot where Oxford University now stands would have spoke a different language from one living where Cambridge is now situated. One band might've been beligerent and the other peaceful. Perhaps the Cambridge band was communal while the one at Oxford was based on nuclear families. The Canterbridgians might ha

@jmsdnns
jmsdnns / ThomasKuhnBriefly.md
Created April 11, 2018 23:05
A Brief Overview Of Thomas Kuhn

A Brief Overview Of Thomas Kuhn

by Stephen Denning

Prior to Kuhn, science was primarily seen as the steady accretion of new facts and relationships, one on top of the other.

Kuhn accepted that science experiences long periods of conceptual continuity and accretion. This is what he calls "normal science". However, it is punctuated by periods of revolutionary science with abrupt discontinuities, as the mental model changes in fundamental ways.

Three Phases

There are three distinct phases.