Skip to content

Instantly share code, notes, and snippets.

@chriswayg
chriswayg / Packer_crash_when_cancelling_Proxmox_builder.md
Created August 27, 2019 17:23
Packer crash when cancelling Proxmox builder
  • debian-10.0.0-x86_64-proxmox.json
{
    "description": "Build Debian 10.0 (buster) x86_64 Proxmox template",
    "variables": {
        "prox_vm_id": "33000",
        "prox_vm_name": "deb10-packer",
        "prox_vm_description": "Debian 10.0 x86_64 Proxmox template built with packer",
        "vm_hostname": "debian10",
        "prox_username": "root@pam",
@chriswayg
chriswayg / apfs-grml.sh
Last active January 6, 2020 11:50
Build APFS fuse on GRML
#!/bin/bash
# mount APFS partition example
# sudo mkdir -pv /media/macos && sudo apfs-fuse -o allow_other /dev/sda2 /media/macos
sudo apt-get -y install build-essential libfuse3-3 libfuse-dev libicu-dev libbz2-dev cmake clang libattr1-dev libz-dev libfuse3-dev
mkdir -pv /home/grml/build
cd /home/grml/build
@chriswayg
chriswayg / macserial-grml.sh
Last active January 6, 2020 18:17
Compile macserial on grml using build-linux.tool
#!/bin/bash
sudo apt-get -y install build-essential
mkdir -pv /home/grml/build
cd /home/grml/build
git clone https://github.com/chriswayg/MacInfoPkg.git
cd /home/grml/build/MacInfoPkg/macserial/
./build-linux.tool
@chriswayg
chriswayg / ansible-role-test.sh
Last active April 28, 2020 11:35 — forked from geerlingguy/ansible-role-test.sh
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)

Create Yosemite.iso from OS X App Store installer

If you prefer to make a bootable dvd, you can do it this way:

After downloading the full Yosemite installer app from the Mac App Store, run these 14 commands in Terminal to create a Yosemite.iso file and then burn it to a dual layer DVD with Disk Utility. You may then boot up from it by holding the option key down and then install Yosemite.

  • This worked on Mojave in 2020-06
  • Location of archived installer: /Volumes/MEDIA_DB4/macOS Installers 2019/Install OS X Yosemite.app
@chriswayg
chriswayg / CC-Offline-Package-Generator.md
Last active July 7, 2020 15:05 — forked from jorisguex/ccdl.command
CC Offline Package Generator v0.1.2 (macOS only)
@chriswayg
chriswayg / Python-conda-30sec-install.md
Last active July 17, 2020 06:43
Install conda Python on macOS in 30 seconds - Oneliner that downloads, installs and activates Miniconda Python 2.7 or 3.x

Install conda Python on macOS in 30 seconds

Oneliner that downloads, installs and activates Miniconda Python 2.7 or 3.x

  • at 50 Mbps on a recent Mac, the 50 MB download including install takes about 30 seconds ;-)

Quick Miniconda install

  • Usage: copy one of the two following lines and paste it into your terminal
Python 3.x
@chriswayg
chriswayg / pythonlister.sh
Last active July 23, 2020 06:12
Find and list most installed Python versions on a macOS system
#!/bin/bash
set -o errexit
# pythonlister version 0.3
# License: MIT - (c) 2020 ChrisWayg
# Run the script directly
# /bin/bash -c "$(curl -fsSL https://gist.githubusercontent.com/chriswayg/ee97606a4dc93a4cdacff90915d5d1e5/raw/pythonlister.sh)"
# Download, install with sudo in /usr/local/ and run the script
# f=/usr/local/bin/pythonlister; sudo mkdir -p /usr/local/bin && sudo curl -sSLo $f https://gist.githubusercontent.com/chriswayg/ee97606a4dc93a4cdacff90915d5d1e5/raw/pythonlister.sh && sudo chmod +x $f && pythonlister
@chriswayg
chriswayg / Python-30sec-install.md
Last active August 28, 2021 07:34
Install Python on macOS in 30 seconds - Oneliner that downloads, installs and activates Python 2.7 or 3.x from Python.org

Install Python on macOS in 30 seconds

Install Python on OS X / macOS 10.9 - 10.15+ (64 bit)

  • Catalina, Mojave, High Sierra, Sierra, El Capitan, Yosemite or Mavericks
  • Usage: copy one of the three following lines and paste it into your terminal. Type the sudo password.
Python 3.8
sudo true; v=3.8.4; f=python-${v}-macosx10.9.pkg; cd $TMPDIR; { curl -LfOsS https://www.python.org/ftp/python/${v}/$f ; cd ~-; } && sudo installer -pkg $TMPDIR/$f -target / &&  v=$(echo "$v"|cut -d'.' -f1-2); "/Applications/Python ${v}/Update Shell Profile.command" && . ~/.bash_profile
https://www.reddit.com/r/tailswiki/wiki/index/internal-hd-install
1) boot from DVD/USB and set a password, then open a terminal
a) sudo gedit /usr/lib/python2.7/dist-packages/tails_installer/creator.py
-> search for "Only pay attention to USB and SDIO devices"
-> comment out next 7 lines (until and including "continue") by prepending a "#" (a changing font color means you did it right)
b) sudo /usr/bin/python -tt /usr/lib/tails_installer/tails-installer -u -n --clone -P -m -x
-> choose your hdd and create the Tails device
c) mount "Tails" partition from just created device/drive using Applications | Utilities | Disks
d) gedit /media/amnesia/Tails/syslinux/live*.cfg