Skip to content

Instantly share code, notes, and snippets.

View Strykar's full-sized avatar
💭
What is Bash?

Avinash H. Duduskar Strykar

💭
What is Bash?
  • India
View GitHub Profile
@Strykar
Strykar / orphans.hook
Last active March 27, 2024 05:33
Pacman post transaction hook to list/remove orphaned packages
[Trigger]
Operation = Install
Operation = Upgrade
Operation = Remove
Type = Package
Target = *
[Action]
Description = Searching for orphaned packages...
When = PostTransaction
@Strykar
Strykar / gist:888cd5efc073b5e92901a4ac9aec41a2
Created January 1, 2024 11:49
AuthnTrend ATKeyPro on Linux
$ sudo dmesg (snipped)
[ 7662.206806] usb 2-1.8.2: New USB device found, idVendor=31bb, idProduct=0622, bcdDevice= 1.00
[ 7662.206814] usb 2-1.8.2: New USB device strings: Mfr=2, Product=30, SerialNumber=xx
[ 7662.206818] usb 2-1.8.2: Product: ATKey.Pro-01xxxxxx
[ 7662.206821] usb 2-1.8.2: Manufacturer: AuthenTrend Technology Inc.
[ 7662.206824] usb 2-1.8.2: SerialNumber: 41544B45-0xxx-xxxx-xxxx-000001xxxxx
[ 7662.209307] hid-generic 0003:31BB:0622.0006: hiddev97,hidraw5: USB HID v2.00 Device [AuthenTrend Technology Inc. ATKey.Pro-01xxxxxx] on usb-0000:00:1d.0-1.8.2/input0
[ 7662.211121] hid-generic 0003:31BB:0622.0007: hiddev98,hidraw6: USB HID v2.00 Device [AuthenTrend Technology Inc. ATKey.Pro-01xxxxxx] on usb-0000:00:1d.0-1.8.2/input1
$ lsusb
@Strykar
Strykar / infnoise_info.txt
Last active December 5, 2023 16:37
Leetronics Infnoise info
$ lsusb
Bus 002 Device 013: ID 0403:6015 Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)
$ dmesg
[ 2624.100019] usb 2-1.8.1: new full-speed USB device number 13 using ehci-pci
[ 2624.206780] usb 2-1.8.1: New USB device found, idVendor=0403, idProduct=6015, bcdDevice=10.00
[ 2624.206786] usb 2-1.8.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2624.206788] usb 2-1.8.1: Product: Infinite Noise TRNG
[ 2624.206789] usb 2-1.8.1: Manufacturer: 13-37.org
[ 2624.206790] usb 2-1.8.1: SerialNumber: 1337-EXXXXXXB
@Strykar
Strykar / infnoise_openssl.txt
Created December 5, 2023 16:34
Infnoise OpenSSL engine test
$ openssl engine
Infnoise engine loaded.
(dynamic) Dynamic engine loading support
(infnoise) RNG engine using the infnoise TRNG
$ time openssl genrsa 4096
Infnoise engine loaded.
-----BEGIN PRIVATE KEY-----
MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQDQ6O8HFWoBtXei
NnSP4WRFC1HAvI56ikf8KsrxQroP4XAmNiZ5R5fzl7H++Yb9UzZEAsMHszgKw29J
@Strykar
Strykar / selectiontobrowser.sh
Created December 3, 2023 08:58
Open URLs from Kitty terminal in a browser on Ctrl + Shift + left click
To kitty.conf, add:
map kitty_mod+o pass_selection_to_program ~/.bin/selectiontobrowser.sh
$ cat ~/.bin/selectiontobrowser.sh
#!/bin/bash
URL="http://www.google.com/search?q="
PRE_FORMAT_QUERY=$1
QUERY="${PRE_FORMAT_QUERY// /+}"
@Strykar
Strykar / upgrade_livepeer.sh
Last active October 16, 2023 11:13
Upgrade Livepeer Go binaries. Run as: $ upgrade_livepeer.sh 4efbda6d5e6586e7eb1e6ccbd526da65cdbe2e4e27a01cb76b1f2893fe790fdb
#!/bin/bash
# Download, extract and update Livepeer binary from Github to a pre-existing directory you set below
# It assumes you have extracted the previous livpeer tar.gz in it and run livepeer from the same directory
# Not intended to be run as root
#
# Expects bash, jq, curl, grep, sed, sha256sum and tar to be installed, usually available even on embedded systems
# Windows Subsystem for Linux (WSL) or Cygwin should provide every utility on Windows
# shellcheck disable=SC2015
set -euf -o pipefail
@Strykar
Strykar / arch-audit.hook
Created November 7, 2019 06:08
Pacman post transaction hook to list vulnerable packages base on Arch CVE
[Trigger]
Operation = Install
Operation = Upgrade
Operation = Remove
Type = Package
Target = *
[Action]
#!/usr/bin/env python3
import sys
import dns.resolver
def resolve_ips(domain, resolver):
ips = []
try:
ips += [str(rdata) for rdata in resolver.resolve(domain, 'A')]
except (dns.resolver.NoAnswer, dns.resolver.Timeout):
IgnorePath '/etc/ld.so.cache' # "File containing an ordered list of libraries found in the directories specified in /etc/ld.so.conf, as well as those found in the trusted directories."
IgnorePath '/usr/share/info/dir'
IgnorePath '/var/lib/logrotate.status'
IgnorePath '/var/lib/upower/history-*.dat'
IgnorePath '/etc/udev/hwdb.bin' # https://www.freedesktop.org/software/systemd/man/hwdb.html
IgnorePath '/usr/lib/udev/hwdb.bin' # https://www.freedesktop.org/software/systemd/man/hwdb.html
IgnorePath '/usr/lib/locale/locale-archive'
IgnorePath '/etc/gconf/gconf.xml.defaults/%gconf-tree.xml'
IgnorePath '/var/lib/systemd/catalog/database' # Message catalog cache
IgnorePath '/var/lib/systemd/coredump/core.*.lz4' # Core dumps
@Strykar
Strykar / update_sqm.sh
Last active January 23, 2023 02:23
Update SQM limits in openwrt 4 times a day
#!/bin/sh
# v0.1 Avinash H. Duduskar <strykar@live.com>
# This adjusts OpenWRT SQM settings by re-calculating up/down bandwidth
# Needs the Speedtest.net CLI binary - https://www.speedtest.net/apps/cli
# Call this script every 4 or 6 hours via cron
set -euf -o pipefail
_sqm_int="queue" # Your actual wan interface: ifstatus wan | grep -e l3_device
_pul="90" # Percentage of wan upload speed to set, 90-95 is good
_pdl="95" # Percentage of wan download speed to set, 90-95 is good