Skip to content

Instantly share code, notes, and snippets.

View james-see's full-sized avatar
🍀
make your own luck

JC james-see

🍀
make your own luck
View GitHub Profile
@james-see
james-see / installme.sh
Last active July 2, 2022 04:16
mac os installer for vmware install iso
#!/bin/bash
## note: change version to whatever comes back for softwareupdate --list-full-installers
softwareupdate --fetch-full-installer --full-installer-version 12.4
## create tmp drive
hdiutil create -o /tmp/MacMonterey -size 12500m -volname MacMonterey -layout SPUD -fs HFS+J
## mount it
hdiutil attach /tmp/MacMonterey.dmg -noverify -mountpoint /Volumes/MacMonterey
## install to volume
sudo /Applications/Install\ macOS\ Monterey.app/Contents/Resources/createinstallmedia --volume /Volumes/MacMonterey --nointeraction
According to this article: https://kb.parallels.com/en/128842
create a config.ini and add to the package folder then run.
@james-see
james-see / zipme.py
Created May 28, 2022 23:46
zip files in a folder with status bar python
def package_tar(configpath="~/MATERIALS/", filename="compressed.zip") -> None:
"""zips up the container tars
Args:
configpath (str, optional): _description_. Defaults to "~/MATERIALS/".
filename (str, optional): _description_. Defaults to "compressed.zip".
"""
import zipfile
import shutil
input_dir = Path(configpath)
@james-see
james-see / ip4check.py
Created May 13, 2022 17:18
check for ip4 in python
import re
class IsIPv4Address:
# noinspection PyPep8Naming
@classmethod
def is_IPv4_address(cls, input_str: str) -> bool:
pattern = r"\b((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|$)){4}\b"
if re.fullmatch(pattern, input_str):
return True
@james-see
james-see / profanity.txt
Created April 27, 2022 14:49
list of profanities for profanity filtering input
4r5e
5h1t
5hit
a55
anal
anus
ar5e
arrse
arse
ass
@james-see
james-see / getphones.py
Created January 19, 2022 06:47
greedy phone number parser with regex in python
def greedyphoneparse(basetext="I can haz phone number? +14126723436") -> list():
"""Very flexible phone number parser that does not require country code.
Args:
basetext (string, optional): The text to parse.
Defaults to "I can haz phone number? +14126723436".
Returns:
list: List of phonenumbers found or empty list.
"""
@james-see
james-see / retro-pie troubleshooting forget-me-not.md
Created January 17, 2022 18:20
retro pie help to get working on raspberry pi 4 and mac os

retropie stuff to not forget

installation

(coming soon)

audio troubleshooting

  1. on raspberry pi 4 the default hdmi1 is actually set as PLUGHW setting in the audio card in the interface hdmi2 is SYSDEFAULT
@james-see
james-see / getip.sh
Last active December 30, 2021 19:16
get just the bare public ip 4 address for eth0 on any VPS (tested on digital ocean and OVH Ubuntu 20.04)
ip a | grep eth0 | cut -d " " --fields=6 | sed '2q;d' | awk -F'/' '{print $1}'
# curl -L https://cutt.ly/UUYcT1r | /bin/bash
@james-see
james-see / minio-flight.sh
Created November 8, 2021 05:20
mini quickstart linux
wget https://dl.minio.io/server/minio/release/linux-amd64/minio
chmod +x minio
sudo ./minio server /minio
wget https://dl.minio.io/client/mc/release/linux-amd64/mc
chmod +x mc
./mc config host add minio http://127.0.0.1:9000 Access_key Secret_key
sudo ln -s /home/jc/Downloads/mc /usr/bin/mc
sudo ln -s /home/jc/Downloads/minio /usr/bin/minio
#### create systemd minio ####
@james-see
james-see / movingToGithub.md
Last active August 11, 2021 16:52
Moving your domain to github hosting guide

MOVING TO GITHUB HOSTING FOR YOUR DOMAIN

WHY

  1. Github hosting is free
  2. For static sites, landing pages, etc. this is the easiest way to get your presence on the web

HOW

Step 1: