Skip to content

Instantly share code, notes, and snippets.

Avatar

Tyler Estes estysdesu

View GitHub Profile
@estysdesu
estysdesu / pyLearn.md
Last active May 5, 2020
[Python: Learning Materials] #python #study #learn
View pyLearn.md

Python 3 Learning Materials

Installing

  1. I would recommend skipping installing Python on your machine for now. Instead, I would start with something like Google Colab. It's linked to your Google account and Google Drive and they have a generous free tier. This is an excellent environment for first learning Python in and similar to a Jupyter Lab/Notebook environment that you will likely use in the future at some point.
  2. After using Google Colab for some time, Python can be installed multiple ways. My recommendations:
@estysdesu
estysdesu / swapfile.sh
Last active May 16, 2020
[dd: Write to Disk/Create Swapfile] #dd #pv #status #progress #swapfile #swap
View swapfile.sh
#!/usr/bin/env sh
dd status=progress if=/dev/zero of=/swapfile status=progress bs=1024 count=$[(1024**2)*4] && sync # 4G
chmod 0600 /swapfile
mkswap -L swap /swapfile
swapon /swapfile
@estysdesu
estysdesu / maxlen.py
Created Apr 9, 2020
[Python: Length in Second Dimension of List] #2d #list
View maxlen.py
from typing import List
# max_len determines the maximum length in the second dimension of Python list
def max_len(items: List) -> int:
maxLen = 0
for item in items:
if (itemLen := len(item)) > maxLen:
maxLen = itemLen
return maxLen
@estysdesu
estysdesu / histExpan.sh
Created Mar 25, 2020
[Bash: History Expansion] #bash #hist #!!
View histExpan.sh
man -P 'less -p ^HISTORY\ EXPANSION' bash
##### GLOBS #####
!^ # first argument
!$ # last argument
!* # all arguments
!:2 # second argument
!:2-3 # second to third arguments
!:2-$ # second to last arguments
@estysdesu
estysdesu / plex.md
Created Jan 3, 2020
[Plex: External Mounted Media] #uid #gid #shell
View plex.md

Plex: External Mounted Media

  1. Add user to the plex group. usermod -aG plex <user>
  2. Get the plex group ID. id -g plex
  3. Mount the external media drive from root user. This allows all users of the plex group to rwx on the mounted drive. mount -o umask=0002,gid=<plexGID> /dev/sdX# /mnt/plexMedia
@estysdesu
estysdesu / offline.sh
Last active Mar 25, 2020
[Go & Rust: Offline Documentation] #go #rust
View offline.sh
#!/usr/bin/env sh
##### GO[LANG] #####
godoc & # starts a webserver so run it in the bg
open http://127.0.0.1:6060
fg %<job>
##### RUST #####
rustup doc [--std]
@estysdesu
estysdesu / readme.md
Last active Dec 31, 2019
[Debian: Apt Sources] #apt #sources
View readme.md

Update Apt Sources

  • sudo <editor> /etc/apt/sources.list (replace editor with nano, vim, or any other command line editor)
    • edit to match included sources.list file
  • apt update
  • apt upgrade
  • apt dist-upgrade
@estysdesu
estysdesu / readme.md
Last active Jan 15, 2021
[Kindle 4: Jailbreak and SSH] #kindle #ssh #jailbreak
View readme.md

Following this guide: https://wiki.mobileread.com/wiki/Kindle4NTHacking#SSH.
Using Kindle 4.1 and macOS 10.14.

Jailbreak

  1. Connect the Kindle. It should be recognized as a USB Mass Storage Device.
  2. Download the jailbreak archive
  3. Copy data.tar.gz, ENABLE_DIAGS, and diagnostic_logs to the Kindle folder.
  4. Restart the Kindle into Diagnostics Mode.
  5. Reboot the Kindle from the Diagnostics Mode. Reboot screen should show jailbroken screensaver.
@estysdesu
estysdesu / patch-edid.rb
Last active Dec 31, 2019 — forked from adaugherity/patch-edid.rb
[macOS: Patch Display Mode to RGB on macOS] #rgb #patch #display
View patch-edid.rb
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@estysdesu
estysdesu / downsample.py
Last active Mar 25, 2020
[Python: Downsample] #downsample #matlab #itertools
View downsample.py
import itertools
def downsample(x, n, phase=0, roll=False):
"""
Downsampling compatible with Matlab's implementation, plus an
additonal argument of roll to allow rolling the end of the iterable
into the beginning when phase is greater than 0.
Args:
x: iterable to be downsampled