Skip to content

Instantly share code, notes, and snippets.

View jrwren's full-sized avatar
💭
🤯💯👍🔥🎉🤷‍♀️😍😕🕴🏽😵😞🤕🤮

Jay R. Wren jrwren

💭
🤯💯👍🔥🎉🤷‍♀️😍😕🕴🏽😵😞🤕🤮
View GitHub Profile
@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
@jrwren
jrwren / Dockerfile
Created October 22, 2021 20:26
Centos6 resurrection Dockerfile
FROM centos:6.7
RUN sed -i 's/#baseurl=http:\/\/mirror/baseurl=http:\/\/vault/;s/mirrorlist/#mirrorlist/' /etc/yum.repos.d/CentOS-Base.repo ;\
curl -LO https://archive.kernel.org/centos-vault/6.10/updates/x86_64/Packages/ca-certificates-2020.2.41-65.1.el6_10.noarch.rpm ;\
rpm -U ./ca-cert*.rpm ;\
rm ca-cert*.rpm ;\
yum -y upgrade ;\
yum install -y yum-utils perl-devel perl-ExtUtils-Embed GeoIP-devel bc \
rpm-build make gcc tar git autoconf automake libtool openssl-devel \
zlib-devel pcre-devel epel-release ;\
@jrwren
jrwren / server.go
Created May 6, 2021 19:17
Slowly responding Go net/http.Server endpoint for testing proxy behavior during shutdown, or connection scalability.
func slow(w http.ResponseWriter, r *http.Request) {
// The slow return of this function is to take 5 minutes.
// We shall return ~1MB total. and use american english dictionary for fun.
f, err := os.Open("/usr/share/dict/words")
if err != nil {
log.Print("couldn't open /usr/share/dict/words")
return
}
defer f.Close()