Skip to content

Instantly share code, notes, and snippets.

dragon788 dragon788

  • Midwest, USA
Block or report user

Report or block dragon788

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dragon788
dragon788 / README.md
Last active May 11, 2019 — forked from atenni/README.md
How to permalink to a gist's raw file
View README.md

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@dragon788
dragon788 / python-awesome-dd.py
Created Apr 25, 2019
Run with `python python-awesome-dd.py help` to get usage info, I find this far more reliable than Etcher/et al for writing images
View python-awesome-dd.py
#!/usr/bin/env python
#
# Copyright (c) 2014, Mike 'Fuzzy' Partin <fuzzy@fu-manchu.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
@dragon788
dragon788 / .crypt-fix.md
Last active Mar 29, 2019
Repair "ubuntu--vg-root" not found with LUKS and LVM encryption
View .crypt-fix.md

Crypt-fix

Use this script via curl -L -O https://gist.github.com/dragon788/e777ba64d373210e4f6306ad40ee0e80/raw/a86f3d05fb56feb6ef01fc2d61a4feb2fd82b281/crypt-fix.sh and sudo bash ./crypt-fix.sh. You may need to edit the DEVICE variable to reflect your disk and partition layout (this was created on an EFI system using LUKS and LVM). It will prompt you for your disk password once to mount and discover the correct name for the encrypted volume mount and then prompt again to mount with the correct name so that the update-initramfs command succeeds with the appropriate mapping, if this wasn't done you would get a warning and your next boot would still fail.

View C:\ProgramData\VMware\VMware Workstation\config.ini
sched.mem.pshare.enable = "FALSE"
mainMem.useNamedFile = "FALSE"
prefvmx.minVmMemPct = "100"
prefvmx.useRecommendedLockedMemSize = "TRUE"
mainMem.partialLazySave = "FALSE"
mainMem.partialLazyRestore = "FALSE"
priority.grabbed = "normal"
priority.ungrabbed = "normal"
#priority.grabbed = "high"
@dragon788
dragon788 / longwindedname.md
Created Nov 25, 2016
Restore rEFInd as default boot manager from Windows after updates
View longwindedname.md

After losing access to rEFInd yet again (Windows 10 Anniversary Edition), I was able to find the proper invocation of BCDEdit thanks to a helpful person on StackOverflow. None of the Microsoft documentation mentions this, but you NEED single quotes around {bootmgr} for sure if you are in the PowerShell shell, but possibly also if you are in the Command Prompt. This allowed me to add a new entry for rEFInd and I've had to do this multiple times so I know it works on Windows 10.

bcdedit /set {bootmgr} path \EFI\refind\refind_x64.efi 

becomes

bcdedit /set '{bootmgr}' path \EFI\refind\refind_x64.efi
@dragon788
dragon788 / powerfile.py
Created Oct 20, 2018
Powerfile C200 Python from Google groups
View powerfile.py
from pywin.mfc import dialog, window, activex
import win32ui, win32uiole, win32con, win32file
import os, sys, win32api, glob, time, pywintypes
from win32com.client import gencache
import discinfo
# c200
c200_typelib = '{E9A61682-5978-11D3-B313-00C04F7654DB}'
c200_clsid = '{61A3F5A5-594F-11D3-B313-00C04F7654DB}'
View HumanOps-mantra.rst
  1. Humans build and fix systems.
  2. Humans get tired and stressed, they feel happy and sad.
  3. Systems don't have feelings yet. They only have SLAs.
  4. Humans need to switch off and on again.
  5. The wellbeing of human operators impacts the reliability of systems.
  6. Alert Fatigue == Human Fatigue
  7. Automate as much as possible, escalate to a human as a last resort.
  8. Document everything. Train everyone. Save time.
  9. Kill the shame game.
  10. Human issues are system issues.
@dragon788
dragon788 / build.sh
Created Feb 16, 2018 — forked from Forst/build.sh
Ubuntu ISO with preseed.cfg generation script
View build.sh
#!/bin/bash
## FORSTWOOF UBUNTU PRESEED :: BUILD SCRIPT
# Quit on first error
set -e
# Temporary directory for the build
TMP="/var/tmp/ubuntu-build"
@dragon788
dragon788 / secure-wipe-nvme.md
Created Dec 6, 2017
Securely wiping NVMe SSD drives using Linux (Ubuntu/Debian shown but others are supported)
View secure-wipe-nvme.md

In order to securely wipe an NVME drive you can use the nvme-cli package that provides the nvme command nvme only exists in the root path so you have to use sudo nvme.

For Debian you need to add jessie-backports (on jessie) and it may be in the newer version default repos. For Ubuntu it should be available in the default repos from Xenial onwards, there may be a PPA if you need it on earlier versions.

You can find your devices with sudo nvme list and securely format with sudo nvme /dev/nvme0n1 --ses=1. You can also explicitly add a namespace but I haven't seen or setup a drive with multiple yet.

@dragon788
dragon788 / chefdk-install.md
Created Nov 13, 2017
Easily install the latest stable chefdk in one lines
View chefdk-install.md

Why isn't this on their site instead of links to downloads?????

Omit the -c stable or change it to -c current if you want the latest

curl -L https://omnitruck.chef.io/install.sh | sudo bash -s -- -c stable -P chefdk

You can’t perform that action at this time.