Cleaned up the image files. Cover images go under /static and in-post images are now in /content/posts/img. Edited and rebuilt some existing posts for this structure. I also removed my birdnet post and put it back in drafts so I can publish it as some future date.
This commit is contained in:
@ -5,7 +5,7 @@ tags: ["homeassistant", "python", "diy"]
|
||||
author: "Me"
|
||||
showToc: true
|
||||
TocOpen: false
|
||||
draft: false
|
||||
draft: true
|
||||
hidemeta: false
|
||||
description: 'Learn how to take BirdNET-Pi Detections to create and display entities in HomeAssistant.'
|
||||
disableHLJS: true # to disable highlightjs
|
||||
@ -83,7 +83,7 @@ information that is pertinent to your own uses.
|
||||
|
||||
Here is how I've setup my MQTT payload from BirdNET-Pi Settings:
|
||||
|
||||

|
||||

|
||||
|
||||
Here it is in text form:
|
||||
|
||||
|
||||
BIN
content/posts/img/birdnet-homeassistant.png
Normal file
BIN
content/posts/img/birdnet-homeassistant.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 90 KiB |
BIN
content/posts/img/birdnet_mqtt_settings.png
Normal file
BIN
content/posts/img/birdnet_mqtt_settings.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 207 KiB |
BIN
content/posts/img/explain-shell-homepage.png
Normal file
BIN
content/posts/img/explain-shell-homepage.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 82 KiB |
BIN
content/posts/img/explain-shell-interface.png
Normal file
BIN
content/posts/img/explain-shell-interface.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 224 KiB |
75
content/posts/new-favorite-website.md
Normal file
75
content/posts/new-favorite-website.md
Normal file
@ -0,0 +1,75 @@
|
||||
---
|
||||
title: 'New Favorite Website!'
|
||||
date: 2023-09-27T10:07:01-04:00
|
||||
tags: ["resources", "shell", "commandline"]
|
||||
author: "Me"
|
||||
showToc: false
|
||||
TocOpen: false
|
||||
draft: false
|
||||
hidemeta: false
|
||||
description: 'Regex101 has long been one of my favorite reference tools. As of today, I will be adding ExplainShell to the list of must-use tools!.'
|
||||
disableHLJS: true # to disable highlightjs
|
||||
disableShare: false
|
||||
disableHLJS: false
|
||||
hideSummary: false
|
||||
searchHidden: true
|
||||
ShowReadingTime: true
|
||||
ShowBreadCrumbs: true
|
||||
ShowPostNavLinks: true
|
||||
ShowWordCount: true
|
||||
ShowRssButtonInSectionTermList: true
|
||||
UseHugoToc: true
|
||||
cover:
|
||||
image: "new-website-cover.png"
|
||||
alt: "Add explainshell.com to your list of favorite websites! Right behind regex101.com."
|
||||
caption: "ExplainShell and Regex101 are the most needed tools in your arsenal."
|
||||
relative: false # when using page bundles set this to true
|
||||
hidden: true # only hide on current single page
|
||||
---
|
||||
|
||||
For the longest time, I had [Regex101](www.regex101.com) as a bookmarked website for (almost) daily use. Not only does it
|
||||
help me build muscle memory for using regex queries without banging my head against the wall with a bunch of print and debug
|
||||
statements, but if I happen to be in a different language - say in javascript instead of python - it gives you the correct
|
||||
syntax for using regex in that language. There are even [spin-off projects](https://github.com/nedrysoft/regex101) to use
|
||||
this tool while offline.
|
||||
|
||||
You can even test it again the strings you do (or don't!) want to verify against. This website is beyond cool.
|
||||
|
||||
So this morning, when I saw [Jérémy Garniaux](https://mapstodon.space/@jeremy) ask if there was an "explain shell" for Vim or
|
||||
Neovim, this was the Regex101 but for shell commands.
|
||||
|
||||
<iframe
|
||||
src="https://mapstodon.space/@jeremy/111135981133166060/embed"
|
||||
width="100%" height="400px" style="border:none;"></iframe>
|
||||
|
||||
|
||||
{{< box info >}}
|
||||
_Side Note: it took me way too long how to figure out how to embed an iframe directly into Hugo without creating a new shortcode template and other suggestions. I'll be sure to post about that in the future._
|
||||
{{< /box >}}
|
||||
|
||||
When you first load ExplainShell.com, you're greeted with a clean, minimal interface with some explanation and a very obvious
|
||||
search bar.
|
||||
|
||||

|
||||
|
||||
For those new to the command line, it also shares some suggested queries to search with. As you read over the results, you
|
||||
can hover on the different elements of the command and it will highlight the explanation below. I mean, look at how clean and
|
||||
nice that is!
|
||||
|
||||

|
||||
|
||||
As many other command line users are apt to do, I use the man page all the time for commands and flags I'm unsure of, or need
|
||||
a refresher on. While knowing what a certain flag is and what it does for a specific command is supremely helpful, I find the
|
||||
man pages a tad bit overwhelming. You can always `grep` for what you're looking for, but even then I've found times where it
|
||||
only pulls out half of the full description, or even just the line the definition is on.
|
||||
|
||||
So the fact that this resources can extract exactly what you need in your command from a man page without digging through
|
||||
every line, is extremely useful! Going back to Jérémy's original toot and question... who is going to make this same tool for
|
||||
Neovim?
|
||||
|
||||
<style>
|
||||
.box-shortcode {
|
||||
color: #e8e8e8;
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
67
content/posts/useful-commands.md
Normal file
67
content/posts/useful-commands.md
Normal file
@ -0,0 +1,67 @@
|
||||
---
|
||||
title: 'Useful Commands'
|
||||
date: 2023-09-26T12:04:05-04:00
|
||||
tags: ["shell", "script", "command line"]
|
||||
author: "Me"
|
||||
endbleGitInfo: true
|
||||
showToc: true
|
||||
TocOpen: false
|
||||
draft: true
|
||||
hidemeta: false
|
||||
description: 'A collection and living document of useful shell commands that I use.'
|
||||
disableHLJS: true # to disable highlightjs
|
||||
disableShare: false
|
||||
disableHLJS: false
|
||||
hideSummary: false
|
||||
searchHidden: true
|
||||
ShowReadingTime: true
|
||||
ShowBreadCrumbs: true
|
||||
ShowPostNavLinks: true
|
||||
ShowWordCount: true
|
||||
ShowRssButtonInSectionTermList: true
|
||||
UseHugoToc: true
|
||||
cover:
|
||||
image: "useful_commands.png" # image path/url
|
||||
alt: "<alt text>" # alt text
|
||||
caption: "<text>" # display caption under cover
|
||||
relative: false # when using page bundles set this to true
|
||||
hidden: true # only hide on current single page
|
||||
---
|
||||
|
||||
This post will act a bit like a living document of all the useful commands and short scripts that I use regularly. Some will
|
||||
be as simple as `ls | wc -l` which counts the number of files in your current working directory, and others will be better
|
||||
suited to small scripts. As this grows, I will hopefully break these into more logical categories.
|
||||
|
||||
## Find by File type
|
||||
|
||||
This command will find every file in your current working directory by the specified file extension.
|
||||
|
||||
```bash
|
||||
find . -type f -name '*.txt'
|
||||
```
|
||||
|
||||
As a bonus, if you wanted find everything _except_ that file extension, you can add a `!` before name. In other words:
|
||||
|
||||
```bash
|
||||
find . type -f ! -name '*.txt'
|
||||
```
|
||||
|
||||
I usually use commands like this to clean up files that I don't need, be it file extensions I don't need anymore, or anything
|
||||
with a specific word in its file name, so adding `-delete` at the end of the command lets me delete those files.
|
||||
|
||||
```bash
|
||||
find . type -f -name '*.txt' -delete
|
||||
```
|
||||
|
||||
## List Files & Dir +
|
||||
|
||||
Using `ls` is a _key_ command for anyone that works within a command line. If you've used `ls` before, then you've also
|
||||
likely used or created an alias for `ls -la` which will display the files, their user:group ownership, permissions
|
||||
(`drwxrwxrwx`) and dates created + modified.
|
||||
|
||||
What if you just want to found the number of files? Not measuring disk usage or free space, but the equivalent of `len` for
|
||||
an array, the array being your current working directory. Enter `wc`!
|
||||
|
||||
```bash
|
||||
ls | wc- l
|
||||
```
|
||||
Reference in New Issue
Block a user