Skip to content

Instantly share code, notes, and snippets.

View porteusconf's full-sized avatar

porteusconf porteusconf

  • 03:21 (UTC -04:00)
View GitHub Profile
@porteusconf
porteusconf / rosetta2detect.sh
Created September 29, 2022 02:08
zsh shell script to detect if running under rosetta on apple-silicon m1 macs
#!/bin/zsh
# Based on https://indiespark.top/software/detecting-apple-silicon-shell-script/
arch_name="$(uname -m | cut -c 1-3)" # x86 or arm (to match arm64 or arm64e)
echo -n ${arch_name} "= specifically "
uname -m
if [ "${arch_name}" = "x86" ]; then
if [ "$(sysctl -in sysctl.proc_translated)" = "1" ]; then
echo "Running on Rosetta 2"
else
echo "Running on native Intel"
@porteusconf
porteusconf / .conkyrc
Created August 5, 2022 17:57
conky can show %charged for more than one battery. Like some lenovo laptops have both a non-removable battery and bigger removable bat (like x240).
Battery0: ${battery_percent BAT0}% ${alignr}${color8}${battery_bar 8,70 BAT0}
Battery1: ${battery_percent BAT1}% ${alignr}${color8}${battery_bar 8,70 BAT1}
]]
@porteusconf
porteusconf / ChevyVoltInverterPinOuts.csv
Created March 10, 2021 17:00
Chevy Volt Inverter pin-outs wire colors
Current sensor connector
Header S10B-MECK-2GA-A
Wire Blue Green Yellow Black Red
Pin 1 2 3 4 5
Name Cur C Cur B Cur A GND VCC
2.85mV/A offset 1/2 VCC 5V
Wire Blue Green Yellow Black Red
Pin 6 7 8 9 10
Name Cur C Cur B Cur A GND VCC
@porteusconf
porteusconf / seeconfig-for-seeman.sh
Last active February 24, 2024 02:28
create ~/.seeconfig for seeman (GUI "manpage" viewer for X windows) apt install seetxt && seeconfig-for-seeman.sh && seeman seeman
#! /usr/bin/env bash
### https://manpages.debian.org/testing/seetxt/seeman.1.en.html
touch ~/seefilelist
touch ~/seedata
if [ ! -f ~/.seeconfig ]; then
echo "text font: helvetica 12" >> ~/.seeconfig
echo "filelist: /home/$USER/seefilelist" >> ~/.seeconfig
echo "seedata: /home/$USER/seedata" >> ~/.seeconfig
echo "dimensions: 900 600" >> ~/.seeconfig
fi
@porteusconf
porteusconf / memtest-uefi-menu.sh
Created February 14, 2021 15:34
put memtest on boot-drive (in boot/EFI/memtest) and add to uefi boot menu (may need to disable secure UEFI boot)
# wget memtest86-usb.zip
unzip memtest86-usb.zip
#
testdisk memtest85-usb.img
mkdir /tmp/memtest
# use testdisk or similar to extract files in /EFI/BOOT/ on partition 1 to /tmp/memtest/
$ tree /tmp/memtest/
/tmp/memtest/
@porteusconf
porteusconf / macos-create-admin-acct-find32.sh
Last active January 29, 2021 03:38
dscl commands for macos to create new admin user (must be run with sudo). And 1-liner to find 32-bit macos apps.
dscl . -create /Users/tts-setup NFSHomeDirectory /Local/Users/tts-setup
dscl . -passwd /Users/tts-setup xxxxxxxx
dscl . -append /Groups/admin GroupMembership tts-setup
id tts-setup
### uid=1007(tts-setup) gid=80(admin) groups=80(admin),12(everyone),61(localaccounts)...
mdfind "kMDItemExecutableArchitectures == '*i386*' && kMDItemExecutableArchitectures != '*x86*'"
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 6 columns, instead of 4 in line 8.
datasetName,about,link,categoryName,cloud,vintage
Microbiome Project,American Gut (Microbiome Project),https://github.com/biocore/American-Gut,Biology,GitHub,NA
GloBI,Global Biotic Interactions (GloBI),https://github.com/jhpoelen/eol-globi-data/wiki#accessing-species-interaction-data,Biology,GitHub,NA
Global Climate,Global Climate Data Since 1929,http://en.tutiempo.net/climate,Climate/Weather,,1929
CommonCraw 2012,3.5B Web Pages from CommonCraw 2012,http://www.bigdatanews.com/profiles/blogs/big-data-set-3-5-billion-web-pages-made-available-for-all-of-us,Computer Networks,,2012
Indiana Webclicks,53.5B Web clicks of 100K users in Indiana Univ.,http://cnets.indiana.edu/groups/nan/webtraffic/click-dataset/,Computer Networks,,NA
Criteo click-through,Criteo click-through data,http://labs.criteo.com/2015/03/criteo-releases-its-new-dataset/,Computer Networks,,NA
ICWSM 2009,ICWSM Data Challenge (since 2009),http://icwsm.cs.umbc.edu/,Data Challenges,,2009
KDD Cup,KDD Cup by Tencent 2012,http://www.kddcup2012.org/,Data

How to buy the $60-per-year (= $5.00 per month) redpocket cell-phone plan on ebay. The $5/mo plan is the lowest price plan, listed under "360-day plans" at redpocket website as the "Basic" $5.00/month. Note you can NOT buy it directly from the redpocket site but you have follow the link to ebay-redpocket site, which is https://www.ebay.com/itm/133058476404 as of Nov 2020. For years now I have reliably bought and used the $60/year plan for several phones The trick is, after the purchase on ebay, be sure to watch for next few days for an email to your email-address associated with ebay from eBay - redpocketstore with subject Red Pocket Mobile eBay Activation Code and a code, aka PIN, such as 99998774919999. This needs to be used in 90 days, and is what you provide when asked for a PIN under the payments section of the redpocket site.

Only once could I not find the email, but given the purchase info from ebay, the re

@porteusconf
porteusconf / wmic2csv.bat
Last active November 11, 2020 05:07
From output of various wmic commands creates plain-ascii (NOT unicode/utf) clean csv output with no blank lines.
@echo off
REM Creates wmic-min.txt with some minimal wmic info. And from .txt file creates clean .csv output
REM Usage: wmic2csv.bat > wmic-min.csv
REM Get REPL.BAT from https://github.com/numericOverflow/REPL.BAT
REM If csv output looks strange, take a look at wmic-min.txt file for clues.
REM The "| find /v " converts unicode (utf) to ansi (plain ascii text).
REM https://stackoverflow.com/questions/28672210/get-rid-of-spaces-and-tabs-in-wmic-output
wmic computersystem LIST brief /format:list | find /v "" > wmic-min.txt
@porteusconf
porteusconf / qgle.command
Last active March 6, 2023 15:16
lauches gui-app qgle.app (should work if you choose newer/older versions of gle by `brew switch gle`) 64-bit gle 4.3.0 Tested on macos 10.15
#!/usr/bin/env bash
## Put this qgle.command in /Applications and in Terminal:
### chmod a+x /Applications/qgle.command
### assumes you installed gle in /usr/local/cellar and did brew link similar to following...
## brew diy --name=gle --version=4.3.0
## mkdir /usr/local/Cellar/gle
## cd /usr/local/Cellar/gle
## tar zxf gle_macosx_4.3.0_x64.tar.bz2 # download newest tarball from sourceforge
## mv /usr/local/Cellar/gle/gle-4.3 /usr/local/Cellar/gle/4.3.0
## brew link gle