Skip to content

Instantly share code, notes, and snippets.

View markuskreitzer's full-sized avatar

Markus markuskreitzer

View GitHub Profile
@markuskreitzer
markuskreitzer / .bashrc.sh
Created July 25, 2018 23:12
Hack brew to always keep a copy of your latests casks and brews on Dropbox
# Append the following to your .bashrc or file that contains your user profile:
function brew(){
case $1 in
install)
echo "Install"
/usr/local/bin/brew $*
/usr/local/bin/brew list > ~/Dropbox/new_comp/mac/brews_autolisted.txt
;;
cask)
echo "Cask"

Download All Typora Themes

Run the following commands after downloading the findlinks utility to a directory in your $PATH variable.

$ mkdir Typora_Themes
$ cd Typora_Themes/
$ for i in $(printlinks https://theme.typora.io/ theme);do echo Downloading $i;wget --content-disposition $(printlinks https://theme.typora.io$i Download);echo;echo;done
@markuskreitzer
markuskreitzer / .bashrc.md
Last active December 5, 2019 19:55
IP Info Function for BashRC

IP Info Function for bash shell loading.

The following function is used to determine a few basics about the network of the user, such as, external and internal IP addresses, subnet, the default gateway, and who's logged in. Note that the 3-liner, ext_ip_info.py is also attached to this gist.

function host_information(){
        export GATEWAY=$(netstat -nr | perl -lne 'print $1 if m/default\s+(.+?)\s+?.+?en0/g')
        export MY_EXT_IP=$(curl -s https://icanhazip.com)
        export EXT_IP_OWNER=$(python3 bin/ext_ip_info.py $MY_EXT_IP)
        export MY_INT_IP=$(nmap --iflist |perl -lne 'print "$1" if m/en0\s+\S+\s+(\S+)\/(\S+)\s+ethernet/g'|head -n1)
@markuskreitzer
markuskreitzer / catalog_files.py
Created March 30, 2021 22:45
Multithreaded File Scanner and Checksum Generator
import hashlib
import multiprocessing
import os
import queue
import threading
import time
from queue import Queue
from typing import Any, TextIO, Dict
import yaml

Radar Refernces

Chapter 6 (Harrison)

  1. B.R. Mahafza. Radar Systems Analysis and Design Using Matlab 3rd Ed.
  2. S. Parl . A new method of calculating the generalized Q function. IEEE Transations on Info Theory 32:121-124, Jan 1980
  3. S. M. Kay. Fundamentals of Radar Signal Processing. 2005
  4. P.E. Cantrell and A. K. Ojha. Comparison of generalized Q-function algorithms. IEEE Transactions on Information Theory, 33(4):591-596, July 1987.
@markuskreitzer
markuskreitzer / parse_itunes_playlist.py
Created August 17, 2021 17:27
This program will use requests and beautiful soup to parse out the name and artist from a publicly visible Apple Music playlist. This is useful to take the data from this program to create playlists for Spotify, Youtube and others. Would love to find something that will take this information and generate a Youtube playlist that's easier to share…
#!/usr/bin/env python3
"""
Author: elec3647
This program will use requests and beautiful soup to parse out the name and artist from a publicly visible Apple Music playlist.
This is useful to take the data from this program to create playlists for Spotify, Youtube and others. Would love to find something that
will take this information and generate a Youtube playlist that's easier to share with folks that do not have a music streaming subscription.
"""
import re
@markuskreitzer
markuskreitzer / github2gitea.sh
Created October 26, 2021 00:40
Migrate all Github Repos to a self-hosted Gitea server
#!/bin/bash
# Adapted from Nicolas Boyer by elec3647
# Original post: https://dev.to/nicolasboyer/migrate-all-of-your-repos-from-github-to-gitea-3fk
# Changelog:
# 1. Added ability to pull a user's personal repos or organization.
# 2. Updated `sed` command to work on Linux.
# TODO: Add some logic to pick between org or user.
# TODO: Give ownership to org in Gitea if pulling org.
GITHUB_USERNAME=""
@markuskreitzer
markuskreitzer / find_dups.py
Created December 5, 2022 03:10
Find Duplicate Files Fast!
#!/usr/bin/env python3
from pathlib import Path
import sys
import hashlib
my_path = Path(sys.argv[1])
b = {}
def filehash(filename: Path):
with filename.open("rb") as f:
@markuskreitzer
markuskreitzer / README.md
Created July 30, 2018 16:15
How to connect a Raspberry Pi to a WPA2 Enterprise Network

How to connect a Raspberry Pi to a WPA2 Enterprise Network

tags: Auburn, Auburn University, WPA2, WPA2 Enterprise

Auburn University is gracious enough to provide instructions to Ubuntu users on how to connect their hosts to the Auburn University WiFi Network.

Many Universities use WPA2 Enterprise authentication on their networks. This allow you to track WHO is connected where and have granular control over who's able to access the WiFi network.

For tinkerers and experimenters with Raspberry Pi, Particle Photon, and other embedded systems, this poses a problem because many simplier IoT devices do not support WPA2 Enterprise natively or not without some hassle.

Raspbian Jesse and earlier will display a WPA2 Enterprise network from its dropdown list, but it will be greyed out. The workaround is to manually connect to it: