64Zbit.com
Tech is way, WAY interesting

Python 3 - Command Line Arguments

Python provides a getopt module that helps you parse command-line options and arguments.

$ python test.py arg1 arg2 arg3 The Python sys module provides access to any command-line arguments via the sys.argv. This serves two purposes −

sys.argv is the list of command-line arguments. len(sys.argv) is the number of command-line arguments. Here sys.argv[0] is the program ie. the script name.

Link to the original article


Markdown Preview Github Styling - Visual Studio Marketplace

Features

Preview what your markdown will look like rendered on GitHub. Extends VS Code's built-in markdown preview. Includes both light or dark Github themes. Customize styling using your own markdown.styles css

Link to the original article


Peek — The Ultimate macOS Quick Look Extension

Peek — The Ultimate Quick Look Extension Accelerate your workflow with the Quick Look conveniences that only Peek can deliver (for macOS 10.15+): copying, searching, jumping, scroll restoring, syntax highlighting, & more.

Link to the original article


geerlingguy/ansible-for-devops: Ansible for DevOps examples.

This repository contains Ansible examples developed to support different sections of Ansible for DevOps, a book on Ansible by Jeff Geerling.

Most of the examples are full-fledged VM examples, which use Vagrant, VirtualBox, and Ansible to boot and configure VMs on your local workstation. Not all playbooks follow all of Ansible's best practices, as they illustrate particular Ansible features in an instructive manner.

For more interesting examples of what you can do with Ansible, please see the Ansible Vagrant Examples repository, and browse through some of geerlingguy's roles on Ansible Galaxy.

Link to the original article


Makefile Tutorial By Example

Why do Makefiles exist? Makefiles are used to help decide which parts of a large program need to be recompiled. In the vast majority of cases, C or C++ files are compiled. Other languages typically have their own tools that serve a similar purpose as Make. Make can also be used beyond compilation too, when you need a series of instructions to run depending on what files have changed. This tutorial will focus on the C/C++ compilation use case. Here's an example dependency graph that you might build with Make. If any file's dependencies changes, then the file will get recompiled:

Link to the original article


How to install Ansible on Ubuntu Server 22.04 | TechRepublic

How to install Ansible

Because Ansible is found in the standard repositories, the installation is as simple as logging in to your controller node and issuing the command:

sudo apt-get install ansible -y

The installation will pick up a large number of dependencies and will take anywhere from 2-10 minutes to complete.

We’ll also need to install a second piece of software, called SSHpass, which is a non-interactive password provider — otherwise you’d have trouble with SSH authentication. Install SSHPass with:

sudo apt-get install sshpass -y

Link to the original article


Make your first open source contribution - Marko Denic - Web Developer

By doing open source contributions, you will learn a lot. It allows you to become a part of the open-source community. It can be hard at the beginning, but it’s definitely worth it. How do you make a pull request? How to ask the maintainers to merge it? Let’s start!

First of all, you should know the basics of git. You’ll need a GitHub account as well. If you don’t have one, you can create it here. Step 1: Find a project you want to contribute to.

If you want to practice a little bit first, you can use this demo repository. Don’t worry, I created it for this purpose.

Link to the original article


"Markdown cheat sheet by GitHub https://t.co/S7eJwKssFT" / Twitter

GitHub uses a syntax called Markdown to format text. As many Python folks use GitHub, here’s a handy reference to how Markdown encodes the typical document formats including bold/italic/lists and much more – Twitter (open for full two page reference).

Link to the original article


Markdown Cheat Sheets

Concise information about GitHub markdown


Running Virtual Machines Under Vagrant on the New Mac M1 | by James Cundle | Better Programming

Running Virtual Machines Under Vagrant on the New Mac M1 Finding a working VM alternative when VirtualBox no longer works

Link to the original article


Monitor your Internet with a Raspberry Pi | Jeff Geerling

The Internet Pi runs Pi-hole for DNS privacy and ad-blocking, and Prometheus and Grafana to provide Internet connection monitoring dashboards.

Having a Pi monitoring my Internet continuously makes it easy to see trends over time, or confirm outages. If you just spot check by running a Speedtest every now and then, you don't have much data to go on.

Link to the original article


Raspberry Pi DNS Settings: How to Change the DNS - Pi My Life Up

The process of changing the DNS server on your Raspberry Pi is a pretty simple process and involves modifying a single file. In addition to showing you what file you will need to edit, we will also walk you through a couple of methods of ensuring your Raspberry Pi is using your newly set DNS.

There are many reasons why you might want to utilize a different DNS server to your ISP’s default. One of the top reasons being performance. Many ISP provided DNS servers can be incredibly slow at lookups and sometimes can take ages to update and add domains.

There is also the privacy factor to be considered, typically your ISP’s DNS server will leak your IP address as well as cache details about what websites you are visiting. Alternatives like Cloudflare 1.1.1.1 offer increased privacy by not logging any identifiable data and offering HTTPS over DNS.

If you’re looking to set up a dynamic DNS for accessing your Raspberry Pi then our tutorial on port forwarding and setting up Dynamic DNS will help you out. This tutorial simply goes into the steps of changing the way your Pi resolves domain names.

Link to the original article


Paste URL - VS Code Extension

VS Code Plugin

Paste URL handy VS Code extension that formats URLs pasted into md documents as correct md links.

The developer website is found at GitHub - kukushi/PasteURL

For more information check out their extension on the Marketplace

Special Features

  • If you highlight text before pasting the text becomes the link text.
  • If you just paste, then it will fetch the title text of the linked page.

Recommendation

  • Update the VS Code keyboard shortcuts key-binding for quick URL pasting experience. I use cmd-b.

Paste Image - VS Code Extension

VS Code Plugin

Paste Image is a VS Code plugin that allows you to paste images into md documents. It's currently on version 1.0.4 with over 226,000 downloads.

The developer website is found at GitHub

For complete details visit the VS Code marketplace.

The only downside is it was last updated on 01/23/2019.

Ideas on how to setup

  • settings --> pasteimage
    • for setting path and filename options
    • pastes image into current_document_folder/images
    • prepends documentname_ to image name
    • pastes formatted md url at cursor in current
  • change the keyboard shortcut
    • I use ctrl-v to paste image from clipboard

Python in Visual Studio Code – August 2022 Release - Python

Microsoft announces the availability of the Python and Jupyter extensions for Visual Studio @Code - August 2022. Updates include a new Python Tools extension template, Web app debug setups that are automatically generated and more. #Python #Jupyter

Link to the original article


SFTP - Visual Studio Marketplace

sftp sync extension for VS Code

New version by @Natizyskunk that just work 😀 (This was originally a fork from liximomo's SFTP plugin)

VS Code marketplace : https://marketplace.visualstudio.com/items?itemName=Natizyskunk.sftp VSIX release : https://github.com/Natizyskunk/vscode-sftp/releases/ Syncs your local directory with a remote server directory. Allows you to optionally edit upload a file to the remote directory after it saves locally. This allows you to edit more or less directly on the server similar to WinScp or other similar programs.

Link to the original article


Setting Up a Developer Environment Using Docker

A Docker-based Dev Environment The dev environment I wish to build will be based on Linux. Frequently, I wish to quickly spin up a Linux environment for fun and dev. Although a VM is awesome, I want something lighter, something that spins up instantly at almost zero cost. And I want something that, if I left it running, I wouldn't even notice.

Docker images always start from a base image. The reason I picked Linux is because Linux comes with the most stripped-down bare-bones starter image. This means that all of the images I build on top of it will be light too, and I get to pick exactly what I want.

Link to the original article


"Docker-composing" a Python 3 Flask App Line-by-Line | by Luis Ferrer-Labarca | BitCraft | Medium

"Docker-composing" a Python 3 Flask App Line-by-Line This is a continuation of our article: “Dockerizing a Python 3 Flask App Line-by-Line”. In this article I will assume you have some basic knowledge on Docker, so make sure to read that first if Docker is completely new to you.

Link to the original article


Getting Started - IOTstack

New installation¶

automatic (recommended)¶

Install curl:

$ sudo apt install -y curl Run the following command:

$ curl -fsSL https://raw.githubusercontent.com/SensorsIot/IOTstack/master/install.sh | bash Run the menu and choose your containers:

$ cd ~/IOTstack $ ./menu.sh Bring up your stack:

$ cd ~/IOTstack $ docker-compose up -d

Link to the original article


How to Upgrade Raspberry Pi OS to the Latest Version? (2022) – RaspberryTips

Debian versionCode nameRelease date Debian 8JessieSeptember 2015 Debian 9StretchAugust 2017 Debian 10BusterJune 2019 Debian 11BullseyeNovember 2021 Debian 12BookwormNot released yet, probably in 2023 🙂

Link to the original article


Purple Air API · PyPI

Welcome to the PurpleAir API PurpleAir was founded on principles of openness, sharing, and community. It is to strengthen these principles and ensure the success of our entire community that we put together updated terms of service, data license, and data attribution requirements when using PurpleAir data and this API. Please take a moment to review them and note the attribution guide and data license agreement. If you have any questions or need more information, we have an excellent resource at https://community.purpleair.com/c/data/api/.

Link to the original article


Lingon - Peter Borg Apps

Lingon X 8 released! Run whatever you want, whenever you want Lingon can start an app, run a script or a command whenever you want. You can schedule it to run at a specific time, regularly or when something special happens.

It can also make sure that an app or a script automatically restarts if it crashes.

Lingon is very easy to use yet extremely powerful. It is a fully featured launchd editor and has also many advanced features like running jobs as root and see the log for each job.

It can also monitor all jobs in the background and show a notification when something changes.

Link to the original article


Link aggregation - Wikipedia

In computer networking, link aggregation is the combining (aggregating) of multiple network connections in parallel by any of several methods, in order to increase throughput beyond what a single connection could sustain, to provide redundancy in case one of the links should fail, or both. A link aggregation group (LAG) is the combined collection of physical ports.

Link to the original article


Review the new Pimoroni Enviro range of sensors

Join me in an hour as we review the new @pimoroni Enviro range of sensors, all of which have the @Raspberry_Pi Pico W aboard. It's a hot one today, so this seemed an appropriate show! #sensors #micropython #raspberrypi #picow #influxdb #nodered #grafana

Link to the original article


Link Aggregation | DSM - Synology Knowledge Center

Synology NAS supports multi-LAN, allowing you to combine those LAN interfaces using the Link Aggregation technology. Link Aggregation increases the bandwidth of your Synology NAS by aggregating multiple network interfaces and provides traffic failover to maintain network connection in case the connection is down. After your LAN interfaces are combined, you will see a new interface named Bond at Control Panel > Network > Network Interface, which could be configured as you would with other interfaces (such as LAN or PPPoE).

Link to the original article