Skip to content

Instantly share code, notes, and snippets.

View jrwren's full-sized avatar
๐Ÿ’ญ
๐Ÿคฏ๐Ÿ’ฏ๐Ÿ‘๐Ÿ”ฅ๐ŸŽ‰๐Ÿคทโ€โ™€๏ธ๐Ÿ˜๐Ÿ˜•๐Ÿ•ด๐Ÿฝ๐Ÿ˜ต๐Ÿ˜ž๐Ÿค•๐Ÿคฎ

Jay R. Wren jrwren

๐Ÿ’ญ
๐Ÿคฏ๐Ÿ’ฏ๐Ÿ‘๐Ÿ”ฅ๐ŸŽ‰๐Ÿคทโ€โ™€๏ธ๐Ÿ˜๐Ÿ˜•๐Ÿ•ด๐Ÿฝ๐Ÿ˜ต๐Ÿ˜ž๐Ÿค•๐Ÿคฎ
View GitHub Profile
>>> I am standing on a cliff 307 meters above the water. If a canon shoots a ball with a mass of 40KG,
... at an angle of 37deg with an acceleration of 800 m/s^2, how far from the cliff will the ball strike
... the water assuming no air resistance?
<think>
Alright, so I'm standing on a cliff that's 307 meters above the water. Someone is shooting a
cannonball with a mass of 40 kilograms using a cannon. The cannon fires the ball at an angle of
37 degrees and accelerates it to a speed squared acceleration of 800 m/sยฒ. I need to figure out
how far from the cliff the ball will land in the water, assuming there's no air resistance.
@jrwren
jrwren / wikiquote.go
Created November 27, 2024 21:48
parse large wikiquote export efficiently
package wikiquote
import (
"encoding/xml"
"iter"
"log"
"os"
"strings"
)
@jrwren
jrwren / lvchange.out
Created May 27, 2024 16:17
output of vchange -vvv -a y datavg/movies3
Parsing: lvchange -vvv -a y datavg/movies3
Recognised command lvchange_activate (id 4 / enum 6).
Sysfs filter initialised.
Internal filter initialised.
LVM type filter initialised.
Usable device filter initialised (scan_lvs 0).
mpath filter initialised.
Partitioned filter initialised.
signature filter initialised.
MD filter initialised.
@jrwren
jrwren / gist:1f37b77171523f693ea28ffa3064a9fa
Created March 31, 2023 13:51
a little curl+jq for peeping recent T-Bill auctions
curl 'https://www.treasurydirect.gov/TA_WS/securities/auctioned?format=json&type=Bill' | jq -C '.[]|select(.securityTerm=="17-Week")|{issueDate,highInvestmentRate,highPrice,lowDiscountRate,pricePer100}' | less
@jrwren
jrwren / i hate this AP so much
Created February 6, 2023 17:29
i hate this AP so much
64 bytes from 192.168.0.101: icmp_seq=1479 ttl=64 time=4.459 ms
64 bytes from 192.168.0.101: icmp_seq=1480 ttl=64 time=4.524 ms
64 bytes from 192.168.0.101: icmp_seq=1481 ttl=64 time=4.343 ms
64 bytes from 192.168.0.101: icmp_seq=1482 ttl=64 time=7.819 ms
64 bytes from 192.168.0.101: icmp_seq=1483 ttl=64 time=56.858 ms
64 bytes from 192.168.0.101: icmp_seq=1484 ttl=64 time=101.132 ms
64 bytes from 192.168.0.101: icmp_seq=1485 ttl=64 time=149.516 ms
64 bytes from 192.168.0.101: icmp_seq=1486 ttl=64 time=196.145 ms
64 bytes from 192.168.0.101: icmp_seq=1487 ttl=64 time=240.002 ms
64 bytes from 192.168.0.101: icmp_seq=1488 ttl=64 time=283.175 ms
@jrwren
jrwren / gist:a2a24e5434272479db5ec15479fdf5fd
Created April 14, 2022 20:36
corporate managed laptops are the worst
My MacBook had load over 600, even after a reboot it was unusable (load still 500+).
I looked at Activity Monitor and noticed kernel_task was maxing out as much as it can and so was syslogd.
I looked at recent writes to log files in /var/log and noticed junk from acnvmagent.
I killed that process. It came back.
I ran `sudo chmod 0 /opt/cisco/anyconnect/NVM/bin/acnvmagent` and killed the process.
It did not come back. Now my laptop is usable again.
Possibly relevant log message:
``` Apr 14 16:13:03 JAWREN-M-455A vpnagentd[85]: [acnvmagent] Function: killNVMIfPresent Thread Id: 0xCFA5000 File: /tmp/build/thehoff/Phoenix_MR10.310731736127/Phoenix_MR1/NVM/ServicePlugin/Unix/NVMServicePluginImpl.cpp Line: 165 :: Verifying process is not already running... Apr 14 16:13:03 JAWREN-M-455A vpnagentd[85]: [acnvmagent] Function: StartService Thread Id: 0xCFA5000 File: /tmp/build/thehoff/Phoenix_MR10.310731736127/Phoenix_MR1/NVM/ServicePlugin/Unix/NVMServicePluginImpl.cpp Line: 118 :: 'acnvmagent' service started,
@jrwren
jrwren / main.go
Created February 28, 2022 18:08
a slow server useful for testing
package main
import (
"errors"
"io"
"log"
"net/http"
"os"
"strconv"
"time"
@jrwren
jrwren / Dockerfile
Created February 24, 2022 20:18
an unminimized ubuntu with build-essential, openssl, man, jq
FROM ubuntu:20.04
# Lifted from unminimize.
RUN set -e; if [ -f /etc/dpkg/dpkg.cfg.d/excludes ] || [ -f /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp ]; then \
echo "Re-enabling installation of all documentation in dpkg..." ;\
if [ -f /etc/dpkg/dpkg.cfg.d/excludes ]; then \
mv /etc/dpkg/dpkg.cfg.d/excludes /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp ;\
fi ;\
echo "Updating package list and upgrading packages..." ;\
apt-get update ;\
# apt-get upgrade asks for confirmation before upgrading packages to let the user stop here
@jrwren
jrwren / sad.md
Created February 18, 2022 17:24
a somewhat reasonable python2.7 on macos in 2022

a somewhat reasonable python2.7 on macos in 2022

Yes, this sucks, but look, there are still python2.7 projects out there. Homebrew did the wrong thing by removing their 2.7 forumla.

The system python2.7 doesn't have ability to install virtualenv or even pip. โ˜น๏ธ

That said, use homebrew to install zlib and bzip2 and maybe openssl as deps.

@jrwren
jrwren / readme.md
Created January 14, 2022 16:50
disable restricted, universe, multiverse in ubuntu server/cloud

If you are using a server or cloud image, you may not want to install the necessary packages to get add-apt-repository. /etc/apt/sources.list.d/ is empty by default so you can edit only /etc/apt/sources.list.

Without comments, OOTB docker image looks like this for me:

deb http://archive.ubuntu.com/ubuntu/ bionic main restricted
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted
deb http://archive.ubuntu.com/ubuntu/ bionic universe
deb http://archive.ubuntu.com/ubuntu/ bionic-updates universe
deb http://archive.ubuntu.com/ubuntu/ bionic multiverse