Posts

MacOS: zsh Terminal and other misc restore/configuration portability...

Image
Summary: I bought a new macbook pro and typical behavior is to use time machine to restore.  This method is perfectly acceptable 99% of the time.  Those that mess w/ kext, sudoers, and other jazz... not so much.  I originally did a time machine restore, but that brought over a mess of things that I quite frankly had forgotten about (I like to tinker) and that was unfair to my new macbook.  Needless to say, but I bricked my new macbook which led me to  Konmari my setup. Details: Then there is the portability aspect of my terminal environment that I've been so lacking.  In combination w/ Dropbox, I'm able to move this stuff around and keep things in sync much easier now. Basically restoring bash/zsh alias is a pain.  Modifying any of these things is also a hassle.  So I developed a shell script that will basically take files that exist in my Dropbox directory and symlink the original files back to Dropbox. This way I can simply run th...

Misc: Adding/Enabling a Linux user via ssh public key w/ sudo and to not require a password.

Summary: This is a very specific use case, but is helpful when working w/ cloud instance VM's that don't make use of central auth.  The following script essentially adds a user to Linux so that they can ssh into the system w/ using their ssh public key and utilize sudo if granted.  Running sudo as these users typically requires a password be set.  In this case, we are not setting a password on the account as  This script circumvents the need for users to provide a password. Details: Effectively, the script works like so: An existing sudoer/root/admin must run this script. You provide a username and the user's ssh public key. Set sudoer to true or false (or anything other than true really) customsudofile path defaults to /etc/sudoers.d/nopasswd Essentially, anything in sudoers.d path is ingested by sudoer file as an override. customsudodata is what you want to insert into the custom sudo file. Default set to allow sudo members to invoke sudo w/o a...

Misc: Amazon Fire TV Remote Home Button not working (but long press does!)

Summary: This happens to my Fire TV remotes randomly, and I'm unclear as to a specific cause.  Pressing the "Home" button no longer takes me to the home screen.  It's effectively dead, but a long press works fine.  Why?  Unsure, seems to be a bug that hasn't been flushed out by Amazon, but thankfully a post in Amazon forums by Tolga presents a possible workaround using adb. See this post on how to use/get adb and setup your fire stick to work w/ adb.   Then come back here for steps specific to this problem: Workaround: Connect to your fire stick using adb adb connect <IPAddressofYourFireStick> For example: adb connect 192.168.20.35 If successful, you should see a return of something like this: connected to <IPAddressofYourFireStick>:5555 adb shell settings --user 0 put secure user_setup_complete 1

Bash, Applescript, and Sshuttle (Python): Creating a multi-jump into the multiverse...

Image
via GIPHY Summary: Basically, I work through VPN's most of my existence.  The problem lies when I have to switch to different VPN's it disrupts my communications w/ other tools that only exist in one VPN, but not the other.  There does appear to be tools around some of these things, but I wanted something quick and dirty.  AND DIRTY it is.  This enables me to stay connected to the main VPN and cheat by sshuttle'ing through systems of access temporarily. Details: I'm using MACOS and to launch a terminal in a new window turned me on to AppleScript.  I wanted to pass two variables. 1st was basically an identifier for the end system I wanted to shuttle my traffic through. 2nd was to pass a password variable to any system inbetween that was not setup w/ my SSH public key. So I made a bash function, to call applescript to open my terminals to run what is effectively a python binary.  It works, but has several prerequisites for it to run smoothly....

Powershell/Azure: Looking for Global Reach enabled ExpressRoutes? Yeah, me too.

Summary: My colleague asked if there is a way to see in the UI whether an ER circuit is enabled for Global Reach .  After a quick check, there doesn't appear to be any obvious way to know.  So I decided to make something in powershell using the AZ module to return circuits that are Global Reach enabled and to return the data in a human readable form. Script: I'm using nothing but "Gets" so it's pretty safe to use.  Has come in handy on more than one occasion.  Anyway feel free submit feedback on gist or transform it for your use cases.

NSX: Differences of NSX-V (NSX for vSphere) and NSX-T (NSX Datacenter)

Image
While there are a lot of differences between the two underneath, the basic setup remains largely the same.  However, know that the Manager and Controllers are now combined.  You basically have a manager/controller cluster now instead.  Basically 3 VMs instead of 4.  The biggest differences start to come into play when you begin deploying components (N-VDS, logical switches, routers, etc.) after these steps. With both, to start, you deploy the NSX Manager/Controller first.  NSX-V was ova only, NSX-T Manager has both ova and qcow2 (for KVM) appliances.  Going to focus on vSphere with vCenter available. After the manager/controller node is deployed is where things diverge significantly. NSX-T: Add "Compute Manager" (as of version 2.3) vCenter 6.5+ Adding vCenter makes management overhead of adding new hosts easier since you've now effectively delegate that job to vCenter. With NSX-V this process is very similar except that NSX-V was tightly co...

PowerCLI: Upload to Content Library using PowerCLI

Summary: Basically was looking to upload an iso or ovf from my system not using the web client to content library.  Couldn't find an example to upload from my local system only to have vCenter pull it from somewhere. Details: So I took VMware's example and added "PUSH" functionality to upload from my local system to the content library.  Learned some interesting things in the process.  Mainly related to OVF uploads.  The content library service, or possibly something else, parses the OVF looking for the related files.  Then the Content Library is instructed to essentially wait for those other files to be uploaded before it closes the upload task.  Kinda interesting. Anyway, the script is powershell core based, so compatible across all platforms. Links: Pull Request My forked code Original Code