64Zbit.com
Tech is way, WAY interesting

Mechanical Watch – Bartosz Ciechanowski

Mechanical Watch In the world of modern portable devices, it may be hard to believe that merely a few decades ago the most convenient way to keep track of time was a mechanical watch. Unlike their quartz and smart siblings, mechanical watches can run without using any batteries or other electronic components. Over the course of this article I’ll explain the workings of the mechanism seen in the demonstration below. You can drag the device around to change your viewing angle, and you can use the slider to peek at what’s going on inside:

Link to the original article


Static Site Generators

The process of building a website has two parts: you provide the content, and then your CMS — WordPress, or whatever you choose to use — takes that content, combines it with your chosen theme and your chosen templates, and makes a website from it for your customers or your readers to read.

But those two parts don’t have to be done together: they can be separated from one another, and that’s what a static site generator (SSG) does.

Check this out...

Read the article at websitesetup.org


AFS, AFF and AFC Focus Modes Explained - Graham's Photography Blog & Technical Reviews

Autofocus Variations Can Ruin Your Focus Accuracy Whilst the autofocus has been improved with successive generations of the camera is still relies upon contrast detection to set the focus point. So the camera moves the lens to the point of maximum contrast and then steps forwards and backwards to get the precise point. Because of mechanical tolerances in the focus mechanism sometimes the repeatability of the focus point is questionable. I noticed some of my shots were not exactly sharp at the pinpoint area that I knew I had set the camera to when I took the shot. So I set up my DSLR focus chart used to correct the optical viewfinder to sensor calibration and shot a series of 10 images in AF single area and smallest target size. There was a noticeable shift in a lot of the images as you can see from the resulting images. Compare that to the same target where I manually set the focus point.

Link to the original article


Impressive Drone Fly-Through Video of a New Tesla Factory

This drone fly-through of Tesla's new factory in Berlin is amazing. I've never seen anything quite like this – the drone flies through cars being assembled and machinery in between cycles of stamping out parts.

Link to the original article


Archive - The Mad Ned Memo

The Mad Ned Memo covers the development of computer technology over the past 40 years to the present day, from someone who has been there through it all. Stories and commentary on the early years of the microprocessor and home computer, the gaming revolution from arcade to mobile platform, hardware and software hacking adventures, and the titanic and sometimes strange shifts in technology that we’ve seen in our lives.

Link to the original article


iPhone Screen Sizes

resolution screen sizes for iPhone

Link to the original article


Raspberry Pi Imager Secret Menu

The Raspberry Pi Imager is a great piece of software for preparing your SD cards for use with Raspberry Pis. However, if you’re setting up a number of Raspberry Pis you will find that you still need to connect a monitor, keyboard and mouse to them to complete the setup, to:

  • update the wifi ssid and password
  • change the hostname and default password
  • change localization settings

There is another, better alternative to doing those 3 steps - use the Raspberry Pi Imager secret menu.

For complete instructions


Inside look at modern web browser (part 1)

Take a deep dive into modern web browsers and see how it all works!

Inside look at modern web browser (part 1)


Rsync (Remote Sync): 20 Helpful Examples in Linux

Rsync, or Remote Sync, is a free command-line tool that lets you transfer files and directories to local and remote destinations. Rsync is used for mirroring, performing backups, or migrating data to other servers.

This tool is fast and efficient, copying only the changes from the source and offering customization options.

Follow this tutorial to learn how to use rsync with 20 command examples to cover most use-cases in Linux.

Link to the original article


How bad is the air out there? – Six Colors

Use Scriptable app to run javascript in a widget on your iOS device.

Right now, several parts of the state of California are on fire. This isn’t the usual early-fall fire season where dry offshore winds fan the flames—that’s yet to come, oh boy! This is a weirder set of fires started by lightning from a rare set of thunderstorms that passed through a few weeks ago.

In any event, when there are fires burning within a few hundred miles of where you live, the air quality can be really bad and highly variable. Just yesterday, we awoke to clean air. Then the wind shifted and the Air Quality Index (AQI) went rapidly from green to red. It was hazy and ugly outside, and smelled like a barbecue. A couple of hours later, the air was back in healthy territory and I went for a run.

Link to the original article


How Many Decimals of Pi Do We Really Need? - Edu News | NASA/JPL Edu

How Many Decimals of Pi Do We Really Need? 3.141592653589793. That’s it. For the whole visible universe!

Link to the original article


The Intel Split – Stratechery by Ben Thompson

The Intel Split

It appears that Intel's partnership with TSMC is much larger than it first seemed; the implications for Intel as whole are massive.

Link to the original article


Obsidian Community Plugins

There are several Community Plugins used to create the 64Zbit.com website. Here are a list of the ones I'm currently using.


* Obsidian Shell Command

It's not bad to open a shell command and execute the make prod command, but it's even better to hit a hotkey within Obsidian to do the same thing.

More info on GitHub

This plugin allows you to execute a shell command from within Obsidian.

Settings

It also allows you to execute that command from the Obsidian command pallet. Which allows you to execute the command from a hotkey.

Example bash script to copy all files to remote web server

If you want to manually upload the files then here is a good use of the scp command.

scp -r /Users/doug/OneDrive/www_root/pelican/projects/64zbit/output/* user@64zbit.com:/home/pi/dev_volumes/public_html/apache/new/

* Customizable Page Header

Add a button to the page header area of Obsidian to run an Obsidian command. Such as the afore mentioned Shell Command to publish the Pelican website to the production server.

Settings

More info on GitHub


* Paste URL Into Selection

A super helpful utility that detects when there is a URL in the clipboard and then pastes it in the correct format into Obsidian. Detects images too.

Settings

More info on GitHub


Google Fonts Blog: Flow and Redacted

When you need to hide something, but still want them to be able to see it later. Of course, they could just look at the source.

Pretty nice looking fonts. Check out the details here:

Google Fonts Blog: Flow and Redacted: Check out these new options for wireframes and other early-stage designs


Moxie Marlinspike 'My First Impressions of Web3'

Moxie Marlinspike 'My First Impressions of Web3'

Read the full article on moxie.org

I think these market forces will likely continue, and in my mind the question of how long it continues is a question of whether the vast amounts of accumulated cryptocurrency are ultimately inside an engine or a leaky bucket. If the money flowing through NFTs ends up channeled back into crypto space, it could continue to accelerate forever (regardless of whether or not it’s just web2x2). If it churns out, then this will be a blip. Personally, I think enough money has been made at this point that there are enough faucets to keep it going, and this won’t just be a blip. If that’s the case, it seems worth thinking about how to avoid web3 being web2x2 (web2 but with even less privacy) with some urgency.

It's worse than I thought. Web3 is already a mess.


Wordle

Wordle is a fun free word of the day game where you have six tries to find the five letter word.

It was tough today.

Wordle 204 6/6

Whew!

Whew!

Play today's Wordle


Using Pelican

site image

Publish with Obsidian

Caps-P - publish

Caps-T - select template

Pelican Site Generator

Make prod - publish to production server

start localhost:8000 dev server and reload on changes

pelican --autoreload --listen


First Robotics Rapid React

First Robotics Rapid React
https://www.firstinspires.org/robotics/frc/kickoff


pelican-plugins/jinja2content: Use Jinja2 template code within post content

This plugin allows the use of Jinja2 directives inside your Pelican articles and pages.

In this approach, your content is first rendered by the Jinja template engine. The result is then passed to the normal Pelican reader as usual. There are two consequences for usage. First, this means the Pelican context and Jinja variables usually visible to your article or page template are not available at rendering time. Second, it means that if any of your input content could be parsed as Jinja directives, they will be rendered as such. This is unlikely to happen accidentally, but it’s good to be aware of.

All input that needs Pelican variables such as article, category, etc., should be put inside your theme’s templating. As such, the main use of this plugin is to automatically generate parts of your articles or pages.

Markdown, reStructured Text, and HTML input are all supported. Note that by enabling this plugin, all input files of these file types will be pre-processed with the Jinja renderer. It is not currently supported to selectively enable or disable jinja2content for only some of these input sources.

Link to the original article


Images with Obsidian and Pelican

A short article on how to work with images so they display correctly in Obsidian and when published with Pelican.

Native

This default Obsidian format, with drag and drop into the document, works in Obsidian, but not Pelican.

Obsidian Native: (doesn't work on this site)

![Obsidian](CleanShot%202022-01-05%20at%2019.30.59@2x.png) Obsidian

Path

Obsidian knows where to find the image, whereas Pelican needs a path added to find the image. In this case /images/

Added Path:

![Added Path](/images/CleanShot%202022-01-05%20at%2019.30.59@2x.png) Added Path

Img Tag

But the images are 2x based on the image format and the Retina display it was captured from. It needs to be resized to 50% to display properly. There is not a size option available in Obsidian markdown. You can revert to a standard img html tag to make this work. However, the image will not display in Obsidian.

Use <img> tag:

<img src="/images/CleanShot%202022-01-05%20at%2019.30.59@2x.png" alt="alt text" title="image Title" width="50%"/>

alt text

1x with Path

The solution is to use images that are 1x sized. Or, set your screen capture tool to 1x, non Retina. This way the images will display correctly in Obsidian and when published with Pelican, with only the path being added manually to the file name.

1x with path added:

![](/images/CleanShot%202022-01-05%20at%2019.59.47.png)

Automation

What automation tools are available in Pelican to automatically reformat and resize the images?

To be continued....


Raspberry Pi as a Flask Server

I created an Air Quality Index gadget made from a Raspberry Pi Zero W with a tiny OLED screen from Adafruit. It shows the AQI from my local PurpleAir sensor.

I created a Flask web server on the Pi so I could remotely see the AQI and change the PurpleAir sensor ID.

print("The triple-colon syntax will *not* show line numbers.")

from flask import Flask, render_template, request, jsonify, make_response
import os
import logging
import datastore
import aqistore

# DotMap is a dot-access dictionary subclass
# https://pypi.org/project/dotmap/
# https://github.com/drgrib/dotmap
from dotmap import DotMap

# logging configuration
# debug, info, warning, error, critical
logging.basicConfig(filename='./instance/aqi.log',
                    level=logging.DEBUG, format='%(asctime)s %(message)s')
logging.info('Started')
logging.info('running server.py')

# Example ajax code from
# https://github.com/caseydunham/ajax-flask-demo

app = Flask(__name__)
app.config.from_mapping(
    SECRET_KEY='dev',
    DATABASE=os.path.join(app.instance_path, 'aqi.sqlite'),
    LOGGER=os.path.join(app.instance_path, 'aqi.log'),
)

# ensure the instance folder exists
try:
    os.makedirs(app.instance_path)
    logging.info('server - created instance folder.')
except OSError:
    pass

# default sensor_id for PurpleAir sensor Forest Park
sensor_id = 104402


@app.route('/')
def index():
    return render_template('index.html')


@app.route('/pi')
def pi():
    return 'Raspberry Pie!'


@app.route('/sensor')
def sensor_index():
    return render_template('sensor.html')


@app.route('/aqi')
def aqi_index():
    resp = make_response(render_template('aqi.html'))
    resp.set_cookie('aqi', 'aqi')
    return resp


@app.route('/api/sensor', methods=['GET', 'POST'])
def get_sensor_post():
    logging.info('**************** starting sensor ')
    # logging.info('request user_agent: ', request.)
    out = get_sensor_proc()
    r = out.toDict()
    return jsonify(result=r, status=200)


def get_sensor_proc():
    error = None
    out = DotMap()
    sensor_id = 0
    try:
        sensor_id = datastore.get_sensor_id()
    except Exception as e:
        error = e
        logging.warning(e)
    out.sensor_id = sensor_id
    out.error = error
    logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(message)s')
    logging.info('get_sensor_proc - sensor_id from db.', out.toDict())
    return out


@app.route('/api/aqi', methods=['GET', 'POST'])
def aqi_post():
    logging.info('**************** starting aqi ')
    # logging.info('request user_agent: ', request.)
    out = aqi_proc()
    r = out.toDict()
    return jsonify(result=r, status=200)


def aqi_proc():
    error = None
    aqi = 0
    aqiColor = 0
    try:
        out = aqistore.purpleAir()
    except Exception as e:
        error = e
        logging.warning(e)
    out.error = error
    logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(message)s')
    logging.info('aqi_proc - data from purpleAir.', out.toDict())
    return out


@app.route('/api/sensor_post', methods=['POST'])
def sensor_post():
    json = request.get_json()
    msg = DotMap(json)
    out = sensor_proc(msg)
    r = out.toDict()
    return jsonify(result=r, status=200)


def sensor_proc(msg):
    sensor_id = msg.sensor_id
    logging.info('server - updating db sensor_id: ' + str(sensor_id))
    error = None

    if not sensor_id:
        error = 'Sensor_id is required.'
        logging.warning(error)

    if error is None:
        error = datastore.set_sensor_id(sensor_id)
    out = DotMap()
    out.sensor_id = sensor_id
    out.error = error
    return out


@app.route('/api/say_name', methods=['POST'])
def say_name_post():
    json = request.get_json()
    msg = DotMap(json)
    out = say_name_proc(msg)
    r = out.toDict()
    return jsonify(result=r, status=200)

# process say_name message


def say_name_proc(msg):
    datastore.get_db()
    first_name = msg.first_name
    last_name = msg.last_name
    day_week = msg.day_week

    out = DotMap()
    out.first_name = first_name
    out.last_name = last_name
    out.day_week = day_week
    datastore.close_db()
    return out


@app.route('/init')
def init():
    datastore.init_db()
    return 'Database initialized'

# dynamic route


@app.route('/<name>')
def print_name(name):
    return 'Hi, {}'.format(name)


if __name__ == '__main__':
    app.run(debug=True, host='0.0.0.0', port=5000)

New Pelican based Website

It's been in the works for awhile, but today I updated my production server settings to show the new website based on the Pelican static site generator.

I tried to follow the same look and feel of the Ghost based server but with a fully customizable template. With Ghost I was limited to using their default template and never wanted to learn how to change it. With the new Pelican based site it is super easy to make all the modifications I want.


Favicon Generator for perfect icons on all browsers

Why RealFaviconGenerator No hard decision With so many platforms and icons, it's hard to know exactly what you should do. What are the dimensions of favicon.ico? How many Touch icons do I need? RealFaviconGenerator did the reseach and testing for you.

Done in 5 minutes You spent hours on design, colors, graphics... How much time left for the favicon? Probably not much. But no worries, you only need a few minutes to tackle this task.

Compelling design, a platform at a time Each platform comes with its own design requirements. You can't just use the same picture everywhere. RealFaviconGenerator knows this and lets you craft your icons platform per platform.

Instant feedback How will Android display my icon? How will iOS round my Touch icon? No more guesswork. RealFaviconGenerator instantly shows you how your icons will look like.

Link to the original article


iPhone Device Resolutions

iphone

source:paintcodeapp.com


pelican-plugins/search: Pelican plugin that adds site search capability

This plugin generates an index for searching content on a Pelican-powered site.

Why would you want this?

Static sites are, well, static… and thus usually don’t have an application server component that could be used to power site search functionality. Rather than give up control (and privacy) to third-party search engine corporations, this plugin adds elegant and self-hosted site search capability to your site. Last but not least, searches are really fast. 🚀

Want to see just how fast? Try it out for yourself. Following are some sites that use this plugin:

Link to the original article