Compare commits

...

10 Commits

Author SHA1 Message Date
John Bowdre 2c42d7aa59 Merge branch 'main' into drafts 2023-02-20 14:39:05 -06:00
John Bowdre 4728a9912e Merge branch 'main' of github.com:jbowdre/virtuallypotato 2023-02-20 14:37:59 -06:00
John Bowdre 257473991d new post: cat-file-without-comments 2023-02-20 14:37:50 -06:00
John Bowdre 48469641c2 new draft 2023-02-20 14:37:11 -06:00
John Bowdre 257334e7c8
Update daily_build.yml 2023-02-20 14:36:47 -06:00
John Bowdre ebc32e89b7
Update daily_build.yml 2023-02-20 14:28:46 -06:00
John Bowdre 785c5b6834
Update daily_build.yml 2023-02-20 14:23:29 -06:00
John Bowdre 4eb422531f
Create daily_build.yml 2023-02-20 14:21:01 -06:00
John Bowdre c59224b02e publish post 2023-02-20 13:55:13 -06:00
John Bowdre 79a47832e2 new post: create-vms-chromebook-hashicorp-vagrant 2023-02-20 13:53:33 -06:00
4 changed files with 70 additions and 2 deletions

14
.github/workflows/daily_build.yml vendored Normal file
View File

@ -0,0 +1,14 @@
name: Daily build
on:
schedule:
- cron: "0 13 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Trigger build webhook on Netlify
run: curl -s -X POST "https://api.netlify.com/build_hooks/${TOKEN}"
env:
TOKEN: ${{ secrets.NETLIFY_CRON_BUILD_HOOK }}

View File

@ -0,0 +1,54 @@
---
title: "Cat a File Without Comments" # Title of the blog post.
date: 2023-02-22 # Date of post creation.
# lastmod: 2023-02-20T10:32:20-06:00 # Date when last modified
description: "A quick trick to strip out the comments when viewing the contents of a file." # Description used for search engine.
featured: false # Sets if post is a featured post, making appear on the home page side bar.
draft: false # Sets whether to render this page. Draft of true will not be rendered.
toc: true # Controls if a table of contents should be generated for first-level links automatically.
usePageBundles: true
# menu: main
# featureImage: "file.png" # Sets featured image on blog post.
# featureImageAlt: 'Description of image' # Alternative text for featured image.
# featureImageCap: 'This is the featured image.' # Caption (optional).
# thumbnail: "thumbnail.png" # Sets thumbnail image appearing inside card on homepage.
# shareImage: "share.png" # Designate a separate image for social media sharing.
codeLineNumbers: false # Override global value for showing of line numbers within code block.
series: Tips # Projects, Scripts, vRA8, K8s on vSphere
tags:
- linux
- shell
- regex
comment: true # Disable comment if false.
---
It's super handy when a Linux config file is loaded with comments to tell you precisely how to configure the thing, but all those comments can really get in the way when you're trying to review the current configuration.
Next time, instead of scrolling through page after page of lengthy embedded explanations, just use:
```shell
egrep -v "^\s*(#|$)" $filename
```
For added usefulness, I alias this command to `ccat` (which my brain interprets as "commentless cat") in [my `~/.zshrc`](https://github.com/jbowdre/dotfiles/blob/main/zsh/.zshrc):
```shell
alias ccat='egrep -v "^\s*(#|$)"'
```
Now instead of viewing all 75 lines of a [mostly-default Vagrantfile](/create-vms-chromebook-hashicorp-vagrant), I just see the 7 that matter:
```shell
; wc -l Vagrantfile
75 Vagrantfile
; ccat Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "oopsme/windows11-22h2"
config.vm.provider :libvirt do |libvirt|
libvirt.cpus = 4
libvirt.memory = 4
end
end
; ccat Vagrantfile | wc -l
7
```
Nice!

View File

@ -4,14 +4,14 @@ date: 2023-02-20 # Date of post creation.
# lastmod: 2023-02-18T17:22:02-06:00 # Date when last modified
description: "Pairing the powerful Linux Development Environment on modern Chromebooks with HashiCorp Vagrant to create and manage local virtual machines for development and testing" # Description used for search engine.
featured: false # Sets if post is a featured post, making appear on the home page side bar.
draft: true # Sets whether to render this page. Draft of true will not be rendered.
draft: false # Sets whether to render this page. Draft of true will not be rendered.
toc: true # Controls if a table of contents should be generated for first-level links automatically.
usePageBundles: true
# menu: main
# featureImage: "file.png" # Sets featured image on blog post.
# featureImageAlt: 'Description of image' # Alternative text for featured image.
# featureImageCap: 'This is the featured image.' # Caption (optional).
# thumbnail: "thumbnail.png" # Sets thumbnail image appearing inside card on homepage.
thumbnail: "thumbnail.png" # Sets thumbnail image appearing inside card on homepage.
# shareImage: "share.png" # Designate a separate image for social media sharing.
codeLineNumbers: false # Override global value for showing of line numbers within code block.
series: Projects

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB