Skip to content

Instantly share code, notes, and snippets.

View chrisdiana's full-sized avatar

Chris Diana chrisdiana

View GitHub Profile
@chrisdiana
chrisdiana / MacBook-Debian-Live-USB.md
Last active July 12, 2023 15:42
MacBook Debian Live USB w/ Persistence

MacBook Debian Live USB w/ Persistence

  1. Download Debian ISO
  2. Modify the ISO to use persistence volume instead:
LANG=C sed 's/splash quiet/persistence /;s/quiet splash/persistence /' \
    </debian-live-10.0.0-amd64-mate.iso \
    >/debian-live-10.0.0-amd64-mate-persist.iso
@chrisdiana
chrisdiana / airpods-ubuntu.md
Created March 31, 2023 13:42
Fix Airpods on Ubuntu 22

Update and install pulseaudio

sudo apt update
sudo apt install pulseaudio-module-bluetooth

Add this to /etc/bluetooth/main.conf

ControllerMode = bredr
@chrisdiana
chrisdiana / mosh-macos.md
Last active February 1, 2024 06:11
Getting mosh server running on macOS Catalina

Running into this error message when trying to run a mosh server on macOS Catalina? The steps below should solve the problem which is most likely either a $PATH and/or firewall issues.

command not found: mosh-server
Connection to X.X.X.X closed.
/usr/local/bin/mosh: Did not find mosh server startup message. (Have you installed mosh on your server?)

1. Install Mosh

@chrisdiana
chrisdiana / opz-cheatsheet.md
Last active March 29, 2024 01:25
OP-Z Cheatsheet

OP-Z Cheatsheet

General

  • Play: Press Play
  • Stop: Press Stop
  • Sequence: Hold Trig + key
  • Sequence v2: Hold Rec + keys
  • Live Record: Hold Rec + Play + key/Play
  • Stop Recording: Press Rec
@chrisdiana
chrisdiana / arch-chromebook.md
Last active September 23, 2023 20:17
Arch Linux on Chromebook Flip C100P

Arch Linux on Chromebook Flip C100P

The ASUS Chromebook Flip C100P (veyron_minnie) is the world's first 10" convertible Chromebook with a full metal chassis, so a user can go from laptop to tablet form factor in a snap. The ASUS Chromebook Flip is powered by a Rockchip quad-core processor with 2GB RAM for incredible performance.

It has a 10-finger multi-touch screen, with a comfortable wide key-pitch keyboard and up to 8 hours battery life for all-day mobile use. The connectivity with dual-band WiFi 802.11ac & BT4.0 support can also provide up to 3 times the speed of 802.11n for faster data transfer. Carved from a single block of aluminum for a seamless design, the ASUS Chromebook Flip is not only beautiful, but durable, too.

These instructions will create a dual-booting environment where you can switch between booting Arch Linux ARM and the stock ChromeOS. No changes are made to the internal eMMC drive, and your new Arch Linux ARM install will run completely from external storage. This is the recommen

@chrisdiana
chrisdiana / export-cognito-users.sh
Last active March 18, 2024 09:38
Export AWS Cognito User Pool
# Export as Text Table
aws --region XXXXXXXXX cognito-idp list-users --user-pool-id XXXXXXXXXXXXX --output table > ~/users.txt
# Export as JSON
aws --region XXXXXXXXX cognito-idp list-users --user-pool-id XXXXXXXXXXXXX --output json > ~/users.json
# Export User Pool with more than 60 users (pagination)
aws --region XXXXXXXXX cognito-idp list-users --user-pool-id XXXXXXXXXXXXX --pagination-token INCREDIBLYLONGSTRINGHERE --output json > ~/users-2.json
@chrisdiana
chrisdiana / reset.css
Created June 2, 2017 17:03
Tiny CSS Resets
/************* Method #1 ***************/
html, body, h1, h2, h3, h4, h5, h6, p, ol, ul, li, dl, dt, dd, blockquote, address {
margin: 0;
padding: 0;
}
/************* Method #2 ***************/
html, body, div, span, applet, object, iframe,
@chrisdiana
chrisdiana / footer.js
Last active January 28, 2021 03:42
Dynamically add footer to jQuery Datatable
@chrisdiana
chrisdiana / size.py
Created May 23, 2016 00:05
Check file size in Python
SUFFIXES = {1000: ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
1024: ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']}
def approximate_size(size, a_kilobyte_is_1024_bytes=True):
'''Convert a file size to human-readable form.
Keyword arguments:
size -- file size in bytes
a_kilobyte_is_1024_bytes -- if True (default), use multiples of 1024
if False, use multiples of 1000
@chrisdiana
chrisdiana / kali-usb.md
Last active March 15, 2019 15:25
Kali with USB Persistence

Kali USB Persistence

  1. Partition USB to 3 sections (KaliLinux, Persistence, USBStorage)

  2. Run Mac Linux USB Loader for KaliLinux partition and install with iso

  3. In KaliLinux partition, set 'efi/boot/enterprise.cfg' to this:

entry Kali