Tech-oriented notes for myself and hopefully others. Likely to contain musings, pontificating and such.
Tuesday, August 7, 2018
Fun with Hyper-V .vhdx (Including "Failed to Power on with Error 'General access denied error' (0x80070005). )
#1 - Can't mount .VHD(X) files on anything other than NTFS that I have tried, not even ExFAT!
#2 - You *CAN* use a symbolic link to a root VHD in one place, say a large HDD, so that the snapshots (and hence most of the write I/O) goes somewhere else. (Smaller SSD)
C:\Users\Public\Documents\Hyper-V\Virtual hard disks>mklink ServerEval.vhdx d:\SSDRedir\ServerEval.vhdx
symbolic link created for ServerEval.vhdx <<===>> d:\SSDRedir\ServerEval.vhdx
#2b - But permissions can get lost!
https://support.microsoft.com/en-us/help/2249906/hyper-v-virtual-machine-may-not-start-and-you-receive-a-general-access has the details.
Less-than-convenient part is that you can't copy the GUID from the pop-up error, have to grab it from event viewer, in Hyper-V Worker "Admin" events. (Thanks to https://www.mcbsys.com/blog/2010/10/hyper-v-virtual-machine-failed-to-start-after-copying-vhd/)
C:\Users\Public\Documents\Hyper-V\Virtual hard disks>icacls ServerEval* /grant "NT VIRTUAL MACHINE\7990B252-E0C9-469A-BDCE-5C1D7D75285A":(F)
processed file: ServerEval_963FFB8A-87A3-42DB-B1A2-0C332FCD0107.avhdx
processed file: ServerEval_B6B9ECD7-44DA-4595-B8E0-33235B624B46.avhdx
Successfully processed 2 files; Failed processing 0 files
Tuesday, July 10, 2018
PSA for myself - don't forget rsync doesn't allow resuming by default!
Nothing like interrupting a 900G file transfer without having specified --partial. (or -P, equivalent to --partial --progress)
Sunday, July 8, 2018
Powerline Shell on MacOS Python version fix
Currently I use Powerline-shell as the necessity of a pleasant to read/understand automatic git status overrides my misgivings about running python for every new terminal instance.
Python update (via homebrew) broke powerline, as it was looking for an explicit version that no longer exists, in
/usr/local/bin/powerline-config and /usr/local/bin/powerline-daemon
There is probably a better way to do this, but I edited those two scripts so that rather than pointing to to /usr/local/opt/python/bin/python2.6 they now point to the system-wide link /usr/local/bin/python
Should be more generic/portable for a while. (At least until homebrew decides to make Python3 the default)
Tuesday, June 26, 2018
Learning Git - for real.
Edit:
TLDR: Intro to git from the author of the Pro Git book.
What a difference 7 years makes: "Has anyone been to github?", indeed.
What a difference 7 years makes: "Has anyone been to github?", indeed.
Git (noun) - a foolish or contemptible person.
Love it or hate it, it's the de-facto standard for most open-source and much closed-source development.
This is the intro to Git that I wish I had 5 years ago. Or one year ago, or even 3 months ago.
"If you're comfortable with version control, and it's a version control system that is not git, you are going hate git. When you start using it, you will hate it, because it is very very different"
Notes to call out:
- 12 verbs to do 99% of everything you'll do in git.
- (Nearly) immutable, (almost) never removes data.
- Previous gen (CVS) are are file-based delta storage. In git everything is checksummed "(c)hunks" or "blobs".
- "Very simple DB, very simple structure, complex algorithms to do interesting things"
- Working Directory = What's on your filesystem *right now*.
- "Index" = Staging.
- "git add" doesn't add a file, it adds the current content to index (to next commit), that is, when you "git add", it's a snapshot of file *when you added it*. You can add a file, delete it from Working Dir, then commit. Git-commit, by default, does not look at your working directory.
- "Master" branch - isn't anything special, just default convention.
- "HEAD is the parent of your next commit" Last known state of working dir.
- Remote: "origin" is also just default convention
- Recommends fetch-then-merge rather than pull. (I wonder if that still holds)
- Understand that clone sets up tracking branches. I recommend doing at least one first time setup of a purely local repo, then add remote(s) as tracking.
- Re-integration merges: Merge on-going changes from other branches (say, master) into your branch as you go along.
- bash completion exists! (I had to install it on MacOS I think)
===
"Git is hard: screwing up is easy, and figuring out how to fix your mistakes is fucking impossible. Git documentation has this chicken and egg problem where you can't search for how to get yourself out of a mess, unless you already know the name of the thing you need to know about in order to fix your problem."
When all else fails: http://ohshitgit.com/
Saturday, December 23, 2017
mac (home)brew command completion
Been missing this in my life:
http://davidalger.com/development/bash-completion-on-os-x-with-brew/
Found via poking at the "triton completion" command.
(Don't forget to "source ~/.bash_profile" or equivalent. .bash_profile for me on OSX 10.12.)
Wednesday, December 6, 2017
Two things that need more exposure: The heir apparent to NTP (the old codebase was a mess with many barriers to contributors, leading to many of the security issues allowing DDoS attacks)
https://www.ntpsec.org/
NTPsec is a secure, hardened, and improved implementation of Network Time Protocol derived from NTP Classic, Dave Mills’s original.
NTPsec, as its name implies, is a more secure NTP. Our goal is to deliver code that can be used with confidence in deployments with the most stringent security, availability, and assurance requirements.
Which is partly supported by the Internet Civil Engineering Institute: (icei.org)
Which leads to their "New Guard" program for mentoring younger programmers on infrastructure software: (icei.org/newguard/)
Something funny happened a few years ago. Google came out with a feature by which a user can have his or her account turned over to a third party after a certain period of inactivity, to essentially will it to someone . A few infrastructure devs set their accounts to go to me.
"Why?" I asked. "Why me instead of your co-developer, children, or spouse?"
"You", they answered, "Are the only one of us under 30".
https://www.ntpsec.org/
NTPsec is a secure, hardened, and improved implementation of Network Time Protocol derived from NTP Classic, Dave Mills’s original.
NTPsec, as its name implies, is a more secure NTP. Our goal is to deliver code that can be used with confidence in deployments with the most stringent security, availability, and assurance requirements.
Which is partly supported by the Internet Civil Engineering Institute: (icei.org)
Which leads to their "New Guard" program for mentoring younger programmers on infrastructure software: (icei.org/newguard/)
Something funny happened a few years ago. Google came out with a feature by which a user can have his or her account turned over to a third party after a certain period of inactivity, to essentially will it to someone . A few infrastructure devs set their accounts to go to me.
"Why?" I asked. "Why me instead of your co-developer, children, or spouse?"
"You", they answered, "Are the only one of us under 30".
Thursday, November 23, 2017
Glue system/util/thing I love - Pashua - Quick Scripting of Mac dialog windows.
Mac-only: This one has a soft spot in my heart as I used it many years ago for adding a menu and rudimentary password protection to Netboot Deployments. (I could netboot and deploy our custom MacOS9 ASR image in under 10 minutes over 100MBit, if I recall correctly.) To my delight, I discovered it's still being maintained!
Pashua (https://www.bluem.net/en/projects/pashua/) provides a pretty simple way of scripting dialog boxes, takes input, and send it back. Currently it has bindings for AppleScript, Shell, JavaScript for Automation (JXA), Perl, PHP, Python (even Python3!), Rexx (?!?), Ruby and Tcl.
Pashua (https://www.bluem.net/en/projects/pashua/) provides a pretty simple way of scripting dialog boxes, takes input, and send it back. Currently it has bindings for AppleScript, Shell, JavaScript for Automation (JXA), Perl, PHP, Python (even Python3!), Rexx (?!?), Ruby and Tcl.
Thursday, August 10, 2017
Brew Cask Updater
Reminder for myself, and because I think it needs more love:
Auto-updater for cask (GUI) apps in mac homebrew.
https://github.com/buo/homebrew-cask-upgrade
Auto-updater for cask (GUI) apps in mac homebrew.
https://github.com/buo/homebrew-cask-upgrade
Thursday, March 2, 2017
Compiling sysbench on WSL and SmartOS
As I noted in https://github.com/akopytov/sysbench/issues/102
SmartOS
#pkgin install automake make gcc libtool gcc49 pkg-config gmake
Windows Subsystem for Linux:
Both of these are using current from a straight "git clone https://github.com/akopytov/sysbench.git",
version is "sysbench 1.1.0-2343e4b (using bundled LuaJIT 2.1.0-beta2)". I've just tried CPU test as a quick sanity check for now.
So thank you to whoever did the configure/make scripts in such a way as to be more portable. (Probably for supporting Oracle/Solaris back in the day.)
SmartOS
( joyent_20161013T025521Z) in a native zone (base-64-lts 16.4.0), required:
#pkgin install automake make gcc libtool gcc49 pkg-config gmake
Windows Subsystem for Linux:
Current Windows 10 Pro (1607, build 14393.693).
Already had GCC installed and who knows what else, needed packages:
apt-get install autoconf libtool pkg-config libmysqlclient-dev
Already had GCC installed and who knows what else, needed packages:
apt-get install autoconf libtool pkg-config libmysqlclient-dev
version is "sysbench 1.1.0-2343e4b (using bundled LuaJIT 2.1.0-beta2)". I've just tried CPU test as a quick sanity check for now.
So thank you to whoever did the configure/make scripts in such a way as to be more portable. (Probably for supporting Oracle/Solaris back in the day.)
Monday, November 14, 2016
SmartOS native zone rename
SmartOS hostname rename:
(from Bob to Alice)
vmadm get 12345678-e0fa-c099-b6f0-ead8e357826d | grep bob
"alias": "bob",
"hostname": "bob-server",
vmadm update 12345678-e0fa-c099-b6f0-ead8e357826d hostname=alice-server
vmadm update 12345678-e0fa-c099-b6f0-ead8e357826d alias=alice
To actually rename, within the zone, edit:
/etc/nodename
/etc/hosts
/etc/hostname.[interface] (e.g. /etc/hostname.net0)
(from Bob to Alice)
vmadm get 12345678-e0fa-c099-b6f0-ead8e357826d | grep bob
"alias": "bob",
"hostname": "bob-server",
vmadm update 12345678-e0fa-c099-b6f0-ead8e357826d hostname=alice-server
vmadm update 12345678-e0fa-c099-b6f0-ead8e357826d alias=alice
To actually rename, within the zone, edit:
/etc/nodename
/etc/hosts
/etc/hostname.[interface] (e.g. /etc/hostname.net0)
Thursday, September 15, 2016
Solaris(h) OS link love
I'm picking my way through the "Solarish" and BSD world, looking for something cleaner than Linux, but with ZFS/DTRACE goodness, and has to support both OS virtualization (probably KVM) and containers. (Docker support is a bonus.) For myself and to bump those google scores up oh-so-slightly so that others might find them:
- Nice overview of SmartOS - http://churnd.net/2014/06/29/smartos-homelab-hypervisor-v3/
- The best explanation of the SmartOS global zone, and the general design architecture I've found: - https://www.perkin.org.uk/posts/smartos-and-the-global-zone.html (How come it's not in any of the documentation/intros/wikis?)
- OmniOS - looks to be the most straightforward, traditional server-os spin.
Subscribe to:
Posts (Atom)
Software List (May 2025)
Current App list. Updating because I've been doing a lot of side work w/ Windows machines recently, having to update myself of what'...
-
#1 - Can't mount .VHD(X) files on anything other than NTFS that I have tried, not even ExFAT! #2 - You *CAN* use a symbolic link to a ro...
-
Edit: TLDR: Intro to git from the author of the Pro Git book . What a difference 7 years makes: "Has anyone been to github?", inde...
