mirror of
https://github.com/Brandon-Rozek/website.git
synced 2024-11-25 01:26:30 -05:00
Medium syndication metadata
This commit is contained in:
parent
c5b2488589
commit
9bf7cfb744
14 changed files with 82 additions and 64 deletions
|
@ -1,14 +1,15 @@
|
||||||
---
|
---
|
||||||
title: "Autostart Desktop Applications"
|
date: 2020-11-29 18:45:28
|
||||||
date: 2020-11-29T13:45:28-05:00
|
|
||||||
draft: false
|
draft: false
|
||||||
tags: ["Linux"]
|
|
||||||
medium_enabled: true
|
medium_enabled: true
|
||||||
|
medium_post_id: f765346971a5
|
||||||
|
tags:
|
||||||
|
- Linux
|
||||||
|
title: Autostart Desktop Applications
|
||||||
---
|
---
|
||||||
|
|
||||||
The [freedesktop specification](https://specifications.freedesktop.org/autostart-spec/0.5/ar01s02.html) describes how to identify file types, launch applications, and other useful desktop functions. A useful spec I've found recently is for launching desktop applications when you log into your machine.
|
The [freedesktop specification](https://specifications.freedesktop.org/autostart-spec/0.5/ar01s02.html) describes how to identify file types, launch applications, and other useful desktop functions. A useful spec I've found recently is for launching desktop applications when you log into your machine.
|
||||||
|
|
||||||
In my Kubuntu 20.10 system, the directory `$HOME/.config/autostart` can contain [`.desktop`](/blog/linuxdesktopicons/) files that describes the applications to start on login. Drop whichever desktop file you wish to start there. In other systems it may be located under `$XDG_CONFIG_DIRS/autostart`.
|
In my Kubuntu 20.10 system, the directory `$HOME/.config/autostart` can contain [`.desktop`](/blog/linuxdesktopicons/) files that describes the applications to start on login. Drop whichever desktop file you wish to start there. In other systems it may be located under `$XDG_CONFIG_DIRS/autostart`.
|
||||||
|
|
||||||
If you want to start up a script instead, you can put the script under `$HOME/.config/autostart-scripts`.
|
If you want to start up a script instead, you can put the script under `$HOME/.config/autostart-scripts`.
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
---
|
---
|
||||||
title: "Quick Bash: Validate IP Address"
|
date: 2020-12-20 01:15:24
|
||||||
date: 2020-12-19T20:15:24-05:00
|
|
||||||
draft: false
|
draft: false
|
||||||
tags: ["Bash", "Networking"]
|
|
||||||
medium_enabled: true
|
medium_enabled: true
|
||||||
|
medium_post_id: c7a65890d9d9
|
||||||
|
tags:
|
||||||
|
- Bash
|
||||||
|
- Networking
|
||||||
|
title: 'Quick Bash: Validate IP Address'
|
||||||
---
|
---
|
||||||
|
|
||||||
`ipcalc` is a terminal tool that lets you validate an IP address. This proves useful to me as I have scripts that automate certain remote tasks given an IP address. Instead of trusting that an argument passed is a valid IP, why not check it?
|
`ipcalc` is a terminal tool that lets you validate an IP address. This proves useful to me as I have scripts that automate certain remote tasks given an IP address. Instead of trusting that an argument passed is a valid IP, why not check it?
|
||||||
|
@ -24,5 +27,4 @@ if ! ipcalc -cs "$IP" ; then
|
||||||
echo "Invalid IP Address"
|
echo "Invalid IP Address"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
---
|
---
|
||||||
title: "Chroot and Virtual Filesystems"
|
date: 2020-11-29 15:52:07
|
||||||
date: 2020-11-29T10:52:07-05:00
|
|
||||||
draft: false
|
draft: false
|
||||||
tags: ["Linux"]
|
|
||||||
medium_enabled: true
|
medium_enabled: true
|
||||||
|
medium_post_id: 37f5b4c46ae8
|
||||||
|
tags:
|
||||||
|
- Linux
|
||||||
|
title: Chroot and Virtual Filesystems
|
||||||
---
|
---
|
||||||
|
|
||||||
When running applications under a [`chroot`](https://en.wikipedia.org/wiki/Chroot) environment, it can be annoying when certain [virtual filesystems](https://opensource.com/article/19/3/virtual-filesystems-linux) are unavailable. Here are the commands to mount the most common ones:
|
When running applications under a [`chroot`](https://en.wikipedia.org/wiki/Chroot) environment, it can be annoying when certain [virtual filesystems](https://opensource.com/article/19/3/virtual-filesystems-linux) are unavailable. Here are the commands to mount the most common ones:
|
||||||
|
@ -14,5 +16,4 @@ sudo mount -o bind /sys /mnt/root/sys
|
||||||
sudo mount -o bind /dev /mnt/root/dev
|
sudo mount -o bind /dev /mnt/root/dev
|
||||||
```
|
```
|
||||||
|
|
||||||
Source: [ArchWiki](https://wiki.archlinux.org/index.php/chroot)
|
Source: [ArchWiki](https://wiki.archlinux.org/index.php/chroot)
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
---
|
---
|
||||||
title: "Clearing Systemd Logs"
|
date: 2021-02-21 21:08:51
|
||||||
date: 2021-02-21T16:08:51-05:00
|
|
||||||
draft: false
|
draft: false
|
||||||
tags: ["Linux"]
|
|
||||||
medium_enabled: true
|
medium_enabled: true
|
||||||
|
medium_post_id: acf4ee0e7f0c
|
||||||
|
tags:
|
||||||
|
- Linux
|
||||||
|
title: Clearing Systemd Logs
|
||||||
---
|
---
|
||||||
|
|
||||||
Short post today. I wanted to clear out some disk space usage on one of my servers and noticed that the systemd logs were taking up a decent bit. Here are two options to clear out old logs.
|
Short post today. I wanted to clear out some disk space usage on one of my servers and noticed that the systemd logs were taking up a decent bit. Here are two options to clear out old logs.
|
||||||
|
@ -18,5 +20,4 @@ An example to clear it by total disk usage, let's say 10Gb:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
journalctl --vacuum-size=10G
|
journalctl --vacuum-size=10G
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
---
|
---
|
||||||
title: "Detect Python Version"
|
date: 2021-03-15 22:09:38
|
||||||
date: 2021-03-15T18:09:38-04:00
|
|
||||||
draft: false
|
draft: false
|
||||||
tags: ["Python"]
|
|
||||||
medium_enabled: true
|
medium_enabled: true
|
||||||
|
medium_post_id: f742be560b7f
|
||||||
|
tags:
|
||||||
|
- Python
|
||||||
|
title: Detect Python Version
|
||||||
---
|
---
|
||||||
|
|
||||||
I was working on a distribution recently where `python` was mapped to `python2`. It mixed me up for a bit since I was writing a script for `python3` but it ran partially under `python2`. To lower confusion in the future, I think it's a great idea to check the python version and exit if it isn't the version you expect.
|
I was working on a distribution recently where `python` was mapped to `python2`. It mixed me up for a bit since I was writing a script for `python3` but it ran partially under `python2`. To lower confusion in the future, I think it's a great idea to check the python version and exit if it isn't the version you expect.
|
||||||
|
@ -20,5 +22,4 @@ if version_info.major != 3:
|
||||||
)
|
)
|
||||||
print("Exiting...")
|
print("Exiting...")
|
||||||
exit(1)
|
exit(1)
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
---
|
---
|
||||||
title: "Human Readable Sizes"
|
date: 2021-03-15 23:11:35
|
||||||
date: 2021-03-15T19:11:35-04:00
|
|
||||||
draft: false
|
draft: false
|
||||||
tags: []
|
|
||||||
math: true
|
math: true
|
||||||
medium_enabled: true
|
medium_enabled: true
|
||||||
|
medium_post_id: 2a32b08bd2c1
|
||||||
|
tags: []
|
||||||
|
title: Human Readable Sizes
|
||||||
---
|
---
|
||||||
|
|
||||||
When playing with large and small values, it is useful to convert them to a different unit in scientific notation. Let's look at bytes.
|
When playing with large and small values, it is useful to convert them to a different unit in scientific notation. Let's look at bytes.
|
||||||
|
@ -45,5 +46,4 @@ def humanReadableBytes(num_bytes: int) -> str:
|
||||||
|
|
||||||
return "{:.2f} ".format(num_bytes / (base ** category_num)) + \
|
return "{:.2f} ".format(num_bytes / (base ** category_num)) + \
|
||||||
size_categories[category_num]
|
size_categories[category_num]
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
---
|
---
|
||||||
title: "LibreOffice Calc Tips"
|
date: 2021-02-20 17:37:48
|
||||||
date: 2021-02-20T12:37:48-05:00
|
|
||||||
draft: false
|
draft: false
|
||||||
tags: []
|
|
||||||
medium_enabled: true
|
medium_enabled: true
|
||||||
|
medium_post_id: c55df201e882
|
||||||
|
tags: []
|
||||||
|
title: LibreOffice Calc Tips
|
||||||
---
|
---
|
||||||
|
|
||||||
I've been working with LibreOffice Calc (or Excel) spreadsheets recently and wanted to share some of the things I've learned.
|
I've been working with LibreOffice Calc (or Excel) spreadsheets recently and wanted to share some of the things I've learned.
|
||||||
|
@ -81,5 +82,4 @@ Strings separated by `&` are concatenated together.
|
||||||
|
|
||||||
```excel
|
```excel
|
||||||
"Hello " & "World."
|
"Hello " & "World."
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
---
|
---
|
||||||
title: "Mirror a Hugo Site"
|
date: 2020-12-08 03:41:17
|
||||||
date: 2020-12-07T22:41:17-05:00
|
|
||||||
draft: false
|
draft: false
|
||||||
tags: ["Archive", "Hugo"]
|
|
||||||
medium_enabled: true
|
medium_enabled: true
|
||||||
|
medium_post_id: 75a8b76182aa
|
||||||
|
tags:
|
||||||
|
- Archive
|
||||||
|
- Hugo
|
||||||
|
title: Mirror a Hugo Site
|
||||||
---
|
---
|
||||||
|
|
||||||
I'm a big proponent of having offline copies of content. Especially when I'm on travel and don't have easy Internet access. Using the built in hugo webserver and a reverse proxy, I will show how we can host a local mirror of a Hugo site.
|
I'm a big proponent of having offline copies of content. Especially when I'm on travel and don't have easy Internet access. Using the built in hugo webserver and a reverse proxy, I will show how we can host a local mirror of a Hugo site.
|
||||||
|
@ -83,5 +86,4 @@ Then restart the `httpd` service.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo systemctl restart httpd
|
sudo systemctl restart httpd
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
---
|
---
|
||||||
title: "Mirroring with Gitea"
|
date: 2020-12-08 04:46:21
|
||||||
date: 2020-12-07T23:46:21-05:00
|
|
||||||
draft: false
|
draft: false
|
||||||
tags: ["Archive"]
|
|
||||||
medium_enabled: true
|
medium_enabled: true
|
||||||
|
medium_post_id: ce7a39da156b
|
||||||
|
tags:
|
||||||
|
- Archive
|
||||||
|
title: Mirroring with Gitea
|
||||||
---
|
---
|
||||||
|
|
||||||
Sites like Github, Gitlab, and BitBucket have nice UIs that make looking at commit diffs and issue tracking easier. However, this requires an internet connection. What if we can mirror the content from these sites locally? Gitea comes to the rescue!
|
Sites like Github, Gitlab, and BitBucket have nice UIs that make looking at commit diffs and issue tracking easier. However, this requires an internet connection. What if we can mirror the content from these sites locally? Gitea comes to the rescue!
|
||||||
|
@ -127,4 +129,4 @@ sudo systemctl restart httpd
|
||||||
```
|
```
|
||||||
|
|
||||||
## Mirroring
|
## Mirroring
|
||||||
To mirror a repo, first click on the plus sign and select "New Migration", then make sure to check the "This repository will be a mirror".
|
To mirror a repo, first click on the plus sign and select "New Migration", then make sure to check the "This repository will be a mirror".
|
|
@ -1,9 +1,12 @@
|
||||||
---
|
---
|
||||||
title: "Multicast Receive Script"
|
date: 2020-11-18 15:09:15
|
||||||
date: 2020-11-18T10:09:15-05:00
|
|
||||||
draft: false
|
draft: false
|
||||||
tags: ["Linux", "Networking"]
|
|
||||||
medium_enabled: true
|
medium_enabled: true
|
||||||
|
medium_post_id: 6f6efe549a47
|
||||||
|
tags:
|
||||||
|
- Linux
|
||||||
|
- Networking
|
||||||
|
title: Multicast Receive Script
|
||||||
---
|
---
|
||||||
|
|
||||||
I use `socat` to debug mutlicast traffic, though the syntax for it is complicated to learn. Here is the command that I normally use to debug multicast traffic.
|
I use `socat` to debug mutlicast traffic, though the syntax for it is complicated to learn. Here is the command that I normally use to debug multicast traffic.
|
||||||
|
@ -46,5 +49,4 @@ multicast_address="$1"
|
||||||
port="$2"
|
port="$2"
|
||||||
|
|
||||||
socat UDP4-RECVFROM:"$port",ip-add-membership="$multicast_address":0.0.0.0,fork -
|
socat UDP4-RECVFROM:"$port",ip-add-membership="$multicast_address":0.0.0.0,fork -
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
---
|
---
|
||||||
title: "DHCP for Raspberry Pi"
|
date: 2021-02-16 03:46:21
|
||||||
date: 2021-02-15T22:46:21-05:00
|
|
||||||
draft: false
|
draft: false
|
||||||
tags: ["Networking"]
|
|
||||||
medium_enabled: true
|
medium_enabled: true
|
||||||
|
medium_post_id: 8c13511f5b45
|
||||||
|
tags:
|
||||||
|
- Networking
|
||||||
|
title: DHCP for Raspberry Pi
|
||||||
---
|
---
|
||||||
|
|
||||||
Recently I ran across the use case where I needed a Raspberry Pi to be connected to the Internet via a WiFI connection, while also providing DHCP leases through an Ethernet connection. I couldn't find a great way to achieve this with `dhcpcd` so instead I grabbed a tool that I'm more familiar with `dnsmasq`.
|
Recently I ran across the use case where I needed a Raspberry Pi to be connected to the Internet via a WiFI connection, while also providing DHCP leases through an Ethernet connection. I couldn't find a great way to achieve this with `dhcpcd` so instead I grabbed a tool that I'm more familiar with `dnsmasq`.
|
||||||
|
@ -55,5 +57,4 @@ dhcp-range=192.168.0.50,192.168.0.150,12h
|
||||||
# Enable DHCPv6. Note that the prefix-length does not need to be specified
|
# Enable DHCPv6. Note that the prefix-length does not need to be specified
|
||||||
# and defaults to 64 if missing/
|
# and defaults to 64 if missing/
|
||||||
#dhcp-range=1234::2, 1234::500, 64, 12h
|
#dhcp-range=1234::2, 1234::500, 64, 12h
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
---
|
---
|
||||||
title: "Streaming PulseAudio over RTP"
|
date: 2020-11-24 04:41:41
|
||||||
date: 2020-11-23T23:41:41-05:00
|
|
||||||
draft: false
|
draft: false
|
||||||
tags: ["Audio-Video"]
|
|
||||||
medium_enabled: true
|
medium_enabled: true
|
||||||
|
medium_post_id: 334b857013b9
|
||||||
|
tags:
|
||||||
|
- Audio-Video
|
||||||
|
title: Streaming PulseAudio over RTP
|
||||||
---
|
---
|
||||||
|
|
||||||
With PulseAudio, we can send a RTP stream over multicast UDP. Here is the bash commands to setup a sink where anything sent to it gets broadcasted to the multicast address 224.0.0.56 at port 46416.
|
With PulseAudio, we can send a RTP stream over multicast UDP. Here is the bash commands to setup a sink where anything sent to it gets broadcasted to the multicast address 224.0.0.56 at port 46416.
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
---
|
---
|
||||||
title: "Quick Bash: Check Argument Count"
|
date: 2020-12-15 14:25:11
|
||||||
date: 2020-12-15T09:25:11-05:00
|
|
||||||
draft: false
|
draft: false
|
||||||
tags: ["Bash"]
|
|
||||||
medium_enabled: true
|
medium_enabled: true
|
||||||
|
medium_post_id: ac38c9d9d896
|
||||||
|
tags:
|
||||||
|
- Bash
|
||||||
|
title: 'Quick Bash: Check Argument Count'
|
||||||
---
|
---
|
||||||
|
|
||||||
I've been writing more bash scripts recently and I noticed that I often check for the number of arguments before validating them in my scripts. I'll share that small snippet here for my future self.
|
I've been writing more bash scripts recently and I noticed that I often check for the number of arguments before validating them in my scripts. I'll share that small snippet here for my future self.
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
---
|
---
|
||||||
title: "Stow Version Manager"
|
date: 2021-02-25 15:31:34
|
||||||
date: 2021-02-25T10:31:34-05:00
|
|
||||||
draft: false
|
draft: false
|
||||||
tags: []
|
|
||||||
medium_enabled: true
|
medium_enabled: true
|
||||||
|
medium_post_id: 14639c9db6a4
|
||||||
|
tags: []
|
||||||
|
title: Stow Version Manager
|
||||||
---
|
---
|
||||||
|
|
||||||
Suppose you need a newer or specific version of a package that isn't included in your standard linux repo. The standard procedure is to do something like the following...
|
Suppose you need a newer or specific version of a package that isn't included in your standard linux repo. The standard procedure is to do something like the following...
|
||||||
|
@ -126,4 +127,4 @@ If you get a command not found for an executable you know lives in `/usr/local/b
|
||||||
Inside your `~/.bash_rc`
|
Inside your `~/.bash_rc`
|
||||||
```bash
|
```bash
|
||||||
export PATH=$PATH:/usr/local/bin
|
export PATH=$PATH:/usr/local/bin
|
||||||
```
|
```
|
Loading…
Reference in a new issue