Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Diana chrisdiana

View GitHub Profile
@chrisdiana
chrisdiana / airpods-ubuntu.md
Created March 31, 2023 13:42
Fix Airpods on Ubuntu 22
View airpods-ubuntu.md

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 April 21, 2023 17:38
Getting mosh server running on macOS Catalina
View mosh-macos.md

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 February 6, 2023 12:17
OP-Z Cheatsheet
View opz-cheatsheet.md

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 April 8, 2023 03:31
Arch Linux on Chromebook Flip C100P
View arch-chromebook.md

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 May 21, 2023 10:27
Export AWS Cognito User Pool
View export-cognito-users.sh
# 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
View reset.css
/************* 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
View footer.js
@chrisdiana
chrisdiana / size.py
Created May 23, 2016 00:05
Check file size in Python
View size.py
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
View kali-usb.md

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
@chrisdiana
chrisdiana / gist:f0777eb35a5adece8422
Last active November 2, 2017 16:20
Reset GIT to commit force push
View gist:f0777eb35a5adece8422
# Local reset:
git reset --hard fj5789sufj
# Remote reset:
git push -f origin fj5789sufj:master