Added tags

This commit is contained in:
Brandon Rozek 2020-02-16 17:46:18 -05:00
parent bca1f711a5
commit aa4280542b
50 changed files with 67 additions and 48 deletions

View file

@ -2,6 +2,7 @@
title: "Debugging and Performance"
date: 2019-06-15T10:59:30-04:00
draft: false
tags: [ "linux" ]
---
I've come to like the GNU Debugger (GDB) and the `perf` tool recently. This post will be a short summary of the various interesting commands you can use.

View file

@ -24,4 +24,4 @@ wget --mirror \
There were other solutions in that stack overflow post, but something about the simplicity of `wget` appealed to me.
[Example site I archived with this.](https://sentenceworthy.com)
[Example site I archived with this.](https://sentenceworthy.com)

View file

@ -2,7 +2,7 @@
title: "aspell"
date: 2019-12-10T22:20:48-05:00
draft: false
images: []
tags: [ "linux" ]
---
When I was working on my honors thesis, I realized that I needed a way to spell check the file. After a quick search, I stumbled upon `aspell` which is a `curses` based tool to provide an interactive way for dealing with misspellings. Try it out when you have the chance!
When I was working on my honors thesis, I realized that I needed a way to spell check the file. After a quick search, I stumbled upon `aspell` which is a `curses` based tool to provide an interactive way for dealing with misspellings. Try it out when you have the chance!

View file

@ -2,6 +2,7 @@
title: "Bash Flags"
date: 2019-08-06T16:55:47-04:00
draft: false
tags: [ "linux", "bash" ]
---
I was creating a bash script and was looking around for a solution for parsing command line arguments. [This StackOverflow post](https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash) has a variety of different solutions available. I want to describe my favorite of these posts.
@ -29,4 +30,4 @@ Let me quickly describe what it does. While the number of arguments left to proc
- If it doesn't. Error out.
- Then get rid of an argument.
At the end of the while loop, you would've evaluated all the arguments!
At the end of the while loop, you would've evaluated all the arguments!

View file

@ -2,6 +2,7 @@
title: "Handling Background Processes in Bash"
date: 2019-06-17T19:50:30-04:00
draft: false
tags: [ "linux", "bash" ]
---
For multi-process applications, I want to be able to start it up using the `bash` command processor and be able to stop all the processes just by hitting `CTRL-C`.

View file

@ -2,7 +2,7 @@
title: "Bat: The user friendly cat"
date: 2020-02-01T06:26:18-05:00
draft: false
images: []
tags: [ "linux" ]
---
`bat` is a more human pleasing replacement of `cat` with the following features:
@ -24,4 +24,4 @@ print(c[1])
And here's a screenshot of my terminal session when I called `bat`
![image-20200201063050726](/files/images/20200201063050726.png)
![image-20200201063050726](/files/images/20200201063050726.png)

View file

@ -2,6 +2,7 @@
title: "Chirp"
date: 2019-09-27T22:46:52-04:00
draft: false
tags: [ "linux", "amateur radio" ]
---
In the land of Ham Radio, you can program your radio with a very popular open source software called `chirp`. For Ubuntu users to install it, it is recommended you use the PPA to keep up to date with radio software...

View file

@ -2,7 +2,7 @@
title: "Ensuring Docker Compose Startup with Systemd"
date: 2019-12-16T20:57:36-05:00
draft: false
images: []
tags: [ "linux", "containers" ]
---
I've been having trouble getting some docker containers such as `nginx` to start automatically on bootup, even with the `restart: always` flag.

View file

@ -2,6 +2,7 @@
title: "Copy to RAM Please"
date: 2019-08-02T22:37:12-04:00
draft: false
tags: [ "linux" ]
---
I bought a 1U server recently, and I forgot to purchase a SSD to actually hold data. Since I couldn't hold my excitement to play with the server, I decided to load an operating system entirely into RAM and never turn it off for the meantime.
@ -10,4 +11,4 @@ I browsed [List of Linux Distributoins that run from RAM](https://en.wikipedia.o
It's not what I would use for my daily driver but in terms of doing this task its perfect. It loads up quickly and lets me perform nice basic user functions. It's also based on debian so I have a whole repository of packages available I can install.
Now by default, if you're on a USB it'll try to run in a persistent mode, just press ESC in the boot splash to have the option to copy to ram.
Now by default, if you're on a USB it'll try to run in a persistent mode, just press ESC in the boot splash to have the option to copy to ram.

View file

@ -2,7 +2,7 @@
title: "coredns"
date: 2019-12-13T02:00:29-05:00
draft: false
images: []
tags: [ "linux", "network", "containers" ]
---
Domain names are the easiest way for a reverse proxy to split up services in a homelab. Since I'm going full docker-compose in my homelab, I decided to use `coredns`.

View file

@ -2,6 +2,7 @@
title: "Custom Python REPL"
date: 2019-10-27T23:43:12-04:00
draft: false
tags: [ "python" ]
---
Are you tired of importing the same libraries and setting up the same variables? Why not just create your own custom REPL? Now of course, we're not going to do it from scratch, but instead utilize what Python already gives us.

View file

@ -2,9 +2,9 @@
title: "Custom Executables"
date: 2020-02-03T20:10:34-05:00
draft: false
images: []
tags: [ "linux" ]
---
As time goes on more and more scripts start to accumulate in my scripts folder. It turns out though, that there is a standard way of having local user scripts that get automatically added to your path. I started noticing this in Ubuntu when more and more projects started utilizing the `~/.local/bin` directory.
So stick any scripts you have in there since by default on some distributions `$PATH` is setup to look there!
So stick any scripts you have in there since by default on some distributions `$PATH` is setup to look there!

View file

@ -2,7 +2,7 @@
title: "Burning ISOs with dd"
date: 2020-01-20T10:23:20-05:00
draft: false
images: []
tags: [ "linux" ]
---
While there are nice graphical tools like [Etcher](https://www.balena.io/etcher/), what is almost always a constant is the tool `dd`. Therefore, for future reference I'll just paste the `dd` command I use to make ISO images.

View file

@ -2,6 +2,7 @@
title: "Getting started with Digital Modes in Linux"
date: 2019-09-04T09:52:21-04:00
draft: false
tags: [ "amateur radio" ]
---
This blog post is going to describe what steps I took to be able to decode signals using digital modes. Hardware wise, you will either need a RTL-SDR receiver or a transceiver radio with a cable plugging into the computer's soundcard.
@ -75,4 +76,4 @@ Since I'm also a beginner, I will share what I got stuck on and how you can avoi
Make sure that you know the appropriate mode to demodulate the signal. I've had luck getting information from https://www.sigidwiki.com/wiki/Signal_Identification_Guide
-> This needs to be configured on both Gqrx and Fldigi
-> This needs to be configured on both Gqrx and Fldigi

View file

@ -2,6 +2,7 @@
title: "Discovering Ham Radio"
date: 2019-07-01T22:06:23-04:00
draft: false
tags: [ "amateur radio" ]
---
I feel like Ham Radio has been hiding in the background as I move through life. I knew someone that kept a Ham radio in his car, Noah talks about it frequently on his [podcast](http://www.asknoahshow.com/), and it seemed like the next step after [playing with](https://github.com/brandon-rozek/radiotuner) [software defined radio](https://www.amazon.com/RTL-SDR-Blog-RTL2832U-Software-Telescopic/dp/B011HVUEME/ref=sr_1_3).

View file

@ -2,7 +2,7 @@
title: "Advanced Docker Image Construction with Bash"
date: 2019-12-26T21:01:37-05:00
draft: false
images: []
tags: [ "linux", "containers", "bash" ]
---
On current versions of Docker, you can't mount volumes during image construction. This poses an issue for me as I don't want to replicate gigabytes of data already existing on my disk when it won't appear on the final build. Therefore, instead of building an image with a traditional Dockerfile, we're going to use a bash script on a running base image container and export the filesystem to create the image from.

View file

@ -2,6 +2,7 @@
title: "FM Radio Tuner"
date: 2019-05-21T22:08:54-04:00
draft: true
tags: [ "software defined radio" ]
---
I recently bought a [RTL-SDR Receiver](https://www.amazon.com/RTL-SDR-Blog-RTL2832U-Software-Telescopic/dp/B011HVUEME/ref=sr_1_3) off of Amazon to get started with [Software Defined Radio](https://en.wikipedia.org/wiki/Software-defined_radio). To start off, I thought that it would be great if I can write a fm receiver.

View file

@ -2,7 +2,7 @@
title: "GStreamer"
date: 2020-02-08T20:46:36-05:00
draft: false
images: []
tags: [ "linux" ]
---
GStreamer is a pipeline based multimedia framework that goes from capture, processing, to a sink such as a X window or UDP sink.

View file

@ -2,7 +2,7 @@
title: "Limit Bandwidth through Terminal"
date: 2020-01-15T19:51:45-05:00
draft: false
images: []
tags: [ "linux", "network" ]
---
Have you ever wondered how an application or a system would operate under low bandwidth environments? Luckily `wondershaper` is a tool to help with just that!
@ -34,4 +34,4 @@ To clear the rules,
```bash
sudo wondershaper clear [interface]
```
```

View file

@ -2,6 +2,7 @@
title: "Linux Desktop Icons"
date: 2019-06-03T21:05:37-04:00
draft: false
tags: [ "linux" ]
---
I get asked a decent number of times how to add desktop icons on Linux. Luckily it's incredibly easy. [It's a `freedesktop` standard](http://standards.freedesktop.org/desktop-entry-spec/latest/).

View file

@ -2,7 +2,7 @@
title: "LXD on tmpfs"
date: 2019-12-31T22:35:21-05:00
draft: false
images: []
tags: [ "linux", "storage", "containers" ]
---
Container images are designed to be as small as possible. Wouldn't it be cool if we can hold entire containers in RAM? This post outlines how to accomplish this using LXD. It turns out that it is a lot easier to setup custom storage pools on LXD than with Docker.

View file

@ -2,7 +2,7 @@
title: "MergerFS"
date: 2020-01-14T23:10:17-05:00
draft: false
images: []
tags: [ "linux", "storage" ]
---
[MergerFS](https://github.com/trapexit/mergerfs) is a great filesystem for an expandable storage system in a homelab. Mostly since it allows you to add disks one at a time without having to, for example, resilver a ZFS pool. MergerFS won't be as efficient as a filesystem that stripes your data across disks, but in the case of a disk failure the disks unaffected will still have part of the data.

View file

@ -2,7 +2,7 @@
title: "Mirror Download with wget"
date: 2020-01-20T21:18:12-05:00
draft: false
images: []
tags: [ "linux" ]
---
This post will describe downloading a `centos` repo using `wget`. Though the ideas in this blog post can apply to any mirror with packages exposed via http.

View file

@ -2,7 +2,7 @@
title: "Missing Libraries"
date: 2020-02-08T20:42:50-05:00
draft: false
images: []
tags: [ "linux" ]
---
The piwheels blog outlined a great [post](https://blog.piwheels.org/how-to-work-out-the-missing-dependencies-for-a-python-package/) on what to do when you are missing shared libraries in Python packages. Though the short of this tip is helpful on its own as well. If you are running any piece of software and its missing a library, try to find the `.so` file related to that package.

View file

@ -2,6 +2,7 @@
title: "Network Throughput Testing"
date: 2019-08-30T20:11:26-04:00
draft: false
tags: [ "linux", "network" ]
---
I ended up upgrading the wiring in my place to CAT7 recently and I wanted to see if there was a noticeable performance difference to my previous cabling. This blog post won't be a product comparison, but instead I'll show how you can do network throughput testing at your own location.

View file

@ -2,6 +2,7 @@
title: "NotImplemented"
date: 2019-10-27T23:35:17-04:00
draft: false
tags: [ "python" ]
---
Let's say you overwrite the `__mul__` operator in a class in Python, but you don't want the function to be called for all kinds of input. You can specify the type by just returning `NotImplemented` for types you don't want.

View file

@ -2,7 +2,7 @@
title: "Offline Pip Packages"
date: 2020-01-20T23:11:05-05:00
draft: false
images: []
tags: [ "python" ]
---
There are a few reasons I can think of to have offline pip packages:

View file

@ -2,6 +2,7 @@
title: "Oh My Zsh"
date: 2019-07-21T08:45:03-04:00
draft: false
tags: [ "linux" ]
---
Zsh is an extension of the sh that contains a lot more features than the default bash shell installed on most systems.
@ -42,4 +43,4 @@ The list of plugins I have is:
- debian
- systemd
- sudo
- zsh-syntax-highlighting
- zsh-syntax-highlighting

View file

@ -2,7 +2,7 @@
title: "Ping Discovery"
date: 2020-02-02T22:21:30-05:00
draft: false
images: []
tags: [ "linux", "network" ]
---
Plugging in a device into a network with DHCP will often result in you not knowing what the ip is. If you don't have easy access to the DHCP server, then one way to see what ip addresses are on the network is to do a ping scan.

View file

@ -2,7 +2,7 @@
title: "Quick Python: Abstract Classes"
date: 2020-01-26T18:40:03-05:00
draft: false
images: []
tags: [ "python" ]
---
You can create an abstract class in Python by inheriting Abstract Base Class (`ABC`) and declaring relevant methods abstract.

View file

@ -2,7 +2,7 @@
title: "Quick Python: Interrupts"
date: 2020-01-25T09:51:34-05:00
draft: false
images: []
tags: [ "python" ]
---
This post is part of a new series I'm starting where I quickly outline small Python snippets.

View file

@ -2,7 +2,7 @@
title: "Quick Python: Package Namespacing"
date: 2020-02-03T20:13:38-05:00
draft: false
images: []
tags: [ "python" ]
---
Package namespacing can help organize modules within a larger project. It can also help show that a package belongs to an organization.

View file

@ -2,7 +2,7 @@
title: "Python Path Hacks"
date: 2020-01-13T22:26:16-05:00
draft: false
images: []
tags: [ "python" ]
---
There are two quick ways to hack together custom imports in Python. One is by using the `PYTHONPATH` environmental variable, and the other way is by using the `sys` module in Python.
@ -28,4 +28,4 @@ sys.path.append('/other/path')
## Remarks
Of course this isn't the best way to add custom libraries to your Python scripts. Ideally, we would use `pip` to manage our dependencies. Perhaps a future blog post will cover this!
Of course this isn't the best way to add custom libraries to your Python scripts. Ideally, we would use `pip` to manage our dependencies. Perhaps a future blog post will cover this!

View file

@ -2,6 +2,7 @@
title: "Python Typing"
date: 2019-10-28T00:12:34-04:00
draft: false
tags: [ "python" ]
---
There's a typing module built right into Python that you can use on your applications. Sobolevn write a great [blog post](https://sobolevn.me/2019/01/simple-dependent-types-in-python) about it. One thing that threw me off at first is that if you add type annotations and then run python like you normally would, it would act as if the annotations weren't there.
@ -11,4 +12,4 @@ Why use type annotations then?
1. It enhances your internal docs. VS Code and other editors pick this up and show it to the user in their IDE.
2. You can use `mypy` to perform type checking for you.
I go back and forth with type checking in Python, but I do think that forcing yourself to follow type safety makes you a better programmer.
I go back and forth with type checking in Python, but I do think that forcing yourself to follow type safety makes you a better programmer.

View file

@ -2,7 +2,7 @@
title: "Quickly Setting up a Storage Device"
date: 2020-01-12T21:43:26-05:00
draft: false
images: []
tags: [ "linux", "storage" ]
---
This post exists mostly to aid myself for when I buy new drives for my home server. It's a quick and easy way to create an ext4 filesystem over the entire drive.

View file

@ -2,7 +2,7 @@
title: "Quick Python: List Files Recursively"
date: 2020-02-09T17:31:44-05:00
draft: false
images: []
tags: [ "python" ]
---
In order to add website files into a Flask application using setuptools, I needed to recurse down several directories and grab HTML and CSS files.

View file

@ -2,6 +2,7 @@
title: "Robustdd"
date: 2019-09-27T22:45:56-04:00
draft: false
tags: [ "linux" ]
---
This blog post is going to assume that we're writing to `/dev/sdX`. Please change this to whatever disk you're actually trying to write to. I bear no responsibility if you accidentally write to your OS drives.

View file

@ -2,7 +2,7 @@
title: "Scrcpy"
date: 2020-01-09T21:36:30-05:00
draft: false
images: []
tags: [ "android" ]
---
With [Scrcpy](https://github.com/Genymobile/scrcpy) you can control an Android device remotely!
@ -24,4 +24,4 @@ adb tcpip 5555
```bash
adb connect DEVICE_IP:5555
```
5. Run `scrcpy`
5. Run `scrcpy`

View file

@ -2,7 +2,7 @@
title: "Analyzing Startup Times with Systemd"
date: 2019-12-26T22:52:59-05:00
draft: false
images: []
tags: [ "linux" ]
---
Startup times feeling slow? Check to see if there are any uneeded services slowing you down!

View file

@ -2,6 +2,7 @@
title: "Systemd with Python environments"
date: 2019-08-25T20:04:20-04:00
draft: false
tags: [ "linux", "python" ]
---
It took me some time to realize why I couldn't start a project during startup. I then realized that it was because I was using a python virtual environment and didn't tell systemd about it.

View file

@ -2,7 +2,7 @@
title: "Temporarily Resolving Hostnames"
date: 2020-01-04T21:26:16-05:00
draft: false
images: []
tags: [ "linux", "network" ]
---
Let's say that we're testing a webserver where the pages served depended on a domain that you don't own. The most common way I know to test this is to modify your `/etc/hosts` file to contain the hostname and ip address you want to map it to.
@ -21,4 +21,4 @@ There are also browser extensions that you can use such as [LiveHosts](https://g
If this is going to be a publicly facing service, then you should just set the records of your domain name to point to the server.
If it's a non-public routable service, then perhaps try looking into setting up your own private [dns server](https://brandonrozek.com/blog/coredns/).
If it's a non-public routable service, then perhaps try looking into setting up your own private [dns server](https://brandonrozek.com/blog/coredns/).

View file

@ -2,7 +2,7 @@
title: "Temporary Static IP"
date: 2020-01-20T21:36:37-05:00
draft: false
images: []
tags: [ "linux", "network" ]
---
I've learned that the fastest way to transfer files is via Ethernet. Now the easiest way to transfer via Ethernet is for both computers to be on the same local area network. However, if needed, an Ethernet cable can used between two computers.

View file

@ -2,7 +2,7 @@
title: "Toggling X Input"
date: 2020-01-07T20:46:32-05:00
draft: false
images: []
tags: [ "linux" ]
---
On X, we can easily enable or disable input devices using the `xinput` command. This is a great use case when you're tired of accidentally hitting the red Thinkpad nub or having your palm be recognized when drawing with a pen.
@ -27,4 +27,4 @@ To enable a device:
xinput enable [id]
```
The ids are listed when you list the devices.
The ids are listed when you list the devices.

View file

@ -2,10 +2,11 @@
title: "Unattended Upgrades"
date: 2019-05-26T12:52:03-04:00
draft: false
tags: [ "linux", "ubuntu" ]
---
I'm a big believer of reducing maintenance. One of the things that I didn't bother setting up before but should've is *unattended upgrades*. The benefits of this is that you don't have to repeatedly log into your sever to upgrade your system.
Why bother managing your own server in the first place? Well with a virtualized system you can set up any type of application that you like. You're not limited to only hosting static sites or whatever applications the C-Panel instance allows.
Now there's no need for me to reiterate what's been done before, so here's a [useful post from libre-software](https://libre-software.net/ubuntu-automatic-updates/) describing how to set it up so that a Ubuntu server updates itself automatically.
Now there's no need for me to reiterate what's been done before, so here's a [useful post from libre-software](https://libre-software.net/ubuntu-automatic-updates/) describing how to set it up so that a Ubuntu server updates itself automatically.

View file

@ -2,8 +2,9 @@
title: "Wacom and USB Redirection in Virtual Machines"
date: 2019-05-24T22:15:56-04:00
draft: false
tags: [ "linux" ]
---
[Virt-Manager](https://virt-manager.org/) is a great tool for managing virtual machines under Linux. Today I learned of [Spice USB redirection](https://blog.wikichoon.com/2014/04/spice-usb-redirection-in-virt-manager.html). Essentially it allows you to switch USB devices from the host to the virtualized environment. This came in handy when I noticed that the graphics tablet device was not able to do pressure sensitivity on the Windows guest.
To achieve this goal, I removed the graphics tablet hardware device and manually redirected that USB device to the guest. I then remembered to install the [Wacom drivers](https://www.wacom.com/en-us/support/product-support/drivers) for the Windows VM.
To achieve this goal, I removed the graphics tablet hardware device and manually redirected that USB device to the guest. I then remembered to install the [Wacom drivers](https://www.wacom.com/en-us/support/product-support/drivers) for the Windows VM.

View file

@ -2,7 +2,7 @@
title: "Virtual Disks"
date: 2020-01-06T22:26:58-05:00
draft: false
images: []
tags: [ "linux", "storage" ]
---
Have you wanted to [play with ZFS](https://wiki.archlinux.org/index.php/ZFS/Virtual_disks) or any other filesystem without creating a dedicated partition or device? We can do this through virtual disks!
@ -81,4 +81,4 @@ rm $HOME/scratch.img
## Conclusion
With virtual disks we can experiment with different types of filesystems and perhaps try out snapshotting in supported filesystems. If we create virtual disks on [`tmpfs` ](/blog/lxdtmpfs/), then we can have a super fast file system as well!
With virtual disks we can experiment with different types of filesystems and perhaps try out snapshotting in supported filesystems. If we create virtual disks on [`tmpfs` ](/blog/lxdtmpfs/), then we can have a super fast file system as well!

View file

@ -2,6 +2,7 @@
title: "Python Virtual Environments"
date: 2019-05-21T23:04:54-04:00
draft: false
tags: [ "python" ]
---
Dependency management is hard. Luckily with Python there is a program called `virtualenv` that can help isolate different projects and manage dependencies.

View file

@ -2,7 +2,7 @@
title: "Nested X Sessions with Xephyr"
date: 2019-12-25T00:52:02-05:00
draft: false
images: []
tags: [ "linux" ]
---
The X Window System was designed at a time when applications that ran on your computer were assumed to be trusted. Therefore there are minimal restrictions in place to prevent applications from grabbing images of whats on another applications screens. This feature as you might imagine is quite useful for screen clipper applications.
@ -52,4 +52,4 @@ DISPLAY=:$DNum
x-window-manager &
```
Of course you can replace ratpoison and your native x-window manager with any other window manager of your choice. It actually makes it a great way to test different environments.
Of course you can replace ratpoison and your native x-window manager with any other window manager of your choice. It actually makes it a great way to test different environments.

View file

@ -2,7 +2,7 @@
title: "xpra"
date: 2020-01-15T18:29:57-05:00
draft: false
images: []
tags: [ "linux" ]
---
[`xpra`](http://xpra.org/) allows one to run persistent X applications on a remote host and display it on a local machine. It's a combination of [SSH X11 Forwarding](https://wiki.archlinux.org/index.php/OpenSSH#X11_forwarding) and [Screen](https://www.gnu.org/software/screen/).

View file

@ -2,7 +2,7 @@
title: "Zsh and Snaps"
date: 2020-01-25T09:46:23-05:00
draft: false
images: []
tags: [ "linux" ]
---
In case I forget again, by default when snaps are installed it doesn't populate in the `zsh` shell. To enable this add the following to `/etc/zsh/zprofile`