Skip to content

Instantly share code, notes, and snippets.

@stucka
stucka / python startup.txt
Last active May 4, 2024 23:40
Set up a new Python
My Python initial setup:
python -m pip install --upgrade pip
Is it sqwaking about managed configuration? If you're on Unix and feeling dumb:
cd /.config
mkdir pip
cd pip
nano pip.conf
...
Add this:
@stucka
stucka / bing-test.ipynb
Created January 31, 2024 17:41
Get Bing's cached version of a URL
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stucka
stucka / bluesky.md
Last active October 19, 2023 14:44
Getting started on Bluesky

Use this code at bsky dot app.

A good way to get started is to identify some of the nexus accounts, people near the center of your social groups on Twitter, then look for them on Bluesky. If you find them, you can follow them -- but consider also going through their lists of who they're following, and who they follow, to find more of your crowd. Think about whether you really want to follow them, instead of automatically following them. Consider repeating this step periodically as Bluesky grows, because you may find more of your people have snuck in.

There was a web site called Fedifinder that tried to find your Twitter crowd in both Mastodon and Bluesky. It's been down the last couple times I've tried it, alas.

LifeHacker referred me to a Chrome extension I haven't tried yet, which tries to identify your Twitter people on Bluesky so you can follow 'em: https://chrome.google.com/webstore/detail/sky-follower-bridge/behhbpbpmailcnfbjagknjngnfdojpko

Block liberally. Don't feed the trolls. Keep it from turnin

@stucka
stucka / gist:338a8f4c194313fa1ad0d92c81b2ca3b
Last active August 30, 2023 12:37
Setting up a new Linux box
Change root password
make a regular user
adduser stucka
usermod -aG sudo stucka
Set up IP with a DYNDNS entry
Save profile in Putty/SSH client
apt-get update
apt-get dist-upgrade
apt-get clean
apt-get autoremove
@stucka
stucka / pipreplace.sh
Last active November 23, 2022 02:50
Force pip to reinstall all Python packages (works great with https://gist.github.com/stucka/0ced1cc71e1a5c374a18874471636d69)
#!/bin/bash
apt-get install libxml2-dev libssl-dev libffi-dev libxslt1-dev python-dev libjpeg-dev
pip freeze --local >pipfreeze.txt
tr '\n' ' ' < pipfreeze.txt >pipfreeze2.txt
pip install --upgrade --force-reinstall `cat pipfreeze2.txt`
@stucka
stucka / OrderedDictWriter.py
Created July 7, 2017 22:19
Python -- write from ordered dictionary OrderedDict to csv file
with open("statereport-geo.csv", 'w', newline='') as csvfile:
writer = csv.writer(csvfile)
headers = []
for key in rows[0]:
headers.append(key)
writer.writerow(headers)
for row in rows:
targetrow = []
for key in headers:
targetrow.append(row[key])
@stucka
stucka / response.txt
Created May 17, 2022 19:11
Spam message response from Derek Willis
Recently? Well, to be honest things could be better, what with my cousin getting arrested for trespassing and defacing public property (we told him he literally can't ski down the front of a museum, no matter how much of a slope it has) and then the tractor wn't start, which is tough because it's our main form of transportation when it rains, and to top it off my gout has returned, but in my left elbow. Why is there no gout vaccine?
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stucka
stucka / combineuniquecsvs.py
Created May 22, 2020 15:10
Combinue unique CSV rows, while destroying row order and clobbering multiline entries
# import csv
from glob import glob
import os
from sys import exit
import datetime
print("This will NOT work with CSVs that have multiline entries.")
print("This will completely screw with the order of your CSVs.")
print("This will risk making the Cubs win another World Series, splitting us into another alternative universe.")