Skip to content

Instantly share code, notes, and snippets.

View texadactyl's full-sized avatar

Richard Elkins texadactyl

View GitHub Profile
@texadactyl
texadactyl / my_acer_laptop.txt
Last active September 28, 2020 20:09
my_acer_laptop
Computer: Acer Aspire 5 Laptop A515-44-R2SA
System: Host: acer Kernel: 5.8.0-19-generic x86_64 bits: 64 Desktop: Xfce 4.14.2 Distro: Ubuntu 20.10 (Groovy Gorilla)
Machine: Type: Laptop System: Acer product: Aspire A515-44 v: V1.06 serial: NXHW4AA002026002FF7600
Mobo: RO model: Calla_RN v: V1.06 serial: NBHVZ11006026002FF7600 UEFI: INSYDE v: 1.06 date: 05/13/2020
Battery: ID-1: BAT1 charge: 17.5 Wh condition: 54.6/53.0 Wh (103%)
Memory: RAM: total: 15.07 GiB used: 3.07 GiB (20.4%)
Array-1: capacity: 64 GiB slots: 2 EC: None
Device-1: DIMM 0 size: 8 GiB speed: 2667 MT/s
@texadactyl
texadactyl / hd127688.py
Created May 16, 2019 16:19
Python Program for Estimating the Habitable Zone
'''
Habitable Zone estimation
Reference: https://exoplanetarchive.ipac.caltech.edu/docs/poet_calculations.html
'''
import numpy as np
R_SUN = 696342.0 # km
T_SUN = 5788.0 # Kelvin
@texadactyl
texadactyl / hexdump.py
Last active June 11, 2018 16:56
For a given Python object, create a labeled dump with hex on the left and ASCII on the right.
"""
Cheap-o-cigar hexdump, somewhat cribbed from somewhere that I cannot recall.
2018-06-10 texadactyl Version 1
"""
import struct
def _bytes2ints(arg_bytes):
ilist = []
for i in range(0, len(arg_bytes)):
ilist.append(int(arg_bytes[i]))
#!/bin/bash
#=============================================================
# Clean up a text file for importing into a LibreOffice Word Processor
# document (file extension = odt).
# Input: $1 (dirty text file)
# Output: $2 (LibreOffice Writer ODT file)
#
# Version 2 on 2018-06-15 by richard.elkins@gmail.com
# Amend and/or distribute as you wish.
#
import sys
import decimal
from math import factorial
usage = "\nUsage: python ntaxa.py {# of taxa}\n"
if __name__ == '__main__':
ntaxa = 0
if len(sys.argv) == 2:
ntaxa = int( sys.argv[1] )
@texadactyl
texadactyl / getlogs.sh
Last active August 27, 2016 10:06
Create a tar.gz file (gzipped tar archive) containing Linux distribution system logs for use in a subsequent investigation. An additional subdirectory is created containing information about the Linux distribution release and the resident hardware.
MYSELF=`basename $0`
ARGC=$#
#--- Validate command line
if [ $ARGC -ne 1 ] || [ -z $1 ]; then
echo
echo -e "\tUsage:\t"$MYSELF"\t{FILENAME.tar.gz}"
echo
exit 86
fi
TAROUTFILE=${1}.tar.gz
@texadactyl
texadactyl / file2pkg.sh
Last active August 28, 2016 19:30
Given an installed Ubuntu file, what Ubuntu package does the file belong to?
MYSELF=`basename $0`
ARG=$1
ARGC=$#
if [ $ARGC -lt 1 ] || [ -z $ARG ]; then
echo
echo -e "\tUsage:\t"$MYSELF"\t{Installed File(s)}"
echo
exit 86
fi