Journal: Combine Multiple Videos Using ffmpeg

As seen on ma.ttias.be. I’m just documenting this in my own way for future reference. This method is only applicable to videos of the same dimensions and encoding. Tested on FFmpeg 4.3. I use this method to download and concatenate youtube-dl outputs.

Step 1: Create a text file and make a list of video files.

touch files.txt
vi files.txt

Example content to save:

file 'p1.mp4'
file 'p2.mp4'
file 'p3.mp4'
file 'p4.mp4'

Step 2: Run the command below

ffmpeg -f concat -safe 0 -i files.txt -c copy output.mp4

Journal: New Laptop & Linux Mint

Switched To Linux Mint 19.1 Xfce

My Lenovo ThinkPad X230 is no more. Lost it to a motherboard issue caused by electrical surge. I’ve been using that laptop connected to direct AC.

Got hold of an HP 14q-cs0029tu i3 8th gen variant. The laptop comes with i3 8130u CPU, Samsung 8GB DDR4 2666MHZ Memory & 256GB WD SN750 NVMe™ SSD. They shipped the laptop with Windows 10 Home.

But, meh…I don’t have a good internet connection at home, which means I can’t install Steam and play lightweight indie games. So ultimately, except for FL Studio, Windows 10 is useless to me at this point.

Installed Linux Mint 19.1 Xfce right away. I’ve installed LMMS as the backup DAW for the time being. I really don’t feel like going to back Windows just for FL Studio. I haven’t installed GIMP yet.

HP 14q-cs0029tu Linux WiFi Driver

And if you’re planning to install Linux on this HP laptop, keep in mind that WiFi won’t work OOB. You’ve to install the Realtek RTL8723DE module for Linux and restart the Machine.

Footnotes

  • I took that cover photo while unboxing. Sorry about the distortion.
  • I use Mc-OS CTLina XFCE theme & OS Catalina icon pack.

API-alpha for Bug Guide

API for Bug Guide | bugguide.net Unofficial API

Explore the data-set of 35447 insects!

Based on bugguide.net’s multiple .txt sets, I created an API to deliver insects’ data in JSON format. At present, the API only delivers the common name, genus, species, family, order, bug_guide_id, and bugguide.net URL information.

API Endpoint

https://bugs.deadauthor.org?api&

Documentation

Data can be parsed as JSON. Access to the bugs.deadauthor.org doesn’t require a token-based authentication. Kindly avoid sending too many requests. Consider donating if you plan to actively use the API.

Examples

Query a common name

GET https://bugs.deadauthor.org?api&common_name=Brown%20Angle%20Shades

Query a genus

GET https://bugs.deadauthor.org?api&genus=Oligotoma

Query species

GET https://bugs.deadauthor.org?api&species=nigra

Query a family

GET https://bugs.deadauthor.org?api&family=Oedemeridae

Query an order

GET https://bugs.deadauthor.org/?api&order=Coleoptera

Query a bug_guide_id

GET https://bugs.deadauthor.org?api&bug_guide_id=389

Query combination example

GET https://bugs.deadauthor.org?api&species=scrutator&order=Coleoptera

API Usage Example (Python)

Alpha disclaimer

The bugs.deadauthor.org API is actually in the alpha stage, which implies that “bugs” and issues may still remain undiscovered until this phase of testing is complete.

The alpha stage also means that the data may be corrupted, is not 100% validated or complete, and is subject to change.

Finally, services may have downtime and the API schemas and calls are subject to change

An Example Bot for Twitter & Facebook

An Example Bot for Twitter & Facebook

Here’s a small Python script to run your own Every Word Bot variant on Facebook and Twitter. The basic guide is available at the bottom of the article. Unfortunately, the guide is not applicable to beginners. Here’s the GitHub repo.

Step 1 — You need a VPS to host and run this script. I highly recommend a DigitalOcean droplet. I think you’ll get a 50USD or 100USD credit on DigitalOcean when you sign-up with the link I shared. You could check Amazon AWS or Google Cloud Platform also. Select Debian, Ubuntu, or CentOS while you’re creating a droplet or instance.

Step 2 — Install Python 3 followed by the modules facebook, tweepy, and schedule. Installing modules will become fairly easy once you get the hang of it. 

Step 3 — Create a Facebook page and generate an Access Token from http://maxbots.ddns.net/token/. Paste the token to the accesstoken field in the script.

Step 4 — Create a Twitter app and generate tokens & secret keys. It’s explained in the Access token/secret method section of this blog post

Step 5 — Download the English words data-set of your choice.  Replace the words.txt in my repo with the text set of yours. Fire up the script with the command sudo python3 main.py

You can use tmux to manage the sessions.

Also read: https://github.com/aparrish/everywordbot

Get Creative

Look at @loveeveryword and @bottubebot for example. You could use Pillow to post images or even GTTS + moviepy to post videos.

Credit: Cover Photo by Brett Jordan on Unsplash

Python for Automation

Python for Automation: An Overview of Personal Projects

30 days of Python, and it’s changing my perspective.

status = "Immersed" #yep

I’m more of a “front-end” development guy. I routinely manage WordPress websites and optimize the servers for optimal performance. Python or Node isn’t something I need every day.

Here’s a source code to get started.

The Every Tom and Jerry Frame in Order Facebook page sparked my interest in the area of “social media automation for entertainment”. I grabbed that project’s source code and started tweaking.

Failed miserably at first. Then I wrote an email to the code maintainer. They were generous and wrote back. The emails went back and forth until I fixed my version of the script.

Learning and tweaking Python code has been a spiritually refreshing experience. I had a good time writing various other scripts.

The progress

I religiously use modules like OpenCV, moviepy, Wikipedia, Pillow, FFmpeg, schedule, requests, JSON, etc.

I’ve managed to learn more about JSON data as well.

I’ve also started using WordPress REST API with Python3.

Results (Facebook bots)

Deep Dreaming Harvard Art Museums Bot — A Facebook page that lets you explore Harvard Art Museums in DeepDream (neural network) mode. Objects are picked in no order. No logs stored on my server.

Met. Museum Bot — Another art museum based on The Metropolitan Museum of Art’s API. 474383 objects in total.

Fishbot 13229 — An ultimate wiki-bot that shares photos and information about fishes. I use fishbase.se’ data as the base to gather Wikipedia info and images.

Birdbot 11147 — Another wiki-bot destined to share photos and information about birds. It also shares the IUCN Red List status.

Insect Bot 35499 — A bot that appreciates hexapod invertebrates.

CryptidWiki Bot — A bot based on cryptidz.fandom.com’ data. It shares stories about various cryptids in a timely manner.

Amphibians & Reptiles Bot — Another wiki-bot that shares photos and information about amphibians and reptiles.

Plant Bot — A bot that randomly posts an image of your favorite photosynthetic eukaryotes. The image search isn’t perfect yet.

Bots With Attitude — A bot based on GPT-2 captions and AI-generated (API) photos. Still a work-in-progress.

abstraktr.py — A script that generates CC0 1.0 abstract art every hour. Based on an open-source project.

Haunted Places Bot – US Edition — A bot that shares info about haunted places in the US. The script uses data from Shadowlands Haunted Places Index. Images are randomly captured from search engine results.

@1000000Bot — A script that randomly shares a website URL (from Alexa’s dataset) and its basic PageSpeed insights.

Miscellaneous

  • https://www.facebook.com/loveeveryword/
  • https://www.facebook.com/bottubebot
  • https://www.facebook.com/waybackexe/ (Scrape)
  • https://www.facebook.com/anguirusbot
  • https://www.facebook.com/cidmoosabot

Radio (China-only)

What's faster than a VPN?

Use SocketPro. Best VPN alternative for expats in China. Just $2.41/m.

Set up a fast website in China

Hire me. I provide top-notch website optimization services for China.

Other Links

Free DigitalOcean CreditCheap VPS HostingSet up a blog in ChinaExpat life in ChengduSpeed up website for ChinaBest VPNs for ChinaHackintosh Journal Sponsor or Donate to Mighil.com.

© 2020 Site Notice. Powered by DigitalOcean & GP.