View on GitHub

Quorten Blog 1

First blog for all Quorten's blog-like writings

SDXC I? What’s that? Looks like it’s just UHS-I.

But, this note is particularly interesting. The performance of high-performance cards is generally better for sequential access and may not provide good random access performance. Also, some of the slower cards may have better random access performance, making them better for smartphones, whereas sequential access matches the pattern commonly used by cameras and camcorders.

Well, good to know. Good to know as to the reason why super-high capacity cards are generally not used with Raspberry Pi.

20170706/https://en.wikipedia.org/wiki/Secure_Digital
20170706/http://static.usenix.org/events/fast/tech/full_papers/Kim.pdf

Important! Ansible notes. VMWare notes.

How do you use Ansible to control VMs in a VMWare vCenter? Use the vmware_guest and vmware_guest_snapshot modules. These are the modules that use the official Python SDK for connecting with the vCenter and they have the features. The alternative, vsphere_guest, uses an API that was written by an independent developer and “got there first,” but it is not longer supported. Although the vsphere_guest module makes some operations more convenient than others, pushing source code modifications upstream to the vmware_guest module is a good approach.

NOTE: My search as recorded here is somewhat condensed.

20170706/http://docs.ansible.com/ansible/vmware_guest_snapshot_module.html
20170706/http://docs.ansible.com/ansible/vsphere_guest_module.html

Having trouble with Ansible using /usr/bin/python when you want to use Python from a virtualenv? Here is the solution. Use an inventory file as follows:

[localhost]
localhost ansible_python_interpreter=python

20170706/DuckDuckGo ansible /usr/bin/python local
20170706/https://www.zigg.com/2014/using-virtualenv-python-local-ansible.html

Read on →

What is Jinja2?

2017-06-16

Categories: ansible  
Tags: ansible  

Ansible notes.

What is this whole Jinja2 thing? Here is the documentation on how to use Jinja2 to create templates, so that you don’t make mistakes when you are authoring one.

  • A Jinja is also Japanese for a Shinto temple. So why the name Jinja? Is it because this system is so “transformative”?

20170616/https://en.wikipedia.org/wiki/Jinja_(template_engine)
20170616/http://jinja.pocoo.org
20170616/http://jinja.pocoo.org/docs/2.9/
20170616/http://jinja.pocoo.org/docs/2.9/templates/

Yes, yes, yes. Battery backup system notes. Server notes. As I have stated in my previous notes, there is no shortage of lithium-ion battery backup packs that can be used to power network switch and router devices. But those are only useful in places that have frequent power outages. For our place that only has a power outage of 2 hours once every 1-2 years on average, that is not going to be an efficient system. No, we need a system that instead runs off of alkaline batteries. So let’s see. Is there such a system you can buy on the Internet? The sort answer appears to be no. If you want to get a good system that works to your precise specifications, you should build one yourself.

20170611/DuckDuckGo D battery ac dc backup power supply

Build a battery backup out of 2 x AA NiMh rechargeable batteries for an alarm clock. The circuit uses a DC input jack.

  • Again, I reiterate, because this is important! I searched for this and found it, that means it’s important!

  • NiCd and NiMh batteries can be charged in series. However, make sure you properly limit and regulate the voltage if you do this.

20170611/https://www.allaboutcircuits.com/projects/battery-backup-power-supplies/
20170611/DuckDuckGo build AA DC battery backup power
20170611/https://raspberrypi.stackexchange.com/questions/1360/how-do-i-build-a-ups-like-battery-backup-system

Read on →

How do you find out when a particular Git commit was merged into a branch? Use this tool.

20170609/https://github.com/mhagger/git-when-merged

How do you find out what release branches a Git commit is part of? Use this command:

git tag --contains <commit>
# Or this:
git describe --contains <commit>

20170609/https://stackoverflow.com/questions/1474115/find-tag-information-for-a-given-commit/7561599#7561599

Do DNS

# Weird system behavior?  First stop this before continuing.
systemctl stop NetworkManager

MAC1=00:11:22:62:4c:5a
MAC2=00:11:22:62:4c:5b
DNS_PROM=my-prometheus
DNS_GRAF=my-grafana

ip link add link eno16780032 address $MAC1 name veth0 type macvlan
ip link add link eno16780032 address $MAC2 name veth1 type macvlan
dhclient -1 -pf /var/run/dhclient-veth0.pid -H $DNS_PROM veth0
dhclient -1 -pf /var/run/dhclient-veth1.pid -H $DNS_GRAF veth1

# NOTE: This probably works correctly once you disable NetworkManager.
# However, I like the later solution of using only a single dhclient
# better.  (Maybe at most two if you want to run IPv6.)

# dhclient -1 -pf /var/run/dhclient-veth0.pid -H $DNS_PROM -I $DNS_PROM veth0
# dhclient -1 -pf /var/run/dhclient-veth1.pid -H $DNS_GRAF -I $DNS_GRAF veth1

# Cleanup
dhclient -pf /var/run/dhclient-veth0.pid -r veth0
rm /var/run/dhclient-veth0.pid
dhclient -pf /var/run/dhclient-veth1.pid -r veth1
rm /var/run/dhclient-veth1.pid
ip link del veth0
ip link del veth1

Read on →

Python notes.

Create a dict using a generator in Python.

20170530/DuckDuckGo python dict generator
20170530/https://stackoverflow.com/questions/1747817/create-a-dictionary-with-list-comprehension-in-python#1747827

20170530/DuckDuckGo python bool base class
20170530/https://stackoverflow.com/questions/2233786/overriding-bool-for-custom-class#2233801
20170530/https://stackoverflow.com/questions/8205558/defining-boolness-of-a-class-in-python

Read on →