Skip to content

Instantly share code, notes, and snippets.

Kenji Rikitake jj1bdx

Block or report user

Report or block jj1bdx

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jj1bdx
jj1bdx / search_devicename_example.sh
Created Jul 23, 2019
Using macOS diskutil output to search the device identifier for a given volume name
View search_devicename_example.sh
#!/bin/sh
# search mount point based on the device name
search_devicename () {
diskutil list -plist | \
plutil -convert json -r -o - - | \
jq -c '[.AllDisksAndPartitions[].APFSVolumes, .AllDisksAndPartitions[].Partitions] | flatten | map(select(has("VolumeName")))[] | {volume: .VolumeName?, id: .DeviceIdentifier?}' | \
jq -r --arg volname "$1" 'select(.volume == $volname) | .id?'
}
@jj1bdx
jj1bdx / macOS-fix-XQuartz-bin-path.md
Last active Jul 18, 2019
Fix XQuartz path on old macOS or OS X
View macOS-fix-XQuartz-bin-path.md

Fix XQuartz path on old macOS or OS X

Symptoms

  • Old OS X had X11 binaries under /usr/bin (and XQuartz circa 2016)
  • Modern OS X has /usr/bin protected and unmodifiable
  • XQuartz installs the files under /opt/X11/bin
  • /usr/libexec/path_helper -s puts /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin at the top of the PATH variable

A workaround

@jj1bdx
jj1bdx / dot-zlogin-stty.zsh
Created Jul 4, 2019
stty .zlogin setting (obsoleted)
View dot-zlogin-stty.zsh
# This is an stty kludge I had been using for FreeBSD,
# which is no longer required for macOS with zsh.
setopt noglob
eval `tset -s -Q -e ^H -r -I -m "dialup:?vt100"`
# tmux kludge
stty erase "^?" erase2 "^H"
setopt glob
@jj1bdx
jj1bdx / airspy-r2-hf-calibration.md
Last active Sep 5, 2019
Calibrating frequency of Airspy HF+ Dual Port/Discovery and Airspy R2/Mini
View airspy-r2-hf-calibration.md
@jj1bdx
jj1bdx / sox-macos-coreaudio.sh
Created Apr 4, 2019
sox examples for macOS coreaudio
View sox-macos-coreaudio.sh
#!/bin/sh
# equivalent to `play`
sox -t raw -esigned-integer -b16 -r 48000 -c 2 -q - -t coreaudio "default"
play --buffer=1024 -t raw -esigned-integer -b16 -r 48000 -c 2 -q -
# check macOS devices
sox -V6 -n -t coreaudio nonexistent
@jj1bdx
jj1bdx / cidr-cheat-sheet
Created Mar 25, 2019 — forked from charlesgreen/cidr-cheat-sheet
CIDR SUBNET MASK CHEATSHEET & ICMP TYPE CODES
View cidr-cheat-sheet
CIDR SUBNET MASK CHEATSHEET & ICMP TYPE CODES
https://oav.net/mirrors/cidr.html
_____________________________________________________________________________
Netmask Netmask (binary) CIDR Notes
_____________________________________________________________________________
255.255.255.255 11111111.11111111.11111111.11111111 /32 Host (single addr)
255.255.255.254 11111111.11111111.11111111.11111110 /31 Unuseable
255.255.255.252 11111111.11111111.11111111.11111100 /30 2 useable
255.255.255.248 11111111.11111111.11111111.11111000 /29 6 useable
@jj1bdx
jj1bdx / duolingo-swedish-fur-pret.txt
Last active Apr 4, 2019
Duolingo Swedish example text for Future Perfect
View duolingo-swedish-fur-pret.txt
När vi skulle åka till sjukhuset gick bilen sönder.
De skulle åka till Frankrike på semester.
Filmen skulle precis börja när allt blev svart.
När vi skulle åka upptäckte vi att bilen var stulen.
Hon gick tidigare, eftersom hon skulle träffa sin syster.
Vi skulle börja med att spela fotboll, men han hade glömt bollen hemma.
Jag hoppades att du skulle komma.
Hon skulle komma efter honom.
Mannen skulle träffa sin fru när han kom ihåg att han hade glömt hennes väska.
Han såg ut som om han skulle börja gråta.
@jj1bdx
jj1bdx / getmpx-examples.sh
Created Mar 1, 2019
Scripts to retrieve MPX (FM demodulated) output for FM broadcasting with RTL-SDR / Airspy and csdr
View getmpx-examples.sh
#!/bin/sh
# 88.1MHz (10Msps, Set 500kHz upper freq)
# CF32 IQ signal decimated to 768kHz first,
# FM decoded to real signal,
# then decimate by 4 to 192kHz CF32 output
airspy_rx -r/dev/fd/1 -p0 -f88.6 -a10000000 -t0 -g7 | \
csdr shift_addition_cc 0.05 | \
csdr fir_decimate_cc 13.028333333333 0.05 HAMMING | \
csdr fmdemod_quadri_cf | csdr fractional_decimator_ff 4
#!/bin/sh
@jj1bdx
jj1bdx / rfworld-no1-no32-tips.md
Created Feb 25, 2019
RFワールド No.1-32のキーワード
View rfworld-no1-no32-tips.md

2015年11月にRFワールド No.1 ~ No.32 を手放すことにしたときのキーワードを列挙しておいたので書いておく。

  • 920MHz ARIB STD-T108 受信距離を伸ばすにはビームアンテナで
  • 技適: TELECホームページの特定無線設備の手引書 www.telec.or.jp
  • 74AHCU04 より高速なアナログ増幅器
  • GNU radio, USRP
  • 小型アンテナ / 携帯やスマホ用
  • Time-Domain Reflectometer
  • ISA100.11a (ISA100WCI)
  • 40kHz/60kHz SDR
View keybase.md

Keybase proof

I hereby claim:

  • I am jj1bdx on github.
  • I am jj1bdx (https://keybase.io/jj1bdx) on keybase.
  • I have a public key ASDzBVChbICNAjHuZdRZp2kwSbrerCQEfsf4i1K7UmbEZQo

To claim this, I am signing this object:

You can’t perform that action at this time.