Commit bfa5b12e22
Unsigned
Layout: unified · split
README.md +9 −8
| @@ -28,12 +28,13 @@ Use `zola build` and deploy to whichever deployment target you prefer. | |||
| 28 | 28 | ||
| 29 | ## Tasks | 29 | ## Tasks |
| 30 | 30 | ||
| 31 | - [ ] Format all blog posts | 31 | - [x] Format all blog posts |
| 32 | - [ ] 2018 | 32 | - [x] 2018 |
| 33 | - [ ] 2019 | 33 | - [x] 2019 |
| 34 | - [ ] 2020 | 34 | - [x] 2020 |
| 35 | - [ ] 2021 | 35 | - [x] 2021 |
| 36 | - [ ] 2022 | 36 | - [x] 2022 |
| 37 | - [ ] 2023 | 37 | - [x] 2023 |
| 38 | - [ ] 2024 | 38 | - [x] 2024 |
| 39 | - [ ] Add descriptions to blog posts | ||
| 39 | - [ ] Figure out how to get file tags to show up | 40 | - [ ] Figure out how to get file tags to show up |
content/blog/2018-11-28-aes-encryption.md +89 −95
| @@ -7,119 +7,113 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Basic AES | 8 | # Basic AES |
| 9 | 9 | ||
| 10 | If you\'re not familiar with encryption techniques, | 10 | If you're not familiar with encryption techniques, |
| 11 | [AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) is the | 11 | [AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) is the |
| 12 | **Advanced Encryption Standard**. This specification was established by | 12 | **Advanced Encryption Standard**. This specification was established by the |
| 13 | the National Institute of Standards and Technology, sub-selected from | 13 | National Institute of Standards and Technology, sub-selected from the Rijndael |
| 14 | the Rijndael family of ciphers (128, 192, and 256 bits) in 2001. | 14 | family of ciphers (128, 192, and 256 bits) in 2001. Furthering its popularity |
| 15 | Furthering its popularity and status, the US government chose AES as | 15 | and status, the US government chose AES as their default encryption method for |
| 16 | their default encryption method for top-secret data, removing the | 16 | top-secret data, removing the previous standard which had been in place since |
| 17 | previous standard which had been in place since 1977. | 17 | 1977. |
| 18 | 18 | ||
| 19 | AES has proven to be an extremely safe encryption method, with 7-round | 19 | AES has proven to be an extremely safe encryption method, with 7-round and |
| 20 | and 8-round attacks making no material improvements since the release of | 20 | 8-round attacks making no material improvements since the release of this |
| 21 | this encryption standard almost two decades ago. | 21 | encryption standard almost two decades ago. |
| 22 | 22 | ||
| 23 | > Though many papers have been published on the cryptanalysis of AES, | 23 | > Though many papers have been published on the cryptanalysis of AES, the |
| 24 | > the fastest single-key attacks on round-reduced AES variants \[20, | 24 | > fastest single-key attacks on round-reduced AES variants [20, 33] so far are |
| 25 | > 33\] so far are only slightly more powerful than those proposed 10 | 25 | > only slightly more powerful than those proposed 10 years ago [23,24]. |
| 26 | > years ago \[23,24\]. | ||
| 27 | > | 26 | > |
| 28 | > - [Bogdonav, et | 27 | > - [Bogdonav, et |
| 29 | > al.](http://research.microsoft.com/en-us/projects/cryptanalysis/aesbc.pdf) | 28 | > al.](http://research.microsoft.com/en-us/projects/cryptanalysis/aesbc.pdf) |
| 30 | 29 | ||
| 31 | # How Secure is AES? | 30 | # How Secure is AES? |
| 32 | 31 | ||
| 33 | In theory, AES-256 is non-crackable due to the massive number of | 32 | In theory, AES-256 is non-crackable due to the massive number of combinations |
| 34 | combinations that can be produced. However, AES-128 is no longer | 33 | that can be produced. However, AES-128 is no longer recommended as a viable |
| 35 | recommended as a viable implementation to protect important data. | 34 | implementation to protect important data. |
| 36 | 35 | ||
| 37 | A semi-short [comic | 36 | A semi-short [comic |
| 38 | strip](http://www.moserware.com/2009/09/stick-figure-guide-to-advanced.html) | 37 | strip](http://www.moserware.com/2009/09/stick-figure-guide-to-advanced.html) |
| 39 | from Moserware quickly explains AES for the public to understand. | 38 | from Moserware quickly explains AES for the public to understand. Basically AES |
| 40 | Basically AES encrypts the data by obscuring the relationship between | 39 | encrypts the data by obscuring the relationship between the data and the |
| 41 | the data and the encrypted data. Additionally, this method spreads the | 40 | encrypted data. Additionally, this method spreads the message out. Lastly, the |
| 42 | message out. Lastly, the key produced by AES is the secret to decrypting | 41 | key produced by AES is the secret to decrypting it. Someone may know the method |
| 43 | it. Someone may know the method of AES, but without the key, they are | 42 | of AES, but without the key, they are powerless. |
| 44 | powerless. | 43 | |
| 45 | 44 | To obscure and spread the data out, AES creates a substitution-permutation | |
| 46 | To obscure and spread the data out, AES creates a | 45 | network. Wikipedia has a wonderful [example of an SP |
| 47 | substitution-permutation network. Wikipedia has a wonderful [example of | ||
| 48 | an SP | ||
| 49 | network](https://upload.wikimedia.org/wikipedia/commons/thumb/c/cd/SubstitutionPermutationNetwork2.png/468px-SubstitutionPermutationNetwork2.png) | 46 | network](https://upload.wikimedia.org/wikipedia/commons/thumb/c/cd/SubstitutionPermutationNetwork2.png/468px-SubstitutionPermutationNetwork2.png) |
| 50 | available. This network sends the data through a set of S boxes (using | 47 | available. This network sends the data through a set of S boxes (using the |
| 51 | the unique key) to substitute the bits with another block of bits. Then, | 48 | unique key) to substitute the bits with another block of bits. Then, a P box |
| 52 | a P box will permutate, or rearrange, the bits. This is done over and | 49 | will permutate, or rearrange, the bits. This is done over and over, with the key |
| 53 | over, with the key being derived from the last round. For AES, the key | 50 | being derived from the last round. For AES, the key size specifies the number of |
| 54 | size specifies the number of transformation rounds: 10, 12, and 14 | 51 | transformation rounds: 10, 12, and 14 rounds for 128-bit, 192-bit, and 256-bit |
| 55 | rounds for 128-bit, 192-bit, and 256-bit keys, respectively. | 52 | keys, respectively. |
| 56 | 53 | ||
| 57 | # The Process | 54 | # The Process |
| 58 | 55 | ||
| 59 | 1. \*KeyExpansion=: Using [Rijndael\'s key | 56 | 1. **KeyExpansion**: Using [Rijndael's key |
| 60 | schedule](https://en.m.wikipedia.org/wiki/Advanced_Encryption_Standard), | 57 | schedule](https://en.m.wikipedia.org/wiki/Advanced_Encryption_Standard), the |
| 61 | the keys are dynamically generated. | 58 | keys are dynamically generated. |
| 62 | 2. **AddRoundKey**: Each byte of the data is combined with this key | 59 | 2. **AddRoundKey**: Each byte of the data is combined with this key using |
| 63 | using bitwise xor. | 60 | bitwise xor. |
| 64 | 3. **SubBytes**: This is followed by the substitution of each byte of | 61 | 3. **SubBytes**: This is followed by the substitution of each byte of data. |
| 65 | data. | 62 | 4. **ShiftRows**: Then, the final three rows are shifted a certain number of |
| 66 | 4. **ShiftRows**: Then, the final three rows are shifted a certain | 63 | steps, dictated by the cipher. |
| 67 | number of steps, dictated by the cipher. | 64 | 5. **MixColumns**: After the rows have been shifted, the columns are mixed and |
| 68 | 5. **MixColumns**: After the rows have been shifted, the columns are | 65 | combined. |
| 69 | mixed and combined. | 66 | |
| 70 | 67 | This process does not necessarily stop after one full round. Steps 2 through 5 | |
| 71 | This process does not necessarily stop after one full round. Steps 2 | 68 | will repeat for the number of rounds specified by the key. However, the final |
| 72 | through 5 will repeat for the number of rounds specified by the key. | 69 | round excludes the MixColumns step. As you can see, this is a fairly complex |
| 73 | However, the final round excludes the MixColumns step. As you can see, | 70 | process. One must have a solid understanding of general mathematic principles to |
| 74 | this is a fairly complex process. One must have a solid understanding of | 71 | fully understand how the sequence works (and to even attempt to find a |
| 75 | general mathematic principles to fully understand how the sequence works | 72 | weakness). |
| 76 | (and to even attempt to find a weakness). | 73 | |
| 77 | 74 | According to research done by Bogdanov et al., it would take billions of years | |
| 78 | According to research done by Bogdanov et al., it would take billions of | 75 | to brute force a 126-bit key with current hardware. Additionally, this brute |
| 79 | years to brute force a 126-bit key with current hardware. Additionally, | 76 | force attack would require storing 2^88^ bits of data! However, there are a few |
| 80 | this brute force attack would require storing 2^88^ bits of data! | 77 | different attacks that have been used to show vulnerabilities with the use of |
| 81 | However, there are a few different attacks that have been used to show | 78 | this technology. Side-channel attacks use inadvertent leaks of data from the |
| 82 | vulnerabilities with the use of this technology. Side-channel attacks | 79 | hardware or software, which can allow attackers to obtain the key or run |
| 83 | use inadvertent leaks of data from the hardware or software, which can | 80 | programs on a user's hardware. |
| 84 | allow attackers to obtain the key or run programs on a user\'s hardware. | 81 | |
| 85 | 82 | Please note that this is not something you should run out and try to implement | |
| 86 | Please note that this is not something you should run out and try to | 83 | in your `Hello, World!` app after only a few hours of research. While AES |
| 87 | implement in your `Hello, World!` app after only a few hours | 84 | (basically all encryption methods) is extremely efficient in what it does, it |
| 88 | of research. While AES (basically all encryption methods) is extremely | 85 | takes a lot of time and patience to understand. If you're looking for something |
| 89 | efficient in what it does, it takes a lot of time and patience to | 86 | which currently implements AES, check out the [Legion of the Bouncy |
| 90 | understand. If you\'re looking for something which currently implements | ||
| 91 | AES, check out the [Legion of the Bouncy | ||
| 92 | Castle](https://www.bouncycastle.org/documentation.html) for Java | 87 | Castle](https://www.bouncycastle.org/documentation.html) for Java |
| 93 | implementations of cryptographic algorithms. | 88 | implementations of cryptographic algorithms. |
| 94 | 89 | ||
| 95 | # Why Does Encryption Matter? | 90 | # Why Does Encryption Matter? |
| 96 | 91 | ||
| 97 | There are limitless reasons to enable encryption at-rest or in-transit | 92 | There are limitless reasons to enable encryption at-rest or in-transit for |
| 98 | for various aspects of your digital life. You can research specific | 93 | various aspects of your digital life. You can research specific examples, such |
| 99 | examples, such as [Australia passes new law to thwart strong | 94 | as [Australia passes new law to thwart strong |
| 100 | encryption](https://arstechnica.com/tech-policy/2018/12/australia-passes-new-law-to-thwart-strong-encryption/). | 95 | encryption](https://arstechnica.com/tech-policy/2018/12/australia-passes-new-law-to-thwart-strong-encryption/). |
| 101 | However, I will simply list a few basic reasons to always enable | 96 | However, I will simply list a few basic reasons to always enable encryption, |
| 102 | encryption, where feasible: | 97 | where feasible: |
| 103 | 98 | ||
| 104 | 1. Privacy is a human right and is recognized as a national right in | 99 | 1. Privacy is a human right and is recognized as a national right in some |
| 105 | some countries (e.g., [US Fourth | 100 | countries (e.g., [US Fourth |
| 106 | Amendment](https://www.law.cornell.edu/wex/fourth_amendment)). | 101 | Amendment](https://www.law.cornell.edu/wex/fourth_amendment)). |
| 107 | 2. \"Why not?\" Encryption rarely affects performance or speed, so | 102 | 2. "Why not?" Encryption rarely affects performance or speed, so there's |
| 108 | there\'s usually not a reason to avoid it in the first place. | 103 | usually not a reason to avoid it in the first place. |
| 109 | 3. Your digital identity and activity (texts, emails, phone calls, | 104 | 3. Your digital identity and activity (texts, emails, phone calls, online |
| 110 | online accounts, etc.) are extremely valuable and can result in | 105 | accounts, etc.) are extremely valuable and can result in terrible |
| 111 | terrible consequences, such as identity theft, if leaked to other | 106 | consequences, such as identity theft, if leaked to other parties. Encrypting |
| 112 | parties. Encrypting this data prevents such leaks from ruining | 107 | this data prevents such leaks from ruining lives. |
| 113 | lives. | 108 | 4. Wiping or factory-resetting does not actually wipe all data from the storage |
| 114 | 4. Wiping or factory-resetting does not actually wipe all data from the | 109 | device. There are methods to read data from the physical disks/boards inside |
| 115 | storage device. There are methods to read data from the physical | 110 | devices. |
| 116 | disks/boards inside devices. | 111 | 5. Corporations, governments, and other nefarious groups/individuals are |
| 117 | 5. Corporations, governments, and other nefarious groups/individuals | 112 | actively looking for ways to collect personal information about anyone they |
| 118 | are actively looking for ways to collect personal information about | 113 | can. If someone's data is unencrypted, that person may become a target due |
| 119 | anyone they can. If someone\'s data is unencrypted, that person may | 114 | to the ease of data collection. |
| 120 | become a target due to the ease of data collection. | ||
| 121 | 115 | ||
| 122 | **Read More:** | 116 | **Read More:** |
| 123 | 117 | ||
| 124 | - [Federal Information Processing Standards Publication | 118 | - [Federal Information Processing Standards Publication |
| 125 | 197](http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197.pdf) | 119 | 197](http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197.pdf) |
content/blog/2018-11-28-cpp-compiler.md +48 −52
| @@ -7,14 +7,14 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # A Brief Introduction | 8 | # A Brief Introduction |
| 9 | 9 | ||
| 10 | [C++](https://en.wikipedia.org/wiki/C%2B%2B) is a general-purpose | 10 | [C++](https://en.wikipedia.org/wiki/C%2B%2B) is a general-purpose programming |
| 11 | programming language with object-oriented, generic, and functional | 11 | language with object-oriented, generic, and functional features in addition to |
| 12 | features in addition to facilities for low-level memory manipulation. | 12 | facilities for low-level memory manipulation. |
| 13 | 13 | ||
| 14 | The source code, shown in the snippet below, must be compiled before it | 14 | The source code, shown in the snippet below, must be compiled before it can be |
| 15 | can be executed. There are many steps and intricacies to the compilation | 15 | executed. There are many steps and intricacies to the compilation process, and |
| 16 | process, and this post was a personal exercise to learn and remember as | 16 | this post was a personal exercise to learn and remember as much information as I |
| 17 | much information as I can. | 17 | can. |
| 18 | 18 | ||
| 19 | ``` cpp | 19 | ``` cpp |
| 20 | #include <iostream> | 20 | #include <iostream> |
| @@ -29,56 +29,52 @@ int main() | |||
| 29 | 29 | ||
| 30 | ### An Overview | 30 | ### An Overview |
| 31 | 31 | ||
| 32 | Compiling C++ projects is a frustrating task most days. Seemingly | 32 | Compiling C++ projects is a frustrating task most days. Seemingly nonexistent |
| 33 | nonexistent errors keeping your program from successfully compiling can | 33 | errors keeping your program from successfully compiling can be annoying |
| 34 | be annoying (especially since you know you wrote it perfectly the first | 34 | (especially since you know you wrote it perfectly the first time, right?). |
| 35 | time, right?). | ||
| 36 | 35 | ||
| 37 | I\'m learning more and more about C++ these days and decided to write | 36 | I'm learning more and more about C++ these days and decided to write this |
| 38 | this concept down so that I can cement it even further in my own head. | 37 | concept down so that I can cement it even further in my own head. However, C++ |
| 39 | However, C++ is not the only compiled language. Check out [the Wikipedia | 38 | is not the only compiled language. Check out [the Wikipedia entry for compiled |
| 40 | entry for compiled | 39 | languages](https://en.wikipedia.org/wiki/Compiled_language) for more examples of |
| 41 | languages](https://en.wikipedia.org/wiki/Compiled_language) for more | 40 | compiled languages. |
| 42 | examples of compiled languages. | ||
| 43 | 41 | ||
| 44 | I\'ll start with a wonderful, graphical way to conceptualize the C++ | 42 | I'll start with a wonderful, graphical way to conceptualize the C++ compiler. |
| 45 | compiler. View [The C++ Compilation | 43 | View [The C++ Compilation |
| 46 | Process](https://web.archive.org/web/20190419035048/http://faculty.cs.niu.edu/~mcmahon/CS241/Notes/compile.html) | 44 | Process](https://web.archive.org/web/20190419035048/http://faculty.cs.niu.edu/~mcmahon/CS241/Notes/compile.html) |
| 47 | by Kurt MacMahon, an NIU professor, to see the graphic and an | 45 | by Kurt MacMahon, an NIU professor, to see the graphic and an explanation. The |
| 48 | explanation. The goal of the compilation process is to take the C++ code | 46 | goal of the compilation process is to take the C++ code and produce a shared |
| 49 | and produce a shared library, dynamic library, or an executable file. | 47 | library, dynamic library, or an executable file. |
| 50 | 48 | ||
| 51 | ## Compilation Phases | 49 | ## Compilation Phases |
| 52 | 50 | ||
| 53 | Let\'s break down the compilation process. There are four major steps to | 51 | Let's break down the compilation process. There are four major steps to |
| 54 | compiling C++ code. | 52 | compiling C++ code. |
| 55 | 53 | ||
| 56 | ### Step 1 | 54 | ### Step 1 |
| 57 | 55 | ||
| 58 | The first step is to expand the source code file to meet all | 56 | The first step is to expand the source code file to meet all dependencies. The |
| 59 | dependencies. The C++ preprocessor includes the code from all the header | 57 | C++ preprocessor includes the code from all the header files, such as `#include |
| 60 | files, such as `#include | 58 | <iostream>`. Now, what does that mean? The previous example includes the |
| 61 | <iostream>`. Now, what does that mean? The previous example | 59 | `iostream` header. This tells the computer that you want to use the `iostream` |
| 62 | includes the `iostream` header. This tells the computer that | 60 | standard library, which contains classes and functions written in the core |
| 63 | you want to use the `iostream` standard library, which | 61 | language. This specific header allows you to manipulate input/output streams. |
| 64 | contains classes and functions written in the core language. This | 62 | After all this, you'll end up which a temporary file that contains the expanded |
| 65 | specific header allows you to manipulate input/output streams. After all | ||
| 66 | this, you\'ll end up which a temporary file that contains the expanded | ||
| 67 | source code. | 63 | source code. |
| 68 | 64 | ||
| 69 | In the example of the C++ code above, the `iostream` class | 65 | In the example of the C++ code above, the `iostream` class would be included in |
| 70 | would be included in the expanded code. | 66 | the expanded code. |
| 71 | 67 | ||
| 72 | ### Step 2 | 68 | ### Step 2 |
| 73 | 69 | ||
| 74 | After the code is expanded, the compiler comes into play. The compiler | 70 | After the code is expanded, the compiler comes into play. The compiler takes the |
| 75 | takes the C++ code and converts this code into the assembly language, | 71 | C++ code and converts this code into the assembly language, understood by the |
| 76 | understood by the platform. You can see this in action if you head over | 72 | platform. You can see this in action if you head over to the [GodBolt Compiler |
| 77 | to the [GodBolt Compiler Explorer](https://godbolt.org), which shows C++ | 73 | Explorer](https://godbolt.org), which shows C++ being converted into assembly |
| 78 | being converted into assembly dynamically. | 74 | dynamically. |
| 79 | 75 | ||
| 80 | For example, the `Hello, world!` code snippet above compiles | 76 | For example, the `Hello, world!` code snippet above compiles into the following |
| 81 | into the following assembly code: | 77 | assembly code: |
| 82 | 78 | ||
| 83 | ``` asm | 79 | ``` asm |
| 84 | .LC0: | 80 | .LC0: |
| @@ -124,17 +120,17 @@ _GLOBAL__sub_I_main: | |||
| 124 | 120 | ||
| 125 | ### Step 3 | 121 | ### Step 3 |
| 126 | 122 | ||
| 127 | Third, the assembly code generated by the compiler is assembled into the | 123 | Third, the assembly code generated by the compiler is assembled into the object |
| 128 | object code for the platform. Essentially, this is when the compiler | 124 | code for the platform. Essentially, this is when the compiler takes the assembly |
| 129 | takes the assembly code and assembles it into machine code in a binary | 125 | code and assembles it into machine code in a binary format. After researching |
| 130 | format. After researching this online, I figured out that a lot of | 126 | this online, I figured out that a lot of compilers will allow you to stop |
| 131 | compilers will allow you to stop compilation at this step. This would be | 127 | compilation at this step. This would be useful for compiling each source code |
| 132 | useful for compiling each source code file separately. This saves time | 128 | file separately. This saves time later if a single file changes; only that file |
| 133 | later if a single file changes; only that file needs to be recompiled. | 129 | needs to be recompiled. |
| 134 | 130 | ||
| 135 | ### Step 4 | 131 | ### Step 4 |
| 136 | 132 | ||
| 137 | Finally, the object code file generated by the assembler is linked | 133 | Finally, the object code file generated by the assembler is linked together with |
| 138 | together with the object code files for any library functions used to | 134 | the object code files for any library functions used to produce a shared |
| 139 | produce a shared library, dynamic library, or an executable file. It | 135 | library, dynamic library, or an executable file. It replaces all references to |
| 140 | replaces all references to undefined symbols with the correct addresses. | 136 | undefined symbols with the correct addresses. |
content/blog/2019-01-07-useful-css.md +54 −64
| @@ -7,36 +7,32 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Introduction to CSS | 8 | # Introduction to CSS |
| 9 | 9 | ||
| 10 | [CSS](https://en.wikipedia.org/wiki/CSS), the language used to markup | 10 | [CSS](https://en.wikipedia.org/wiki/CSS), the language used to markup HTML code |
| 11 | HTML code and make it \"pretty\", is one of the most effective ways to | 11 | and make it "pretty", is one of the most effective ways to increase the |
| 12 | increase the attractiveness of a website. It can also lead to increased | 12 | attractiveness of a website. It can also lead to increased user engagement, |
| 13 | user engagement, retention, and satisfaction. In fact, there are whole | 13 | retention, and satisfaction. In fact, there are whole career fields are |
| 14 | career fields are dedicated to the improvement of user experiences, | 14 | dedicated to the improvement of user experiences, known as UI design and UX |
| 15 | known as UI design and UX design. | 15 | design. |
| 16 | 16 | ||
| 17 | Some web developers are used to the common CSS properties, such as | 17 | Some web developers are used to the common CSS properties, such as element |
| 18 | element sizing, fonts, colors, etc., but are not as well versed in | 18 | sizing, fonts, colors, etc., but are not as well versed in less-used properties |
| 19 | less-used properties and values such as `flexbox`, | 19 | and values such as `flexbox`, `clip-path`, and `transform`. This article will |
| 20 | `clip-path`, and `transform`. This article will | ||
| 21 | provide some insight into the less-used and unique CSS properties. | 20 | provide some insight into the less-used and unique CSS properties. |
| 22 | 21 | ||
| 23 | # CSS Variables | 22 | # CSS Variables |
| 24 | 23 | ||
| 25 | The first topic today is CSS variables. Variables are not often used by | 24 | The first topic today is CSS variables. Variables are not often used by smaller |
| 26 | smaller developers. CSS variables allow you to give your website a | 25 | developers. CSS variables allow you to give your website a well-defined |
| 27 | well-defined structure, where you can easily reuse CSS properties | 26 | structure, where you can easily reuse CSS properties throughout the project. |
| 28 | throughout the project. | ||
| 29 | 27 | ||
| 30 | You can use variables to define things, such as color palettes. Then, | 28 | You can use variables to define things, such as color palettes. Then, you can |
| 31 | you can use these colors for backgrounds anywhere else in the HTML. This | 29 | use these colors for backgrounds anywhere else in the HTML. This could be |
| 32 | could be extended, where extra variables could be defined for | 30 | extended, where extra variables could be defined for `primary-text`, |
| 33 | `primary-text`, `quoted-text`, etc. Variables can | 31 | `quoted-text`, etc. Variables can also be used to define spacing (e.g. `32px` or |
| 34 | also be used to define spacing (e.g. `32px` or | 32 | `2rem`), which can then be applied to margins, padding, font sizes, and more. |
| 35 | `2rem`), which can then be applied to margins, padding, font | ||
| 36 | sizes, and more. | ||
| 37 | 33 | ||
| 38 | For example, here are some variables defined at the root of the website, | 34 | For example, here are some variables defined at the root of the website, which |
| 39 | which allows for any subsequent CSS rules to use those variables: | 35 | allows for any subsequent CSS rules to use those variables: |
| 40 | 36 | ||
| 41 | ``` css | 37 | ``` css |
| 42 | :root { | 38 | :root { |
| @@ -52,23 +48,22 @@ body { | |||
| 52 | 48 | ||
| 53 | # CSS Box Shadows | 49 | # CSS Box Shadows |
| 54 | 50 | ||
| 55 | Box shadows were once my mortal enemy. No matter how hard I tried, I | 51 | Box shadows were once my mortal enemy. No matter how hard I tried, I just |
| 56 | just couldn\'t get them to work how I wanted. Because of this, my | 52 | couldn't get them to work how I wanted. Because of this, my favorite discovery |
| 57 | favorite discovery has been CSSMatic\'s [box shadow | 53 | has been CSSMatic's [box shadow |
| 58 | generator](https://www.cssmatic.com/box-shadow). It provides an | 54 | generator](https://www.cssmatic.com/box-shadow). It provides an excellent tool |
| 59 | excellent tool to generate box shadows using their simple sliders. | 55 | to generate box shadows using their simple sliders. Surprisingly, this is the |
| 60 | Surprisingly, this is the reason I learned how box shadows work! You can | 56 | reason I learned how box shadows work! You can use the sliders and watch how the |
| 61 | use the sliders and watch how the CSS code changes in the image that is | 57 | CSS code changes in the image that is displayed. Through this, you should |
| 62 | displayed. Through this, you should understand that the basic structure | 58 | understand that the basic structure for box shadows is: |
| 63 | for box shadows is: | ||
| 64 | 59 | ||
| 65 | ``` css | 60 | ``` css |
| 66 | box-shadow: inset horizontal vertical blur spread color; | 61 | box-shadow: inset horizontal vertical blur spread color; |
| 67 | ``` | 62 | ``` |
| 68 | 63 | ||
| 69 | Now, let\'s look at some basic examples! You can copy and paste the | 64 | Now, let's look at some basic examples! You can copy and paste the following |
| 70 | following code into a site like CodePen or your own HTML files. Feel | 65 | code into a site like CodePen or your own HTML files. Feel free to play around |
| 71 | free to play around with the code, experiment, and learn. | 66 | with the code, experiment, and learn. |
| 72 | 67 | ||
| 73 | **Box Shadow #1** | 68 | **Box Shadow #1** |
| 74 | 69 | ||
| @@ -124,22 +119,20 @@ free to play around with the code, experiment, and learn. | |||
| 124 | } | 119 | } |
| 125 | ``` | 120 | ``` |
| 126 | 121 | ||
| 127 | Try these box shadows out on your own and see how changing each shadow | 122 | Try these box shadows out on your own and see how changing each shadow value |
| 128 | value works. | 123 | works. |
| 129 | 124 | ||
| 130 | # CSS Flexbox | 125 | # CSS Flexbox |
| 131 | 126 | ||
| 132 | Now, let\'s move on to the best part of this article: flexbox. The | 127 | Now, let's move on to the best part of this article: flexbox. The flexbox is by |
| 133 | flexbox is by far my favorite new toy. I originally stumbled across this | 128 | far my favorite new toy. I originally stumbled across this solution after |
| 134 | solution after looking for more efficient ways of centering content | 129 | looking for more efficient ways of centering content horizontally AND |
| 135 | horizontally AND vertically. I had used a few hack-ish methods before, | 130 | vertically. I had used a few hack-ish methods before, but flexbox throws those |
| 136 | but flexbox throws those out the window. The best part of it all is that | 131 | out the window. The best part of it all is that flexbox is *dead simple*. |
| 137 | flexbox is *dead simple*. | ||
| 138 | 132 | ||
| 139 | Flexbox pertains to the parent div of any element. You want the parent | 133 | Flexbox pertains to the parent div of any element. You want the parent to be the |
| 140 | to be the flexbox in which items are arranged to use the flex methods. | 134 | flexbox in which items are arranged to use the flex methods. It's easier to see |
| 141 | It\'s easier to see this in action that explained, so let\'s see an | 135 | this in action that explained, so let's see an example. |
| 142 | example. | ||
| 143 | 136 | ||
| 144 | **Flexbox** | 137 | **Flexbox** |
| 145 | 138 | ||
| @@ -174,27 +167,24 @@ example. | |||
| 174 | } | 167 | } |
| 175 | ``` | 168 | ``` |
| 176 | 169 | ||
| 177 | You may notice that we no longer need to use the `top` | 170 | You may notice that we no longer need to use the `top` property for the `h3` |
| 178 | property for the `h3` elements in our code. This is because | 171 | elements in our code. This is because we set the display box to be a flex |
| 179 | we set the display box to be a flex container for the small boxes, AND | 172 | container for the small boxes, AND we made the small boxes flex containers for |
| 180 | we made the small boxes flex containers for their elements (the h3 | 173 | their elements (the h3 tags). Flex boxes can be nested like this to center |
| 181 | tags). Flex boxes can be nested like this to center content that is | 174 | content that is inside centered content. |
| 182 | inside centered content. | ||
| 183 | 175 | ||
| 184 | For the example above, we designated the `justify-content` | 176 | For the example above, we designated the `justify-content` property to be |
| 185 | property to be `flex-start` so that the boxes stack from the | 177 | `flex-start` so that the boxes stack from the left side of the screen. This |
| 186 | left side of the screen. This property can be changed to | 178 | property can be changed to `center` to make the boxes appear in the center of |
| 187 | `center` to make the boxes appear in the center of the | 179 | the screen. |
| 188 | screen. | ||
| 189 | 180 | ||
| 190 | For an interactive example, [check out this | 181 | For an interactive example, [check out this |
| 191 | CodePen](https://codepen.io/LandonSchropp/pen/KpzzGo) from | 182 | CodePen](https://codepen.io/LandonSchropp/pen/KpzzGo) from |
| 192 | [LandonScropp](https://codepen.io/LandonSchropp/). Resize the window | 183 | [LandonScropp](https://codepen.io/LandonSchropp/). Resize the window with dice |
| 193 | with dice to see how they collapse and re-align. | 184 | to see how they collapse and re-align. |
| 194 | 185 | ||
| 195 | # Even More CSS | 186 | # Even More CSS |
| 196 | 187 | ||
| 197 | For more inspiration, you can visit [CodePen](https://www.codepen.io), | 188 | For more inspiration, you can visit [CodePen](https://www.codepen.io), |
| 198 | [Dribbble](https://dribbble.com), or [UI | 189 | [Dribbble](https://dribbble.com), or [UI Movement](https://uimovement.com) to |
| 199 | Movement](https://uimovement.com) to browse the collections of many | 190 | browse the collections of many amazing web designers. |
| 200 | amazing web designers. | ||
content/blog/2019-09-09-audit-analytics.md +154 −172
| @@ -7,150 +7,139 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # What Are Data Analytics? | 8 | # What Are Data Analytics? |
| 9 | 9 | ||
| 10 | A quick aside before I dive into this post: `data analytics` | 10 | A quick aside before I dive into this post: `data analytics` is a vague term |
| 11 | is a vague term that has become popular in recent years. Think of a | 11 | that has become popular in recent years. Think of a `data analytic` as the |
| 12 | `data analytic` as the output of any data analysis you | 12 | output of any data analysis you perform. For example, a pivot table or a pie |
| 13 | perform. For example, a pivot table or a pie chart could be a data | 13 | chart could be a data analytic. |
| 14 | analytic. | 14 | |
| 15 | 15 | [Data analysis](https://en.wikipedia.org/wiki/Data_analysis) is a process that | |
| 16 | [Data analysis](https://en.wikipedia.org/wiki/Data_analysis) is a | 16 | utilizes statistics and other mathematical methods to discover useful |
| 17 | process that utilizes statistics and other mathematical methods to | 17 | information within datasets. This involves examining, cleaning, transforming, |
| 18 | discover useful information within datasets. This involves examining, | 18 | and modeling data so that you can use the data to support an opinion, create |
| 19 | cleaning, transforming, and modeling data so that you can use the data | 19 | more useful viewpoints, and gain knowledge to implement into audit planning or |
| 20 | to support an opinion, create more useful viewpoints, and gain knowledge | 20 | risk assessments. |
| 21 | to implement into audit planning or risk assessments. | 21 | |
| 22 | 22 | One of the common mistakes that managers (and anyone new to the process) make is | |
| 23 | One of the common mistakes that managers (and anyone new to the process) | 23 | assuming that everything involved with this process is "data analytics". In |
| 24 | make is assuming that everything involved with this process is \"data | 24 | fact, data analytics are only a small part of the process. |
| 25 | analytics\". In fact, data analytics are only a small part of the | 25 | |
| 26 | process. | 26 | See **Figure 1** for a more accurate representation of where data analysis |
| 27 | 27 | sits within the full process. This means that data analysis does not include | |
| 28 | See **Figure 1\*** for a more accurate representation of where data | 28 | querying or extracting data, selecting samples, or performing audit tests. These |
| 29 | analysis sits within the full process. This means that data analysis | 29 | steps can be necessary for an audit (and may even be performed by the same |
| 30 | does not include querying or extracting data, selecting samples, or | 30 | associates), but they are not data analytics. |
| 31 | performing audit tests. These steps can be necessary for an audit (and | ||
| 32 | may even be performed by the same associates), but they are not data | ||
| 33 | analytics. | ||
| 34 | 31 | ||
| 35 |  | 33 | Cycle](https://img.cleberg.net/blog/20190909-data-analysis-in-auditing/intelligence_cycle-min.png) |
| 37 | 34 | ||
| 38 | # Current Use of Analytics in Auditing | 35 | # Current Use of Analytics in Auditing |
| 39 | 36 | ||
| 40 | While data analysis has been an integral part of most businesses and | 37 | While data analysis has been an integral part of most businesses and departments |
| 41 | departments for the better part of the last century, only recently have | 38 | for the better part of the last century, only recently have internal audit |
| 42 | internal audit functions been adopting this practice. The internal audit | 39 | functions been adopting this practice. The internal audit function works |
| 43 | function works exclusively to provide assurance and consulting services | 40 | exclusively to provide assurance and consulting services to the business areas |
| 44 | to the business areas within the firm (except for internal auditing | 41 | within the firm (except for internal auditing firms who are hired by different |
| 45 | firms who are hired by different companies to perform their roles). | 42 | companies to perform their roles). |
| 46 | 43 | ||
| 47 | > Internal Auditing helps an organization accomplish its objectives by | 44 | > Internal Auditing helps an organization accomplish its objectives by bringing |
| 48 | > bringing a systematic, disciplined approach to evaluate and improve | 45 | > a systematic, disciplined approach to evaluate and improve the effectiveness |
| 49 | > the effectiveness of risk management, control and governance | 46 | > of risk management, control and governance processes. |
| 50 | > processes. | ||
| 51 | > | 47 | > |
| 52 | > - The IIA\'s Definition of Internal Audit | 48 | > - The IIA's Definition of Internal Audit |
| 53 | 49 | ||
| 54 | Part of the blame for the slow adoption of data analysis can be | 50 | Part of the blame for the slow adoption of data analysis can be attributed to |
| 55 | attributed to the fact that internal auditing is strongly based on | 51 | the fact that internal auditing is strongly based on tradition and following the |
| 56 | tradition and following the precedents set by previous auditors. | 52 | precedents set by previous auditors. However, there can be no progress without |
| 57 | However, there can be no progress without auditors who are willing to | 53 | auditors who are willing to break the mold and test new audit techniques. In |
| 58 | break the mold and test new audit techniques. In fact, as of 2018, [only | 54 | fact, as of 2018, [only 63% of internal audit departments currently utilize data |
| 59 | 63% of internal audit departments currently utilize data | ||
| 60 | analytics](https://www.cpapracticeadvisor.com/accounting-audit/news/12404086/internal-audit-groups-are-lagging-in-data-analytics) | 55 | analytics](https://www.cpapracticeadvisor.com/accounting-audit/news/12404086/internal-audit-groups-are-lagging-in-data-analytics) |
| 61 | in North America. This number should be as close as possible to 100%. I | 56 | in North America. This number should be as close as possible to 100%. I have |
| 62 | have never been part of an audit that would not have benefited from data | 57 | never been part of an audit that would not have benefited from data analytics. |
| 63 | analytics. | ||
| 64 | 58 | ||
| 65 | So, how do internal audit functions remedy this situation? It\'s | 59 | So, how do internal audit functions remedy this situation? It's definitely not |
| 66 | definitely not as easy as walking into work on Monday and telling your | 60 | as easy as walking into work on Monday and telling your Chief Audit Executive |
| 67 | Chief Audit Executive that you\'re going to start implementing analytics | 61 | that you're going to start implementing analytics in the next audit. You need a |
| 68 | in the next audit. You need a plan and a system to make the analysis | 62 | plan and a system to make the analysis process as effective as possible. |
| 69 | process as effective as possible. | ||
| 70 | 63 | ||
| 71 | # The DELTA Model | 64 | # The DELTA Model |
| 72 | 65 | ||
| 73 | One of the easiest ways to experiment with data analytics and gain an | 66 | One of the easiest ways to experiment with data analytics and gain an |
| 74 | understanding of the processes is to implement them within your own | 67 | understanding of the processes is to implement them within your own department. |
| 75 | department. But how do we do this if we\'ve never worked with analysis | 68 | But how do we do this if we've never worked with analysis before? One of the |
| 76 | before? One of the most common places to start is to research some data | 69 | most common places to start is to research some data analysis models currently |
| 77 | analysis models currently available. For this post, we\'ll take a look | 70 | available. For this post, we'll take a look at the DELTA model. You can take a |
| 78 | at the DELTA model. You can take a look at **\*\*\*Figure 2\*\*\*\*** | 71 | look at **Figure 2** for a quick overview of the model. |
| 79 | for a quick overview of the model. | 72 | |
| 80 | 73 | The DELTA model sets a few guidelines for areas wanting to implement data | |
| 81 | The DELTA model sets a few guidelines for areas wanting to implement | 74 | analytics so that the results can be as comprehensive as possible: |
| 82 | data analytics so that the results can be as comprehensive as possible: | 75 | |
| 83 | 76 | - **Data**: Must be clean, accessible, and (usually) unique. | |
| 84 | - **Data**: Must be clean, accessible, and (usually) unique. | 77 | - **Enterprise-Wide Focus**: Key data systems and analytical resources must be |
| 85 | - **Enterprise-Wide Focus**: Key data systems and analytical resources | 78 | available for use (by the Internal Audit Function). |
| 86 | must be available for use (by the Internal Audit Function). | 79 | - **Leaders**: Must promote a data analytics approach and show the value of |
| 87 | - **Leaders**: Must promote a data analytics approach and show the | 80 | analytical results. |
| 88 | value of analytical results. | 81 | - **Targets**: Must be set for key areas and risks that the analytics can be |
| 89 | - **Targets**: Must be set for key areas and risks that the analytics | 82 | compared against (KPIs). |
| 90 | can be compared against (KPIs). | 83 | - **Analysts**: There must be auditors willing and able to perform data |
| 91 | - **Analysts**: There must be auditors willing and able to perform | 84 | analytics or else the system cannot be sustained. |
| 92 | data analytics or else the system cannot be sustained. | ||
| 93 | 85 | ||
| 94 |  | 87 | Model](https://img.cleberg.net/blog/20190909-data-analysis-in-auditing/delta-min.png) |
| 96 | 88 | ||
| 97 | # Finding the Proper KPIs | 89 | # Finding the Proper KPIs |
| 98 | 90 | ||
| 99 | Once the Internal Audit Function has decided that they want to start | 91 | Once the Internal Audit Function has decided that they want to start using data |
| 100 | using data analytics internally and have ensured they\'re properly set | 92 | analytics internally and have ensured they're properly set up to do so, they |
| 101 | up to do so, they need to figure out what they will be testing against. | 93 | need to figure out what they will be testing against. Key Performance Indicators |
| 102 | Key Performance Indicators (KPIs) are qualitative or quantitative | 94 | (KPIs) are qualitative or quantitative factors that can be evaluated and |
| 103 | factors that can be evaluated and assessed to determine if the | 95 | assessed to determine if the department is performing well, usually compared to |
| 104 | department is performing well, usually compared to historical or | 96 | historical or industry benchmarks. Once KPIs have been agreed upon and set, |
| 105 | industry benchmarks. Once KPIs have been agreed upon and set, auditors | 97 | auditors can use data analytics to assess and report on these KPIs. This allows |
| 106 | can use data analytics to assess and report on these KPIs. This allows | 98 | the person performing the analytics the freedom to express opinions on the |
| 107 | the person performing the analytics the freedom to express opinions on | 99 | results, whereas the results are ambiguous if no KPIs exist. |
| 108 | the results, whereas the results are ambiguous if no KPIs exist. | 100 | |
| 109 | 101 | It should be noted that tracking KPIs in the department can help ensure you have | |
| 110 | It should be noted that tracking KPIs in the department can help ensure | 102 | a rigorous Quality Assurance and Improvement Program (QAIP) in accordance with |
| 111 | you have a rigorous Quality Assurance and Improvement Program (QAIP) in | 103 | some applicable standards, such as IPPF Standard 1300. |
| 112 | accordance with some applicable standards, such as IPPF Standard 1300. | 104 | |
| 113 | 105 | > The chief audit executive must develop and maintain a quality assurance and | |
| 114 | > The chief audit executive must develop and maintain a quality | 106 | > improvement program that covers all aspects of the internal audit activity. |
| 115 | > assurance and improvement program that covers all aspects of the | ||
| 116 | > internal audit activity. | ||
| 117 | > | 107 | > |
| 118 | > - IPPF Standard 1300 | 108 | > - IPPF Standard 1300 |
| 119 | 109 | ||
| 120 | Additionally, IPPF Standard 2060 discusses reporting: | 110 | Additionally, IPPF Standard 2060 discusses reporting: |
| 121 | 111 | ||
| 122 | > The chief audit executive must report periodically to senior | 112 | > The chief audit executive must report periodically to senior management and |
| 123 | > management and the board on the internal audit activity\'s purpose, | 113 | > the board on the internal audit activity's purpose, authority, |
| 124 | > authority, responsibility, and performance relative to its plan and on | 114 | > responsibility, and performance relative to its plan and on its conformance |
| 125 | > its conformance with the Code of Ethics and the Standards. Reporting | 115 | > with the Code of Ethics and the Standards. Reporting must also include |
| 126 | > must also include significant risk and control issues, including fraud | 116 | > significant risk and control issues, including fraud risks, governance issues, |
| 127 | > risks, governance issues, and other matters that require the attention | 117 | > and other matters that require the attention of senior management and/or the |
| 128 | > of senior management and/or the board. | 118 | > board. |
| 129 | > | 119 | > |
| 130 | > - IPPF Standard 2060 | 120 | > - IPPF Standard 2060 |
| 131 | 121 | ||
| 132 | The hardest part of finding KPIs is to determine which KPIs are | 122 | The hardest part of finding KPIs is to determine which KPIs are appropriate for |
| 133 | appropriate for your department. Since every department is different and | 123 | your department. Since every department is different and has different goals, |
| 134 | has different goals, KPIs will vary drastically between companies. To | 124 | KPIs will vary drastically between companies. To give you an idea of where to |
| 135 | give you an idea of where to look, here are some ideas I came up with | 125 | look, here are some ideas I came up with when discussing the topic with a few |
| 136 | when discussing the topic with a few colleagues. | 126 | colleagues. |
| 137 | 127 | ||
| 138 | - Efficiency/Budgeting: | 128 | - Efficiency/Budgeting: |
| 139 | - Audit hours to staff utilization ratio (annual hours divided by | 129 | - Audit hours to staff utilization ratio (annual hours divided by total |
| 140 | total annual work hours). | 130 | annual work hours). |
| 141 | - Audit hours compared to the number of audits completed. | 131 | - Audit hours compared to the number of audits completed. |
| 142 | - Time between audit steps or to complete the whole audit. E.g., | 132 | - Time between audit steps or to complete the whole audit. E.g., time from |
| 143 | time from fieldwork completion to audit report issuance. | 133 | fieldwork completion to audit report issuance. |
| 144 | - Reputation: | 134 | - Reputation: |
| 145 | - The frequency that management has requested the services of the | 135 | - The frequency that management has requested the services of the IAF. |
| 146 | IAF. | 136 | - Management, audit committee, or external audit satisfaction survey |
| 147 | - Management, audit committee, or external audit satisfaction | 137 | results. |
| 148 | survey results. | 138 | - Education, experience, certifications, tenure, and training of the |
| 149 | - Education, experience, certifications, tenure, and training of | 139 | auditors on staff. |
| 150 | the auditors on staff. | ||
| 151 | - Quality: | 140 | - Quality: |
| 152 | - Number and frequency of audit findings. Assign monetary or | 141 | - Number and frequency of audit findings. Assign monetary or numerical |
| 153 | numerical values, if possible. | 142 | values, if possible. |
| 154 | - Percentage of recommendations issued and implemented. | 143 | - Percentage of recommendations issued and implemented. |
| 155 | - Planning: | 144 | - Planning: |
| 156 | - Percentage or number of key risks audited per year or per audit. | 145 | - Percentage or number of key risks audited per year or per audit. |
| @@ -158,65 +147,59 @@ when discussing the topic with a few colleagues. | |||
| 158 | 147 | ||
| 159 | # Data Analysis Tools | 148 | # Data Analysis Tools |
| 160 | 149 | ||
| 161 | Finally, to be able to analyze and report on the data analysis, auditors | 150 | Finally, to be able to analyze and report on the data analysis, auditors need to |
| 162 | need to evaluate the tools at their disposal. There are many options | 151 | evaluate the tools at their disposal. There are many options available, but a |
| 163 | available, but a few of the most common ones can easily get the job | 152 | few of the most common ones can easily get the job done. For example, almost |
| 164 | done. For example, almost every auditor already has access to Microsoft | 153 | every auditor already has access to Microsoft Excel. Excel is more powerful than |
| 165 | Excel. Excel is more powerful than most people give it credit for and | 154 | most people give it credit for and can accomplish a lot of basic statistics |
| 166 | can accomplish a lot of basic statistics without much work. If you | 155 | without much work. If you don't know a lot about statistics but still want to |
| 167 | don\'t know a lot about statistics but still want to see some of the | 156 | see some of the more basic results, Excel is a great option. |
| 168 | more basic results, Excel is a great option. | 157 | |
| 169 | 158 | To perform more in-depth statistical analysis or to explore large datasets that | |
| 170 | To perform more in-depth statistical analysis or to explore large | 159 | Excel cannot handle, auditors will need to explore other options. The big three |
| 171 | datasets that Excel cannot handle, auditors will need to explore other | 160 | that have had a lot of success in recent years are Python, R, and ACL. ACL can |
| 172 | options. The big three that have had a lot of success in recent years | 161 | be used as either a graphical tool (point and click) or as a scripting tool, |
| 173 | are Python, R, and ACL. ACL can be used as either a graphical tool | 162 | where the auditor must write the scripts manually. Python and the R-language are |
| 174 | (point and click) or as a scripting tool, where the auditor must write | 163 | solely scripting languages. |
| 175 | the scripts manually. Python and the R-language are solely scripting | 164 | |
| 176 | languages. | 165 | The general trend in the data analytics environment is that if the tool allows |
| 177 | 166 | you to do everything by clicking buttons or dragging elements, you won't be | |
| 178 | The general trend in the data analytics environment is that if the tool | 167 | able to fully utilize the analytics you need. The most robust solutions are |
| 179 | allows you to do everything by clicking buttons or dragging elements, | 168 | created by those who understand how to write the scripts manually. It should be |
| 180 | you won\'t be able to fully utilize the analytics you need. The most | 169 | noted that as the utility of a tool increases, it usually means that the |
| 181 | robust solutions are created by those who understand how to write the | 170 | learning curve for that tool will also be higher. It will take auditors longer |
| 182 | scripts manually. It should be noted that as the utility of a tool | 171 | to learn how to utilize Python, R, or ACL versus learning how to utilize Excel. |
| 183 | increases, it usually means that the learning curve for that tool will | ||
| 184 | also be higher. It will take auditors longer to learn how to utilize | ||
| 185 | Python, R, or ACL versus learning how to utilize Excel. | ||
| 186 | 172 | ||
| 187 | # Visualization | 173 | # Visualization |
| 188 | 174 | ||
| 189 | Once an auditor has finally found the right data, KPIs, and tools, they | 175 | Once an auditor has finally found the right data, KPIs, and tools, they must |
| 190 | must report these results so that actions can be taken. Performing | 176 | report these results so that actions can be taken. Performing in-depth data |
| 191 | in-depth data analysis is only useful if the results are understood by | 177 | analysis is only useful if the results are understood by the audiences of the |
| 192 | the audiences of the data. The best way to create this understanding is | 178 | data. The best way to create this understanding is to visualize the results of |
| 193 | to visualize the results of the data. Let\'s take a look at some of the | 179 | the data. Let's take a look at some of the best options to visualize and report |
| 194 | best options to visualize and report the results you\'ve found. | 180 | the results you've found. |
| 195 | 181 | ||
| 196 | Some of the most popular commercial tools for visualization are | 182 | Some of the most popular commercial tools for visualization are Microsoft |
| 197 | Microsoft PowerBI and Tableau Desktop. However, other tools exist such | 183 | PowerBI and Tableau Desktop. However, other tools exist such as JMP, Plotly, |
| 198 | as JMP, Plotly, Qlikview, Alteryx, or D3. Some require commercial | 184 | Qlikview, Alteryx, or D3. Some require commercial licenses while others are |
| 199 | licenses while others are simply free to use. For corporate data, you | 185 | simply free to use. For corporate data, you may want to make sure that the tool |
| 200 | may want to make sure that the tool does not communicate any of the data | 186 | does not communicate any of the data outside the company (such as cloud |
| 201 | outside the company (such as cloud storage). I won\'t be going into | 187 | storage). I won't be going into depth on any of these tools since visualization |
| 202 | depth on any of these tools since visualization is largely a subjective | 188 | is largely a subjective and creative experience, but remember to constantly |
| 203 | and creative experience, but remember to constantly explore new options | 189 | explore new options as you repeat the process. |
| 204 | as you repeat the process. | 190 | |
| 205 | 191 | Lastly, let's take a look at an example of data visualization. This example | |
| 206 | Lastly, let\'s take a look at an example of data visualization. This | 192 | comes from a [blog post written by Kushal |
| 207 | example comes from a [blog post written by Kushal | ||
| 208 | Chakrabarti](https://talent.works/2018/03/28/the-science-of-the-job-search-part-iii-61-of-entry-level-jobs-require-3-years-of-experience/) | 193 | Chakrabarti](https://talent.works/2018/03/28/the-science-of-the-job-search-part-iii-61-of-entry-level-jobs-require-3-years-of-experience/) |
| 209 | in 2018 about the percent of entry-level US jobs that require | 194 | in 2018 about the percent of entry-level US jobs that require experience. |
| 210 | experience. **Figure 3\*** shows us an easy-to-digest picture of the | 195 | **Figure 3** shows us an easy-to-digest picture of the data. We can quickly |
| 211 | data. We can quickly tell that only about 12.5% of entry-level jobs | 196 | tell that only about 12.5% of entry-level jobs don't require experience. |
| 212 | don\'t require experience. | 197 | |
| 213 | 198 | This is the kind of result that easily describes the data for you. However, make | |
| 214 | This is the kind of result that easily describes the data for you. | 199 | sure to include an explanation of what the results mean. Don't let the reader |
| 215 | However, make sure to include an explanation of what the results mean. | 200 | assume what the data means, especially if it relates to a complex subject. *Tell |
| 216 | Don\'t let the reader assume what the data means, especially if it | 201 | a story* about the data and why the results matter. For example, **Figure 4** |
| 217 | relates to a complex subject. *Tell a story* about the data and why the | 202 | shows a part of the explanation the author gives to illustrate his point. |
| 218 | results matter. For example, **Figure 4\*** shows a part of the | ||
| 219 | explanation the author gives to illustrate his point. | ||
| 220 | 203 | ||
| 221 |  | 205 | Visualization](https://img.cleberg.net/blog/20190909-data-analysis-in-auditing/vis_example-min.png) |
| @@ -226,8 +209,7 @@ Explanation](https://img.cleberg.net/blog/20190909-data-analysis-in-auditing/vis | |||
| 226 | 209 | ||
| 227 | # Wrap-Up | 210 | # Wrap-Up |
| 228 | 211 | ||
| 229 | While this is not an all-encompassing program that you can just adopt | 212 | While this is not an all-encompassing program that you can just adopt into your |
| 230 | into your department, it should be enough to get anyone started on the | 213 | department, it should be enough to get anyone started on the process of |
| 231 | process of understanding and implementing data analytics. Always | 214 | understanding and implementing data analytics. Always remember to continue |
| 232 | remember to continue learning and exploring new options as your | 215 | learning and exploring new options as your processes grow and evolve. |
| 233 | processes grow and evolve. | ||
content/blog/2019-12-03-the-ansoff-matrix.md +87 −96
| @@ -7,38 +7,35 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Overview | 8 | # Overview |
| 9 | 9 | ||
| 10 | As the world of business evolves, managers must approach business | 10 | As the world of business evolves, managers must approach business planning and |
| 11 | planning and strategy with a contemporary mindset. According to Dess, | 11 | strategy with a contemporary mindset. According to Dess, McNamara, Eisner, and |
| 12 | McNamara, Eisner, and Lee, managers must be willing to adapt to the | 12 | Lee, managers must be willing to adapt to the modern business environment by |
| 13 | modern business environment by going beyond \"\'incremental | 13 | going beyond "'incremental management', whereby they view their job as making |
| 14 | management\', whereby they view their job as making a series of small, | 14 | a series of small, minor changes to improve the efficiency of the firm's |
| 15 | minor changes to improve the efficiency of the firm\'s | 15 | operations"(2019). |
| 16 | operations\"(2019). | 16 | |
| 17 | 17 | One reason that strategic management is crucial is because most businesses that | |
| 18 | One reason that strategic management is crucial is because most | 18 | fail in the United States each year fail due to a lack of strategic focus or |
| 19 | businesses that fail in the United States each year fail due to a lack | 19 | direction(2019). The rate of failure for businesses with poor strategies shows |
| 20 | of strategic focus or direction(2019). The rate of failure for | 20 | that strategic planning and management are crucial to a business's strength and |
| 21 | businesses with poor strategies shows that strategic planning and | 21 | longevity, injecting the critical factors of growth and direction into a |
| 22 | management are crucial to a business\'s strength and longevity, | 22 | company's business plan. |
| 23 | injecting the critical factors of growth and direction into a company\'s | 23 | |
| 24 | business plan. | 24 | One of the most significant strategic planning and management frameworks that |
| 25 | 25 | companies can use is the [Ansoff | |
| 26 | One of the most significant strategic planning and management frameworks | 26 | Matrix](https://en.wikipedia.org/wiki/Ansoff_matrix). While this framework has |
| 27 | that companies can use is the [Ansoff | 27 | unique purposes and use-cases, it can effectively help an organization grow and |
| 28 | Matrix](https://en.wikipedia.org/wiki/Ansoff_matrix). While this | 28 | compete. Specifically, the Ansoff matrix is one of the most effective frameworks |
| 29 | framework has unique purposes and use-cases, it can effectively help an | 29 | for companies who want to focus on increasing sales revenue or |
| 30 | organization grow and compete. Specifically, the Ansoff matrix is one of | 30 | profitability(2019). |
| 31 | the most effective frameworks for companies who want to focus on | 31 | |
| 32 | increasing sales revenue or profitability(2019). | 32 | This framework uses a two-by-two figure to show the four strategic options for |
| 33 | 33 | companies to use in this framework: market penetration, market development, | |
| 34 | This framework uses a two-by-two figure to show the four strategic | 34 | product development, and diversification (see **Figure 1**). The x-axis of the |
| 35 | options for companies to use in this framework: market penetration, | 35 | matrix focuses on the firm's markets and also determines if the firm is looking |
| 36 | market development, product development, and diversification (see | 36 | to enter new markets or innovate in its current markets. The y-axis of the |
| 37 | **Figure 1**). The x-axis of the matrix focuses on the firm\'s markets | 37 | matrix focuses on the firm's products and determines if the firm wants to |
| 38 | and also determines if the firm is looking to enter new markets or | 38 | pursue strategies around their existing products or explore new products. |
| 39 | innovate in its current markets. The y-axis of the matrix focuses on the | ||
| 40 | firm\'s products and determines if the firm wants to pursue strategies | ||
| 41 | around their existing products or explore new products. | ||
| 42 | 39 | ||
| 43 |  | 41 | 3.0](https://img.cleberg.net/blog/20191203-the-ansoff-matrix/ansoff_matrix-min.png) |
| @@ -47,82 +44,76 @@ around their existing products or explore new products. | |||
| 47 | 44 | ||
| 48 | ## Market Penetration | 45 | ## Market Penetration |
| 49 | 46 | ||
| 50 | The most straightforward strategy in the Ansoff matrix is to focus on | 47 | The most straightforward strategy in the Ansoff matrix is to focus on existing |
| 51 | existing products in existing markets, also known as market | 48 | products in existing markets, also known as market penetration(2019). Companies |
| 52 | penetration(2019). Companies such as Coca-Cola have used market | 49 | such as Coca-Cola have used market penetration successfully by investing a lot |
| 53 | penetration successfully by investing a lot of money to get further | 50 | of money to get further value out of their current markets. Coca-Cola does this |
| 54 | value out of their current markets. Coca-Cola does this by introducing | 51 | by introducing new features such as Christmas-themed bottles, personal names on |
| 55 | new features such as Christmas-themed bottles, personal names on the | 52 | the bottles, and other marketing schemes. |
| 56 | bottles, and other marketing schemes. | ||
| 57 | 53 | ||
| 58 | ## Market Development | 54 | ## Market Development |
| 59 | 55 | ||
| 60 | Market development extends existing products into new markets in an | 56 | Market development extends existing products into new markets in an attempt to |
| 61 | attempt to increase the number of buyers. One interesting way that | 57 | increase the number of buyers. One interesting way that Coca-Cola used this |
| 62 | Coca-Cola used this strategy comes from the stigma that Diet Coke is a | 58 | strategy comes from the stigma that Diet Coke is a woman's drink(2019). |
| 63 | woman\'s drink(2019). Coca-Cola introduced Coca-Cola Zero, which | 59 | Coca-Cola introduced Coca-Cola Zero, which contained the same nutritional |
| 64 | contained the same nutritional content as Diet Coke, but was packaged in | 60 | content as Diet Coke, but was packaged in a dark black can to appear more |
| 65 | a dark black can to appear more \"manly\"(2019). | 61 | "manly"(2019). |
| 66 | 62 | ||
| 67 | ## Product Development | 63 | ## Product Development |
| 68 | 64 | ||
| 69 | Product development uses existing markets to introduce new products so | 65 | Product development uses existing markets to introduce new products so that the |
| 70 | that the firm can better meet customer needs(2019). The extreme end of | 66 | firm can better meet customer needs(2019). The extreme end of diversification is |
| 71 | diversification is home to companies such as Johnson & Johnson, a | 67 | home to companies such as Johnson & Johnson, a healthcare company that has |
| 72 | healthcare company that has developed a business portfolio of more than | 68 | developed a business portfolio of more than 60,000 different products(2019). |
| 73 | 60,000 different products(2019). Johnson & Johnson\'s dedication to | 69 | Johnson & Johnson's dedication to continuous diversification has led them to a |
| 74 | continuous diversification has led them to a balance sheet rating of | 70 | balance sheet rating of "AAA", industry recognition for diversification, and |
| 75 | \"AAA\", industry recognition for diversification, and increases in | 71 | increases in their investor dividends for 57 consecutive years(2019). |
| 76 | their investor dividends for 57 consecutive years(2019). | ||
| 77 | 72 | ||
| 78 | ## Related Diversification | 73 | ## Related Diversification |
| 79 | 74 | ||
| 80 | Diversification, the final strategy of the Ansoff Matrix, is more | 75 | Diversification, the final strategy of the Ansoff Matrix, is more difficult than |
| 81 | difficult than the others since it involves exploring both new markets | 76 | the others since it involves exploring both new markets and new products. |
| 82 | and new products. Related diversification is a diversification strategy | 77 | Related diversification is a diversification strategy that closely relates to |
| 83 | that closely relates to the firm\'s core business. Coca-Cola\'s best | 78 | the firm's core business. Coca-Cola's best example of related diversification |
| 84 | example of related diversification is its acquisition of Glaceau and | 79 | is its acquisition of Glaceau and Vitamin Water, which expanded their drinking |
| 85 | Vitamin Water, which expanded their drinking lines of business(2019). | 80 | lines of business(2019). |
| 86 | 81 | ||
| 87 | ## Unrelated Diversification | 82 | ## Unrelated Diversification |
| 88 | 83 | ||
| 89 | Unrelated diversification is a diversification strategy that does not | 84 | Unrelated diversification is a diversification strategy that does not really |
| 90 | really relate to the firm\'s core business but still diversifies their | 85 | relate to the firm's core business but still diversifies their business |
| 91 | business portfolio. A good example of this would be a coffee company who | 86 | portfolio. A good example of this would be a coffee company who has decided to |
| 92 | has decided to enter the market for bicycle sales. The main purpose of | 87 | enter the market for bicycle sales. The main purpose of this strategy is to an |
| 93 | this strategy is to an extremely diverse company that will not go | 88 | extremely diverse company that will not go bankrupt if one market goes through |
| 94 | bankrupt if one market goes through difficult times. However, this | 89 | difficult times. However, this requires a lot of independent skills and heavy |
| 95 | requires a lot of independent skills and heavy investments since the | 90 | investments since the company most likely cannot easily transfer knowledge |
| 96 | company most likely cannot easily transfer knowledge between the markets | 91 | between the markets they compete in. |
| 97 | they compete in. | ||
| 98 | 92 | ||
| 99 | # Requirements for Success | 93 | # Requirements for Success |
| 100 | 94 | ||
| 101 | To use the Ansoff Matrix framework, managers need to formulate corporate | 95 | To use the Ansoff Matrix framework, managers need to formulate corporate goals |
| 102 | goals and objectives. Without goals and direction, management frameworks | 96 | and objectives. Without goals and direction, management frameworks do not |
| 103 | do not present much practical utility. Further, the Ansoff Matrix | 97 | present much practical utility. Further, the Ansoff Matrix requires the managers |
| 104 | requires the managers involved to make tactical decisions and create a | 98 | involved to make tactical decisions and create a path for the company to take |
| 105 | path for the company to take toward their goals. Lastly, both the Ansoff | 99 | toward their goals. Lastly, both the Ansoff Matrix needs to consider both |
| 106 | Matrix needs to consider both internal and external perspectives | 100 | internal and external perspectives throughout the strategy formulation process. |
| 107 | throughout the strategy formulation process. | 101 | |
| 108 | 102 | One interesting probability is that companies will be using multiple strategic | |
| 109 | One interesting probability is that companies will be using multiple | 103 | planning and management frameworks at the same time. While this may sound like |
| 110 | strategic planning and management frameworks at the same time. While | 104 | it could crowd the management process, there are numerous reasons to do so. For |
| 111 | this may sound like it could crowd the management process, there are | 105 | example, the Ansoff Matrix and the Balanced Scorecard are relatively popular, |
| 112 | numerous reasons to do so. For example, the Ansoff Matrix and the | 106 | and they cover entirely different parts of a company's strategy. Using the |
| 113 | Balanced Scorecard are relatively popular, and they cover entirely | 107 | results from the Balanced Scorecard could inform a company of the potential |
| 114 | different parts of a company\'s strategy. Using the results from the | 108 | product and market demands, such as from customer or supplier survey results, to |
| 115 | Balanced Scorecard could inform a company of the potential product and | 109 | help the company determine which Ansoff Matrix strategy to pursue. However, a |
| 116 | market demands, such as from customer or supplier survey results, to | 110 | combined approach at this level would require mature frameworks and focused |
| 117 | help the company determine which Ansoff Matrix strategy to pursue. | 111 | managers who are able to strategize at a high level. |
| 118 | However, a combined approach at this level would require mature | 112 | |
| 119 | frameworks and focused managers who are able to strategize at a high | 113 | Lastly, it should be noted that the author of the Ansoff matrix, Igor Ansoff, |
| 120 | level. | 114 | often used the term [paralysis by |
| 121 | 115 | analysis](https://en.wikipedia.org/wiki/Analysis_paralysis) to explain the | |
| 122 | Lastly, it should be noted that the author of the Ansoff matrix, Igor | 116 | mistake of companies who overuse analysis and spend too much time planning. |
| 123 | Ansoff, often used the term [paralysis by | 117 | Companies need to understand the utility of a strategic management framework |
| 124 | analysis](https://en.wikipedia.org/wiki/Analysis_paralysis) to explain | 118 | while ensuring that the company is poised to execute as efficiently as they have |
| 125 | the mistake of companies who overuse analysis and spend too much time | 119 | planned. |
| 126 | planning. Companies need to understand the utility of a strategic | ||
| 127 | management framework while ensuring that the company is poised to | ||
| 128 | execute as efficiently as they have planned. | ||
content/blog/2019-12-16-password-security.md +85 −95
| @@ -9,119 +9,109 @@ draft = false | |||
| 9 | 9 | ||
| 10 | ## Why Does It Matter? | 10 | ## Why Does It Matter? |
| 11 | 11 | ||
| 12 | Information security, including passwords and identities, has become one | 12 | Information security, including passwords and identities, has become one of the |
| 13 | of the most important digital highlights of the last decade. With | 13 | most important digital highlights of the last decade. With [billions of people |
| 14 | [billions of people affected by data breaches each | 14 | affected by data breaches each |
| 15 | year](https://www.usatoday.com/story/money/2018/12/28/data-breaches-2018-billions-hit-growing-number-cyberattacks/2413411002/), | 15 | year](https://www.usatoday.com/story/money/2018/12/28/data-breaches-2018-billions-hit-growing-number-cyberattacks/2413411002/), |
| 16 | there\'s a greater need to introduce strong information security | 16 | there's a greater need to introduce strong information security systems. If you |
| 17 | systems. If you think you\'ve been part of a breach, or you want to | 17 | think you've been part of a breach, or you want to check and see, you can use |
| 18 | check and see, you can use [Have I Been | 18 | [Have I Been Pwned](https://haveibeenpwned.com/) to see if your email has been |
| 19 | Pwned](https://haveibeenpwned.com/) to see if your email has been | 19 | involved in any public breaches. Remember that there's a possibility that a |
| 20 | involved in any public breaches. Remember that there\'s a possibility | 20 | company experienced a breach and did not report it to anyone. |
| 21 | that a company experienced a breach and did not report it to anyone. | ||
| 22 | 21 | ||
| 23 | ## How Do I Protect Myself? | 22 | ## How Do I Protect Myself? |
| 24 | 23 | ||
| 25 | The first place to start with any personal security check-up is to | 24 | The first place to start with any personal security check-up is to gather a list |
| 26 | gather a list of all the different websites, apps, or programs that | 25 | of all the different websites, apps, or programs that require you to have login |
| 27 | require you to have login credentials. Optionally, once you know where | 26 | credentials. Optionally, once you know where your information is being stored, |
| 28 | your information is being stored, you can sort the list from the | 27 | you can sort the list from the most-important items such as banks or government |
| 29 | most-important items such as banks or government logins to less | 28 | logins to less important items such as your favorite meme site. You will want to |
| 30 | important items such as your favorite meme site. You will want to ensure | 29 | ensure that your critical logins are secure before getting to the others. |
| 31 | that your critical logins are secure before getting to the others. | ||
| 32 | 30 | ||
| 33 | Once you think you have a good idea of all your different authentication | 31 | Once you think you have a good idea of all your different authentication |
| 34 | methods, I recommend using a password manager such as | 32 | methods, I recommend using a password manager such as |
| 35 | [Bitwarden](https://bitwarden.com/). Using a password manager allows you | 33 | [Bitwarden](https://bitwarden.com/). Using a password manager allows you to |
| 36 | to automatically save your logins, create randomized passwords, and | 34 | automatically save your logins, create randomized passwords, and transfer |
| 37 | transfer passwords across devices. However, you\'ll need to memorize | 35 | passwords across devices. However, you'll need to memorize your "vault |
| 38 | your \"vault password\" that allows you to open the password manager. | 36 | password" that allows you to open the password manager. It's important to make |
| 39 | It\'s important to make this something hard to guess since it would | 37 | this something hard to guess since it would allow anyone who has it to access |
| 40 | allow anyone who has it to access every password you\'ve stored in | 38 | every password you've stored in there. |
| 41 | there. | ||
| 42 | 39 | ||
| 43 | Personally, I recommend using a | 40 | Personally, I recommend using a |
| 44 | [passphrase](https://en.wikipedia.org/wiki/Passphrase) instead of a | 41 | [passphrase](https://en.wikipedia.org/wiki/Passphrase) instead of a |
| 45 | [password](https://en.wikipedia.org/wiki/Password) for your vault | 42 | [password](https://en.wikipedia.org/wiki/Password) for your vault password. |
| 46 | password. Instead of using a string of characters (whether random or | 43 | Instead of using a string of characters (whether random or simple), use a phrase |
| 47 | simple), use a phrase and add in symbols and a number. For example, your | 44 | and add in symbols and a number. For example, your vault password could be |
| 48 | vault password could be `Racing-Alphabet-Gourd-Parrot3`. Swap | 45 | `Racing-Alphabet-Gourd-Parrot3`. Swap the symbols out for whichever symbol you |
| 49 | the symbols out for whichever symbol you want, move the number around, | 46 | want, move the number around, and fine-tune the passphrase until you are |
| 50 | and fine-tune the passphrase until you are confident that you can | 47 | confident that you can remember it whenever necessary. |
| 51 | remember it whenever necessary. | 48 | |
| 52 | 49 | Once you've stored your passwords, make sure you continually check up on your | |
| 53 | Once you\'ve stored your passwords, make sure you continually check up | 50 | account and make sure you aren't following bad password practices. Krebs on |
| 54 | on your account and make sure you aren\'t following bad password | 51 | Security has a great [blog post on password |
| 55 | practices. Krebs on Security has a great [blog post on password | 52 | recommendations](https://krebsonsecurity.com/password-dos-and-donts/). Any time |
| 56 | recommendations](https://krebsonsecurity.com/password-dos-and-donts/). | 53 | that a data breach happens, make sure you check to see if you were included, and |
| 57 | Any time that a data breach happens, make sure you check to see if you | 54 | if you need to reset any account passwords. |
| 58 | were included, and if you need to reset any account passwords. | ||
| 59 | 55 | ||
| 60 | # Developers | 56 | # Developers |
| 61 | 57 | ||
| 62 | ## What Are the Basic Requirements? | 58 | ## What Are the Basic Requirements? |
| 63 | 59 | ||
| 64 | When developing any password-protected application, there are a few | 60 | When developing any password-protected application, there are a few basic rules |
| 65 | basic rules that anyone should follow even if they do not follow any | 61 | that anyone should follow even if they do not follow any official guidelines |
| 66 | official guidelines such as NIST. The foremost practice is to require | 62 | such as NIST. The foremost practice is to require users to use passwords that |
| 67 | users to use passwords that are at least 8 characters and cannot easily | 63 | are at least 8 characters and cannot easily be guessed. This sounds extremely |
| 68 | be guessed. This sounds extremely simple, but it requires quite a few | 64 | simple, but it requires quite a few different strategies. First, the application |
| 69 | different strategies. First, the application should check the potential | 65 | should check the potential passwords against a dictionary of insecure passwords |
| 70 | passwords against a dictionary of insecure passwords such | 66 | such `password`, `1234abc`, or `application_name`. |
| 71 | `password`, `1234abc`, or | 67 | |
| 72 | `application_name`. | 68 | Next, the application should offer guidance on the strength of passwords being |
| 73 | 69 | entered during enrollment. Further, NIST officially recommends **not** | |
| 74 | Next, the application should offer guidance on the strength of passwords | 70 | implementing any composition rules that make passwords hard to remember (e.g. |
| 75 | being entered during enrollment. Further, NIST officially recommends | 71 | passwords with letters, numbers, and special characters) and instead encouraging |
| 76 | **not\*** implementing any composition rules that make passwords hard to | 72 | the use of long pass phrases which can include spaces. It should be noted that |
| 77 | remember (e.g. passwords with letters, numbers, and special characters) | 73 | to be able to keep spaces within passwords, all unicode characters should be |
| 78 | and instead encouraging the use of long pass phrases which can include | 74 | supported, and passwords should not be truncated. |
| 79 | spaces. It should be noted that to be able to keep spaces within | ||
| 80 | passwords, all unicode characters should be supported, and passwords | ||
| 81 | should not be truncated. | ||
| 82 | 75 | ||
| 83 | ## What Does NIST Recommend? | 76 | ## What Does NIST Recommend? |
| 84 | 77 | ||
| 85 | The National Institute of Standards and Technology | 78 | The National Institute of Standards and Technology |
| 86 | ([NIST](https://www.nist.gov)) in the US Department of Commerce | 79 | ([NIST](https://www.nist.gov)) in the US Department of Commerce regularly |
| 87 | regularly publishes information around information security and digital | 80 | publishes information around information security and digital identity |
| 88 | identity guidelines. Recently, NIST published [Special Publication | 81 | guidelines. Recently, NIST published [Special Publication |
| 89 | 800-63b](https://pages.nist.gov/800-63-3/sp800-63b.html): Digital | 82 | 800-63b](https://pages.nist.gov/800-63-3/sp800-63b.html): Digital Identity |
| 90 | Identity Guidelines and Authentication and Lifecycle Management. | 83 | Guidelines and Authentication and Lifecycle Management. |
| 91 | 84 | ||
| 92 | > A Memorized Secret authenticator - commonly referred to as a password | 85 | > A Memorized Secret authenticator - commonly referred to as a password or, if |
| 93 | > or, if numeric, a PIN - is a secret value intended to be chosen and | 86 | > numeric, a PIN - is a secret value intended to be chosen and memorized by the |
| 94 | > memorized by the user. Memorized secrets need to be of sufficient | 87 | > user. Memorized secrets need to be of sufficient complexity and secrecy that |
| 95 | > complexity and secrecy that it would be impractical for an attacker to | 88 | > it would be impractical for an attacker to guess or otherwise discover the |
| 96 | > guess or otherwise discover the correct secret value. A memorized | 89 | > correct secret value. A memorized secret is something you know. |
| 97 | > secret is something you know. | ||
| 98 | > | 90 | > |
| 99 | > - NIST Special Publication 800-63B | 91 | > - NIST Special Publication 800-63B |
| 100 | 92 | ||
| 101 | NIST offers a lot of guidance on passwords, but I\'m going to highlight | 93 | NIST offers a lot of guidance on passwords, but I'm going to highlight just a |
| 102 | just a few of the important factors: | 94 | few of the important factors: |
| 103 | 95 | ||
| 104 | - Require passwords to be a minimum of 8 characters (6 characters if | 96 | - Require passwords to be a minimum of 8 characters (6 characters if randomly |
| 105 | randomly generated and be generated using an approved random bit | 97 | generated and be generated using an approved random bit generator). |
| 106 | generator). | 98 | - Compare potential passwords against a list that contains values known to be |
| 107 | - Compare potential passwords against a list that contains values | 99 | commonly-used, expected, or compromised. |
| 108 | known to be commonly-used, expected, or compromised. | 100 | - Offer guidance on password strength, such as a strength meter. |
| 109 | - Offer guidance on password strength, such as a strength meter. | 101 | - Implement a rate-limiting mechanism to limit the number of failed |
| 110 | - Implement a rate-limiting mechanism to limit the number of failed | 102 | authentication attempts for each user account. |
| 111 | authentication attempts for each user account. | 103 | - Do not require composition rules for passwords and do not require passwords to |
| 112 | - Do not require composition rules for passwords and do not require | 104 | be changed periodically (unless compromised). |
| 113 | passwords to be changed periodically (unless compromised). | 105 | - Allow pasting of user identification and passwords to facilitate the use of |
| 114 | - Allow pasting of user identification and passwords to facilitate the | 106 | password managers. |
| 115 | use of password managers. | 107 | - Allow users to view the password as it is being entered. |
| 116 | - Allow users to view the password as it is being entered. | 108 | - Use secure forms of communication and storage, including salting and hashing |
| 117 | - Use secure forms of communication and storage, including salting and | 109 | passwords using a one-way key derivation function. |
| 118 | hashing passwords using a one-way key derivation function. | 110 | |
| 119 | 111 | NIST offers further guidance on other devices that require specific security | |
| 120 | NIST offers further guidance on other devices that require specific | 112 | policies, querying for passwords, and more. All the information discussed so far |
| 121 | security policies, querying for passwords, and more. All the information | 113 | comes from [NIST SP800-63b](https://pages.nist.gov/800-63-3/sp800-63b.html) but |
| 122 | discussed so far comes from [NIST | 114 | NIST offers a lot of information on digital identities, enrollment, identity |
| 123 | SP800-63b](https://pages.nist.gov/800-63-3/sp800-63b.html) but NIST | 115 | proofing, authentication, lifecycle management, federation, and assertions in |
| 124 | offers a lot of information on digital identities, enrollment, identity | 116 | the total [NIST SP800-63 Digital Identity |
| 125 | proofing, authentication, lifecycle management, federation, and | ||
| 126 | assertions in the total [NIST SP800-63 Digital Identity | ||
| 127 | Guidelines](https://pages.nist.gov/800-63-3/). | 117 | Guidelines](https://pages.nist.gov/800-63-3/). |
content/blog/2020-01-25-linux-software.md +72 −87
| @@ -12,32 +12,31 @@ draft = false | |||
| 12 |  | 13 | Screenshot](https://img.cleberg.net/blog/20200125-the-best-linux-software/etcher.png) |
| 14 | 14 | ||
| 15 | [Etcher](https://www.balena.io/etcher/) is a quick and easy way to burn | 15 | [Etcher](https://www.balena.io/etcher/) is a quick and easy way to burn ISO |
| 16 | ISO images to CDs and USB devices. There are two different ways you can | 16 | images to CDs and USB devices. There are two different ways you can install this |
| 17 | install this program. First, you can navigate to the [official | 17 | program. First, you can navigate to the [official |
| 18 | website](https://www.balena.io/etcher/) and download the AppImage file, | 18 | website](https://www.balena.io/etcher/) and download the AppImage file, which |
| 19 | which can run without installation. | 19 | can run without installation. |
| 20 | 20 | ||
| 21 | However, AppImage files are not executable by default, so you\'ll either | 21 | However, AppImage files are not executable by default, so you'll either need to |
| 22 | need to right-click to open the properties of the file and click the | 22 | right-click to open the properties of the file and click the "Allow executing |
| 23 | \"Allow executing file as program\" box in the Permissions tab or use | 23 | file as program" box in the Permissions tab or use the following command: |
| 24 | the following command: | ||
| 25 | 24 | ||
| 26 | ```sh | 25 | ```sh |
| 27 | chmod u+x FILE_NAME | 26 | chmod u+x FILE_NAME |
| 28 | ``` | 27 | ``` |
| 29 | 28 | ||
| 30 | If you don\'t like AppImage files or just prefer repositories, you can | 29 | If you don't like AppImage files or just prefer repositories, you can use the |
| 31 | use the following commands to add the author\'s repository and install | 30 | following commands to add the author's repository and install it through the |
| 32 | it through the command-line only. | 31 | command-line only. |
| 33 | 32 | ||
| 34 | First, you\'ll have to echo the repo and write it to a list file: | 33 | First, you'll have to echo the repo and write it to a list file: |
| 35 | 34 | ||
| 36 | ```sh | 35 | ```sh |
| 37 | echo "deb https://deb.etcher.io stable etcher" | sudo tee /etc/apt/sources.list.d/balena-etcher.list | 36 | echo "deb https://deb.etcher.io stable etcher" | sudo tee /etc/apt/sources.list.d/balena-etcher.list |
| 38 | ``` | 37 | ``` |
| 39 | 38 | ||
| 40 | Next, add the application keys to Ubuntu\'s keyring: | 39 | Next, add the application keys to Ubuntu's keyring: |
| 41 | 40 | ||
| 42 | ```sh | 41 | ```sh |
| 43 | sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 379CE192D401AB61 | 42 | sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 379CE192D401AB61 |
| @@ -49,8 +48,7 @@ Finally, update the repositories and install the app. | |||
| 49 | sudo apt update && sudo apt install balena-etcher-electron | 48 | sudo apt update && sudo apt install balena-etcher-electron |
| 50 | ``` | 49 | ``` |
| 51 | 50 | ||
| 52 | Using Arch, Manjaro, or another distro using the AUR? Use this command | 51 | Using Arch, Manjaro, or another distro using the AUR? Use this command instead: |
| 53 | instead: | ||
| 54 | 52 | ||
| 55 | ```sh | 53 | ```sh |
| 56 | sudo pacman -S etcher | 54 | sudo pacman -S etcher |
| @@ -61,12 +59,11 @@ sudo pacman -S etcher | |||
| 61 |  | 60 | Screenshot](https://img.cleberg.net/blog/20200125-the-best-linux-software/atom.png) |
| 63 | 61 | ||
| 64 | [Atom](https://atom.io) is the self-proclaimed \"hackable text editor | 62 | [Atom](https://atom.io) is the self-proclaimed "hackable text editor for the |
| 65 | for the 21st century\". This text editor is made by GitHub, [now owned | 63 | 21st century". This text editor is made by GitHub, [now owned by |
| 66 | by | ||
| 67 | Microsoft](https://news.microsoft.com/2018/06/04/microsoft-to-acquire-github-for-7-5-billion/), | 64 | Microsoft](https://news.microsoft.com/2018/06/04/microsoft-to-acquire-github-for-7-5-billion/), |
| 68 | and has some of the best add-ons available to customize the layout and | 65 | and has some of the best add-ons available to customize the layout and abilities |
| 69 | abilities of the app. | 66 | of the app. |
| 70 | 67 | ||
| 71 | First, add the Atom repository to your sources. | 68 | First, add the Atom repository to your sources. |
| 72 | 69 | ||
| @@ -80,25 +77,24 @@ Next, update your package listings and install atom. | |||
| 80 | sudo apt update && sudo apt install atom | 77 | sudo apt update && sudo apt install atom |
| 81 | ``` | 78 | ``` |
| 82 | 79 | ||
| 83 | If you have issues updating your packages with the Atom repository, | 80 | If you have issues updating your packages with the Atom repository, you'll need |
| 84 | you\'ll need to use the snap package described below instead of the | 81 | to use the snap package described below instead of the repository. To remove the |
| 85 | repository. To remove the repository we just added, use this command: | 82 | repository we just added, use this command: |
| 86 | 83 | ||
| 87 | ```sh | 84 | ```sh |
| 88 | sudo add-apt-repository -r ppa:webupd8team/atom | 85 | sudo add-apt-repository -r ppa:webupd8team/atom |
| 89 | ``` | 86 | ``` |
| 90 | 87 | ||
| 91 | You can also install Atom as a snap package, but it must be installed | 88 | You can also install Atom as a snap package, but it must be installed with the |
| 92 | with the `--classic` flag. A [full explanation is | 89 | `--classic` flag. A [full explanation is |
| 93 | available](https://language-bash.com/blog/how-to-snap-introducing-classic-confinement) | 90 | available](https://language-bash.com/blog/how-to-snap-introducing-classic-confinement) |
| 94 | if you\'d like to read more about why you need the classic flag. | 91 | if you'd like to read more about why you need the classic flag. |
| 95 | 92 | ||
| 96 | ```sh | 93 | ```sh |
| 97 | snap install atom --classic | 94 | snap install atom --classic |
| 98 | ``` | 95 | ``` |
| 99 | 96 | ||
| 100 | Using Arch, Manjaro, or another distro using the AUR? Use this command | 97 | Using Arch, Manjaro, or another distro using the AUR? Use this command instead: |
| 101 | instead: | ||
| 102 | 98 | ||
| 103 | ```sh | 99 | ```sh |
| 104 | sudo pacman -S atom | 100 | sudo pacman -S atom |
| @@ -109,28 +105,25 @@ sudo pacman -S atom | |||
| 109 |  | 106 | Code](https://img.cleberg.net/blog/20200125-the-best-linux-software/vscode.png) |
| 111 | 107 | ||
| 112 | [Visual Studio Code](https://code.visualstudio.com) is yet another | 108 | [Visual Studio Code](https://code.visualstudio.com) is yet another fantastic |
| 113 | fantastic choice for programming on Linux, especially if you need those | 109 | choice for programming on Linux, especially if you need those extra add-ons to |
| 114 | extra add-ons to spice up your late-night coding sessions. The theme | 110 | spice up your late-night coding sessions. The theme used in the screenshot is |
| 115 | used in the screenshot is | 111 | [Mars](https://marketplace.visualstudio.com/items?itemName=EliverLara.mars) by |
| 116 | [Mars](https://marketplace.visualstudio.com/items?itemName=EliverLara.mars) | 112 | theme creator [Eliver Lara](https://github.com/EliverLara), who makes a ton of |
| 117 | by theme creator [Eliver Lara](https://github.com/EliverLara), who makes | 113 | great themes for VS Code, Atom, and various Linux desktop environments. |
| 118 | a ton of great themes for VS Code, Atom, and various Linux desktop | 114 | |
| 119 | environments. | 115 | To install VS Code, you'll need to download the `.deb` file from the official |
| 120 | 116 | website. Once you've downloaded the file, either double-click it to install | |
| 121 | To install VS Code, you\'ll need to download the `.deb` file | 117 | through the Software Center or run the following command: |
| 122 | from the official website. Once you\'ve downloaded the file, either | ||
| 123 | double-click it to install through the Software Center or run the | ||
| 124 | following command: | ||
| 125 | 118 | ||
| 126 | ```sh | 119 | ```sh |
| 127 | sudo dpkg -i FILE_NAME.deb | 120 | sudo dpkg -i FILE_NAME.deb |
| 128 | ``` | 121 | ``` |
| 129 | 122 | ||
| 130 | You can also install VS Code as a snap package, but it must be installed | 123 | You can also install VS Code as a snap package, but it must be installed with |
| 131 | with the `--classic` flag. A [full explanation is | 124 | the `--classic` flag. A [full explanation is |
| 132 | available](https://language-bash.com/blog/how-to-snap-introducing-classic-confinement) | 125 | available](https://language-bash.com/blog/how-to-snap-introducing-classic-confinement) |
| 133 | if you\'d like to read more about why you need the classic flag. | 126 | if you'd like to read more about why you need the classic flag. |
| 134 | 127 | ||
| 135 | ```sh | 128 | ```sh |
| 136 | snap install code --classic | 129 | snap install code --classic |
| @@ -148,19 +141,18 @@ sudo pacman -S yay binutils make gcc pkg-config fakeroot yay -S visual-studio-co | |||
| 148 |  | 142 | Screenshot](https://img.cleberg.net/blog/20200125-the-best-linux-software/gnome-tweaks.png) |
| 150 | 143 | ||
| 151 | [Gnome Tweaks](https://gitlab.gnome.org/GNOME/gnome-tweaks) is the | 144 | [Gnome Tweaks](https://gitlab.gnome.org/GNOME/gnome-tweaks) is the ultimate tool |
| 152 | ultimate tool to use if you want to customize your GNOME desktop | 145 | to use if you want to customize your GNOME desktop environment. This is how you |
| 153 | environment. This is how you can switch application themes (GTK), shell | 146 | can switch application themes (GTK), shell themes, icons, fonts, and more. To |
| 154 | themes, icons, fonts, and more. To install GNOME Tweaks on Ubuntu, you | 147 | install GNOME Tweaks on Ubuntu, you just need to install the official package. |
| 155 | just need to install the official package. | ||
| 156 | 148 | ||
| 157 | ```sh | 149 | ```sh |
| 158 | sudo apt install gnome-tweaks | 150 | sudo apt install gnome-tweaks |
| 159 | ``` | 151 | ``` |
| 160 | 152 | ||
| 161 | If you\'ve installed Manjaro or Arch with Gnome, you should have the | 153 | If you've installed Manjaro or Arch with Gnome, you should have the tweak tool |
| 162 | tweak tool pre-installed. If you\'re on Fedora, this tool is available | 154 | pre-installed. If you're on Fedora, this tool is available as an official |
| 163 | as an official package: | 155 | package: |
| 164 | 156 | ||
| 165 | ```sh | 157 | ```sh |
| 166 | sudo dnf install gnome-tweaks | 158 | sudo dnf install gnome-tweaks |
| @@ -171,22 +163,20 @@ sudo dnf install gnome-tweaks | |||
| 171 |  | 164 | Screenshot](https://img.cleberg.net/blog/20200125-the-best-linux-software/steam.png) |
| 173 | 165 | ||
| 174 | [Steam](https://steampowered.com) is one of the most popular gaming | 166 | [Steam](https://steampowered.com) is one of the most popular gaming libraries |
| 175 | libraries for computers and is one of the main reasons that many people | 167 | for computers and is one of the main reasons that many people have been able to |
| 176 | have been able to switch to Linux in recent years, thanks to Steam | 168 | switch to Linux in recent years, thanks to Steam Proton, which makes it easier |
| 177 | Proton, which makes it easier to play games not officially created for | 169 | to play games not officially created for Linux platforms. |
| 178 | Linux platforms. | ||
| 179 | 170 | ||
| 180 | To install Steam on Ubuntu, you just need to install the official | 171 | To install Steam on Ubuntu, you just need to install the official package. |
| 181 | package. | ||
| 182 | 172 | ||
| 183 | ```sh | 173 | ```sh |
| 184 | sudo apt install steam-installer | 174 | sudo apt install steam-installer |
| 185 | ``` | 175 | ``` |
| 186 | 176 | ||
| 187 | For Arch-based systems, you\'ll simply need to install the | 177 | For Arch-based systems, you'll simply need to install the `steam` package. |
| 188 | `steam` package. However, this requires that you enable the | 178 | However, this requires that you enable the `multilib` source. To do so, use the |
| 189 | `multilib` source. To do so, use the following command: | 179 | following command: |
| 190 | 180 | ||
| 191 | ```sh | 181 | ```sh |
| 192 | sudo nano /etc/pacman.conf | 182 | sudo nano /etc/pacman.conf |
| @@ -220,27 +210,26 @@ Here.](./2020-01-26-steam-on-ntfs-drives.html) | |||
| 220 |  | 211 | Screenshot](https://img.cleberg.net/blog/20200125-the-best-linux-software/neofetch.png) |
| 222 | 212 | ||
| 223 | [Neofetch](https://github.com/dylanaraps/neofetch) is a customizable | 213 | [Neofetch](https://github.com/dylanaraps/neofetch) is a customizable tool used |
| 224 | tool used in the command-line to show system information. This is | 214 | in the command-line to show system information. This is exceptionally useful if |
| 225 | exceptionally useful if you want to see your system\'s information | 215 | you want to see your system's information quickly without the clutter of some |
| 226 | quickly without the clutter of some resource-heavy GUI apps. | 216 | resource-heavy GUI apps. |
| 227 | 217 | ||
| 228 | This is an official package if you\'re running Ubuntu 17.04 or later, so | 218 | This is an official package if you're running Ubuntu 17.04 or later, so simply |
| 229 | simply use the following command: | 219 | use the following command: |
| 230 | 220 | ||
| 231 | ```sh | 221 | ```sh |
| 232 | sudo apt install neofetch | 222 | sudo apt install neofetch |
| 233 | ``` | 223 | ``` |
| 234 | 224 | ||
| 235 | If you\'re running Ubuntu 16.10 or earlier, you\'ll have to use a series | 225 | If you're running Ubuntu 16.10 or earlier, you'll have to use a series of |
| 236 | of commands: | 226 | commands: |
| 237 | 227 | ||
| 238 | ```sh | 228 | ```sh |
| 239 | sudo add-apt-repository ppa:dawidd0811/neofetch; sudo apt update; sudo apt install neofetch | 229 | sudo add-apt-repository ppa:dawidd0811/neofetch; sudo apt update; sudo apt install neofetch |
| 240 | ``` | 230 | ``` |
| 241 | 231 | ||
| 242 | Using Arch, Manjaro, or another distro using the AUR? Use this command | 232 | Using Arch, Manjaro, or another distro using the AUR? Use this command instead: |
| 243 | instead: | ||
| 244 | 233 | ||
| 245 | ```sh | 234 | ```sh |
| 246 | sudo pacman -S neofetch | 235 | sudo pacman -S neofetch |
| @@ -251,31 +240,27 @@ sudo pacman -S neofetch | |||
| 251 |  | 241 | Screenshot](https://img.cleberg.net/blog/20200125-the-best-linux-software/yt-dlp.png) |
| 253 | 242 | ||
| 254 | [yt-dlp](https://github.com/yt-dlp/yt-dlp) is an extremely handy | 243 | [yt-dlp](https://github.com/yt-dlp/yt-dlp) is an extremely handy command-line |
| 255 | command-line tool that allows you to download video or audio files from | 244 | tool that allows you to download video or audio files from various websites, |
| 256 | various websites, such as YouTube. There are a ton of different options | 245 | such as YouTube. There are a ton of different options when running this package, |
| 257 | when running this package, so be sure to run `yt-dlp --help` | 246 | so be sure to run `yt-dlp --help` first to look through everything you can do |
| 258 | first to look through everything you can do (or give up and search for | 247 | (or give up and search for the best config online). |
| 259 | the best config online). | ||
| 260 | 248 | ||
| 261 | While this shouldn\'t be a problem for most users, yt-dlp requires | 249 | While this shouldn't be a problem for most users, yt-dlp requires Python 2.6, |
| 262 | Python 2.6, 2.7, or 3.2+ to work correctly, so install Python if you | 250 | 2.7, or 3.2+ to work correctly, so install Python if you don't have it already. |
| 263 | don\'t have it already. You can check to see if you have Python | 251 | You can check to see if you have Python installed by running: |
| 264 | installed by running: | ||
| 265 | 252 | ||
| 266 | ```sh | 253 | ```sh |
| 267 | python -V | 254 | python -V |
| 268 | ``` | 255 | ``` |
| 269 | 256 | ||
| 270 | To get the youtube-dl package, simply curl the URL and output the | 257 | To get the youtube-dl package, simply curl the URL and output the results. |
| 271 | results. | ||
| 272 | 258 | ||
| 273 | ```sh | 259 | ```sh |
| 274 | sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp | 260 | sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp |
| 275 | ``` | 261 | ``` |
| 276 | 262 | ||
| 277 | Finally, make the file executable so that it can be run from the | 263 | Finally, make the file executable so that it can be run from the command-line. |
| 278 | command-line. | ||
| 279 | 264 | ||
| 280 | ```sh | 265 | ```sh |
| 281 | sudo chmod a+rx /usr/local/bin/yt-dlp | 266 | sudo chmod a+rx /usr/local/bin/yt-dlp |
content/blog/2020-01-26-steam-on-ntfs.md +30 −33
| @@ -10,29 +10,28 @@ draft = false | |||
| 10 |  | 11 | Screenshot](https://img.cleberg.net/blog/20200125-the-best-linux-software/steam.png) |
| 12 | 12 | ||
| 13 | If you want to see how to install Steam on Linux, see my other post: | 13 | If you want to see how to install Steam on Linux, see my other post: [Linux |
| 14 | [Linux Software](../linux-software/). | 14 | Software](../linux-software/). |
| 15 | 15 | ||
| 16 | Are you having trouble launching games, even though they\'ve installed | 16 | Are you having trouble launching games, even though they've installed |
| 17 | correctly? This may happen if you\'re storing your games on an | 17 | correctly? This may happen if you're storing your games on an NTFS-formatted |
| 18 | NTFS-formatted drive. This shouldn\'t be an issue if you\'re storing | 18 | drive. This shouldn't be an issue if you're storing your games on the same |
| 19 | your games on the same drive that Steam is on, but some gamers prefer to | 19 | drive that Steam is on, but some gamers prefer to put Steam on their main drive |
| 20 | put Steam on their main drive and game files on another SSD or HDD. | 20 | and game files on another SSD or HDD. |
| 21 | 21 | ||
| 22 | To fix this problem, you\'ll need to try a few things. First, you\'ll | 22 | To fix this problem, you'll need to try a few things. First, you'll need to |
| 23 | need to install the `ntfs-3g` package, which is meant for | 23 | install the `ntfs-3g` package, which is meant for better interoperability with |
| 24 | better interoperability with Linux. | 24 | Linux. |
| 25 | 25 | ||
| 26 | ```sh | 26 | ```sh |
| 27 | sudo apt install ntfs-3g | 27 | sudo apt install ntfs-3g |
| 28 | ``` | 28 | ``` |
| 29 | 29 | ||
| 30 | Next, you should set up the `/etc/fstab` file to | 30 | Next, you should set up the `/etc/fstab` file to automatically mount your drives |
| 31 | automatically mount your drives on boot. To automatically mount your | 31 | on boot. To automatically mount your drives when the computer boots up, you'll |
| 32 | drives when the computer boots up, you\'ll have to create the folders | 32 | have to create the folders you want to mount your drive to first. I store mine |
| 33 | you want to mount your drive to first. I store mine in the | 33 | in the `/mnt` folder using names that I'll recognize, but you can create your |
| 34 | `/mnt` folder using names that I\'ll recognize, but you can | 34 | folders wherever you want. |
| 35 | create your folders wherever you want. | ||
| 36 | 35 | ||
| 37 | ```sh | 36 | ```sh |
| 38 | mkdir /path/to/folder | 37 | mkdir /path/to/folder |
| @@ -44,28 +43,27 @@ For example: | |||
| 44 | mkdir /mnt/steam_library | 43 | mkdir /mnt/steam_library |
| 45 | ``` | 44 | ``` |
| 46 | 45 | ||
| 47 | To automatically mount drives upon system boot, you will need to collect | 46 | To automatically mount drives upon system boot, you will need to collect a few |
| 48 | a few items. The UUID is the identification number connected to | 47 | items. The UUID is the identification number connected to whichever drive |
| 49 | whichever drive you\'re using to store Steam games. | 48 | you're using to store Steam games. |
| 50 | 49 | ||
| 51 | Drives are usually labeled similar to `/dev/nvme0n1p1` or | 50 | Drives are usually labeled similar to `/dev/nvme0n1p1` or `/dev/sda1`, so |
| 52 | `/dev/sda1`, so you\'ll need to find the line in the output | 51 | you'll need to find the line in the output of the command below that correlates |
| 53 | of the command below that correlates to your drive and copy the UUID | 52 | to your drive and copy the UUID over to the `/etc/fstab` file. |
| 54 | over to the `/etc/fstab` file. | ||
| 55 | 53 | ||
| 56 | ```sh | 54 | ```sh |
| 57 | sudo blkid | grep UUID= | 55 | sudo blkid | grep UUID= |
| 58 | ``` | 56 | ``` |
| 59 | 57 | ||
| 60 | Next, you\'ll need your `uid` and `gid`. To find | 58 | Next, you'll need your `uid` and `gid`. To find these, run the following |
| 61 | these, run the following command: | 59 | command: |
| 62 | 60 | ||
| 63 | ```sh | 61 | ```sh |
| 64 | id -u && id -g | 62 | id -u && id -g |
| 65 | ``` | 63 | ``` |
| 66 | 64 | ||
| 67 | Now that you have collected the necessary information, open the | 65 | Now that you have collected the necessary information, open the `/etc/fstab` |
| 68 | `/etc/fstab` file: | 66 | file: |
| 69 | 67 | ||
| 70 | ```sh | 68 | ```sh |
| 71 | sudo nano /etc/fstab | 69 | sudo nano /etc/fstab |
| @@ -78,9 +76,8 @@ Each drive you want to mount on boot should have its own line in the | |||
| 78 | UUID=B64E53824E5339F7 /mnt/steam_library ntfs-3g uid=1000,gid=1000 0 0 | 76 | UUID=B64E53824E5339F7 /mnt/steam_library ntfs-3g uid=1000,gid=1000 0 0 |
| 79 | ``` | 77 | ``` |
| 80 | 78 | ||
| 81 | Now all you need to do is unmount your drive and re-mount it. You can | 79 | Now all you need to do is unmount your drive and re-mount it. You can unmount |
| 82 | unmount the drive by doing this (be sure to use the correct drive name | 80 | the drive by doing this (be sure to use the correct drive name here): |
| 83 | here): | ||
| 84 | 81 | ||
| 85 | ```sh | 82 | ```sh |
| 86 | sudo umount /dev/sdxX | 83 | sudo umount /dev/sdxX |
| @@ -92,6 +89,6 @@ You can re-mount all your drives by executing the following: | |||
| 92 | sudo mount -a | 89 | sudo mount -a |
| 93 | ``` | 90 | ``` |
| 94 | 91 | ||
| 95 | If you don\'t know what your drive name is, or you\'re nervous about | 92 | If you don't know what your drive name is, or you're nervous about unmounting |
| 96 | unmounting and re-mounting, simply reboot your computer, and it will be | 93 | and re-mounting, simply reboot your computer, and it will be done for you |
| 97 | done for you automatically. | 94 | automatically. |
content/blog/2020-02-09-cryptography-basics.md +135 −148
| @@ -7,174 +7,161 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Similar Article Available | 8 | # Similar Article Available |
| 9 | 9 | ||
| 10 | If you haven\'t already, feel free to read my post on [AES | 10 | If you haven't already, feel free to read my post on [AES |
| 11 | Encryption](../aes-encryption/). | 11 | Encryption](../aes-encryption/). |
| 12 | 12 | ||
| 13 | # What is Cryptography? | 13 | # What is Cryptography? |
| 14 | 14 | ||
| 15 | In layman\'s terms, cryptography is a process that can change data from | 15 | In layman's terms, cryptography is a process that can change data from a |
| 16 | a readable format into an unreadable format (and vice-versa) through a | 16 | readable format into an unreadable format (and vice-versa) through a series of |
| 17 | series of processes and secrets. More technically, this is the Internet | 17 | processes and secrets. More technically, this is the Internet Security |
| 18 | Security Glossary\'s definition: | 18 | Glossary's definition: |
| 19 | 19 | ||
| 20 | > \[Cryptography is\] the mathematical science that deals with | 20 | > [Cryptography is] the mathematical science that deals with transforming data |
| 21 | > transforming data to render its meaning unintelligible (i.e., to hide | 21 | > to render its meaning unintelligible (i.e., to hide its semantic content), |
| 22 | > its semantic content), prevent its undetected alteration, or prevent | 22 | > prevent its undetected alteration, or prevent its unauthorized use. If the |
| 23 | > its unauthorized use. If the transformation is reversible, | 23 | > transformation is reversible, cryptography also deals with restoring encrypted |
| 24 | > cryptography also deals with restoring encrypted data to an | 24 | > data to an intelligible form. |
| 25 | > intelligible form. | ||
| 26 | > | 25 | > |
| 27 | > - [Internet Security Glossary | 26 | > - [Internet Security Glossary (2000)](https://tools.ietf.org/html/rfc2828) |
| 28 | > (2000)](https://tools.ietf.org/html/rfc2828) | ||
| 29 | 27 | ||
| 30 | Cryptography cannot offer protection against the loss of data; it simply | 28 | Cryptography cannot offer protection against the loss of data; it simply offers |
| 31 | offers encryption methods to protect data at-rest and data in-traffic. | 29 | encryption methods to protect data at-rest and data in-traffic. At a high-level, |
| 32 | At a high-level, encrypted is when plaintext data is encrypted to | 30 | encrypted is when plaintext data is encrypted to ciphertext (a secure form of |
| 33 | ciphertext (a secure form of text that cannot be understood unless | 31 | text that cannot be understood unless decrypted back to plaintext). The |
| 34 | decrypted back to plaintext). The encryption process is completed | 32 | encryption process is completed through the use of a mathematical function that |
| 35 | through the use of a mathematical function that utilizes one or more | 33 | utilizes one or more values called keys to encrypt or decrypt the data. |
| 36 | values called keys to encrypt or decrypt the data. | ||
| 37 | 34 | ||
| 38 | # Key Elements of Cryptographic Systems | 35 | # Key Elements of Cryptographic Systems |
| 39 | 36 | ||
| 40 | To create or evaluate a cryptographic system, you need to know the | 37 | To create or evaluate a cryptographic system, you need to know the essential |
| 41 | essential pieces to the system: | 38 | pieces to the system: |
| 42 | 39 | ||
| 43 | - **Encryption Algorithm (Primitive):\*** A mathematical process that | 40 | - **Encryption Algorithm (Primitive):** A mathematical process that encrypts |
| 44 | encrypts and decrypts data. | 41 | and decrypts data. |
| 45 | - **Encryption Key:\*** A string of bits used within the encryption | 42 | - **Encryption Key:** A string of bits used within the encryption algorithm as |
| 46 | algorithm as the secret that allows successful encryption or | 43 | the secret that allows successful encryption or decryption of data. |
| 47 | decryption of data. | 44 | - **Key Length (Size):** The maximum number of bits within the encryption key. |
| 48 | - **Key Length (Size):\*** The maximum number of bits within the | 45 | It's important to remember that key size is regulated in many countries. |
| 49 | encryption key. It\'s important to remember that key size is | 46 | - **Message Digest:** A smaller, fixed-size bit string version of the original |
| 50 | regulated in many countries. | 47 | message. This is practically infeasible to reverse, which is why it's |
| 51 | - **Message Digest:\*** A smaller, fixed-size bit string version of | 48 | commonly used to verify integrity. |
| 52 | the original message. This is practically infeasible to reverse, | ||
| 53 | which is why it\'s commonly used to verify integrity. | ||
| 54 | 49 | ||
| 55 | # Symmetric Systems (Secret Key Cryptography) | 50 | # Symmetric Systems (Secret Key Cryptography) |
| 56 | 51 | ||
| 57 | Symmetric cryptography utilizes a secret, bidirectional key to perform | 52 | Symmetric cryptography utilizes a secret, bidirectional key to perform both |
| 58 | both encryption and decryption of the data. The most common | 53 | encryption and decryption of the data. The most common implementation of |
| 59 | implementation of symmetric cryptography is the Advanced Encryption | 54 | symmetric cryptography is the Advanced Encryption Standard, which uses keys that |
| 60 | Standard, which uses keys that are 128 bits to 256 bits in size. This | 55 | are 128 bits to 256 bits in size. This standard came after the National |
| 61 | standard came after the National Institute of Standards and Technology | 56 | Institute of Standards and Technology (NIST) decided to retire the Data |
| 62 | (NIST) decided to retire the Data Encryption Standard (DES) in 2001. | 57 | Encryption Standard (DES) in 2001. |
| 63 | 58 | ||
| 64 | Since brute force attacks strongly correlate with key length, the 56-bit | 59 | Since brute force attacks strongly correlate with key length, the 56-bit key |
| 65 | key length of DES was considered insecure after it was publicly broken | 60 | length of DES was considered insecure after it was publicly broken in under 24 |
| 66 | in under 24 hours. However, there is a modern implementation of DES | 61 | hours. However, there is a modern implementation of DES called Triple DES where |
| 67 | called Triple DES where the DES method is applied three times to each | 62 | the DES method is applied three times to each data block. |
| 68 | data block. | 63 | |
| 69 | 64 | The main advantages to symmetric systems are the ease of use, since only one key | |
| 70 | The main advantages to symmetric systems are the ease of use, since only | 65 | is required for both encryption and decryption, and the simplicity of the |
| 71 | one key is required for both encryption and decryption, and the | 66 | algorithms. This helps with bulk data encryption that may unnecessarily waste |
| 72 | simplicity of the algorithms. This helps with bulk data encryption that | 67 | time and power using asymmetric systems. |
| 73 | may unnecessarily waste time and power using asymmetric systems. | 68 | |
| 74 | 69 | However, symmetric systems have disadvantages to keep in mind. Since the key is | |
| 75 | However, symmetric systems have disadvantages to keep in mind. Since the | 70 | private, it can be difficult to safely distribute keys to communication |
| 76 | key is private, it can be difficult to safely distribute keys to | 71 | partners. Additionally, the key cannot be used to sign messages since it's |
| 77 | communication partners. Additionally, the key cannot be used to sign | 72 | necessary to keep the key private. |
| 78 | messages since it\'s necessary to keep the key private. | ||
| 79 | 73 | ||
| 80 | # Asymmetric Systems (Public Key Cryptography) | 74 | # Asymmetric Systems (Public Key Cryptography) |
| 81 | 75 | ||
| 82 | Asymmetric cryptography utilizes two keys within the system: a secret | 76 | Asymmetric cryptography utilizes two keys within the system: a secret key that |
| 83 | key that is privately-held and a public key that can be distributed | 77 | is privately-held and a public key that can be distributed freely. The |
| 84 | freely. The interesting aspect of asymmetric cryptography is that either | 78 | interesting aspect of asymmetric cryptography is that either key can be used to |
| 85 | key can be used to encrypt the data, there\'s no rule that dictates | 79 | encrypt the data, there's no rule that dictates which key must be used for |
| 86 | which key must be used for encryption. Once one key is used to encrypt | 80 | encryption. Once one key is used to encrypt the data, only the other key can be |
| 87 | the data, only the other key can be used to decrypt the data. This means | 81 | used to decrypt the data. This means that if the private key encrypts the data, |
| 88 | that if the private key encrypts the data, only the public key can | 82 | only the public key can decrypt the data. |
| 89 | decrypt the data. | 83 | |
| 90 | 84 | An advantage of this system is that if you successfully decrypt data using one | |
| 91 | An advantage of this system is that if you successfully decrypt data | 85 | of the keys, you can be sure of the sender since only the other key could have |
| 92 | using one of the keys, you can be sure of the sender since only the | 86 | encrypted the data. |
| 93 | other key could have encrypted the data. | 87 | |
| 94 | 88 | One of the major implementations of an asymmetric system is a digital signature. | |
| 95 | One of the major implementations of an asymmetric system is a digital | 89 | A digital signature can be generated using the sender's private key, or a |
| 96 | signature. A digital signature can be generated using the sender\'s | 90 | one-way hash function and is used to provide assurance for the integrity and |
| 97 | private key, or a one-way hash function and is used to provide assurance | 91 | authenticity of the message. A couple common message digest algorithms are |
| 98 | for the integrity and authenticity of the message. A couple common | 92 | SHA-256 and SHA-512, which securely compress data and produce a 128-bit message |
| 99 | message digest algorithms are SHA-256 and SHA-512, which securely | 93 | digest. |
| 100 | compress data and produce a 128-bit message digest. | 94 | |
| 101 | 95 | It should be noted that man-in-the-middle attacks are one of the risks with | |
| 102 | It should be noted that man-in-the-middle attacks are one of the risks | 96 | digital signatures and public keys. To combat this, applications often use a |
| 103 | with digital signatures and public keys. To combat this, applications | 97 | public key infrastructure (PKI) to independently authenticate the validity of |
| 104 | often use a public key infrastructure (PKI) to independently | 98 | signatures and keys. |
| 105 | authenticate the validity of signatures and keys. | ||
| 106 | 99 | ||
| 107 | Due to the large key size and [inefficient mathematical | 100 | Due to the large key size and [inefficient mathematical |
| 108 | functions](https://crypto.stackexchange.com/a/591) of asymmetric | 101 | functions](https://crypto.stackexchange.com/a/591) of asymmetric encryption, |
| 109 | encryption, elliptical curve cryptography (ECC) is often used to | 102 | elliptical curve cryptography (ECC) is often used to increase security while |
| 110 | increase security while using fewer resources. | 103 | using fewer resources. |
| 111 | 104 | ||
| 112 | # Applications of Cryptographic Systems | 105 | # Applications of Cryptographic Systems |
| 113 | 106 | ||
| 114 | There are quite a few implementations of cryptographic systems around | 107 | There are quite a few implementations of cryptographic systems around the world. |
| 115 | the world. Here are a few popular examples: | 108 | Here are a few popular examples: |
| 116 | 109 | ||
| 117 | **Transport Layer Security (TLS):\*** One of the most famous | 110 | **Transport Layer Security (TLS):** One of the most famous cryptographic |
| 118 | cryptographic solutions created is TLS, a session-layered or | 111 | solutions created is TLS, a session-layered or connection-layered internet |
| 119 | connection-layered internet protocol that allows for secure | 112 | protocol that allows for secure communications between browsers and servers. |
| 120 | communications between browsers and servers. Using handshakes, peer | 113 | Using handshakes, peer negotiation, and authentication allows TLS to prevent |
| 121 | negotiation, and authentication allows TLS to prevent eavesdropping and | 114 | eavesdropping and malicious transformation of data. The major reason for TLS |
| 122 | malicious transformation of data. The major reason for TLS popularity is | 115 | popularity is that a major vulnerability was found in the SSL protocol in 2014. |
| 123 | that a major vulnerability was found in the SSL protocol in 2014. | 116 | Instead of SSL, TLS can be used with HTTP to form HTTPS and is the preferred |
| 124 | Instead of SSL, TLS can be used with HTTP to form HTTPS and is the | 117 | method for modern web development due to its increased security. |
| 125 | preferred method for modern web development due to its increased | 118 | |
| 126 | security. | 119 | **Secure Hypertext Transfer Protocol (HTTPS):** An application layer protocol |
| 127 | 120 | that allows for secure transport of data between servers and web clients. One of | |
| 128 | **Secure Hypertext Transfer Protocol (HTTPS):\*** An application layer | 121 | the unique parts of HTTPS is that it uses a secured port number instead of the |
| 129 | protocol that allows for secure transport of data between servers and | 122 | default web port address. |
| 130 | web clients. One of the unique parts of HTTPS is that it uses a secured | 123 | |
| 131 | port number instead of the default web port address. | 124 | **Virtual Private Network (VPN):** VPNs are made to securely extend a private |
| 132 | 125 | network across public networks by utilizing an encrypted layered tunneling | |
| 133 | **Virtual Private Network (VPN):\*** VPNs are made to securely extend a | 126 | protocol paired with an authentication method, such as usernames and passwords. |
| 134 | private network across public networks by utilizing an encrypted layered | 127 | This technology originally allowed remote employees to access their company's |
| 135 | tunneling protocol paired with an authentication method, such as | 128 | data but have evolved into one of the top choices for anyone who wishes to mask |
| 136 | usernames and passwords. This technology originally allowed remote | 129 | their sensitive personal data. |
| 137 | employees to access their company\'s data but have evolved into one of | 130 | |
| 138 | the top choices for anyone who wishes to mask their sensitive personal | 131 | **Internet Protocol Security (IPSec):** This protocol suite facilitates |
| 139 | data. | 132 | communication between two or more hosts or subnets by authenticating and |
| 140 | 133 | encrypting the data packets. IPSec is used in a lot of VPNs to establish the VPN | |
| 141 | **Internet Protocol Security (IPSec):\*** This protocol suite | 134 | connection through the transport and tunnel mode encryption methods. IPSec |
| 142 | facilitates communication between two or more hosts or subnets by | 135 | encrypts just the data portion of packets in the transport methods, but it |
| 143 | authenticating and encrypting the data packets. IPSec is used in a lot | 136 | encrypts both the data and headers in the tunnel method (introducing an |
| 144 | of VPNs to establish the VPN connection through the transport and tunnel | 137 | additional header for authentication). |
| 145 | mode encryption methods. IPSec encrypts just the data portion of packets | 138 | |
| 146 | in the transport methods, but it encrypts both the data and headers in | 139 | **Secure Shell (SSH):** SSH is another network protocol used to protect |
| 147 | the tunnel method (introducing an additional header for authentication). | 140 | network services by authenticating users through a secure channel. This protocol |
| 148 | 141 | is often used for command-line (shell) functions such as remote shell commands, | |
| 149 | **Secure Shell (SSH):\*** SSH is another network protocol used to | 142 | logins, and file transfers. |
| 150 | protect network services by authenticating users through a secure | 143 | |
| 151 | channel. This protocol is often used for command-line (shell) functions | 144 | **Kerberos:** Developed by MIT, Kerberos is a computer-network authentication |
| 152 | such as remote shell commands, logins, and file transfers. | 145 | protocol that works on the basis of tickets to allow nodes communicating over a |
| 153 | 146 | non-secure network to prove their identity to one another securely. This is most | |
| 154 | **Kerberos:\*** Developed by MIT, Kerberos is a computer-network | 147 | commonly used in business environments when used as the authentication and |
| 155 | authentication protocol that works on the basis of tickets to allow | 148 | encryption method for Windows Active Directory (AD). |
| 156 | nodes communicating over a non-secure network to prove their identity to | ||
| 157 | one another securely. This is most commonly used in business | ||
| 158 | environments when used as the authentication and encryption method for | ||
| 159 | Windows Active Directory (AD). | ||
| 160 | 149 | ||
| 161 | # Cybersecurity Controls | 150 | # Cybersecurity Controls |
| 162 | 151 | ||
| 163 | If you\'re someone who needs solutions on how to control risks | 152 | If you're someone who needs solutions on how to control risks associated with |
| 164 | associated with utilizing a crytograhpic system, start with a few basic | 153 | utilizing a crytograhpic system, start with a few basic controls: |
| 165 | controls: | 154 | |
| 166 | 155 | - **Policies:** A policy on the use of cryptographic controls for protection | |
| 167 | - **Policies:\*** A policy on the use of cryptographic controls for | 156 | of information is implemented and is in accordance with organizational |
| 168 | protection of information is implemented and is in accordance with | 157 | objectives. |
| 169 | organizational objectives. | 158 | - **Key management:** A policy on the use, protection and lifetime of |
| 170 | - **Key management:\*** A policy on the use, protection and lifetime | 159 | cryptographic keys is implemented through the entire application lifecycle. |
| 171 | of cryptographic keys is implemented through the entire application | 160 | - **Key size:** The organization has researched the optimal key size for their |
| 172 | lifecycle. | 161 | purposes, considering national laws, required processing power, and longevity |
| 173 | - **Key size:\*** The organization has researched the optimal key size | 162 | of the solution. |
| 174 | for their purposes, considering national laws, required processing | 163 | - **Algorithm selection:** Implemented algorithms are sufficiently appropriate |
| 175 | power, and longevity of the solution. | 164 | for the business of the organization, robust, and align with recommended |
| 176 | - **Algorithm selection:\*** Implemented algorithms are sufficiently | 165 | guidelines. |
| 177 | appropriate for the business of the organization, robust, and align | 166 | - **Protocol configuration:** Protocols have been reviewed and configured |
| 178 | with recommended guidelines. | 167 | suitable to the purpose of the business. |
| 179 | - **Protocol configuration:\*** Protocols have been reviewed and | ||
| 180 | configured suitable to the purpose of the business. | ||
content/blog/2020-03-25-session-messenger.md +64 −69
| @@ -7,67 +7,65 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Privacy Warning | 8 | # Privacy Warning |
| 9 | 9 | ||
| 10 | The company behind Session (Loki Foundation) is from Australia. If you | 10 | The company behind Session (Loki Foundation) is from Australia. If you didn't |
| 11 | didn\'t know, Australia has introduced | 11 | know, Australia has introduced |
| 12 | [legislation](https://parlinfo.aph.gov.au/parlInfo/download/legislation/bills/r6195_aspassed/toc_pdf/18204b01.pdf) | 12 | [legislation](https://parlinfo.aph.gov.au/parlInfo/download/legislation/bills/r6195_aspassed/toc_pdf/18204b01.pdf) |
| 13 | mandating companies comply with government requests to build backdoor | 13 | mandating companies comply with government requests to build backdoor access |
| 14 | access into applications. For more information, read my article on [AES | 14 | into applications. For more information, read my article on [AES |
| 15 | Encryption](./2020-01-25-aes-encryption.html). | 15 | Encryption](./2020-01-25-aes-encryption.html). |
| 16 | 16 | ||
| 17 | # About Session | 17 | # About Session |
| 18 | 18 | ||
| 19 | [Session](https://getsession.org) is a private, cross-platform messaging | 19 | [Session](https://getsession.org) is a private, cross-platform messaging app |
| 20 | app from the [Loki Foundation](https://loki.foundation). As someone who | 20 | from the [Loki Foundation](https://loki.foundation). As someone who has spent |
| 21 | has spent years looking for quality alternatives to major messaging | 21 | years looking for quality alternatives to major messaging apps, I was excited |
| 22 | apps, I was excited when I first heard about Session. Reading through | 22 | when I first heard about Session. Reading through [Session's white |
| 23 | [Session\'s white paper](https://arxiv.org/pdf/2002.04609.pdf), you can | 23 | paper](https://arxiv.org/pdf/2002.04609.pdf), you can learn the technologies |
| 24 | learn the technologies behind the Session app. Part of the security of | 24 | behind the Session app. Part of the security of Session comes from the Signal |
| 25 | Session comes from the Signal protocol, which was forked as the origin | 25 | protocol, which was forked as the origin of Session. |
| 26 | of Session. | ||
| 27 | 26 | ||
| 28 | > Session is an end-to-end encrypted messenger that removes sensitive | 27 | > Session is an end-to-end encrypted messenger that removes sensitive metadata |
| 29 | > metadata collection, and is designed for people who want privacy and | 28 | > collection, and is designed for people who want privacy and freedom from any |
| 30 | > freedom from any forms of surveillance. | 29 | > forms of surveillance. |
| 31 | 30 | ||
| 32 | In general, this app promises security through end-to-end encryption, | 31 | In general, this app promises security through end-to-end encryption, |
| 33 | decentralized onion routing, and private identities. The biggest change | 32 | decentralized onion routing, and private identities. The biggest change that the |
| 34 | that the Loki Foundation has made to the Signal protocol is removing the | 33 | Loki Foundation has made to the Signal protocol is removing the need for a phone |
| 35 | need for a phone number. Instead, a random identification string is | 34 | number. Instead, a random identification string is generated for any session you |
| 36 | generated for any session you create. This means you can create a new | 35 | create. This means you can create a new session for each device if you want to, |
| 37 | session for each device if you want to, or link new devices with your | 36 | or link new devices with your ID. |
| 38 | ID. | ||
| 39 | 37 | ||
| 40 | Since Session\'s website and white paper describe the details of | 38 | Since Session's website and white paper describe the details of Session's |
| 41 | Session\'s security, I\'m going to focus on using the app in this post. | 39 | security, I'm going to focus on using the app in this post. |
| 42 | 40 | ||
| 43 | # Features | 41 | # Features |
| 44 | 42 | ||
| 45 | Since most people are looking for an alternative to a popular chat app, | 43 | Since most people are looking for an alternative to a popular chat app, I am |
| 46 | I am going to list out the features that Session has so that you are | 44 | going to list out the features that Session has so that you are able to |
| 47 | able to determine if the app would suit your needs: | 45 | determine if the app would suit your needs: |
| 48 | 46 | ||
| 49 | - Multiple device linking (via QR code or ID) | 47 | - Multiple device linking (via QR code or ID) |
| 50 | - App locking via device screen lock, password, or fingerprint | 48 | - App locking via device screen lock, password, or fingerprint |
| 51 | - Screenshot blocking | 49 | - Screenshot blocking |
| 52 | - Incognito keyboard | 50 | - Incognito keyboard |
| 53 | - Read receipts and typing indicators | 51 | - Read receipts and typing indicators |
| 54 | - Mobile notification customization | 52 | - Mobile notification customization |
| 55 | - Old message deletion and conversation limit | 53 | - Old message deletion and conversation limit |
| 56 | - Backups | 54 | - Backups |
| 57 | - Recovery phrase | 55 | - Recovery phrase |
| 58 | - Account deletion, including ID, messages, sessions, and contacts | 56 | - Account deletion, including ID, messages, sessions, and contacts |
| 59 | 57 | ||
| 60 | # Downloads | 58 | # Downloads |
| 61 | 59 | ||
| 62 | I have tested this app on Ubuntu 19.10, Android 10, macOS Monterey, and | 60 | I have tested this app on Ubuntu 19.10, Android 10, macOS Monterey, and iOS 15. |
| 63 | iOS 15. All apps have worked well without many issues. | 61 | All apps have worked well without many issues. |
| 64 | 62 | ||
| 65 | Below is a brief overview of the Session app on Linux. To get this app, | 63 | Below is a brief overview of the Session app on Linux. To get this app, you'll |
| 66 | you\'ll need to go to the [Downloads](https://getsession.org/download/) | 64 | need to go to the [Downloads](https://getsession.org/download/) page and click |
| 67 | page and click to link to the operating system you\'re using. | 65 | to link to the operating system you're using. |
| 68 | 66 | ||
| 69 | For Linux, it will download an AppImage that you\'ll need to enable with | 67 | For Linux, it will download an AppImage that you'll need to enable with the |
| 70 | the following command: | 68 | following command: |
| 71 | 69 | ||
| 72 | ```sh | 70 | ```sh |
| 73 | sudo chmod u+x session-messenger-desktop-linux-x86_64-1.0.5.AppImage | 71 | sudo chmod u+x session-messenger-desktop-linux-x86_64-1.0.5.AppImage |
| @@ -78,12 +76,12 @@ Options](https://img.cleberg.net/blog/20200325-session-private-messenger/session | |||
| 78 | 76 | ||
| 79 | # Creating an Account | 77 | # Creating an Account |
| 80 | 78 | ||
| 81 | Once you\'ve installed the app, simply run the app and create your | 79 | Once you've installed the app, simply run the app and create your unique |
| 82 | unique Session ID. It will look something like this: | 80 | Session ID. It will look something like this: |
| 83 | `05af1835afdd63c947b47705867501d6373f486aa1ae05b1f2f3fcd24570eba608`. | 81 | `05af1835afdd63c947b47705867501d6373f486aa1ae05b1f2f3fcd24570eba608`. |
| 84 | 82 | ||
| 85 | You\'ll need to set a display name and, optionally, a password. If you | 83 | You'll need to set a display name and, optionally, a password. If you set a |
| 86 | set a password, you will need to enter it every time you open the app. | 84 | password, you will need to enter it every time you open the app. |
| 87 | 85 | ||
| 88 |  | 87 | (Linux)](https://img.cleberg.net/blog/20200325-session-private-messenger/session_linux_login.png) |
| @@ -96,42 +94,39 @@ Authentication](https://img.cleberg.net/blog/20200325-session-private-messenger/ | |||
| 96 | 94 | ||
| 97 | # Start Messaging | 95 | # Start Messaging |
| 98 | 96 | ||
| 99 | Once you\'ve created your account and set up your profile details, the | 97 | Once you've created your account and set up your profile details, the next step |
| 100 | next step is to start messaging other people. To do so, you\'ll need to | 98 | is to start messaging other people. To do so, you'll need to share your Session |
| 101 | share your Session ID with other people. From this point, it\'s fairly | 99 | ID with other people. From this point, it's fairly straightforward and acts |
| 102 | straightforward and acts like any other messaging app, so I won\'t dive | 100 | like any other messaging app, so I won't dive into much detail here. |
| 103 | into much detail here. | ||
| 104 | 101 | ||
| 105 | ## macOS | 102 | ## macOS |
| 106 | 103 | ||
| 107 |  | 105 | Conversations](https://img.cleberg.net/blog/20200325-session-private-messenger/session_macos_conversations.png) |
| 109 | 106 | ||
| 110 | One key feature to note is that the desktop application now provides a | 107 | One key feature to note is that the desktop application now provides a helpful |
| 111 | helpful pop-up box explaining the process that Session uses to hide your | 108 | pop-up box explaining the process that Session uses to hide your IP address: |
| 112 | IP address: | ||
| 113 | 109 | ||
| 114 |  | 111 | Box](https://img.cleberg.net/blog/20200325-session-private-messenger/session_ip.png) |
| 116 | 112 | ||
| 117 | ## iOS | 113 | ## iOS |
| 118 | 114 | ||
| 119 | The mobile app is quite simple and effective, giving you all the | 115 | The mobile app is quite simple and effective, giving you all the standard mobile |
| 120 | standard mobile messaging options you\'d expect. | 116 | messaging options you'd expect. |
| 121 | 117 | ||
| 122 |  | 119 | App](https://img.cleberg.net/blog/20200325-session-private-messenger/session_ios.png) |
| 124 | 120 | ||
| 125 | # Potential Issues | 121 | # Potential Issues |
| 126 | 122 | ||
| 127 | I\'ve discovered one annoying issue that would prevent from using this | 123 | I've discovered one annoying issue that would prevent from using this app |
| 128 | app regularly. On a mobile device, there have been issues with receiving | 124 | regularly. On a mobile device, there have been issues with receiving messages on |
| 129 | messages on time. Even with battery optimization disabled and no network | 125 | time. Even with battery optimization disabled and no network restrictions, |
| 130 | restrictions, Session notifications sometimes do not display until I | 126 | Session notifications sometimes do not display until I open the app or the |
| 131 | open the app or the conversation itself and wait a few moments. This is | 127 | conversation itself and wait a few moments. This is actually one of the reasons |
| 132 | actually one of the reasons I stopped using Signal (this seems fixed as | 128 | I stopped using Signal (this seems fixed as of my updates in 2021/2022, so I |
| 133 | of my updates in 2021/2022, so I wouldn\'t worry about this issue | 129 | wouldn't worry about this issue anymore). |
| 134 | anymore). | 130 | |
| 135 | 131 | Looking for another messenger instead of Session? I recommend Signal, Matrix, | |
| 136 | Looking for another messenger instead of Session? I recommend Signal, | 132 | and IRC. |
| 137 | Matrix, and IRC. | ||
content/blog/2020-05-03-homelab.md +87 −98
| @@ -7,16 +7,15 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # What is a Homelab? | 8 | # What is a Homelab? |
| 9 | 9 | ||
| 10 | Starting as a developer, I have largely stayed away from hardware-based | 10 | Starting as a developer, I have largely stayed away from hardware-based hobbies |
| 11 | hobbies (other than building a gaming desktop). However, as the | 11 | (other than building a gaming desktop). However, as the quarantine for COVID-19 |
| 12 | quarantine for COVID-19 stretches out further and further, I found | 12 | stretches out further and further, I found myself bored and in search of new |
| 13 | myself bored and in search of new hobbies. After spending the last few | 13 | hobbies. After spending the last few months browsing the |
| 14 | months browsing the [r/homelab](https://www.reddit.com/r/homelab/) | 14 | [r/homelab](https://www.reddit.com/r/homelab/) subreddit, I decided it was time |
| 15 | subreddit, I decided it was time to jump in and try things out for | 15 | to jump in and try things out for myself. |
| 16 | myself. | ||
| 17 | 16 | ||
| 18 | Since I am a beginner and just recently graduated from college, | 17 | Since I am a beginner and just recently graduated from college, everything I've |
| 19 | everything I\'ve done so far in my homelab is fairly low-budget. | 18 | done so far in my homelab is fairly low-budget. |
| 20 | 19 | ||
| 21 | # Hardware | 20 | # Hardware |
| 22 | 21 | ||
| @@ -26,141 +25,131 @@ Diagram](https://img.cleberg.net/blog/20200503-homelab/homelab-min.png) | |||
| 26 | ### Raspberry Pi 4 | 25 | ### Raspberry Pi 4 |
| 27 | 26 | ||
| 28 | Luckily, I had actually purchased a [Raspberry Pi | 27 | Luckily, I had actually purchased a [Raspberry Pi |
| 29 | 4](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) before | 28 | 4](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) before the |
| 30 | the quarantine started so that I could try to keep Plex Media Center | 29 | quarantine started so that I could try to keep Plex Media Center running, even |
| 31 | running, even while my desktop computer was turned off. I started here, | 30 | while my desktop computer was turned off. I started here, using the Pi to hold |
| 32 | using the Pi to hold Plex and Pi-hole until I grew tired with the slow | 31 | Plex and Pi-hole until I grew tired with the slow performance. |
| 33 | performance. | ||
| 34 | 32 | ||
| 35 | Here are the specifications for the Pi 4: | 33 | Here are the specifications for the Pi 4: |
| 36 | 34 | ||
| 37 | - Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz | 35 | - Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz |
| 38 | - 4GB LPDDR4-3200 SDRAM | 36 | - 4GB LPDDR4-3200 SDRAM |
| 39 | - Gigabit Ethernet | 37 | - Gigabit Ethernet |
| 40 | - H.265 (4kp60 decode), H264 (1080p60 decode, 1080p30 encode) | 38 | - H.265 (4kp60 decode), H264 (1080p60 decode, 1080p30 encode) |
| 41 | - 64 GB MicroSD Card | 39 | - 64 GB MicroSD Card |
| 42 | 40 | ||
| 43 | ## Dell Optiplex 5040 | 41 | ## Dell Optiplex 5040 |
| 44 | 42 | ||
| 45 | Since I wasn\'t happy with the Pi as my main server, I turned to | 43 | Since I wasn't happy with the Pi as my main server, I turned to Craigslist. I |
| 46 | Craigslist. I know a lot of other homelabbers use Ebay, but I can\'t | 44 | know a lot of other homelabbers use Ebay, but I can't seem to ever trust it |
| 47 | seem to ever trust it enough to purchase items on there. So I used | 45 | enough to purchase items on there. So I used Craigslist and found a Dell |
| 48 | Craigslist and found a Dell Optiplex 5040 desktop computer on sale for | 46 | Optiplex 5040 desktop computer on sale for $90. While this computer might be |
| 49 | \$90. While this computer might be underpowered, it was one of the few | 47 | underpowered, it was one of the few computers under $100 that was available |
| 50 | computers under \$100 that was available during quarantine. | 48 | during quarantine. |
| 51 | 49 | ||
| 52 | Here are the specifications for the Dell Optiplex 5040: | 50 | Here are the specifications for the Dell Optiplex 5040: |
| 53 | 51 | ||
| 54 | - Intel Core i3 6100 | 52 | - Intel Core i3 6100 |
| 55 | - 8GB RAM DDR3 | 53 | - 8GB RAM DDR3 |
| 56 | - Intel HD Graphics | 54 | - Intel HD Graphics |
| 57 | - Gigabit Ethernet | 55 | - Gigabit Ethernet |
| 58 | - 500GB Hard Drive | 56 | - 500GB Hard Drive |
| 59 | 57 | ||
| 60 | While this hardware would be awful for a work computer or a gaming rig, | 58 | While this hardware would be awful for a work computer or a gaming rig, it |
| 61 | it turned out to be wonderful for my server purposes. The only | 59 | turned out to be wonderful for my server purposes. The only limitation I have |
| 62 | limitation I have found so far is the CPU. The i3-6100 only has enough | 60 | found so far is the CPU. The i3-6100 only has enough power for a single 4k video |
| 63 | power for a single 4k video transcode at a time. I haven\'t tested more | 61 | transcode at a time. I haven't tested more than three 1080p streams at a time, |
| 64 | than three 1080p streams at a time, but the maximum amount of streams | 62 | but the maximum amount of streams I've ever actually used is two. |
| 65 | I\'ve ever actually used is two. | ||
| 66 | 63 | ||
| 67 | ## WD easystore 10TB & 8TB | 64 | ## WD easystore 10TB & 8TB |
| 68 | 65 | ||
| 69 | Application storage and temporary files are stored on the internal hard | 66 | Application storage and temporary files are stored on the internal hard drive of |
| 70 | drive of the server, but all media files (movies, tv, games, books, etc) | 67 | the server, but all media files (movies, tv, games, books, etc) are stored |
| 71 | are stored externally on my WD easystore hard drive. Creating auto-boot | 68 | externally on my WD easystore hard drive. Creating auto-boot configurations in |
| 72 | configurations in the `/etc/fstab` file on my server allows | 69 | the `/etc/fstab` file on my server allows the hard drives to automatically mount |
| 73 | the hard drives to automatically mount whenever I need to restart my | 70 | whenever I need to restart my server. |
| 74 | server. | ||
| 75 | 71 | ||
| 76 | > Update: In March 2022, I shucked the hard drives out of their external | 72 | > Update: In March 2022, I shucked the hard drives out of their external cases, |
| 77 | > cases, put some Kapton tape on the third power pin to prevent power | 73 | > put some Kapton tape on the third power pin to prevent power shutdowns, and |
| 78 | > shutdowns, and stuck them inside my server tower using internal SATA | 74 | > stuck them inside my server tower using internal SATA cables. |
| 79 | > cables. | ||
| 80 | 75 | ||
| 81 | ## Netgear Unmanaged Switch | 76 | ## Netgear Unmanaged Switch |
| 82 | 77 | ||
| 83 | To manage all the ethernet cords used by my homelab, my desktop, and my | 78 | To manage all the ethernet cords used by my homelab, my desktop, and my living |
| 84 | living room media center, I purchased an 8-port gigabit ethernet switch | 79 | room media center, I purchased an 8-port gigabit ethernet switch for $50 at my |
| 85 | for \$50 at my local computer store. This is probably much more than I | 80 | local computer store. This is probably much more than I should have spent on an |
| 86 | should have spent on an unmanaged switch, but I am comfortable with the | 81 | unmanaged switch, but I am comfortable with the choice. |
| 87 | choice. | ||
| 88 | 82 | ||
| 89 | ## TP-Link Managed Switch | 83 | ## TP-Link Managed Switch |
| 90 | 84 | ||
| 91 | Since I use the unmanaged switch to group all living room devices | 85 | Since I use the unmanaged switch to group all living room devices together, I |
| 92 | together, I use the managed switch to configure VLANs and secure my | 86 | use the managed switch to configure VLANs and secure my network. |
| 93 | network. | ||
| 94 | 87 | ||
| 95 | ## Arris TM1602A Modem & Sagecom Fast 5280 Router | 88 | ## Arris TM1602A Modem & Sagecom Fast 5280 Router |
| 96 | 89 | ||
| 97 | My default modem and router, provided by my ISP, are fairly standard. | 90 | My default modem and router, provided by my ISP, are fairly standard. The Arris |
| 98 | The Arris modem supports DOCSIS 3.0, which is something that I | 91 | modem supports DOCSIS 3.0, which is something that I definitely wanted as a |
| 99 | definitely wanted as a minimum. The Sagecom router is also standard, no | 92 | minimum. The Sagecom router is also standard, no fancy bells or whistles. |
| 100 | fancy bells or whistles. However, it does support DHCP and DHCPv6, which | 93 | However, it does support DHCP and DHCPv6, which is something you can use to |
| 101 | is something you can use to route all household traffic through a | 94 | route all household traffic through a pi-hole or firewall. |
| 102 | pi-hole or firewall. | ||
| 103 | 95 | ||
| 104 | ## TP-Link EAP | 96 | ## TP-Link EAP |
| 105 | 97 | ||
| 106 | In order to gain better control over the network, I use my own wireless | 98 | In order to gain better control over the network, I use my own wireless access |
| 107 | access point instead of the one included in the Sagecom router above. | 99 | point instead of the one included in the Sagecom router above. Now I can control |
| 108 | Now I can control and organize all of my ethernet connections through | 100 | and organize all of my ethernet connections through the VLANs on the managed |
| 109 | the VLANs on the managed switch and wireless connections through the | 101 | switch and wireless connections through the VLANS on the EAP. |
| 110 | VLANS on the EAP. | ||
| 111 | 102 | ||
| 112 | ## Generic Printer | 103 | ## Generic Printer |
| 113 | 104 | ||
| 114 | The last piece to my homelab is a standard wireless printer. Nothing | 105 | The last piece to my homelab is a standard wireless printer. Nothing special |
| 115 | special here. | 106 | here. |
| 116 | 107 | ||
| 117 | # Software | 108 | # Software |
| 118 | 109 | ||
| 119 | ## Ubuntu Server 20.04 | 110 | ## Ubuntu Server 20.04 |
| 120 | 111 | ||
| 121 | While the 20.04 version of Ubuntu was just released, I always like to | 112 | While the 20.04 version of Ubuntu was just released, I always like to experiment |
| 122 | experiment with new features (and I don\'t mind breaking my system - it | 113 | with new features (and I don't mind breaking my system - it just gives me more |
| 123 | just gives me more experience learning how to fix things). So, I have | 114 | experience learning how to fix things). So, I have Ubuntu Server 20.04 installed |
| 124 | Ubuntu Server 20.04 installed on the Dell Optiplex server and Ubuntu | 115 | on the Dell Optiplex server and Ubuntu Server 19.10 installed on the Raspberry |
| 125 | Server 19.10 installed on the Raspberry Pi. Once I find an acceptable | 116 | Pi. Once I find an acceptable use for the Pi, I will most likely switch the |
| 126 | use for the Pi, I will most likely switch the operating system. | 117 | operating system. |
| 127 | 118 | ||
| 128 | ## Docker | 119 | ## Docker |
| 129 | 120 | ||
| 130 | I am *very* new to Docker, but I have had a lot of fun playing with it | 121 | I am *very* new to Docker, but I have had a lot of fun playing with it so far. |
| 131 | so far. Docker is used to create containers that can hold all the | 122 | Docker is used to create containers that can hold all the contents of a system |
| 132 | contents of a system without interfering with other software on the same | 123 | without interfering with other software on the same system. So far, I have |
| 133 | system. So far, I have successfully installed pi-hole, GitLab, Gogs, and | 124 | successfully installed pi-hole, GitLab, Gogs, and Nextcloud in containers. |
| 134 | Nextcloud in containers. However, I opted to delete all of those so that | 125 | However, I opted to delete all of those so that I can reconfigure them more |
| 135 | I can reconfigure them more professionally at a later time. | 126 | professionally at a later time. |
| 136 | 127 | ||
| 137 | ## Plex Media Server | 128 | ## Plex Media Server |
| 138 | 129 | ||
| 139 | Plex is a media center software that allows you to organize your movies, | 130 | Plex is a media center software that allows you to organize your movies, TV |
| 140 | TV shows, music, photos, and videos automatically. It will even download | 131 | shows, music, photos, and videos automatically. It will even download metadata |
| 141 | metadata for you so that you can easily browse these collections. | 132 | for you so that you can easily browse these collections. |
| 142 | 133 | ||
| 143 | ## Pi-hole | 134 | ## Pi-hole |
| 144 | 135 | ||
| 145 | Pi-hole is an alternative ad-blocker that runs at the DNS level, | 136 | Pi-hole is an alternative ad-blocker that runs at the DNS level, allowing you to |
| 146 | allowing you to block traffic when it hits your network, so that you can | 137 | block traffic when it hits your network, so that you can reject any traffic you |
| 147 | reject any traffic you deem to be bad. Pi-hole uses blacklists and | 138 | deem to be bad. Pi-hole uses blacklists and whitelists to decide which traffic |
| 148 | whitelists to decide which traffic block and, luckily, there are a lot | 139 | block and, luckily, there are a lot of pre-made lists out there on Reddit, |
| 149 | of pre-made lists out there on Reddit, GitHub, etc. | 140 | GitHub, etc. |
| 150 | 141 | ||
| 151 | ## Nextcloud | 142 | ## Nextcloud |
| 152 | 143 | ||
| 153 | While I had trouble with the Docker version of Nextcloud, I was very | 144 | While I had trouble with the Docker version of Nextcloud, I was very successful |
| 154 | successful when setting up the snap version. Using this, I was able to | 145 | when setting up the snap version. Using this, I was able to map Nextcloud to a |
| 155 | map Nextcloud to a subdomain of a domain I own in Namecheap. | 146 | subdomain of a domain I own in Namecheap. Additionally, Nextcloud has an |
| 156 | Additionally, Nextcloud has an integration with Let\'s Encrypt that | 147 | integration with Let's Encrypt that allows me to issue certificates |
| 157 | allows me to issue certificates automatically to any new domain I | 148 | automatically to any new domain I authorize. |
| 158 | authorize. | ||
| 159 | 149 | ||
| 160 | ## Webmin | 150 | ## Webmin |
| 161 | 151 | ||
| 162 | To monitor my servers, and the processes running on them, I use the | 152 | To monitor my servers, and the processes running on them, I use the Webmin |
| 163 | Webmin dashboard. This was fairly painless to set up, and I currently | 153 | dashboard. This was fairly painless to set up, and I currently access it |
| 164 | access it straight through the server\'s IP address. In the future, I | 154 | straight through the server's IP address. In the future, I will be looking to |
| 165 | will be looking to configure Webmin to use a custom domain just like | 155 | configure Webmin to use a custom domain just like Nextcloud. |
| 166 | Nextcloud. | ||
content/blog/2020-05-19-customizing-ubuntu.md +89 −100
| @@ -7,20 +7,20 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # More Information | 8 | # More Information |
| 9 | 9 | ||
| 10 | For inspiration on designing your \*nix computer, check out the | 10 | For inspiration on designing your *nix computer, check out the |
| 11 | [r/unixporn](https://libredd.it/r/unixporn) subreddit! | 11 | [r/unixporn](https://libredd.it/r/unixporn) subreddit! |
| 12 | 12 | ||
| 13 | # Customizing Ubuntu | 13 | # Customizing Ubuntu |
| 14 | 14 | ||
| 15 | New to Linux and want to add a personal touch to your machine? One of | 15 | New to Linux and want to add a personal touch to your machine? One of the best |
| 16 | the best perks of Linux is that it is **extremely\*** customizable. You | 16 | perks of Linux is that it is **extremely** customizable. You can change the |
| 17 | can change the styles of the windows, shell (status bars/docks), icons, | 17 | styles of the windows, shell (status bars/docks), icons, fonts, terminals, and |
| 18 | fonts, terminals, and more. | 18 | more. |
| 19 | 19 | ||
| 20 | In this post, I\'m going to go through customization on Ubuntu 20.04 | 20 | In this post, I'm going to go through customization on Ubuntu 20.04 (GNOME) |
| 21 | (GNOME) since most new users tend to choose Ubuntu-based distros. If | 21 | since most new users tend to choose Ubuntu-based distros. If you've found a way |
| 22 | you\'ve found a way to install Arch with i3-gaps, I\'m assuming you know | 22 | to install Arch with i3-gaps, I'm assuming you know how to find more advanced |
| 23 | how to find more advanced tutorials out there on customizations. | 23 | tutorials out there on customizations. |
| 24 | 24 | ||
| 25 | ## Required Tools | 25 | ## Required Tools |
| 26 | 26 | ||
| @@ -28,61 +28,55 @@ how to find more advanced tutorials out there on customizations. | |||
| 28 | Tweaks](https://img.cleberg.net/blog/20200519-customizing-ubuntu/gnome-tweaks-min.png) | 28 | Tweaks](https://img.cleberg.net/blog/20200519-customizing-ubuntu/gnome-tweaks-min.png) |
| 29 | 29 | ||
| 30 | Ubuntu 20.04 ships with the default desktop environment | 30 | Ubuntu 20.04 ships with the default desktop environment |
| 31 | [Gnome](https://www.gnome.org/), which includes the handy | 31 | [Gnome](https://www.gnome.org/), which includes the handy `gnome-tweaks` tool to |
| 32 | `gnome-tweaks` tool to quickly change designs. To install | 32 | quickly change designs. To install this, just open your terminal and enter the |
| 33 | this, just open your terminal and enter the following command: | 33 | following command: |
| 34 | 34 | ||
| 35 | ```sh | 35 | ```sh |
| 36 | sudo apt install gnome-tweaks | 36 | sudo apt install gnome-tweaks |
| 37 | ``` | 37 | ``` |
| 38 | 38 | ||
| 39 | After you\'ve finished installing the tool, simply launch the Tweaks | 39 | After you've finished installing the tool, simply launch the Tweaks |
| 40 | application, and you\'ll be able to access the various customization | 40 | application, and you'll be able to access the various customization options |
| 41 | options available by default on Ubuntu. You might even like some of the | 41 | available by default on Ubuntu. You might even like some of the pre-installed |
| 42 | pre-installed options. | 42 | options. |
| 43 | 43 | ||
| 44 | ## GNOME Application Themes | 44 | ## GNOME Application Themes |
| 45 | 45 | ||
| 46 | To change the themes applied to applications in GNOME, you will need to | 46 | To change the themes applied to applications in GNOME, you will need to change |
| 47 | change the Applications dropdown in the Appearance section of Tweaks. To | 47 | the Applications dropdown in the Appearance section of Tweaks. To add more |
| 48 | add more themes, you will have to find your preferred theme online and | 48 | themes, you will have to find your preferred theme online and follow the steps |
| 49 | follow the steps below to have it show up in the Tweaks tool. While you | 49 | below to have it show up in the Tweaks tool. While you may find themes anywhere, |
| 50 | may find themes anywhere, one of the most popular sites for GNOME themes | 50 | one of the most popular sites for GNOME themes is |
| 51 | is [gnome-look.org](https://www.gnome-look.org/). This website contains | 51 | [gnome-look.org](https://www.gnome-look.org/). This website contains themes for |
| 52 | themes for applications, shells, icons, and cursors. | 52 | applications, shells, icons, and cursors. |
| 53 | 53 | ||
| 54 | Steps to import themes into Tweaks: | 54 | Steps to import themes into Tweaks: |
| 55 | 55 | ||
| 56 | 1. Download the theme. | 56 | 1. Download the theme. |
| 57 | 2. These files are usually compressed (.zip, .tar.gz, .tar.xz), so you | 57 | 2. These files are usually compressed (.zip, .tar.gz, .tar.xz), so you will need |
| 58 | will need to extract the contents. This is easiest when opening the | 58 | to extract the contents. This is easiest when opening the file explorer, |
| 59 | file explorer, right-clicking the compressed file, and choosing | 59 | right-clicking the compressed file, and choosing "Extract here." |
| 60 | \"Extract here.\" | 60 | 3. Move the theme folder to `/usr/share/themes/`. You can do so with the |
| 61 | 3. Move the theme folder to `/usr/share/themes/`. You can do | 61 | following command: `sudo mv theme-folder/ /usr/share/themes/`. |
| 62 | so with the following command: | 62 | - Icons and cursors will be moved to the `/usr/share/icons/` folder. |
| 63 | `sudo mv theme-folder/ /usr/share/themes/`. | 63 | - Fonts will be moved to the `/usr/share/fonts/` folder Alternatively, you |
| 64 | - Icons and cursors will be moved to the | 64 | can move them to the `/usr/share/fonts/opentype/` or |
| 65 | `/usr/share/icons/` folder. | 65 | `/usr/share/fonts/opentype/` folders, if you have a specific font type. |
| 66 | - Fonts will be moved to the `/usr/share/fonts/` folder | 66 | 4. Close tweaks if it is open. Re-open Tweaks and your new theme will be |
| 67 | Alternatively, you can move them to the | 67 | available in the Applications dropdown in the Appearance section of Tweaks. |
| 68 | `/usr/share/fonts/opentype/` or | 68 | |
| 69 | `/usr/share/fonts/opentype/` folders, if you have a | 69 | If the theme is not showing up after you've moved it into the themes folder, |
| 70 | specific font type. | 70 | you may have uncompressed the folder into a sub-folder. You can check this by |
| 71 | 4. Close tweaks if it is open. Re-open Tweaks and your new theme will | 71 | entering the theme folder and listing the contents: |
| 72 | be available in the Applications dropdown in the Appearance section | ||
| 73 | of Tweaks. | ||
| 74 | |||
| 75 | If the theme is not showing up after you\'ve moved it into the themes | ||
| 76 | folder, you may have uncompressed the folder into a sub-folder. You can | ||
| 77 | check this by entering the theme folder and listing the contents: | ||
| 78 | 72 | ||
| 79 | ```sh | 73 | ```sh |
| 80 | cd /usr/share/themes/Mojave-Dark && ls -la | 74 | cd /usr/share/themes/Mojave-Dark && ls -la |
| 81 | ``` | 75 | ``` |
| 82 | 76 | ||
| 83 | This is an example of what the contents of your theme folder should look | 77 | This is an example of what the contents of your theme folder should look like. |
| 84 | like. If you just see another folder there, you should move that folder | 78 | If you just see another folder there, you should move that folder up into the |
| 85 | up into the `/usr/share/themes/` folder. | 79 | `/usr/share/themes/` folder. |
| 86 | 80 | ||
| 87 | ```sh | 81 | ```sh |
| 88 | cinnamon COPYING gnome-shell gtk-2.0 gtk-3.0 index.theme metacity-1 plank xfwm4 | 82 | cinnamon COPYING gnome-shell gtk-2.0 gtk-3.0 index.theme metacity-1 plank xfwm4 |
| @@ -90,77 +84,73 @@ cinnamon COPYING gnome-shell gtk-2.0 gtk-3.0 index.theme metacity-1 plank | |||
| 90 | 84 | ||
| 91 | ## GNOME Shell Themes | 85 | ## GNOME Shell Themes |
| 92 | 86 | ||
| 93 | To change the appearance of the title bar, default dock, app menu, and | 87 | To change the appearance of the title bar, default dock, app menu, and other |
| 94 | other parts of the GNOME shell, you\'ll need to install the [user | 88 | parts of the GNOME shell, you'll need to install the [user |
| 95 | themes](https://extensions.gnome.org/extension/19/user-themes/) | 89 | themes](https://extensions.gnome.org/extension/19/user-themes/) extension on |
| 96 | extension on [Gnome Extensions](https://extensions.gnome.org/). To be | 90 | [Gnome Extensions](https://extensions.gnome.org/). To be able to install |
| 97 | able to install extensions, you will first need to install the browser | 91 | extensions, you will first need to install the browser extension that the |
| 98 | extension that the website instructs you to. See this screenshot for the | 92 | website instructs you to. See this screenshot for the blue box with a link to |
| 99 | blue box with a link to the extension. | 93 | the extension. |
| 100 | 94 | ||
| 101 |  | 96 | Extensions](https://img.cleberg.net/blog/20200519-customizing-ubuntu/gnome-extensions-min.png) |
| 103 | 97 | ||
| 104 | After the browser extension is installed, you will need to install the | 98 | After the browser extension is installed, you will need to install the native |
| 105 | native host connector: | 99 | host connector: |
| 106 | 100 | ||
| 107 | ```sh | 101 | ```sh |
| 108 | sudo apt install chrome-gnome-shell | 102 | sudo apt install chrome-gnome-shell |
| 109 | ``` | 103 | ``` |
| 110 | 104 | ||
| 111 | Finally, you can go the [user | 105 | Finally, you can go the [user |
| 112 | themes](https://extensions.gnome.org/extension/19/user-themes/) | 106 | themes](https://extensions.gnome.org/extension/19/user-themes/) extension page |
| 113 | extension page and click the installation button. This will enable the | 107 | and click the installation button. This will enable the Shell option in Tweaks. |
| 114 | Shell option in Tweaks. Now you can move shell themes to the | 108 | Now you can move shell themes to the `/usr/share/themes` directory, using the |
| 115 | `/usr/share/themes` directory, using the same steps mentioned | 109 | same steps mentioned in the previous section, and enable the new theme in |
| 116 | in the previous section, and enable the new theme in Tweaks. | 110 | Tweaks. |
| 117 | 111 | ||
| 118 | ## Icons & Cursors | 112 | ## Icons & Cursors |
| 119 | 113 | ||
| 120 | Icons and cursors are installed exactly the same way, so I\'m grouping | 114 | Icons and cursors are installed exactly the same way, so I'm grouping these |
| 121 | these together in this post. Both of these items will need to follow the | 115 | together in this post. Both of these items will need to follow the same process |
| 122 | same process as installing themes, except you will want to move your | 116 | as installing themes, except you will want to move your font folders to the |
| 123 | font folders to the `/usr/share/icons/` directory instead. | 117 | `/usr/share/icons/` directory instead. |
| 124 | 118 | ||
| 125 | ## Fonts | 119 | ## Fonts |
| 126 | 120 | ||
| 127 | Fonts are one of the overlooked parts of customization, but a good font | 121 | Fonts are one of the overlooked parts of customization, but a good font can make |
| 128 | can make the whole screen look different. For example, I have installed | 122 | the whole screen look different. For example, I have installed the [IBM |
| 129 | the [IBM Plex](https://github.com/IBM/plex/releases) fonts on my system. | 123 | Plex](https://github.com/IBM/plex/releases) fonts on my system. This follows the |
| 130 | This follows the same process as installing themes, except you will want | 124 | same process as installing themes, except you will want to move your font |
| 131 | to move your font folders to the `/usr/share/fonts/` | 125 | folders to the `/usr/share/fonts/` directory instead. |
| 132 | directory instead. | ||
| 133 | 126 | ||
| 134 | ## Terminal | 127 | ## Terminal |
| 135 | 128 | ||
| 136 | If you spend a lot of time typing commands, you know how important the | 129 | If you spend a lot of time typing commands, you know how important the style and |
| 137 | style and functionality of the terminal is. After spending a lot of time | 130 | functionality of the terminal is. After spending a lot of time using the default |
| 138 | using the default GNOME terminal with [unix | 131 | GNOME terminal with [unix |
| 139 | shell](https://en.wikipedia.org/wiki/Bash_(Unix_shell)), I decided to | 132 | shell](https://en.wikipedia.org/wiki/Bash_(Unix_shell)), I decided to try some |
| 140 | try some different options. I ended up choosing | 133 | different options. I ended up choosing |
| 141 | [Terminator](https://terminator-gtk3.readthedocs.io/en/latest/) with | 134 | [Terminator](https://terminator-gtk3.readthedocs.io/en/latest/) with |
| 142 | [zsh](https://en.wikipedia.org/wiki/Z_shell). | 135 | [zsh](https://en.wikipedia.org/wiki/Z_shell). |
| 143 | 136 | ||
| 144 | Terminator is great if you need to open multiple terminals at one time | 137 | Terminator is great if you need to open multiple terminals at one time by simply |
| 145 | by simply right-clicking and splitting the screen into as many terminals | 138 | right-clicking and splitting the screen into as many terminals as you want. |
| 146 | as you want. While this project hasn\'t been updated in a while, [it is | 139 | While this project hasn't been updated in a while, [it is coming under new |
| 147 | coming under new | 140 | development](https://github.com/gnome-terminator/terminator/issues/1). However, |
| 148 | development](https://github.com/gnome-terminator/terminator/issues/1). | 141 | this terminal is great and I haven't experienced any errors yet. |
| 149 | However, this terminal is great and I haven\'t experienced any errors | ||
| 150 | yet. | ||
| 151 | 142 | ||
| 152 | For the shell choice, I decided to choose zsh after trying it out on a | 143 | For the shell choice, I decided to choose zsh after trying it out on a fresh |
| 153 | fresh Manjaro installation. Zsh is great if you like to change the | 144 | Manjaro installation. Zsh is great if you like to change the themes of your |
| 154 | themes of your terminal, include icons, or add plugins. | 145 | terminal, include icons, or add plugins. |
| 155 | 146 | ||
| 156 | The desktop uses the | 147 | The desktop uses the |
| 157 | [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) | 148 | [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) to |
| 158 | to suggest past commands as you type. In addition, it suggests | 149 | suggest past commands as you type. In addition, it suggests corrections if you |
| 159 | corrections if you misspell a command. Lastly, it uses the | 150 | misspell a command. Lastly, it uses the `af-magic` theme, which adds dashed |
| 160 | `af-magic` theme, which adds dashed lines between commands, | 151 | lines between commands, moving the user@host tag to the right side of the |
| 161 | moving the user@host tag to the right side of the terminal, and changes | 152 | terminal, and changes the colors. There are plenty of plugins and themes to |
| 162 | the colors. There are plenty of plugins and themes to choose from. Just | 153 | choose from. Just figure out what you like and add it to your `~/.zshrc` file! |
| 163 | figure out what you like and add it to your `~/.zshrc` file! | ||
| 164 | 154 | ||
| 165 | ### Steps to Replicate My Terminal | 155 | ### Steps to Replicate My Terminal |
| 166 | 156 | ||
| @@ -194,10 +184,9 @@ To install zsh-autosuggestions via Oh My Zsh: | |||
| 194 | git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions | 184 | git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions |
| 195 | ``` | 185 | ``` |
| 196 | 186 | ||
| 197 | Then, add the following plugin wording to your `~/.zshrc` | 187 | Then, add the following plugin wording to your `~/.zshrc` file (the default |
| 198 | file (the default config usually has the `git` plugin | 188 | config usually has the `git` plugin activated, so just add any other plugins to |
| 199 | activated, so just add any other plugins to the parentheses separated by | 189 | the parentheses separated by a space): |
| 200 | a space): | ||
| 201 | 190 | ||
| 202 | ```sh | 191 | ```sh |
| 203 | nano ~/.zshrc | 192 | nano ~/.zshrc |
| @@ -207,5 +196,5 @@ nano ~/.zshrc | |||
| 207 | plugins=(git zsh-autosuggestions) | 196 | plugins=(git zsh-autosuggestions) |
| 208 | ``` | 197 | ``` |
| 209 | 198 | ||
| 210 | Finally, you need to log out of your computer and log back in so your | 199 | Finally, you need to log out of your computer and log back in so your user shell |
| 211 | user shell can refresh. | 200 | can refresh. |
content/blog/2020-07-20-video-game-sales.md +31 −32
| @@ -8,26 +8,25 @@ draft = false | |||
| 8 | # Background Information | 8 | # Background Information |
| 9 | 9 | ||
| 10 | This dataset (obtained from | 10 | This dataset (obtained from |
| 11 | [Kaggle](https://www.kaggle.com/gregorut/videogamesales/data)) contains | 11 | [Kaggle](https://www.kaggle.com/gregorut/videogamesales/data)) contains a list |
| 12 | a list of video games with sales greater than 100,000 copies. It was | 12 | of video games with sales greater than 100,000 copies. It was generated by a |
| 13 | generated by a scrape of vgchartz.com. | 13 | scrape of vgchartz.com. |
| 14 | 14 | ||
| 15 | Fields include: | 15 | Fields include: |
| 16 | 16 | ||
| 17 | - Rank: Ranking of overall sales | 17 | - Rank: Ranking of overall sales |
| 18 | - Name: The game name | 18 | - Name: The game name |
| 19 | - Platform: Platform of the game release (i.e. PC,PS4, etc.) | 19 | - Platform: Platform of the game release (i.e. PC,PS4, etc.) |
| 20 | - Year: Year of the game\'s release | 20 | - Year: Year of the game's release |
| 21 | - Genre: Genre of the game | 21 | - Genre: Genre of the game |
| 22 | - Publisher: Publisher of the game | 22 | - Publisher: Publisher of the game |
| 23 | - NA~Sales~: Sales in North America (in millions) | 23 | - NA~Sales~: Sales in North America (in millions) |
| 24 | - EU~Sales~: Sales in Europe (in millions) | 24 | - EU~Sales~: Sales in Europe (in millions) |
| 25 | - JP~Sales~: Sales in Japan (in millions) | 25 | - JP~Sales~: Sales in Japan (in millions) |
| 26 | - Other~Sales~: Sales in the rest of the world (in millions) | 26 | - Other~Sales~: Sales in the rest of the world (in millions) |
| 27 | - Global~Sales~: Total worldwide sales. | 27 | - Global~Sales~: Total worldwide sales. |
| 28 | 28 | ||
| 29 | There are 16,598 records. 2 records were dropped due to incomplete | 29 | There are 16,598 records. 2 records were dropped due to incomplete information. |
| 30 | information. | ||
| 31 | 30 | ||
| 32 | # Import the Data | 31 | # Import the Data |
| 33 | 32 | ||
| @@ -166,18 +165,18 @@ Sales](https://img.cleberg.net/blog/20200720-data-exploration-video-game-sales/0 | |||
| 166 | 165 | ||
| 167 | # Discussion | 166 | # Discussion |
| 168 | 167 | ||
| 169 | The purpose of exploring datasets is to ask questions, answer questions, | 168 | The purpose of exploring datasets is to ask questions, answer questions, and |
| 170 | and discover intelligence that can be used to inform decision-making. | 169 | discover intelligence that can be used to inform decision-making. So, what have |
| 171 | So, what have we found in this dataset? | 170 | we found in this dataset? |
| 172 | 171 | ||
| 173 | Today we simply explored a publicly-available dataset to see what kind | 172 | Today we simply explored a publicly-available dataset to see what kind of |
| 174 | of information it contained. During that exploration, we found that | 173 | information it contained. During that exploration, we found that video game |
| 175 | video game sales peaked in 2006. That peak was largely due to Nintendo, | 174 | sales peaked in 2006. That peak was largely due to Nintendo, who sold the top 5 |
| 176 | who sold the top 5 games in 2006 and has a number of games in the top-10 | 175 | games in 2006 and has a number of games in the top-10 list for the years |
| 177 | list for the years 1980-2020. Additionally, the top four platforms by | 176 | 1980-2020. Additionally, the top four platforms by global sales (Wii, NES, GB, |
| 178 | global sales (Wii, NES, GB, DS) are owned by Nintendo. | 177 | DS) are owned by Nintendo. |
| 179 | 178 | ||
| 180 | We didn\'t explore everything this dataset has to offer, but we can tell | 179 | We didn't explore everything this dataset has to offer, but we can tell from a |
| 181 | from a brief analysis that Nintendo seems to rule sales in the video | 180 | brief analysis that Nintendo seems to rule sales in the video gaming world. |
| 182 | gaming world. Further analysis could provide insight into which genres, | 181 | Further analysis could provide insight into which genres, regions, publishers, |
| 183 | regions, publishers, or world events are correlated with sales. | 182 | or world events are correlated with sales. |
content/blog/2020-07-26-business-analysis.md +63 −69
| @@ -7,24 +7,24 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Background Information | 8 | # Background Information |
| 9 | 9 | ||
| 10 | This project aims to help investors learn more about a random city in | 10 | This project aims to help investors learn more about a random city in order to |
| 11 | order to determine optimal locations for business investments. The data | 11 | determine optimal locations for business investments. The data used in this |
| 12 | used in this project was obtained using Foursquare\'s developer API. | 12 | project was obtained using Foursquare's developer API. |
| 13 | 13 | ||
| 14 | Fields include: | 14 | Fields include: |
| 15 | 15 | ||
| 16 | - Venue Name | 16 | - Venue Name |
| 17 | - Venue Category | 17 | - Venue Category |
| 18 | - Venue Latitude | 18 | - Venue Latitude |
| 19 | - Venue Longitude | 19 | - Venue Longitude |
| 20 | 20 | ||
| 21 | There are 232 records found using the center of Lincoln as the area of | 21 | There are 232 records found using the center of Lincoln as the area of interest |
| 22 | interest with a radius of 10,000. | 22 | with a radius of 10,000. |
| 23 | 23 | ||
| 24 | # Import the Data | 24 | # Import the Data |
| 25 | 25 | ||
| 26 | The first step is the simplest: import the applicable libraries. We will | 26 | The first step is the simplest: import the applicable libraries. We will be |
| 27 | be using the libraries below for this project. | 27 | using the libraries below for this project. |
| 28 | 28 | ||
| 29 | ``` python | 29 | ``` python |
| 30 | # Import the Python libraries we will be using | 30 | # Import the Python libraries we will be using |
| @@ -37,10 +37,10 @@ from pandas.io.json import json_normalize | |||
| 37 | from sklearn.cluster import KMeans | 37 | from sklearn.cluster import KMeans |
| 38 | ``` | 38 | ``` |
| 39 | 39 | ||
| 40 | To begin our analysis, we need to import the data for this project. The | 40 | To begin our analysis, we need to import the data for this project. The data we |
| 41 | data we are using in this project comes directly from the Foursquare | 41 | are using in this project comes directly from the Foursquare API. The first step |
| 42 | API. The first step is to get the latitude and longitude of the city | 42 | is to get the latitude and longitude of the city being studied (Lincoln, NE) and |
| 43 | being studied (Lincoln, NE) and setting up the folium map. | 43 | setting up the folium map. |
| 44 | 44 | ||
| 45 | ``` python | 45 | ``` python |
| 46 | # Define the latitude and longitude, then map the results | 46 | # Define the latitude and longitude, then map the results |
| @@ -54,11 +54,11 @@ map_LNK | |||
| 54 |  | 55 | Map](https://img.cleberg.net/blog/20200726-ibm-data-science/01_blank_map-min.png) |
| 56 | 56 | ||
| 57 | Now that we have defined our city and created the map, we need to go get | 57 | Now that we have defined our city and created the map, we need to go get the |
| 58 | the business data. The Foursquare API will limit the results to 100 per | 58 | business data. The Foursquare API will limit the results to 100 per API call, so |
| 59 | API call, so we use our first API call below to determine the total | 59 | we use our first API call below to determine the total results that Foursquare |
| 60 | results that Foursquare has found. Since the total results are 232, we | 60 | has found. Since the total results are 232, we perform the API fetching process |
| 61 | perform the API fetching process three times (100 + 100 + 32 = 232). | 61 | three times (100 + 100 + 32 = 232). |
| 62 | 62 | ||
| 63 | ``` python | 63 | ``` python |
| 64 | # Foursquare API credentials | 64 | # Foursquare API credentials |
| @@ -122,13 +122,12 @@ results3 = requests.get(url3).json() | |||
| 122 | 122 | ||
| 123 | # Clean the Data | 123 | # Clean the Data |
| 124 | 124 | ||
| 125 | Now that we have our data in three separate dataframes, we need to | 125 | Now that we have our data in three separate dataframes, we need to combine them |
| 126 | combine them into a single dataframe and make sure to reset the index so | 126 | into a single dataframe and make sure to reset the index so that we have a |
| 127 | that we have a unique ID for each business. The | 127 | unique ID for each business. The `get~categorytype~` function below will pull |
| 128 | `get~categorytype~` function below will pull the categories | 128 | the categories and name from each business's entry in the Foursquare data |
| 129 | and name from each business\'s entry in the Foursquare data | 129 | automatically. Once all the data has been labeled and combined, the results are |
| 130 | automatically. Once all the data has been labeled and combined, the | 130 | stored in the `nearby_venues` dataframe. |
| 131 | results are stored in the `nearby_venues` dataframe. | ||
| 132 | 131 | ||
| 133 | ``` python | 132 | ``` python |
| 134 | # This function will extract the category of the venue from the API dictionary | 133 | # This function will extract the category of the venue from the API dictionary |
| @@ -200,9 +199,9 @@ Data](https://img.cleberg.net/blog/20200726-ibm-data-science/02_clean_data-min.p | |||
| 200 | 199 | ||
| 201 | # Visualize the Data | 200 | # Visualize the Data |
| 202 | 201 | ||
| 203 | We now have a complete, clean data set. The next step is to visualize | 202 | We now have a complete, clean data set. The next step is to visualize this data |
| 204 | this data onto the map we created earlier. We will be using folium\'s | 203 | onto the map we created earlier. We will be using folium's `CircleMarker()` |
| 205 | `CircleMarker()` function to do this. | 204 | function to do this. |
| 206 | 205 | ||
| 207 | ``` python | 206 | ``` python |
| 208 | # add markers to map | 207 | # add markers to map |
| @@ -227,15 +226,14 @@ map](https://img.cleberg.net/blog/20200726-ibm-data-science/03_data_map-min.png) | |||
| 227 | 226 | ||
| 228 | # Clustering: *k-means* | 227 | # Clustering: *k-means* |
| 229 | 228 | ||
| 230 | To cluster the data, we will be using the *k-means* algorithm. This | 229 | To cluster the data, we will be using the *k-means* algorithm. This algorithm is |
| 231 | algorithm is iterative and will automatically make sure that data points | 230 | iterative and will automatically make sure that data points in each cluster are |
| 232 | in each cluster are as close as possible to each other, while being as | 231 | as close as possible to each other, while being as far as possible away from |
| 233 | far as possible away from other clusters. | 232 | other clusters. |
| 234 | 233 | ||
| 235 | However, we first have to figure out how many clusters to use (defined | 234 | However, we first have to figure out how many clusters to use (defined as the |
| 236 | as the variable *\'k\'*). To do so, we will use the next two functions | 235 | variable *'k'*). To do so, we will use the next two functions to calculate the |
| 237 | to calculate the sum of squares within clusters and then return the | 236 | sum of squares within clusters and then return the optimal number of clusters. |
| 238 | optimal number of clusters. | ||
| 239 | 237 | ||
| 240 | ``` python | 238 | ``` python |
| 241 | # This function will return the sum of squares found in the data | 239 | # This function will return the sum of squares found in the data |
| @@ -273,9 +271,9 @@ def optimal_number_of_clusters(wcss): | |||
| 273 | n = optimal_number_of_clusters(sum_of_squares) | 271 | n = optimal_number_of_clusters(sum_of_squares) |
| 274 | ``` | 272 | ``` |
| 275 | 273 | ||
| 276 | Now that we have found that our optimal number of clusters is six, we | 274 | Now that we have found that our optimal number of clusters is six, we need to |
| 277 | need to perform k-means clustering. When this clustering occurs, each | 275 | perform k-means clustering. When this clustering occurs, each business is |
| 278 | business is assigned a cluster number from 0 to 5 in the dataframe. | 276 | assigned a cluster number from 0 to 5 in the dataframe. |
| 279 | 277 | ||
| 280 | ``` python | 278 | ``` python |
| 281 | # set number of clusters equal to the optimal number | 279 | # set number of clusters equal to the optimal number |
| @@ -288,9 +286,8 @@ kmeans = KMeans(n_clusters=kclusters, random_state=0).fit(cluster_df) | |||
| 288 | nearby_venues.insert(0, 'Cluster Labels', kmeans.labels_) | 286 | nearby_venues.insert(0, 'Cluster Labels', kmeans.labels_) |
| 289 | ``` | 287 | ``` |
| 290 | 288 | ||
| 291 | Success! We now have a dataframe with clean business data, along with a | 289 | Success! We now have a dataframe with clean business data, along with a cluster |
| 292 | cluster number for each business. Now let\'s map the data using six | 290 | number for each business. Now let's map the data using six different colors. |
| 293 | different colors. | ||
| 294 | 291 | ||
| 295 | ``` python | 292 | ``` python |
| 296 | # create map with clusters | 293 | # create map with clusters |
| @@ -318,12 +315,11 @@ Map](https://img.cleberg.net/blog/20200726-ibm-data-science/04_clusters-min.png) | |||
| 318 | 315 | ||
| 319 | # Investigate Clusters | 316 | # Investigate Clusters |
| 320 | 317 | ||
| 321 | Now that we have figured out our clusters, let\'s do a little more | 318 | Now that we have figured out our clusters, let's do a little more analysis to |
| 322 | analysis to provide more insight into the clusters. With the information | 319 | provide more insight into the clusters. With the information below, we can see |
| 323 | below, we can see which clusters are more popular for businesses and | 320 | which clusters are more popular for businesses and which are less popular. The |
| 324 | which are less popular. The results below show us that clusters 0 | 321 | results below show us that clusters 0 through 3 are popular, while clusters 4 |
| 325 | through 3 are popular, while clusters 4 and 5 are not very popular at | 322 | and 5 are not very popular at all. |
| 326 | all. | ||
| 327 | 323 | ||
| 328 | ``` python | 324 | ``` python |
| 329 | # Show how many venues are in each cluster | 325 | # Show how many venues are in each cluster |
| @@ -337,9 +333,9 @@ for x in range(0,6): | |||
| 337 |  | 334 | Cluster](https://img.cleberg.net/blog/20200726-ibm-data-science/05_venues_per_cluster-min.png) |
| 339 | 335 | ||
| 340 | Our last piece of analysis is to summarize the categories of businesses | 336 | Our last piece of analysis is to summarize the categories of businesses within |
| 341 | within each cluster. With these results, we can clearly see that | 337 | each cluster. With these results, we can clearly see that restaurants, coffee |
| 342 | restaurants, coffee shops, and grocery stores are the most popular. | 338 | shops, and grocery stores are the most popular. |
| 343 | 339 | ||
| 344 | ``` python | 340 | ``` python |
| 345 | # Calculate how many venues there are in each category | 341 | # Calculate how many venues there are in each category |
| @@ -371,19 +367,17 @@ with pd.option_context('display.max_rows', None, 'display.max_columns', None): | |||
| 371 | 367 | ||
| 372 | # Discussion | 368 | # Discussion |
| 373 | 369 | ||
| 374 | In this project, we gathered location data for Lincoln, Nebraska, USA | 370 | In this project, we gathered location data for Lincoln, Nebraska, USA and |
| 375 | and clustered the data using the k-means algorithm in order to identify | 371 | clustered the data using the k-means algorithm in order to identify the unique |
| 376 | the unique clusters of businesses in Lincoln. Through these actions, we | 372 | clusters of businesses in Lincoln. Through these actions, we found that there |
| 377 | found that there are six unique business clusters in Lincoln and that | 373 | are six unique business clusters in Lincoln and that two of the clusters are |
| 378 | two of the clusters are likely unsuitable for investors. The remaining | 374 | likely unsuitable for investors. The remaining four clusters have a variety of |
| 379 | four clusters have a variety of businesses, but are largely dominated by | 375 | businesses, but are largely dominated by restaurants and grocery stores. |
| 380 | restaurants and grocery stores. | 376 | |
| 381 | 377 | Using this project, investors can now make more informed decisions when deciding | |
| 382 | Using this project, investors can now make more informed decisions when | 378 | the location and category of business in which to invest. |
| 383 | deciding the location and category of business in which to invest. | 379 | |
| 384 | 380 | Further studies may involve other attributes for business locations, such as | |
| 385 | Further studies may involve other attributes for business locations, | 381 | population density, average wealth across the city, or crime rates. In addition, |
| 386 | such as population density, average wealth across the city, or crime | 382 | further studies may include additional location data and businesses by utilizing |
| 387 | rates. In addition, further studies may include additional location data | 383 | multiple sources, such as Google Maps and OpenStreetMap. |
| 388 | and businesses by utilizing multiple sources, such as Google Maps and | ||
| 389 | OpenStreetMap. | ||
content/blog/2020-08-22-redirect-github-pages.md +53 −66
| @@ -9,18 +9,17 @@ draft = false | |||
| 9 | 9 | ||
| 10 | ## Step 1 | 10 | ## Step 1 |
| 11 | 11 | ||
| 12 | Add a new file CNAME to your GitHub Pages repository containing only one | 12 | Add a new file CNAME to your GitHub Pages repository containing only one line: |
| 13 | line: your top-level domain name. E.g.: `example.com` | 13 | your top-level domain name. E.g.: `example.com` |
| 14 | 14 | ||
| 15 | ## Step 2 | 15 | ## Step 2 |
| 16 | 16 | ||
| 17 | \[Optional\] but highly recommended | 17 | [Optional] but highly recommended |
| 18 | 18 | ||
| 19 | 2.1: Remove all other top-level records (prefixed with @) of type A from | 19 | 2.1: Remove all other top-level records (prefixed with @) of type A from your |
| 20 | your DNS configuration. | 20 | DNS configuration. |
| 21 | 21 | ||
| 22 | 2.2: Remove a CNAME record for the second-level domain www if it is | 22 | 2.2: Remove a CNAME record for the second-level domain www if it is present. |
| 23 | present. | ||
| 24 | 23 | ||
| 25 | ## Step 3 | 24 | ## Step 3 |
| 26 | 25 | ||
| @@ -34,70 +33,61 @@ Add these 5 entries to the very top of your DNS configuration: | |||
| 34 | www CNAME your_github_username.github.io. | 33 | www CNAME your_github_username.github.io. |
| 35 | ``` | 34 | ``` |
| 36 | 35 | ||
| 37 | Replace `your_github_username` with your actual GitHub | 36 | Replace `your_github_username` with your actual GitHub username. |
| 38 | username. | ||
| 39 | 37 | ||
| 40 | ## Step 4 | 38 | ## Step 4 |
| 41 | 39 | ||
| 42 | Wait for your DNS changes to propagate. DNS changes aren\'t effective | 40 | Wait for your DNS changes to propagate. DNS changes aren't effective |
| 43 | immediately. They can take up to a full day to propagate. | 41 | immediately. They can take up to a full day to propagate. |
| 44 | 42 | ||
| 45 | # Long answer | 43 | # Long answer |
| 46 | 44 | ||
| 47 | This issue has two sides. One is the DNS configuration itself. Another | 45 | This issue has two sides. One is the DNS configuration itself. Another one is |
| 48 | one is the way GitHub Pages will forward HTTP requests. | 46 | the way GitHub Pages will forward HTTP requests. |
| 49 | 47 | ||
| 50 | We need to know a few things to understand what GitHub is trying to say | 48 | We need to know a few things to understand what GitHub is trying to say in their |
| 51 | in their documentation. | 49 | documentation. |
| 52 | 50 | ||
| 53 | ## DNS Entry Types | 51 | ## DNS Entry Types |
| 54 | 52 | ||
| 55 | There are two types of DNS records which interest us: CNAME and A. | 53 | There are two types of DNS records which interest us: CNAME and A. |
| 56 | 54 | ||
| 57 | `A` is also known as `Apex` or sometimes as | 55 | `A` is also known as `Apex` or sometimes as `root entry`. It forwards requests |
| 58 | `root entry`. It forwards requests to a specified fixed IP | 56 | to a specified fixed IP address. `CNAME` entry forwards requests to a specified |
| 59 | address. `CNAME` entry forwards requests to a specified URL | 57 | URL (actual valid plain text URL, not an IP address). |
| 60 | (actual valid plain text URL, not an IP address). | ||
| 61 | 58 | ||
| 62 | ## DNS Load balancing | 59 | ## DNS Load balancing |
| 63 | 60 | ||
| 64 | GitHub has one central URL address which accepts all DNS requests for | 61 | GitHub has one central URL address which accepts all DNS requests for GitHub |
| 65 | GitHub Pages: `http://username.github.io`. That URL is | 62 | Pages: `http://username.github.io`. That URL is resolved to different IP |
| 66 | resolved to different IP addresses based on your geographical location. | 63 | addresses based on your geographical location. Website hosted on GitHub Pages is |
| 67 | Website hosted on GitHub Pages is a simple collection of | 64 | a simple collection of `HTML`, `CSS` and `JS` files. GitHub distributes these |
| 68 | `HTML`, `CSS` and `JS` files. GitHub | 65 | files to different servers across the globe. So that when your browser sends a |
| 69 | distributes these files to different servers across the globe. So that | 66 | request from Europe, it receives data from a server in Europe. The same is valid |
| 70 | when your browser sends a request from Europe, it receives data from a | 67 | for the requests from Asia and the USA. |
| 71 | server in Europe. The same is valid for the requests from Asia and the | ||
| 72 | USA. | ||
| 73 | 68 | ||
| 74 | ## What GitHub is trying to say | 69 | ## What GitHub is trying to say |
| 75 | 70 | ||
| 76 | Since `A` records in DNS must contain IP addresses, and they | 71 | Since `A` records in DNS must contain IP addresses, and they must be either |
| 77 | must be either `185.199.108.153` or | 72 | `185.199.108.153` or `185.199.109.153` or `185.199.110.153` or |
| 78 | `185.199.109.153` or `185.199.110.153` or | 73 | `185.199.111.153`, there is no way to forward requests to a server located |
| 79 | `185.199.111.153`, there is no way to forward requests to a | 74 | somewhere in Europe or Asia. Your website hosted at GitHub Pages will be |
| 80 | server located somewhere in Europe or Asia. Your website hosted at | 75 | downloaded from a central GitHub Pages server. There is a minor risk that if |
| 81 | GitHub Pages will be downloaded from a central GitHub Pages server. | 76 | GitHub Pages DNS servers (`x.x.x.153`) are down for some reason, all custom |
| 82 | There is a minor risk that if GitHub Pages DNS servers | 77 | domains which use fixed GitHub Pages IP addresses will not be accessible (their |
| 83 | (`x.x.x.153`) are down for some reason, all custom domains | ||
| 84 | which use fixed GitHub Pages IP addresses will not be accessible (their | ||
| 85 | DNS requests will not be resolvable). | 78 | DNS requests will not be resolvable). |
| 86 | 79 | ||
| 87 | That is why GitHub strongly suggests to either use a second-level domain | 80 | That is why GitHub strongly suggests to either use a second-level domain for |
| 88 | for your GitHub Pages (e.g. `blog.example.com`) or use a DNS | 81 | your GitHub Pages (e.g. `blog.example.com`) or use a DNS service provider that |
| 89 | service provider that supports a record type `ALIAS` that | 82 | supports a record type `ALIAS` that acts as `A` record but forwards request to a |
| 90 | acts as `A` record but forwards request to a URL address | 83 | URL address (e.g. `username.github.io`) instead of a fixed IP address. |
| 91 | (e.g. `username.github.io`) instead of a fixed IP address. | ||
| 92 | 84 | ||
| 93 | ## How GitHub Pages treats HTTP requests | 85 | ## How GitHub Pages treats HTTP requests |
| 94 | 86 | ||
| 95 | After a DNS request for `your_github_username.github.io` is | 87 | After a DNS request for `your_github_username.github.io` is resolved into an IP |
| 96 | resolved into an IP address, e.g. `185.199.108.153` your | 88 | address, e.g. `185.199.108.153` your browser sends an HTTP request to that |
| 97 | browser sends an HTTP request to that server with an HTTP header | 89 | server with an HTTP header `Host`. Below are `curl` examples that load the same |
| 98 | `Host`. Below are `curl` examples that load the | 90 | website (these examples might not work if you are behind a proxy server): |
| 99 | same website (these examples might not work if you are behind a proxy | ||
| 100 | server): | ||
| 101 | 91 | ||
| 102 | ```sh | 92 | ```sh |
| 103 | curl --header "Host: your_github_username.github.io" http://185.199.108.153/ | 93 | curl --header "Host: your_github_username.github.io" http://185.199.108.153/ |
| @@ -107,31 +97,28 @@ curl --header "Host: example.com" http://185.199.108.153/ | |||
| 107 | 97 | ||
| 108 | This way GitHub Pages servers know which user website to serve. | 98 | This way GitHub Pages servers know which user website to serve. |
| 109 | 99 | ||
| 110 | > GitHub Pages server will automatically redirect HTTP requests to the | 100 | > GitHub Pages server will automatically redirect HTTP requests to the top-level |
| 111 | > top-level domain if your `CNAME` file contains | 101 | > domain if your `CNAME` file contains `example.com` but `www.example.com` is |
| 112 | > `example.com` but `www.example.com` is | ||
| 113 | > requested. | 102 | > requested. |
| 114 | > | 103 | > |
| 115 | > The same is valid if your `CNAME` file contains | 104 | > The same is valid if your `CNAME` file contains `www.example.com` but the |
| 116 | > `www.example.com` but the header `Host` in the | 105 | > header `Host` in the `HTTP` request contains `example.com`. |
| 117 | > `HTTP` request contains `example.com`. | ||
| 118 | 106 | ||
| 119 | ## Why can\'t I add a `CNAME` record entry that accepts a top-level request (`@`) to my DNS configuration? | 107 | ## Why can't I add a `CNAME` record entry that accepts a top-level request (`@`) to my DNS configuration? |
| 120 | 108 | ||
| 121 | Quote from the GitHub Pages documentation: | 109 | Quote from the GitHub Pages documentation: |
| 122 | 110 | ||
| 123 | > Warning: Do not create a CNAME record for your custom apex domain! | 111 | > Warning: Do not create a CNAME record for your custom apex domain! Doing so |
| 124 | > Doing so may cause issues with other services, such as email, on that | 112 | > may cause issues with other services, such as email, on that domain. |
| 125 | > domain. | ||
| 126 | 113 | ||
| 127 | ## References: | 114 | ## References: |
| 128 | 115 | ||
| 129 | 1. [Setting up a custom domain with GitHub | 116 | 1. [Setting up a custom domain with GitHub |
| 130 | Pages](https://docs.github.com/en/github/working-with-github-pages/configuring-a-custom-domain-for-your-github-pages-site) | 117 | Pages](https://docs.github.com/en/github/working-with-github-pages/configuring-a-custom-domain-for-your-github-pages-site) |
| 131 | 2. [My custom domain isn\'t | 118 | 2. [My custom domain isn't |
| 132 | working](https://docs.github.com/en/github/working-with-github-pages/troubleshooting-custom-domains-and-github-pages) | 119 | working](https://docs.github.com/en/github/working-with-github-pages/troubleshooting-custom-domains-and-github-pages) |
| 133 | 3. [Cannot access my GitHub Pages website by IP | 120 | 3. [Cannot access my GitHub Pages website by IP |
| 134 | Address](https://serverfault.com/questions/589370/cannot-access-my-github-pages-website-by-ip-address) | 121 | Address](https://serverfault.com/questions/589370/cannot-access-my-github-pages-website-by-ip-address) |
| 135 | 4. [How do I set up GitHub Pages to redirect DNS requests from a | 122 | 4. [How do I set up GitHub Pages to redirect DNS requests from a subdomain (e.g. |
| 136 | subdomain (e.g. www) to the top-level domain (TLD, Apex | 123 | www) to the top-level domain (TLD, Apex |
| 137 | record)?](https://stackoverflow.com/questions/23375422/how-do-i-set-up-github-pages-to-redirect-dns-requests-from-a-subdomain-e-g-www) | 124 | record)?](https://stackoverflow.com/questions/23375422/how-do-i-set-up-github-pages-to-redirect-dns-requests-from-a-subdomain-e-g-www) |
content/blog/2020-08-29-php-auth-flow.md +38 −42
| @@ -7,16 +7,15 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Introduction | 8 | # Introduction |
| 9 | 9 | ||
| 10 | When creating websites that will allow users to create accounts, the | 10 | When creating websites that will allow users to create accounts, the developer |
| 11 | developer always needs to consider the proper authentication flow for | 11 | always needs to consider the proper authentication flow for their app. For |
| 12 | their app. For example, some developers will utilize an API for | 12 | example, some developers will utilize an API for authentication, some will use |
| 13 | authentication, some will use OAuth, and some may just use their own | 13 | OAuth, and some may just use their own simple database. |
| 14 | simple database. | ||
| 15 | 14 | ||
| 16 | For those using pre-built libraries, authentication may simply be a | 15 | For those using pre-built libraries, authentication may simply be a problem of |
| 17 | problem of copying and pasting the code from their library\'s | 16 | copying and pasting the code from their library's documentation. For example, |
| 18 | documentation. For example, here\'s the code I use to authenticate users | 17 | here's the code I use to authenticate users with the Tumblr OAuth API for my |
| 19 | with the Tumblr OAuth API for my Tumblr client, Vox Populi: | 18 | Tumblr client, Vox Populi: |
| 20 | 19 | ||
| 21 | ``` php | 20 | ``` php |
| 22 | // Start the session | 21 | // Start the session |
| @@ -41,24 +40,23 @@ $client = new Tumblr\API\Client( | |||
| 41 | ); | 40 | ); |
| 42 | ``` | 41 | ``` |
| 43 | 42 | ||
| 44 | However, developers creating authentication flows from scratch will need | 43 | However, developers creating authentication flows from scratch will need to |
| 45 | to think carefully about when to make sure a web page will check the | 44 | think carefully about when to make sure a web page will check the user's |
| 46 | user\'s authenticity. | 45 | authenticity. |
| 47 | 46 | ||
| 48 | In this article, we\'re going to look at a simple authentication flow | 47 | In this article, we're going to look at a simple authentication flow using a |
| 49 | using a MySQL database and PHP. | 48 | MySQL database and PHP. |
| 50 | 49 | ||
| 51 | # Creating User Accounts | 50 | # Creating User Accounts |
| 52 | 51 | ||
| 53 | The beginning to any type of user authentication is to create a user | 52 | The beginning to any type of user authentication is to create a user account. |
| 54 | account. This process can take many formats, but the simplest is to | 53 | This process can take many formats, but the simplest is to accept user input |
| 55 | accept user input from a form (e.g., username and password) and send it | 54 | from a form (e.g., username and password) and send it over to your database. For |
| 56 | over to your database. For example, here\'s a snippet that shows how to | 55 | example, here's a snippet that shows how to get username and password |
| 57 | get username and password parameters that would come when a user submits | 56 | parameters that would come when a user submits a form to your PHP script. |
| 58 | a form to your PHP script. | ||
| 59 | 57 | ||
| 60 | **Note**: Ensure that your password column is large enough to hold the | 58 | **Note**: Ensure that your password column is large enough to hold the hashed |
| 61 | hashed value (at least 60 characters or longer). | 59 | value (at least 60 characters or longer). |
| 62 | 60 | ||
| 63 | ``` php | 61 | ``` php |
| 64 | // Get the values from the URL | 62 | // Get the values from the URL |
| @@ -97,9 +95,9 @@ $conn->close(); | |||
| 97 | 95 | ||
| 98 | ## Validate Returning Users | 96 | ## Validate Returning Users |
| 99 | 97 | ||
| 100 | To be able to verify that a returning user has a valid username and | 98 | To be able to verify that a returning user has a valid username and password in |
| 101 | password in your database is as simple as having users fill out a form | 99 | your database is as simple as having users fill out a form and comparing their |
| 102 | and comparing their inputs to your database. | 100 | inputs to your database. |
| 103 | 101 | ||
| 104 | ``` php | 102 | ``` php |
| 105 | // Query the database for username and password | 103 | // Query the database for username and password |
| @@ -116,24 +114,23 @@ if(password_verify($password_input, $hashed_password)) { | |||
| 116 | 114 | ||
| 117 | # Storing Authentication State | 115 | # Storing Authentication State |
| 118 | 116 | ||
| 119 | Once you\'ve created the user\'s account, now you\'re ready to | 117 | Once you've created the user's account, now you're ready to initialize the |
| 120 | initialize the user\'s session. **You will need to do this on every page | 118 | user's session. **You will need to do this on every page you load while the |
| 121 | you load while the user is logged in.\*** To do so, simply enter the | 119 | user is logged in.** To do so, simply enter the following code snippet: |
| 122 | following code snippet: | ||
| 123 | 120 | ||
| 124 | ``` php | 121 | ``` php |
| 125 | session_start(); | 122 | session_start(); |
| 126 | ``` | 123 | ``` |
| 127 | 124 | ||
| 128 | Once you\'ve initialized the session, the next step is to store the | 125 | Once you've initialized the session, the next step is to store the session in a |
| 129 | session in a cookie so that you can access it later. | 126 | cookie so that you can access it later. |
| 130 | 127 | ||
| 131 | ``` php | 128 | ``` php |
| 132 | setcookie(session_name()); | 129 | setcookie(session_name()); |
| 133 | ``` | 130 | ``` |
| 134 | 131 | ||
| 135 | Now that the session name has been stored, you\'ll be able to check if | 132 | Now that the session name has been stored, you'll be able to check if there's |
| 136 | there\'s an active session whenever you load a page. | 133 | an active session whenever you load a page. |
| 137 | 134 | ||
| 138 | ``` php | 135 | ``` php |
| 139 | if(isset(session_name())) { | 136 | if(isset(session_name())) { |
| @@ -143,9 +140,9 @@ if(isset(session_name())) { | |||
| 143 | 140 | ||
| 144 | ## Removing User Authentication | 141 | ## Removing User Authentication |
| 145 | 142 | ||
| 146 | The next logical step is to give your users the option to log out once | 143 | The next logical step is to give your users the option to log out once they are |
| 147 | they are done using your application. This can be tricky in PHP since a | 144 | done using your application. This can be tricky in PHP since a few of the |
| 148 | few of the standard ways do not always work. | 145 | standard ways do not always work. |
| 149 | 146 | ||
| 150 | ``` php | 147 | ``` php |
| 151 | // Initialize the session. | 148 | // Initialize the session. |
| @@ -183,14 +180,13 @@ die(); | |||
| 183 | 180 | ||
| 184 | # Wrapping Up | 181 | # Wrapping Up |
| 185 | 182 | ||
| 186 | Now you should be ready to begin your authentication programming with | 183 | Now you should be ready to begin your authentication programming with PHP. You |
| 187 | PHP. You can create user accounts, create sessions for users across | 184 | can create user accounts, create sessions for users across different pages of |
| 188 | different pages of your site, and then destroy the user data when | 185 | your site, and then destroy the user data when they're ready to leave. |
| 189 | they\'re ready to leave. | ||
| 190 | 186 | ||
| 191 | For more information on this subject, I recommend reading the [PHP | 187 | For more information on this subject, I recommend reading the [PHP |
| 192 | Documentation](https://www.php.net/). Specifically, you may want to look | 188 | Documentation](https://www.php.net/). Specifically, you may want to look at |
| 193 | at [HTTP Authentication with | 189 | [HTTP Authentication with |
| 194 | PHP](https://www.php.net/manual/en/features.http-auth.php), [session | 190 | PHP](https://www.php.net/manual/en/features.http-auth.php), [session |
| 195 | handling](https://www.php.net/manual/en/book.session.php), and | 191 | handling](https://www.php.net/manual/en/book.session.php), and |
| 196 | [hash](https://www.php.net/manual/en/function.hash.php). | 192 | [hash](https://www.php.net/manual/en/function.hash.php). |
content/blog/2020-09-01-visual-recognition.md +71 −77
| @@ -7,42 +7,41 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # What is IBM Watson? | 8 | # What is IBM Watson? |
| 9 | 9 | ||
| 10 | If you\'ve never heard of [Watson](https://www.ibm.com/watson), this | 10 | If you've never heard of [Watson](https://www.ibm.com/watson), this service is |
| 11 | service is a suite of enterprise-ready AI services, applications, and | 11 | a suite of enterprise-ready AI services, applications, and tooling provided by |
| 12 | tooling provided by IBM. Watson contains quite a few useful tools for | 12 | IBM. Watson contains quite a few useful tools for data scientists and students, |
| 13 | data scientists and students, including the subject of this post today: | 13 | including the subject of this post today: visual recognition. |
| 14 | visual recognition. | 14 | |
| 15 | 15 | If you'd like to view the official documentation for the Visual Recognition | |
| 16 | If you\'d like to view the official documentation for the Visual | 16 | API, visit the [API |
| 17 | Recognition API, visit the [API | ||
| 18 | Docs](https://cloud.ibm.com/apidocs/visual-recognition/visual-recognition-v3?code=python). | 17 | Docs](https://cloud.ibm.com/apidocs/visual-recognition/visual-recognition-v3?code=python). |
| 19 | 18 | ||
| 20 | # Prerequisites | 19 | # Prerequisites |
| 21 | 20 | ||
| 22 | To be able to use Watson Visual Recognition, you\'ll need the following: | 21 | To be able to use Watson Visual Recognition, you'll need the following: |
| 23 | 22 | ||
| 24 | 1. Create a free account on [IBM Watson | 23 | 1. Create a free account on [IBM Watson |
| 25 | Studio](https://www.ibm.com/cloud/watson-studio). | 24 | Studio](https://www.ibm.com/cloud/watson-studio). |
| 26 | 2. Add the [Watson Visual | 25 | 2. Add the [Watson Visual |
| 27 | Recognition](https://www.ibm.com/cloud/watson-visual-recognition) | 26 | Recognition](https://www.ibm.com/cloud/watson-visual-recognition) service to |
| 28 | service to your IBM Watson account. | 27 | your IBM Watson account. |
| 29 | 3. Get your API key and URL. To do this, first go to the [profile | 28 | 3. Get your API key and URL. To do this, first go to the [profile |
| 30 | dashboard](https://dataplatform.cloud.ibm.com/home2?context=cpdaas) | 29 | dashboard](https://dataplatform.cloud.ibm.com/home2?context=cpdaas) for your |
| 31 | for your IBM account and click on the Watson Visual Recognition | 30 | IBM account and click on the Watson Visual Recognition service you created. |
| 32 | service you created. This will be listed in the section titled | 31 | This will be listed in the section titled **Your services**. Then click the |
| 33 | **Your services**. Then click the **Credentials\*** tab and open the | 32 | **Credentials** tab and open the **Auto-generated credentials** dropdown. |
| 34 | **Auto-generated credentials\*** dropdown. Copy your API key and URL | 33 | Copy your API key and URL so that you can use them in the Python script |
| 35 | so that you can use them in the Python script later. | 34 | later. |
| 36 | 4. **\[Optional\]\*** While not required, you can also create the | 35 | 4. **[Optional]** While not required, you can also create the Jupyter Notebook |
| 37 | Jupyter Notebook for this project right inside [Watson | 36 | for this project right inside [Watson |
| 38 | Studio](https://www.ibm.com/cloud/watson-studio). Watson Studio will | 37 | Studio](https://www.ibm.com/cloud/watson-studio). Watson Studio will save |
| 39 | save your notebooks inside an organized project and allow you to use | 38 | your notebooks inside an organized project and allow you to use their other |
| 40 | their other integrated products, such as storage containers, AI | 39 | integrated products, such as storage containers, AI models, documentation, |
| 41 | models, documentation, external sharing, etc. | 40 | external sharing, etc. |
| 42 | 41 | ||
| 43 | # Calling the IBM Watson Visual Recognition API | 42 | # Calling the IBM Watson Visual Recognition API |
| 44 | 43 | ||
| 45 | Okay, now let\'s get started. | 44 | Okay, now let's get started. |
| 46 | 45 | ||
| 47 | To begin, we need to install the proper Python package for IBM Watson. | 46 | To begin, we need to install the proper Python package for IBM Watson. |
| 48 | 47 | ||
| @@ -50,8 +49,8 @@ To begin, we need to install the proper Python package for IBM Watson. | |||
| 50 | pip install --upgrade --user "ibm-watson>=4.5.0" | 49 | pip install --upgrade --user "ibm-watson>=4.5.0" |
| 51 | ``` | 50 | ``` |
| 52 | 51 | ||
| 53 | Next, we need to specify the API key, version, and URL given to us when | 52 | Next, we need to specify the API key, version, and URL given to us when we |
| 54 | we created the Watson Visual Recognition service. | 53 | created the Watson Visual Recognition service. |
| 55 | 54 | ||
| 56 | ``` python | 55 | ``` python |
| 57 | apikey = "<your-apikey>" | 56 | apikey = "<your-apikey>" |
| @@ -59,7 +58,7 @@ version = "2018-03-19" | |||
| 59 | url = "<your-url>" | 58 | url = "<your-url>" |
| 60 | ``` | 59 | ``` |
| 61 | 60 | ||
| 62 | Now, let\'s import the necessary libraries and authenticate our service. | 61 | Now, let's import the necessary libraries and authenticate our service. |
| 63 | 62 | ||
| 64 | ``` python | 63 | ``` python |
| 65 | import json | 64 | import json |
| @@ -75,16 +74,15 @@ visual_recognition = VisualRecognitionV3( | |||
| 75 | visual_recognition.set_service_url(url) | 74 | visual_recognition.set_service_url(url) |
| 76 | ``` | 75 | ``` |
| 77 | 76 | ||
| 78 | **\[Optional\]** If you\'d like to tell the API not to use any data to | 77 | **[Optional]** If you'd like to tell the API not to use any data to improve |
| 79 | improve their products, set the following header. | 78 | their products, set the following header. |
| 80 | 79 | ||
| 81 | ``` python | 80 | ``` python |
| 82 | visual_recognition.set_default_headers({'x-watson-learning-opt-out': "true"}) | 81 | visual_recognition.set_default_headers({'x-watson-learning-opt-out': "true"}) |
| 83 | ``` | 82 | ``` |
| 84 | 83 | ||
| 85 | Now we have our API all set and ready to go. For this example, I\'m | 84 | Now we have our API all set and ready to go. For this example, I'm going to |
| 86 | going to include a `dict` of photos to load as we test out | 85 | include a `dict` of photos to load as we test out the API. |
| 87 | the API. | ||
| 88 | 86 | ||
| 89 | ``` python | 87 | ``` python |
| 90 | data = [ | 88 | data = [ |
| @@ -115,14 +113,14 @@ data = [ | |||
| 115 | ] | 113 | ] |
| 116 | ``` | 114 | ``` |
| 117 | 115 | ||
| 118 | Now that we\'ve set up our libraries and have the photos ready, let\'s | 116 | Now that we've set up our libraries and have the photos ready, let's create a |
| 119 | create a loop to call the API for each image. The code below shows a | 117 | loop to call the API for each image. The code below shows a loop that calls the |
| 120 | loop that calls the URL of each image and sends it to the API, | 118 | URL of each image and sends it to the API, requesting results with at least 60% |
| 121 | requesting results with at least 60% confidence. The results are output | 119 | confidence. The results are output to the console with dotted lines separating |
| 122 | to the console with dotted lines separating each section. | 120 | each section. |
| 123 | 121 | ||
| 124 | In the case of an API error, the codes and explanations are output to | 122 | In the case of an API error, the codes and explanations are output to the |
| 125 | the console. | 123 | console. |
| 126 | 124 | ||
| 127 | ``` python | 125 | ``` python |
| 128 | from ibm_watson import ApiException | 126 | from ibm_watson import ApiException |
| @@ -149,23 +147,22 @@ except ApiException as ex: | |||
| 149 | 147 | ||
| 150 | # The Results | 148 | # The Results |
| 151 | 149 | ||
| 152 | Here we can see the full result set of our function above. If you view | 150 | Here we can see the full result set of our function above. If you view each of |
| 153 | each of the URLs that we sent to the API, you\'ll be able to see that it | 151 | the URLs that we sent to the API, you'll be able to see that it was remarkably |
| 154 | was remarkably accurate. To be fair, these are clear high-resolution, | 152 | accurate. To be fair, these are clear high-resolution, clear photos shot with a |
| 155 | clear photos shot with a professional camera. In reality, you will most | 153 | professional camera. In reality, you will most likely be processing images that |
| 156 | likely be processing images that are lower quality and may have a lot of | 154 | are lower quality and may have a lot of noise in the photo. |
| 157 | noise in the photo. | ||
| 158 | 155 | ||
| 159 | However, we can clearly see the benefit of being able to call this API | 156 | However, we can clearly see the benefit of being able to call this API instead |
| 160 | instead of attempting to write our own image recognition function. Each | 157 | of attempting to write our own image recognition function. Each of the |
| 161 | of the classifications returned was a fair description of the image. | 158 | classifications returned was a fair description of the image. |
| 162 | 159 | ||
| 163 | If you wanted to restrict the results to those that are at least 90% | 160 | If you wanted to restrict the results to those that are at least 90% confident |
| 164 | confident or greater, you would simply adjust the `threshold` | 161 | or greater, you would simply adjust the `threshold` in the |
| 165 | in the `visual_recognition.classify()` function. | 162 | `visual_recognition.classify()` function. |
| 166 | 163 | ||
| 167 | When your program runs, it should show the output below for each photo | 164 | When your program runs, it should show the output below for each photo you |
| 168 | you provide. | 165 | provide. |
| 169 | 166 | ||
| 170 | ``` txt | 167 | ``` txt |
| 171 | ---------------------------------------------------------------- | 168 | ---------------------------------------------------------------- |
| @@ -184,22 +181,19 @@ greenishness color ( 0.975 ) | |||
| 184 | 181 | ||
| 185 | # Discussion | 182 | # Discussion |
| 186 | 183 | ||
| 187 | Now, this was a very minimal implementation of the API. We simply | 184 | Now, this was a very minimal implementation of the API. We simply supplied some |
| 188 | supplied some images and looked to see how accurate the results were. | 185 | images and looked to see how accurate the results were. However, you could |
| 189 | However, you could implement this type of API into many machine learning | 186 | implement this type of API into many machine learning (ML) models. |
| 190 | (ML) models. | 187 | |
| 191 | 188 | For example, you could be working for a company that scans their warehouses or | |
| 192 | For example, you could be working for a company that scans their | 189 | inventory using drones. Would you want to pay employees to sit there and watch |
| 193 | warehouses or inventory using drones. Would you want to pay employees to | 190 | drone footage all day in order to identify or count things in the video? |
| 194 | sit there and watch drone footage all day in order to identify or count | 191 | Probably not. Instead, you could use a classification system similar to this one |
| 195 | things in the video? Probably not. Instead, you could use a | 192 | in order to train your machine learning model to correctly identify items that |
| 196 | classification system similar to this one in order to train your machine | 193 | the drones show through video. More specifically, you could have your machine |
| 197 | learning model to correctly identify items that the drones show through | 194 | learning model watch a drone fly over a field of sheep in order to count how |
| 198 | video. More specifically, you could have your machine learning model | 195 | many sheep are living in that field. |
| 199 | watch a drone fly over a field of sheep in order to count how many sheep | 196 | |
| 200 | are living in that field. | 197 | There are many ways to implement machine learning functionality, but hopefully |
| 201 | 198 | this post helped inspire some deeper thought about the tools that can help | |
| 202 | There are many ways to implement machine learning functionality, but | 199 | propel us further into the future of machine learning and AI. |
| 203 | hopefully this post helped inspire some deeper thought about the tools | ||
| 204 | that can help propel us further into the future of machine learning and | ||
| 205 | AI. | ||
content/blog/2020-09-22-internal-audit.md +165 −181
| @@ -10,66 +10,64 @@ Overview](https://img.cleberg.net/blog/20200922-what-is-internal-audit/internal- | |||
| 10 | 10 | ||
| 11 | # Definitions | 11 | # Definitions |
| 12 | 12 | ||
| 13 | One of the many reasons that Internal Audit needs such thorough | 13 | One of the many reasons that Internal Audit needs such thorough explaining to |
| 14 | explaining to non-auditors is that Internal Audit can serve many | 14 | non-auditors is that Internal Audit can serve many purposes, depending on the |
| 15 | purposes, depending on the organization\'s size and needs. However, the | 15 | organization's size and needs. However, the Institute of Internal Auditors |
| 16 | Institute of Internal Auditors (IIA) defines Internal Auditing as: | 16 | (IIA) defines Internal Auditing as: |
| 17 | 17 | ||
| 18 | > Internal auditing is an independent, objective assurance and | 18 | > Internal auditing is an independent, objective assurance and consulting |
| 19 | > consulting activity designed to add value and improve an | 19 | > activity designed to add value and improve an organization's operations. It |
| 20 | > organization\'s operations. It helps an organization accomplish its | 20 | > helps an organization accomplish its objectives by bringing a systematic, |
| 21 | > objectives by bringing a systematic, disciplined approach to evaluate | 21 | > disciplined approach to evaluate and improve the effectiveness of risk |
| 22 | > and improve the effectiveness of risk management, control, and | 22 | > management, control, and governance processes. |
| 23 | > governance processes. | 23 | |
| 24 | 24 | However, this definition uses quite a few terms that aren't clear unless the | |
| 25 | However, this definition uses quite a few terms that aren\'t clear | 25 | reader already has a solid understanding of the auditing profession. To further |
| 26 | unless the reader already has a solid understanding of the auditing | 26 | explain, the following is a list of definitions that can help supplement |
| 27 | profession. To further explain, the following is a list of definitions | 27 | understanding of internal auditing. |
| 28 | that can help supplement understanding of internal auditing. | ||
| 29 | 28 | ||
| 30 | ## Independent | 29 | ## Independent |
| 31 | 30 | ||
| 32 | Independence is the freedom from conditions that threaten the ability of | 31 | Independence is the freedom from conditions that threaten the ability of the |
| 33 | the internal audit activity to carry out internal audit responsibilities | 32 | internal audit activity to carry out internal audit responsibilities in an |
| 34 | in an unbiased manner. To achieve the degree of independence necessary | 33 | unbiased manner. To achieve the degree of independence necessary to effectively |
| 35 | to effectively carry out the responsibilities of the internal audit | 34 | carry out the responsibilities of the internal audit activity, the chief audit |
| 36 | activity, the chief audit executive has direct and unrestricted access | 35 | executive has direct and unrestricted access to senior management and the board. |
| 37 | to senior management and the board. This can be achieved through a | 36 | This can be achieved through a dual-reporting relationship. Threats to |
| 38 | dual-reporting relationship. Threats to independence must be managed at | 37 | independence must be managed at the individual auditor, engagement, functional, |
| 39 | the individual auditor, engagement, functional, and organizational | 38 | and organizational levels. |
| 40 | levels. | ||
| 41 | 39 | ||
| 42 | ## Objective | 40 | ## Objective |
| 43 | 41 | ||
| 44 | Objectivity is an unbiased mental attitude that allows internal auditors | 42 | Objectivity is an unbiased mental attitude that allows internal auditors to |
| 45 | to perform engagements in such a manner that they believe in their work | 43 | perform engagements in such a manner that they believe in their work product and |
| 46 | product and that no quality compromises are made. Objectivity requires | 44 | that no quality compromises are made. Objectivity requires that internal |
| 47 | that internal auditors do not subordinate their judgment on audit | 45 | auditors do not subordinate their judgment on audit matters to others. Threats |
| 48 | matters to others. Threats to objectivity must be managed at the | 46 | to objectivity must be managed at the individual auditor, engagement, |
| 49 | individual auditor, engagement, functional, and organizational levels. | 47 | functional, and organizational levels. |
| 50 | 48 | ||
| 51 | ## Assurance | 49 | ## Assurance |
| 52 | 50 | ||
| 53 | Assurance services involve the internal auditor\'s objective assessment | 51 | Assurance services involve the internal auditor's objective assessment of |
| 54 | of evidence to provide opinions or conclusions regarding an entity, | 52 | evidence to provide opinions or conclusions regarding an entity, operation, |
| 55 | operation, function, process, system, or other subject matters. The | 53 | function, process, system, or other subject matters. The internal auditor |
| 56 | internal auditor determines the nature and scope of an assurance | 54 | determines the nature and scope of an assurance engagement. Generally, three |
| 57 | engagement. Generally, three parties are participants in assurance | 55 | parties are participants in assurance services: (1) the person or group directly |
| 58 | services: (1) the person or group directly involved with the entity, | 56 | involved with the entity, operation, function, process, system, or other subject |
| 59 | operation, function, process, system, or other subject - (the process | 57 | - (the process owner), (2) the person or group making the assessment - (the |
| 60 | owner), (2) the person or group making the assessment - (the internal | 58 | internal auditor), and (3) the person or group using the assessment - (the |
| 61 | auditor), and (3) the person or group using the assessment - (the user). | 59 | user). |
| 62 | 60 | ||
| 63 | ## Consulting | 61 | ## Consulting |
| 64 | 62 | ||
| 65 | Consulting services are advisory in nature and are generally performed | 63 | Consulting services are advisory in nature and are generally performed at the |
| 66 | at the specific request of an engagement client. The nature and scope of | 64 | specific request of an engagement client. The nature and scope of the consulting |
| 67 | the consulting engagement are subject to agreement with the engagement | 65 | engagement are subject to agreement with the engagement client. Consulting |
| 68 | client. Consulting services generally involve two parties: (1) the | 66 | services generally involve two parties: (1) the person or group offering the |
| 69 | person or group offering the advice (the internal auditor), and (2) the | 67 | advice (the internal auditor), and (2) the person or group seeking and receiving |
| 70 | person or group seeking and receiving the advice (the engagement | 68 | the advice (the engagement client). When performing consulting services, the |
| 71 | client). When performing consulting services, the internal auditor | 69 | internal auditor should maintain objectivity and not assume management |
| 72 | should maintain objectivity and not assume management responsibility. | 70 | responsibility. |
| 73 | 71 | ||
| 74 | ## Governance, Risk Management, & Compliance (GRC) | 72 | ## Governance, Risk Management, & Compliance (GRC) |
| 75 | 73 | ||
| @@ -78,187 +76,173 @@ reliably achieve objectives, address uncertainty and act with integrity. | |||
| 78 | 76 | ||
| 79 | # Audit Charter & Standards | 77 | # Audit Charter & Standards |
| 80 | 78 | ||
| 81 | First, it\'s important to note that not every organization needs | 79 | First, it's important to note that not every organization needs internal |
| 82 | internal auditors. In fact, it\'s unwise for an organization to hire | 80 | auditors. In fact, it's unwise for an organization to hire internal auditors |
| 83 | internal auditors unless they have regulatory requirements for auditing | 81 | unless they have regulatory requirements for auditing and have the capital to |
| 84 | and have the capital to support the department. Internal audit is a cost | 82 | support the department. Internal audit is a cost center that can only affect |
| 85 | center that can only affect revenue indirectly. | 83 | revenue indirectly. |
| 86 | 84 | ||
| 87 | Once an organization determines the need for internal assurance | 85 | Once an organization determines the need for internal assurance services, they |
| 88 | services, they will hire a Chief Audit Executive and create the audit | 86 | will hire a Chief Audit Executive and create the audit charter. This charter is |
| 89 | charter. This charter is a document, approved by the company\'s | 87 | a document, approved by the company's governing body, that will define internal |
| 90 | governing body, that will define internal audit\'s purpose, authority, | 88 | audit's purpose, authority, responsibility, and position within the |
| 91 | responsibility, and position within the organization. Fortunately, the | 89 | organization. Fortunately, the IIA has model charters available to IIA members |
| 92 | IIA has model charters available to IIA members for those developing or | 90 | for those developing or improving their charter. |
| 93 | improving their charter. | 91 | |
| 94 | 92 | Beyond the charter and organizational documents, internal auditors follow a few | |
| 95 | Beyond the charter and organizational documents, internal auditors | 93 | different standards in order to perform their job. First is the International |
| 96 | follow a few different standards in order to perform their job. First is | 94 | Professional Practices Framework (IPPF) by the IIA, which is the model of |
| 97 | the International Professional Practices Framework (IPPF) by the IIA, | 95 | standards for internal auditing. In addition, ISACA's Information Technology |
| 98 | which is the model of standards for internal auditing. In addition, | 96 | Assurance Framework (ITAF) helps guide auditors in reference to information |
| 99 | ISACA\'s Information Technology Assurance Framework (ITAF) helps guide | 97 | technology (IT) compliance and assurance. Finally, additional standards such as |
| 100 | auditors in reference to information technology (IT) compliance and | 98 | FASB, GAAP, and industry-specific standards are used when performing internal |
| 101 | assurance. Finally, additional standards such as FASB, GAAP, and | 99 | audit work. |
| 102 | industry-specific standards are used when performing internal audit | ||
| 103 | work. | ||
| 104 | 100 | ||
| 105 | # Three Lines of Defense | 101 | # Three Lines of Defense |
| 106 | 102 | ||
| 107 | [The IIA](https://theiia.org) released the original Three Lines of | 103 | [The IIA](https://theiia.org) released the original Three Lines of Defense model |
| 108 | Defense model in 2013, but have released an updated version in 2020. | 104 | in 2013, but have released an updated version in 2020. Here is what the Three |
| 109 | Here is what the Three Lines of Defense model has historically looked | 105 | Lines of Defense model has historically looked like: |
| 110 | like: | ||
| 111 | 106 | ||
| 112 |  | 108 | Model](https://img.cleberg.net/blog/20200922-what-is-internal-audit/three_lines_model.png) |
| 114 | 109 | ||
| 115 | I won\'t go into depth about the changes made to the model in this | 110 | I won't go into depth about the changes made to the model in this article. |
| 116 | article. Instead, let\'s take a look at the most current model. | 111 | Instead, let's take a look at the most current model. |
| 117 | 112 | ||
| 118 |  | 114 | Model](https://img.cleberg.net/blog/20200922-what-is-internal-audit/updated_three_lines_model.png) |
| 120 | 115 | ||
| 121 | The updated model forgets the strict idea of areas performing their own | 116 | The updated model forgets the strict idea of areas performing their own |
| 122 | functions or line of defense. Instead of talking about management, risk, | 117 | functions or line of defense. Instead of talking about management, risk, and |
| 123 | and internal audit as 1-2-3, the new model creates a more fluid and | 118 | internal audit as 1-2-3, the new model creates a more fluid and cooperative |
| 124 | cooperative model. | 119 | model. |
| 125 | 120 | ||
| 126 | Looking at this model from an auditing perspective shows us that | 121 | Looking at this model from an auditing perspective shows us that auditors will |
| 127 | auditors will need to align, communicate, and collaborate with | 122 | need to align, communicate, and collaborate with management, including business |
| 128 | management, including business area managers and chief officers, as well | 123 | area managers and chief officers, as well as reporting to the governing body. |
| 129 | as reporting to the governing body. The governing body will instruct | 124 | The governing body will instruct internal audit *functionally* on their goals |
| 130 | internal audit *functionally* on their goals and track their progress | 125 | and track their progress periodically. |
| 131 | periodically. | 126 | |
| 132 | 127 | However, the internal audit department will report *administratively* to a chief | |
| 133 | However, the internal audit department will report *administratively* to | 128 | officer in the company for the purposes of collaboration, direction, and |
| 134 | a chief officer in the company for the purposes of collaboration, | 129 | assistance with the business. Note that in most situations, the governing body |
| 135 | direction, and assistance with the business. Note that in most | 130 | is the audit committee on the company's board of directors. |
| 136 | situations, the governing body is the audit committee on the company\'s | 131 | |
| 137 | board of directors. | 132 | The result of this structure is that internal audit is an independent and |
| 138 | 133 | objective function that can provide assurance over the topics they audit. | |
| 139 | The result of this structure is that internal audit is an independent | ||
| 140 | and objective function that can provide assurance over the topics they | ||
| 141 | audit. | ||
| 142 | 134 | ||
| 143 | # Audit Process | 135 | # Audit Process |
| 144 | 136 | ||
| 145 | A normal audit will generally follow the same process, regardless of the | 137 | A normal audit will generally follow the same process, regardless of the topic. |
| 146 | topic. However, certain special projects or abnormal business areas may | 138 | However, certain special projects or abnormal business areas may call for |
| 147 | call for changes to the audit process. The audit process is not set in | 139 | changes to the audit process. The audit process is not set in stone, it's |
| 148 | stone, it\'s simply a set of best practices so that audits can be | 140 | simply a set of best practices so that audits can be performed consistently. |
| 149 | performed consistently. | ||
| 150 | 141 | ||
| 151 |  | 143 | Process](https://img.cleberg.net/blog/20200922-what-is-internal-audit/internal-audit-process.jpg) |
| 153 | 144 | ||
| 154 | While different organizations may tweak the process, it will generally | 145 | While different organizations may tweak the process, it will generally follow |
| 155 | follow this flow: | 146 | this flow: |
| 156 | 147 | ||
| 157 | ## 1. Risk Assessment | 148 | ## 1. Risk Assessment |
| 158 | 149 | ||
| 159 | The risk assessment part of the process has historically been performed | 150 | The risk assessment part of the process has historically been performed |
| 160 | annually, but many organizations have moved to performing this process | 151 | annually, but many organizations have moved to performing this process much more |
| 161 | much more frequently. In fact, some organizations are moving to an agile | 152 | frequently. In fact, some organizations are moving to an agile approach that can |
| 162 | approach that can take new risks into the risk assessment and | 153 | take new risks into the risk assessment and re-prioritize risk areas on-the-go. |
| 163 | re-prioritize risk areas on-the-go. To perform a risk assessment, | 154 | To perform a risk assessment, leaders in internal audit will research industry |
| 164 | leaders in internal audit will research industry risks, consult with | 155 | risks, consult with business leaders around the company, and perform analyses on |
| 165 | business leaders around the company, and perform analyses on company | 156 | company data. |
| 166 | data. | ||
| 167 | 157 | ||
| 168 | Once a risk assessment has been documented, the audit department has a | 158 | Once a risk assessment has been documented, the audit department has a |
| 169 | prioritized list of risks that can be audited. This is usually in the | 159 | prioritized list of risks that can be audited. This is usually in the form of |
| 170 | form of auditable entities, such as business areas or departments. | 160 | auditable entities, such as business areas or departments. |
| 171 | 161 | ||
| 172 | ## 2. Planning | 162 | ## 2. Planning |
| 173 | 163 | ||
| 174 | During the planning phase of an audit, auditors will meet with the | 164 | During the planning phase of an audit, auditors will meet with the business area |
| 175 | business area to discuss the various processes, controls, and risks | 165 | to discuss the various processes, controls, and risks applicable to the |
| 176 | applicable to the business. This helps the auditors determine the scope | 166 | business. This helps the auditors determine the scope limits for the audit, as |
| 177 | limits for the audit, as well as timing and subject-matter experts. | 167 | well as timing and subject-matter experts. Certain documents will be created in |
| 178 | Certain documents will be created in this phase that will be used to | 168 | this phase that will be used to keep the audit on-track an in-scope as it goes |
| 179 | keep the audit on-track an in-scope as it goes forward. | 169 | forward. |
| 180 | 170 | ||
| 181 | ## 3. Testing | 171 | ## 3. Testing |
| 182 | 172 | ||
| 183 | The testing phase, also known as fieldwork or execution, is where | 173 | The testing phase, also known as fieldwork or execution, is where internal |
| 184 | internal auditors will take the information they\'ve discovered and test | 174 | auditors will take the information they've discovered and test it against |
| 185 | it against regulations, industry standards, company rules, best | 175 | regulations, industry standards, company rules, best practices, as well as |
| 186 | practices, as well as validating that any processes are complete and | 176 | validating that any processes are complete and accurate. For example, an audit |
| 187 | accurate. For example, an audit of HR would most likely examine | 177 | of HR would most likely examine processes such as employee on-boarding, employee |
| 188 | processes such as employee on-boarding, employee termination, security | 178 | termination, security of personally identifiable information (PII), or the IT |
| 189 | of personally identifiable information (PII), or the IT systems involved | 179 | systems involved in these processes. Company standards would be examined and |
| 190 | in these processes. Company standards would be examined and compared | 180 | compared against how the processes are actually being performed day-to-day, as |
| 191 | against how the processes are actually being performed day-to-day, as | 181 | well as compared against regulations such as the Equal Employment Opportunity |
| 192 | well as compared against regulations such as the Equal Employment | 182 | (EEO), American with Disabilities Act, and National Labor Relations Act. |
| 193 | Opportunity (EEO), American with Disabilities Act, and National Labor | ||
| 194 | Relations Act. | ||
| 195 | 183 | ||
| 196 | ## 4. Reporting | 184 | ## 4. Reporting |
| 197 | 185 | ||
| 198 | Once all the tests have been completed, the audit will enter the | 186 | Once all the tests have been completed, the audit will enter the reporting |
| 199 | reporting phase. This is when the audit team will conclude on the | 187 | phase. This is when the audit team will conclude on the evidence they've |
| 200 | evidence they\'ve collected, interviews they\'ve held, and any opinions | 188 | collected, interviews they've held, and any opinions they've formed on the |
| 201 | they\'ve formed on the controls in place. A summary of the audit | 189 | controls in place. A summary of the audit findings, conclusions, and specific |
| 202 | findings, conclusions, and specific recommendations are officially | 190 | recommendations are officially communicated to the client through a draft |
| 203 | communicated to the client through a draft report. Clients have the | 191 | report. Clients have the opportunity to respond to the report and submit an |
| 204 | opportunity to respond to the report and submit an action plan and time | 192 | action plan and time frame. These responses become part of the final report |
| 205 | frame. These responses become part of the final report which is | 193 | which is distributed to the appropriate level of administration. |
| 206 | distributed to the appropriate level of administration. | ||
| 207 | 194 | ||
| 208 | ## 5. Follow-Up | 195 | ## 5. Follow-Up |
| 209 | 196 | ||
| 210 | After audits have been completed and management has formed action plans | 197 | After audits have been completed and management has formed action plans and time |
| 211 | and time frames for audit issues, internal audit will follow up once | 198 | frames for audit issues, internal audit will follow up once that due date has |
| 212 | that due date has arrived. In most cases, the follow-up will simply | 199 | arrived. In most cases, the follow-up will simply consist of a meeting to |
| 213 | consist of a meeting to discuss how the action plan has been completed | 200 | discuss how the action plan has been completed and to request documentation to |
| 214 | and to request documentation to prove it. | 201 | prove it. |
| 215 | 202 | ||
| 216 | # Audit Department Structure | 203 | # Audit Department Structure |
| 217 | 204 | ||
| 218 | While an internal audit department is most often thought of as a team of | 205 | While an internal audit department is most often thought of as a team of |
| 219 | full-time employees, there are actually many different ways in which a | 206 | full-time employees, there are actually many different ways in which a |
| 220 | department can be structured. As the world becomes more digital and | 207 | department can be structured. As the world becomes more digital and fast-paced, |
| 221 | fast-paced, outsourcing has become a more attractive option for some | 208 | outsourcing has become a more attractive option for some organizations. Internal |
| 222 | organizations. Internal audit can be fully outsourced or partially | 209 | audit can be fully outsourced or partially outsourced, allowing for flexibility |
| 223 | outsourced, allowing for flexibility in cases where turnover is high. | 210 | in cases where turnover is high. |
| 224 | 211 | ||
| 225 | In addition, departments can implement a rotational model. This allows | 212 | In addition, departments can implement a rotational model. This allows for |
| 226 | for interested employees around the organization to rotate into the | 213 | interested employees around the organization to rotate into the internal audit |
| 227 | internal audit department for a period of time, allowing them to obtain | 214 | department for a period of time, allowing them to obtain knowledge of risks and |
| 228 | knowledge of risks and controls and allowing the internal audit team to | 215 | controls and allowing the internal audit team to obtain more business area |
| 229 | obtain more business area knowledge. This program is popular in very | 216 | knowledge. This program is popular in very large organizations, but |
| 230 | large organizations, but organizations tend to rotate lower-level audit | 217 | organizations tend to rotate lower-level audit staff instead of managers. This |
| 231 | staff instead of managers. This helps prevent any significant knowledge | 218 | helps prevent any significant knowledge loss as auditors rotate out to business |
| 232 | loss as auditors rotate out to business areas. | 219 | areas. |
| 233 | 220 | ||
| 234 | # Consulting | 221 | # Consulting |
| 235 | 222 | ||
| 236 | Consulting is not an easy task at any organization, especially for a | 223 | Consulting is not an easy task at any organization, especially for a department |
| 237 | department that can have negative perceptions within the organization as | 224 | that can have negative perceptions within the organization as the "compliance |
| 238 | the \"compliance police.\" However, once an internal audit department | 225 | police." However, once an internal audit department has delivered value to |
| 239 | has delivered value to organization, adding consulting to their suite of | 226 | organization, adding consulting to their suite of services is a smart move. In |
| 240 | services is a smart move. In most cases, Internal Audit can insert | 227 | most cases, Internal Audit can insert themselves into a consulting role without |
| 241 | themselves into a consulting role without affecting the process of | 228 | affecting the process of project management at the company. This means that |
| 242 | project management at the company. This means that internal audit can | 229 | internal audit can add objective assurance and opinions to business areas as |
| 243 | add objective assurance and opinions to business areas as they develop | 230 | they develop new processes, instead of coming in periodically to audit an area |
| 244 | new processes, instead of coming in periodically to audit an area and | 231 | and file issues that could have been fixed at the beginning. |
| 245 | file issues that could have been fixed at the beginning. | ||
| 246 | 232 | ||
| 247 | # Data Science & Data Analytics | 233 | # Data Science & Data Analytics |
| 248 | 234 | ||
| 249 |  | 236 | Set](https://img.cleberg.net/blog/20200922-what-is-internal-audit/data-science-skillset.png) |
| 251 | 237 | ||
| 252 | One major piece of the internal audit function in the modern world is | 238 | One major piece of the internal audit function in the modern world is data |
| 253 | data science. While the process is data science, most auditors will | 239 | science. While the process is data science, most auditors will refer to anything |
| 254 | refer to anything in this realm as data analytics. Hot topics such as | 240 | in this realm as data analytics. Hot topics such as robotic process automation |
| 255 | robotic process automation (RPA), machine learning (ML), and data mining | 241 | (RPA), machine learning (ML), and data mining have taken over the auditing world |
| 256 | have taken over the auditing world in recent years. These technologies | 242 | in recent years. These technologies have been immensely helpful with increasing |
| 257 | have been immensely helpful with increasing the effectiveness and | 243 | the effectiveness and efficiency of auditors. |
| 258 | efficiency of auditors. | 244 | |
| 259 | 245 | For example, mundane and repetitive tasks can be automated in order for auditors | |
| 260 | For example, mundane and repetitive tasks can be automated in order for | 246 | to make more room in their schedules for labor-intensive work. Further, auditors |
| 261 | auditors to make more room in their schedules for labor-intensive work. | 247 | will need to adapt technologies like machine learning in order to extract more |
| 262 | Further, auditors will need to adapt technologies like machine learning | 248 | value from the data they're using to form conclusions. |
| 263 | in order to extract more value from the data they\'re using to form | ||
| 264 | conclusions. | ||
content/blog/2020-09-25-happiness-map.md +46 −49
| @@ -8,28 +8,28 @@ draft = false | |||
| 8 | # Background Information | 8 | # Background Information |
| 9 | 9 | ||
| 10 | The dataset (obtained from | 10 | The dataset (obtained from |
| 11 | [Kaggle](https://www.kaggle.com/unsdsn/world-happiness)) used in this | 11 | [Kaggle](https://www.kaggle.com/unsdsn/world-happiness)) used in this article |
| 12 | article contains a list of countries around the world, their happiness | 12 | contains a list of countries around the world, their happiness rankings and |
| 13 | rankings and scores, as well as other national scoring measures. | 13 | scores, as well as other national scoring measures. |
| 14 | 14 | ||
| 15 | Fields include: | 15 | Fields include: |
| 16 | 16 | ||
| 17 | - Overall rank | 17 | - Overall rank |
| 18 | - Country or region | 18 | - Country or region |
| 19 | - GDP per capita | 19 | - GDP per capita |
| 20 | - Social support | 20 | - Social support |
| 21 | - Healthy life expectancy | 21 | - Healthy life expectancy |
| 22 | - Freedom to make life choices | 22 | - Freedom to make life choices |
| 23 | - Generosity | 23 | - Generosity |
| 24 | - Perceptions of corruption | 24 | - Perceptions of corruption |
| 25 | 25 | ||
| 26 | There are 156 records. Since there are \~195 countries in the world, we | 26 | There are 156 records. Since there are ~195 countries in the world, we can see |
| 27 | can see that around 40 countries will be missing from this dataset. | 27 | that around 40 countries will be missing from this dataset. |
| 28 | 28 | ||
| 29 | # Install Packages | 29 | # Install Packages |
| 30 | 30 | ||
| 31 | As always, run the `install` command for all packages needed | 31 | As always, run the `install` command for all packages needed to perform |
| 32 | to perform analysis. | 32 | analysis. |
| 33 | 33 | ||
| 34 | ``` python | 34 | ``` python |
| 35 | !pip install folium geopandas matplotlib numpy pandas | 35 | !pip install folium geopandas matplotlib numpy pandas |
| @@ -38,9 +38,9 @@ to perform analysis. | |||
| 38 | # Import the Data | 38 | # Import the Data |
| 39 | 39 | ||
| 40 | We only need a couple packages to create a choropleth map. We will use | 40 | We only need a couple packages to create a choropleth map. We will use |
| 41 | [Folium](https://python-visualization.github.io/folium/), which provides | 41 | [Folium](https://python-visualization.github.io/folium/), which provides map |
| 42 | map visualizations in Python. We will also use geopandas and pandas to | 42 | visualizations in Python. We will also use geopandas and pandas to wrangle our |
| 43 | wrangle our data before we put it on a map. | 43 | data before we put it on a map. |
| 44 | 44 | ||
| 45 | ``` python | 45 | ``` python |
| 46 | # Import the necessary Python packages | 46 | # Import the necessary Python packages |
| @@ -49,14 +49,14 @@ import geopandas as gpd | |||
| 49 | import pandas as pd | 49 | import pandas as pd |
| 50 | ``` | 50 | ``` |
| 51 | 51 | ||
| 52 | To get anything to show up on a map, we need a file that will specify | 52 | To get anything to show up on a map, we need a file that will specify the |
| 53 | the boundaries of each country. Luckily, GeoJSON files exist (for free!) | 53 | boundaries of each country. Luckily, GeoJSON files exist (for free!) on the |
| 54 | on the internet. To get the boundaries of every country in the world, we | 54 | internet. To get the boundaries of every country in the world, we will use the |
| 55 | will use the GeoJSON link shown below. | 55 | GeoJSON link shown below. |
| 56 | 56 | ||
| 57 | GeoPandas will take this data and load it into a dataframe so that we | 57 | GeoPandas will take this data and load it into a dataframe so that we can easily |
| 58 | can easily match it to the data we\'re trying to analyze. Let\'s look at | 58 | match it to the data we're trying to analyze. Let's look at the GeoJSON |
| 59 | the GeoJSON dataframe: | 59 | dataframe: |
| 60 | 60 | ||
| 61 | ``` python | 61 | ``` python |
| 62 | # Load the GeoJSON data with geopandas | 62 | # Load the GeoJSON data with geopandas |
| @@ -67,9 +67,9 @@ geo_data.head() | |||
| 67 |  | 68 | Dataframe](https://img.cleberg.net/blog/20200925-world-choropleth-map/geojson_df.png) |
| 69 | 69 | ||
| 70 | Next, let\'s load the data from the Kaggle dataset. I\'ve downloaded | 70 | Next, let's load the data from the Kaggle dataset. I've downloaded this file, |
| 71 | this file, so update the file path if you have it somewhere else. After | 71 | so update the file path if you have it somewhere else. After loading, let's |
| 72 | loading, let\'s take a look at this dataframe: | 72 | take a look at this dataframe: |
| 73 | 73 | ||
| 74 | ``` python | 74 | ``` python |
| 75 | # Load the world happiness data with pandas | 75 | # Load the world happiness data with pandas |
| @@ -82,12 +82,11 @@ Dataframe](https://img.cleberg.net/blog/20200925-world-choropleth-map/happiness_ | |||
| 82 | 82 | ||
| 83 | # Clean the Data | 83 | # Clean the Data |
| 84 | 84 | ||
| 85 | Some countries need to be renamed, or they will be lost when you merge | 85 | Some countries need to be renamed, or they will be lost when you merge the |
| 86 | the happiness and GeoJSON dataframes. This is something I discovered | 86 | happiness and GeoJSON dataframes. This is something I discovered when the map |
| 87 | when the map below showed empty countries. I searched both data frames | 87 | below showed empty countries. I searched both data frames for the missing |
| 88 | for the missing countries to see the naming differences. Any countries | 88 | countries to see the naming differences. Any countries that do not have records |
| 89 | that do not have records in the `happy_data` df will not show | 89 | in the `happy_data` df will not show up on the map. |
| 90 | up on the map. | ||
| 91 | 90 | ||
| 92 | ``` python | 91 | ``` python |
| 93 | # Rename some countries to match our GeoJSON data | 92 | # Rename some countries to match our GeoJSON data |
| @@ -112,11 +111,11 @@ happy_data.at[democratic_congo_index, 'Country or region'] = 'Democratic Republi | |||
| 112 | # Merge the Data | 111 | # Merge the Data |
| 113 | 112 | ||
| 114 | Now that we have clean data, we need to merge the GeoJSON data with the | 113 | Now that we have clean data, we need to merge the GeoJSON data with the |
| 115 | happiness data. Since we\'ve stored them both in dataframes, we just | 114 | happiness data. Since we've stored them both in dataframes, we just need to |
| 116 | need to call the `.merge()` function. | 115 | call the `.merge()` function. |
| 117 | 116 | ||
| 118 | We will also rename a couple columns, just so that they\'re a little | 117 | We will also rename a couple columns, just so that they're a little easier to |
| 119 | easier to use when we create the map. | 118 | use when we create the map. |
| 120 | 119 | ||
| 121 | ``` python | 120 | ``` python |
| 122 | # Merge the two previous dataframes into a single geopandas dataframe | 121 | # Merge the two previous dataframes into a single geopandas dataframe |
| @@ -133,10 +132,9 @@ Dataframe](https://img.cleberg.net/blog/20200925-world-choropleth-map/merged_df. | |||
| 133 | # Create the Map | 132 | # Create the Map |
| 134 | 133 | ||
| 135 | The data is finally ready to be added to a map. The code below shows the | 134 | The data is finally ready to be added to a map. The code below shows the |
| 136 | simplest way to find the center of the map and create a Folium map | 135 | simplest way to find the center of the map and create a Folium map object. The |
| 137 | object. The important part is to remember to reference the merged | 136 | important part is to remember to reference the merged dataframe for our GeoJSON |
| 138 | dataframe for our GeoJSON data and value data. The columns specify which | 137 | data and value data. The columns specify which geo data and value data to use. |
| 139 | geo data and value data to use. | ||
| 140 | 138 | ||
| 141 | ``` python | 139 | ``` python |
| 142 | # Assign centroids to map | 140 | # Assign centroids to map |
| @@ -164,17 +162,16 @@ folium.Choropleth( | |||
| 164 | ).add_to(world_map) | 162 | ).add_to(world_map) |
| 165 | ``` | 163 | ``` |
| 166 | 164 | ||
| 167 | Let\'s look at the resulting map. | 165 | Let's look at the resulting map. |
| 168 | 166 | ||
| 169 |  | 168 | Map](https://img.cleberg.net/blog/20200925-world-choropleth-map/map.png) |
| 171 | 169 | ||
| 172 | # Create a Tooltip on Hover | 170 | # Create a Tooltip on Hover |
| 173 | 171 | ||
| 174 | Now that we have a map set up, we could stop. However, I want to add a | 172 | Now that we have a map set up, we could stop. However, I want to add a tooltip |
| 175 | tooltip so that I can see more information about each country. The | 173 | so that I can see more information about each country. The `tooltip_data` code |
| 176 | `tooltip_data` code below will show a popup on hover with all | 174 | below will show a popup on hover with all the data fields shown. |
| 177 | the data fields shown. | ||
| 178 | 175 | ||
| 179 | ``` python | 176 | ``` python |
| 180 | # Adding labels to map | 177 | # Adding labels to map |
| @@ -219,8 +216,8 @@ folium.LayerControl().add_to(world_map) | |||
| 219 | world_map | 216 | world_map |
| 220 | ``` | 217 | ``` |
| 221 | 218 | ||
| 222 | The final image below will show you what the tooltip looks like whenever | 219 | The final image below will show you what the tooltip looks like whenever you |
| 223 | you hover over a country. | 220 | hover over a country. |
| 224 | 221 | ||
| 225 |  | 223 | Tooltip](https://img.cleberg.net/blog/20200925-world-choropleth-map/tooltip_map.png) |
content/blog/2020-10-12-mediocrity.md +97 −102
| @@ -7,115 +7,110 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Perfect is the Enemy of Good | 8 | # Perfect is the Enemy of Good |
| 9 | 9 | ||
| 10 | As the saying goes, \"the best is the enemy of the good.\" As we strive | 10 | As the saying goes, "the best is the enemy of the good." As we strive for |
| 11 | for perfection, we often fail to realize the implications of such an | 11 | perfection, we often fail to realize the implications of such an undertaking. |
| 12 | undertaking. Attempting to reach perfection is often unrealistic. Even | 12 | Attempting to reach perfection is often unrealistic. Even worse, it can get in |
| 13 | worse, it can get in the way of achieving a good outcome. In certain | 13 | the way of achieving a good outcome. In certain situations, we try so hard to |
| 14 | situations, we try so hard to achieve the ideal solution that we have | 14 | achieve the ideal solution that we have burned the bridges that would have |
| 15 | burned the bridges that would have allowed us to reach a lesser yet | 15 | allowed us to reach a lesser yet still superb solution. |
| 16 | still superb solution. | 16 | |
| 17 | 17 | Philosophers throughout history have inspected this plight from many viewpoints. | |
| 18 | Philosophers throughout history have inspected this plight from many | 18 | Greek mythology speaks of the [golden |
| 19 | viewpoints. Greek mythology speaks of the [golden | 19 | mean](https://en.wikipedia.org/wiki/Golden_mean_(philosophy)), which uses the |
| 20 | mean](https://en.wikipedia.org/wiki/Golden_mean_(philosophy)), which | 20 | story of Icarus to illustrate that sometimes "the middle course" is the best |
| 21 | uses the story of Icarus to illustrate that sometimes \"the middle | 21 | solution. In this story, Daedalus, a famous artist of his time, built feathered |
| 22 | course\" is the best solution. In this story, Daedalus, a famous artist | 22 | wings for himself and his son so that they might escape the clutches of King |
| 23 | of his time, built feathered wings for himself and his son so that they | 23 | Minos. Daedalus warns his beloved son whom he loved so much to "fly the middle |
| 24 | might escape the clutches of King Minos. Daedalus warns his beloved son | 24 | course", between the sea spray and the sun's heat. Icarus did not heed his |
| 25 | whom he loved so much to \"fly the middle course\", between the sea | 25 | father; he flew up and up until the sun melted the wax off his wings. For not |
| 26 | spray and the sun\'s heat. Icarus did not heed his father; he flew up | 26 | heeding the middle course, he fell into the sea and drowned. |
| 27 | and up until the sun melted the wax off his wings. For not heeding the | ||
| 28 | middle course, he fell into the sea and drowned. | ||
| 29 | 27 | ||
| 30 | More recently, management scholars have explored the [Pareto | 28 | More recently, management scholars have explored the [Pareto |
| 31 | principle](https://en.wikipedia.org/wiki/Pareto_principle) and found | 29 | principle](https://en.wikipedia.org/wiki/Pareto_principle) and found that as we |
| 32 | that as we increase the frequency of something, or strive to perform | 30 | increase the frequency of something, or strive to perform actions to achieve |
| 33 | actions to achieve some form of perfection, we run into [diminishing | 31 | some form of perfection, we run into [diminishing |
| 34 | returns](https://en.wikipedia.org/wiki/Diminishing_returns). | 32 | returns](https://en.wikipedia.org/wiki/Diminishing_returns). |
| 35 | 33 | ||
| 36 | Even further, Harold Demsetz is noted as coining the term [the Nirvana | 34 | Even further, Harold Demsetz is noted as coining the term [the Nirvana |
| 37 | fallacy](https://en.wikipedia.org/wiki/Nirvana_fallacy) in 1969, which | 35 | fallacy](https://en.wikipedia.org/wiki/Nirvana_fallacy) in 1969, which shows the |
| 38 | shows the fallacy of comparing actual things with unrealistic, idealized | 36 | fallacy of comparing actual things with unrealistic, idealized alternatives. |
| 39 | alternatives. This is another trap that we may fall into, where we are | 37 | This is another trap that we may fall into, where we are constantly thinking of |
| 40 | constantly thinking of the ultimate solutions to problems, when | 38 | the ultimate solutions to problems, when something more realistic needs to be |
| 41 | something more realistic needs to be considered. | 39 | considered. |
| 42 | 40 | ||
| 43 | Over and over throughout history, we\'ve found that perfection is often | 41 | Over and over throughout history, we've found that perfection is often |
| 44 | unrealistic and unachievable. However, we push ourselves and our peers | 42 | unrealistic and unachievable. However, we push ourselves and our peers to "give |
| 45 | to \"give 100%\" or \"go the extra mile,\" while it may be that the | 43 | 100%" or "go the extra mile," while it may be that the better course is to |
| 46 | better course is to give a valuable level of effort while considering | 44 | give a valuable level of effort while considering the effects of further effort |
| 47 | the effects of further effort on the outcome. Working harder does not | 45 | on the outcome. Working harder does not always help us achieve loftier goals. |
| 48 | always help us achieve loftier goals. | 46 | |
| 49 | 47 | This has presented itself to me most recently during my time studying at my | |
| 50 | This has presented itself to me most recently during my time studying at | 48 | university. I was anxious and feeling the stresses of my courses, career, and |
| 51 | my university. I was anxious and feeling the stresses of my courses, | 49 | personal life for quite a while, which was greatly affecting how well I was |
| 52 | career, and personal life for quite a while, which was greatly affecting | 50 | doing at school and my level of effort at work. One day, I happened to be |
| 53 | how well I was doing at school and my level of effort at work. One day, | 51 | talking to my father when he said something simple that hit home: |
| 54 | I happened to be talking to my father when he said something simple that | 52 | |
| 55 | hit home: | 53 | > All you can do is show up and do your best. Worrying about the outcomes won't |
| 56 | 54 | > affect the outcome itself. | |
| 57 | > All you can do is show up and do your best. Worrying about the | ||
| 58 | > outcomes won\'t affect the outcome itself. | ||
| 59 | 55 | ||
| 60 | The thought was extremely straightforward and uncomplicated, yet it was | 56 | The thought was extremely straightforward and uncomplicated, yet it was |
| 61 | something that I had lost sight of during my stress-filled years at | 57 | something that I had lost sight of during my stress-filled years at school. Ever |
| 62 | school. Ever since then, I\'ve found myself pausing and remembering that | 58 | since then, I've found myself pausing and remembering that quote every time I |
| 63 | quote every time I get anxious or stressed. It helps to stop and think | 59 | get anxious or stressed. It helps to stop and think "Can I do anything to |
| 64 | \"Can I do anything to affect the outcome, or am I simply worrying over | 60 | affect the outcome, or am I simply worrying over something I can't change?" |
| 65 | something I can\'t change?\" | 61 | |
| 66 | 62 | # When Mediocrity Isn't Enough | |
| 67 | # When Mediocrity Isn\'t Enough | 63 | |
| 68 | 64 | One problem with the philosophies presented in this post is that they are | |
| 69 | One problem with the philosophies presented in this post is that they | 65 | implemented far too often in situations where mediocrity simply isn't adequate. |
| 70 | are implemented far too often in situations where mediocrity simply | 66 | For example, let's take a look at digital user data, specifically |
| 71 | isn\'t adequate. For example, let\'s take a look at digital user data, | 67 | personally-identifiable information (PII). As a cybersecurity auditor in the |
| 72 | specifically personally-identifiable information (PII). As a | 68 | United States, I have found that most companies are concerned more with |
| 73 | cybersecurity auditor in the United States, I have found that most | 69 | compliance than any actual safeguards over the privacy or protection of user |
| 74 | companies are concerned more with compliance than any actual safeguards | 70 | data. Other than companies who have built their reputation on privacy and |
| 75 | over the privacy or protection of user data. Other than companies who | 71 | security, most companies will use |
| 76 | have built their reputation on privacy and security, most companies will | 72 | [satisficing](https://en.wikipedia.org/wiki/Satisficing) as their primary |
| 77 | use [satisficing](https://en.wikipedia.org/wiki/Satisficing) as their | 73 | decision-making strategy around user data. |
| 78 | primary decision-making strategy around user data. | 74 | |
| 79 | 75 | > Satisficing is a decision-making strategy or cognitive heuristic that entails | |
| 80 | > Satisficing is a decision-making strategy or cognitive heuristic that | 76 | > searching through the available alternatives until an acceptability threshold |
| 81 | > entails searching through the available alternatives until an | 77 | > is met. |
| 82 | > acceptability threshold is met. | 78 | |
| 83 | 79 | This means that each decision will be met with certain possible solutions until | |
| 84 | This means that each decision will be met with certain possible | 80 | one of the solutions meets their minimum acceptable standards. For companies |
| 85 | solutions until one of the solutions meets their minimum acceptable | 81 | that deal with user data, the minimum-acceptable standards come from three |
| 86 | standards. For companies that deal with user data, the | 82 | areas: |
| 87 | minimum-acceptable standards come from three areas: | 83 | |
| 88 | 84 | 1. Laws and regulations | |
| 89 | 1. Laws and regulations | 85 | 2. Competitive pressure |
| 90 | 2. Competitive pressure | 86 | 3. Risk of monetary or reputation loss |
| 91 | 3. Risk of monetary or reputation loss | 87 | |
| 92 | 88 | Working with project management or auditing, the primary concern here is the | |
| 93 | Working with project management or auditing, the primary concern here is | 89 | risk of legal ramifications. Since the primary risk comes from laws and |
| 94 | the risk of legal ramifications. Since the primary risk comes from laws | 90 | regulations, companies will require that any project that involves user data |
| 95 | and regulations, companies will require that any project that involves | 91 | must follow all the rules of those laws so that the company can protect itself |
| 96 | user data must follow all the rules of those laws so that the company | 92 | from fines or other penalties. |
| 97 | can protect itself from fines or other penalties. | 93 | |
| 98 | 94 | Following this, companies will consider best practices in order to place itself | |
| 99 | Following this, companies will consider best practices in order to place | 95 | in a competitive position (e.g. Google vs. Apple) and review any recent or |
| 100 | itself in a competitive position (e.g. Google vs. Apple) and review any | 96 | ongoing litigation against companies regarding user data. In a perfect company, |
| 101 | recent or ongoing litigation against companies regarding user data. In a | 97 | management would then consider the ethical responsibilities of their |
| 102 | perfect company, management would then consider the ethical | 98 | organization and discuss their responsibilities over things like |
| 103 | responsibilities of their organization and discuss their | 99 | personally-identifiable information. |
| 104 | responsibilities over things like personally-identifiable information. | 100 | |
| 105 | 101 | However, as we mentioned above, most companies follow the idea of satisficing, | |
| 106 | However, as we mentioned above, most companies follow the idea of | 102 | which states that they have met the minimum acceptable standards and can now |
| 107 | satisficing, which states that they have met the minimum acceptable | 103 | move on to other decisions. Modern business culture in the United States |
| 108 | standards and can now move on to other decisions. Modern business | 104 | dictates that profits are the golden measure of how well a company or manager is |
| 109 | culture in the United States dictates that profits are the golden | 105 | performing, so we often don't think about our responsibilities beyond these |
| 110 | measure of how well a company or manager is performing, so we often | 106 | basic standards. |
| 111 | don\'t think about our responsibilities beyond these basic standards. | 107 | |
| 112 | 108 | Not all situations demand excellence, but I believe that applying any philosophy | |
| 113 | Not all situations demand excellence, but I believe that applying any | 109 | as a broad stroke across one's life can be a mistake. We must be able to think |
| 114 | philosophy as a broad stroke across one\'s life can be a mistake. We | 110 | critically about what we are doing as we do it and ask ourselves a few |
| 115 | must be able to think critically about what we are doing as we do it and | 111 | questions. Have I done everything I can in this situation? Is mediocrity an |
| 116 | ask ourselves a few questions. Have I done everything I can in this | 112 | acceptable outcome, or should we strive for perfection, even if we can't attain |
| 117 | situation? Is mediocrity an acceptable outcome, or should we strive for | 113 | it? |
| 118 | perfection, even if we can\'t attain it? | ||
| 119 | 114 | ||
| 120 | Taking a few moments to think critically throughout our day, as we make | 115 | Taking a few moments to think critically throughout our day, as we make |
| 121 | decisions, can have a tremendous effect on the outcomes we create. | 116 | decisions, can have a tremendous effect on the outcomes we create. |
content/blog/2020-12-27-website-redesign.md +72 −81
| @@ -7,98 +7,89 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # A Brief History | 8 | # A Brief History |
| 9 | 9 | ||
| 10 | As a form of continuous learning and entertainment, I\'ve been running a | 10 | As a form of continuous learning and entertainment, I've been running a handful |
| 11 | handful of websites since 2016 when I took my first programming courses | 11 | of websites since 2016 when I took my first programming courses in college. I |
| 12 | in college. I maintain one main website, the place I consider the | 12 | maintain one main website, the place I consider the official website to |
| 13 | official website to represent me. Under this site, I have a handful of | 13 | represent me. Under this site, I have a handful of subdirectories and |
| 14 | subdirectories and subdomains. | 14 | subdomains. |
| 15 | 15 | ||
| 16 | One of the parts I\'ve enjoyed the most about web development is the | 16 | One of the parts I've enjoyed the most about web development is the aspect of |
| 17 | aspect of designing an identity for a web page and working to find | 17 | designing an identity for a web page and working to find exciting ways to |
| 18 | exciting ways to display the site\'s content. Inevitably, this means | 18 | display the site's content. Inevitably, this means I've changed the designs |
| 19 | I\'ve changed the designs for my websites more times than I could | 19 | for my websites more times than I could possibly count. Since I don't really |
| 20 | possibly count. Since I don\'t really host anything on my main webpage | 20 | host anything on my main webpage that's vital, it allows me the freedom to |
| 21 | that\'s vital, it allows me the freedom to change things as inspiration | 21 | change things as inspiration strikes. |
| 22 | strikes. | 22 | |
| 23 | 23 | Historically, I've relied on core utilities for spacing, components, and | |
| 24 | Historically, I\'ve relied on core utilities for spacing, components, | 24 | layouts from [Bootstrap](https://getbootstrap.com) and added custom CSS for |
| 25 | and layouts from [Bootstrap](https://getbootstrap.com) and added custom | 25 | fonts, accents, colors, and other items. I also tend to create sites with no |
| 26 | CSS for fonts, accents, colors, and other items. I also tend to create | 26 | border radius on items, visible borders, and content that takes up the entire |
| 27 | sites with no border radius on items, visible borders, and content that | 27 | screen (using whitespace inside components instead of whitespace around my |
| 28 | takes up the entire screen (using whitespace inside components instead | 28 | components). |
| 29 | of whitespace around my components). | ||
| 30 | 29 | ||
| 31 | # The Redesign Process | 30 | # The Redesign Process |
| 32 | 31 | ||
| 33 | About a week ago, I found myself wishing for a new design yet again. The | 32 | About a week ago, I found myself wishing for a new design yet again. The prior |
| 34 | prior design was largely inspired by IBM\'s [Carbon Design | 33 | design was largely inspired by IBM's [Carbon Design |
| 35 | System](https://www.carbondesignsystem.com) and relied on jQuery, | 34 | System](https://www.carbondesignsystem.com) and relied on jQuery, Bootstrap, |
| 36 | Bootstrap, along with some compressed | 35 | along with some compressed [.webp](https://en.wikipedia.org/wiki/WebP) images. |
| 37 | [.webp](https://en.wikipedia.org/wiki/WebP) images. | ||
| 38 | 36 | ||
| 39 | To anyone who knows my preferences toward web design - and even in my | 37 | To anyone who knows my preferences toward web design - and even in my personal |
| 40 | personal life - it should be no surprise that I immediately started | 38 | life - it should be no surprise that I immediately started looking for |
| 41 | looking for inspiration on minimalism. While there are some decent | 39 | inspiration on minimalism. While there are some decent minimalistic designs on |
| 42 | minimalistic designs on sites like | 40 | sites like |
| 43 | [Dribbble](https://dribbble.com/search/shots/popular/web-design?q=minimalism), | 41 | [Dribbble](https://dribbble.com/search/shots/popular/web-design?q=minimalism), |
| 44 | people seem to mostly discuss [brutalist web | 42 | people seem to mostly discuss [brutalist web |
| 45 | design](https://brutalist-web.design) when you ask about minimalism. | 43 | design](https://brutalist-web.design) when you ask about minimalism. While |
| 46 | While brutalist web design doesn\'t have to be minimal, it often is. | 44 | brutalist web design doesn't have to be minimal, it often is. |
| 47 | 45 | ||
| 48 | I suppose, in a way, I did create a brutalist website since my HTML is | 46 | I suppose, in a way, I did create a brutalist website since my HTML is semantic |
| 49 | semantic and accessible, hyperlinks are colored and underlined, and all | 47 | and accessible, hyperlinks are colored and underlined, and all native browser |
| 50 | native browser functions like scrolling and the back button work as | 48 | functions like scrolling and the back button work as expected. However, I |
| 51 | expected. However, I didn\'t think about brutalism while designing these | 49 | didn't think about brutalism while designing these sites. |
| 52 | sites. | 50 | |
| 53 | 51 | The new design followed a simple design process. I walked through the screens on | |
| 54 | The new design followed a simple design process. I walked through the | 52 | my blog and asked myself: "Is this element necessary for a user?" This allowed |
| 55 | screens on my blog and asked myself: \"Is this element necessary for a | 53 | me to first start by removing all javascript, which had the sole purpose of |
| 56 | user?\" This allowed me to first start by removing all javascript, which | 54 | allowing users to open a collapsed navbar on mobile. Replacing the collapsible |
| 57 | had the sole purpose of allowing users to open a collapsed navbar on | 55 | navbar allowed me to remove both jQuery and Bootstrap's javascript. |
| 58 | mobile. Replacing the collapsible navbar allowed me to remove both | 56 | |
| 59 | jQuery and Bootstrap\'s javascript. | 57 | Next, I removed things like author names (since I'm literally the only person |
| 60 | 58 | who will ever write on this site), multiple ways to click on a blog post card, | |
| 61 | Next, I removed things like author names (since I\'m literally the only | 59 | blog post descriptions, and the scroll-to-top button. It also helped to move all |
| 62 | person who will ever write on this site), multiple ways to click on a | 60 | categories to a single page, rather than have each category on its own page. |
| 63 | blog post card, blog post descriptions, and the scroll-to-top button. It | ||
| 64 | also helped to move all categories to a single page, rather than have | ||
| 65 | each category on its own page. | ||
| 66 | 61 | ||
| 67 | The final big piece to finish the | 62 | The final big piece to finish the |
| 68 | \"[KonMari](https://en.wikipedia.org/wiki/Marie_Kondo#KonMari_method)\"-like | 63 | "[KonMari](https://en.wikipedia.org/wiki/Marie_Kondo#KonMari_method)"-like |
| 69 | part of my process was to remove Bootstrap CSS in its entirety. However, | 64 | part of my process was to remove Bootstrap CSS in its entirety. However, this |
| 70 | this meant pulling out a few very useful classes, such as | 65 | meant pulling out a few very useful classes, such as `.img-fluid` and the |
| 71 | `.img-fluid` and the default font stacks to keep in my custom | 66 | default font stacks to keep in my custom CSS. |
| 72 | CSS. | 67 | |
| 73 | 68 | After removing all the unnecessary pieces, I was finally able to reorganize my | |
| 74 | After removing all the unnecessary pieces, I was finally able to | 69 | content and add a very small amount of custom CSS to make everything pretty. |
| 75 | reorganize my content and add a very small amount of custom CSS to make | 70 | This took a brief amount of time, effectively just consisting of me converting |
| 76 | everything pretty. This took a brief amount of time, effectively just | 71 | `<div>` tags into things like `<ul>` lists and choosing accent colors. |
| 77 | consisting of me converting `<div>` tags into things like | ||
| 78 | `<ul>` lists and choosing accent colors. | ||
| 79 | 72 | ||
| 80 | # The Results | 73 | # The Results |
| 81 | 74 | ||
| 82 | ## Reflection | 75 | ## Reflection |
| 83 | 76 | ||
| 84 | So, what did all of this reorganizing do to my webpages? Well, first, my | 77 | So, what did all of this reorganizing do to my webpages? Well, first, my |
| 85 | websites are now **ridiculously fast**. Since the prior designs were | 78 | websites are now **ridiculously fast**. Since the prior designs were also |
| 86 | also minimal and didn\'t have many images, they measured up in | 79 | minimal and didn't have many images, they measured up in Firefox's Network |
| 87 | Firefox\'s Network Monitor around 300 KB - 600KB. After making the | 80 | Monitor around 300 KB - 600KB. After making the changes, my main site is at 5 KB |
| 88 | changes, my main site is at 5 KB transferred (22 KB total), and my blog | 81 | transferred (22 KB total), and my blog is at 6.5 KB transferred (13 KB total). |
| 89 | is at 6.5 KB transferred (13 KB total). **That means the redesigned | 82 | **That means the redesigned pages are less than 2% the size of the old |
| 90 | pages are less than 2% the size of the old designs.** | 83 | designs.** |
| 91 | 84 | ||
| 92 | Google Lighthouse ranks the new webpage as 100 in performance, | 85 | Google Lighthouse ranks the new webpage as 100 in performance, accessibility, |
| 93 | accessibility, and best practices, with SEO at 92 since they think tap | 86 | and best practices, with SEO at 92 since they think tap targets are not sized |
| 94 | targets are not sized appropriately for mobile users. First contextual | 87 | appropriately for mobile users. First contextual paints of the pages are under |
| 95 | paints of the pages are under 0.8 seconds with 0 ms of blocking time. | 88 | 0.8 seconds with 0 ms of blocking time. However, the blog subdomain ranks at 100 |
| 96 | However, the blog subdomain ranks at 100 for all four categories! First | 89 | for all four categories! First contextual paints of the blog homepage are under |
| 97 | contextual paints of the blog homepage are under 1.0 seconds with 0 ms | 90 | 1.0 seconds with 0 ms of blocking time, due to the fact that the CSS for my blog |
| 98 | of blocking time, due to the fact that the CSS for my blog is within a | 91 | is within a separate CSS file, and the CSS for my main website is simply |
| 99 | separate CSS file, and the CSS for my main website is simply embedded in | 92 | embedded in the HTML file. |
| 100 | the HTML file. | 93 | |
| 101 | 94 | Now that everything is complete, I can confidently say I'm happy with the | |
| 102 | Now that everything is complete, I can confidently say I\'m happy with | 95 | result and proud to look at the fastest set of websites I've created so far. |
| 103 | the result and proud to look at the fastest set of websites I\'ve | ||
| 104 | created so far. | ||
content/blog/2020-12-28-neon-drive.md +48 −51
| @@ -7,51 +7,49 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Game Description | 8 | # Game Description |
| 9 | 9 | ||
| 10 | [Neon Drive](https://store.steampowered.com/app/433910/Neon_Drive/) | 10 | [Neon Drive](https://store.steampowered.com/app/433910/Neon_Drive/) presents |
| 11 | presents itself as a simple arcade-style game inspired by the arcade | 11 | itself as a simple arcade-style game inspired by the arcade race games of the |
| 12 | race games of the 1980s, yet it has managed to take up hours of my life | 12 | 1980s, yet it has managed to take up hours of my life without much effort. The |
| 13 | without much effort. The game description, directly from the Steam page, | 13 | game description, directly from the Steam page, is intriguing enough to entice |
| 14 | is intriguing enough to entice anyone who\'s been looking for a good | 14 | anyone who's been looking for a good arcade racing game: |
| 15 | arcade racing game: | ||
| 16 | 15 | ||
| 17 | > Neon Drive is a slick retro-futuristic arcade game that will make your | 16 | > Neon Drive is a slick retro-futuristic arcade game that will make your brain |
| 18 | > brain melt. You\'ve been warned. From beautiful cityscapes and ocean | 17 | > melt. You've been warned. From beautiful cityscapes and ocean roads to |
| 19 | > roads to exploding enemy spaceships, Neon Drive has it all. | 18 | > exploding enemy spaceships, Neon Drive has it all. |
| 20 | 19 | ||
| 21 | # Gameplay | 20 | # Gameplay |
| 22 | 21 | ||
| 23 | The game holds true to the | 22 | The game holds true to the |
| 24 | [retro-futurism](https://en.wikipedia.org/wiki/Retrofuturism) style, | 23 | [retro-futurism](https://en.wikipedia.org/wiki/Retrofuturism) style, including |
| 25 | including chrome female robots, pixelated arcade machines, and | 24 | chrome female robots, pixelated arcade machines, and |
| 26 | [outrun](https://teddit.net/r/outrun/) aesthetics. | 25 | [outrun](https://teddit.net/r/outrun/) aesthetics. |
| 27 | 26 | ||
| 28 | Each level of the game is shown as a separate arcade machine. Each | 27 | Each level of the game is shown as a separate arcade machine. Each arcade |
| 29 | arcade machine lets you play on Normal, Hard, Insane, Practice, and Free | 28 | machine lets you play on Normal, Hard, Insane, Practice, and Free Run. To beat |
| 30 | Run. To beat each arcade, you must reach the end of the level without | 29 | each arcade, you must reach the end of the level without crashing your car into |
| 31 | crashing your car into the various obstacles on the course. Basic levels | 30 | the various obstacles on the course. Basic levels let you move left or right to |
| 32 | let you move left or right to avoid blocks in the road. Later levels put | 31 | avoid blocks in the road. Later levels put you through other tests, such as |
| 33 | you through other tests, such as dodging traffic or blasting asteroids. | 32 | dodging traffic or blasting asteroids. |
| 34 | 33 | ||
| 35 | The game uses synthwave music to keep you on track to make the correct | 34 | The game uses synthwave music to keep you on track to make the correct moves by |
| 36 | moves by timing the beats of the songs to the correct moves on the | 35 | timing the beats of the songs to the correct moves on the screen. It reminds me |
| 37 | screen. It reminds me of the early Guitar Hero games, as well as mobile | 36 | of the early Guitar Hero games, as well as mobile apps like VOEZ - repetition |
| 38 | apps like VOEZ - repetition and staying on-beat is the only way to win. | 37 | and staying on-beat is the only way to win. |
| 39 | 38 | ||
| 40 | # In-Game Screenshots | 39 | # In-Game Screenshots |
| 41 | 40 | ||
| 42 | Taking a look at the main menu, you can see that Neon Drive plays into | 41 | Taking a look at the main menu, you can see that Neon Drive plays into every |
| 43 | every stereotype you can think of around retro-futuristic, synthwave | 42 | stereotype you can think of around retro-futuristic, synthwave arcades (in a |
| 44 | arcades (in a good way). | 43 | good way). |
| 45 | 44 | ||
| 46 |  | 46 | Menu](https://img.cleberg.net/blog/20201228-neon-drive/neon_drive_menu.png) |
| 48 | 47 | ||
| 49 | Once you get into the first level, we see that the choice of car fits | 48 | Once you get into the first level, we see that the choice of car fits right in |
| 50 | right in with the stereotypical cars of the 80s, like the | 49 | with the stereotypical cars of the 80s, like the |
| 51 | [DeLorean](https://en.wikipedia.org/wiki/DMC_DeLorean) or the [Ferrari | 50 | [DeLorean](https://en.wikipedia.org/wiki/DMC_DeLorean) or the [Ferrari |
| 52 | F40](https://en.wikipedia.org/wiki/Ferrari_F40). Each new level comes | 51 | F40](https://en.wikipedia.org/wiki/Ferrari_F40). Each new level comes with new |
| 53 | with new color schemes and cars, so you should never get tired of the | 52 | color schemes and cars, so you should never get tired of the aesthetic. |
| 54 | aesthetic. | ||
| 55 | 53 | ||
| 56 |  | 55 | Race](https://img.cleberg.net/blog/20201228-neon-drive/neon_drive_race.png) |
| @@ -61,35 +59,34 @@ Personally, I love the orange and blue colors used in level 2: | |||
| 61 |  | 60 | 2](https://img.cleberg.net/blog/20201228-neon-drive/neon_drive_level_2.png) |
| 63 | 61 | ||
| 64 | If you\'re the competitive type and getting 100% on all arcade machines | 62 | If you're the competitive type and getting 100% on all arcade machines isn't |
| 65 | isn\'t enough, there are leaderboards for the regular part of the game, | 63 | enough, there are leaderboards for the regular part of the game, and the |
| 66 | and the endurance game mode. | 64 | endurance game mode. |
| 67 | 65 | ||
| 68 |  | 66 |  |
| 69 | 67 | ||
| 70 | # Other Suggestions | 68 | # Other Suggestions |
| 71 | 69 | ||
| 72 | Neon Drive sits nicely within the well-founded cult genre of Outrun. | 70 | Neon Drive sits nicely within the well-founded cult genre of Outrun. Other games |
| 73 | Other games that I\'ve enjoyed in this same spectrum are: | 71 | that I've enjoyed in this same spectrum are: |
| 74 | 72 | ||
| 75 | - [Far Cry 3: Blood | 73 | - [Far Cry 3: Blood |
| 76 | Dragon](https://store.steampowered.com/app/233270/Far_Cry_3__Blood_Dragon/) | 74 | Dragon](https://store.steampowered.com/app/233270/Far_Cry_3__Blood_Dragon/) |
| 77 | - [Retrowave](https://store.steampowered.com/app/1239690/Retrowave/) | 75 | - [Retrowave](https://store.steampowered.com/app/1239690/Retrowave/) |
| 78 | - [Slipstream](https://store.steampowered.com/app/732810/Slipstream/) | 76 | - [Slipstream](https://store.steampowered.com/app/732810/Slipstream/) |
| 79 | 77 | ||
| 80 | Although these games aren\'t necessarily in the same genre, they do have | 78 | Although these games aren't necessarily in the same genre, they do have aspects |
| 81 | aspects that place them close enough to interest gamers that enjoyed | 79 | that place them close enough to interest gamers that enjoyed Neon Drive: |
| 82 | Neon Drive: | ||
| 83 | 80 | ||
| 84 | - [Black Ice](https://store.steampowered.com/app/311800/Black_Ice/) | 81 | - [Black Ice](https://store.steampowered.com/app/311800/Black_Ice/) |
| 85 | - [Cloudpunk](https://store.steampowered.com/app/746850/Cloudpunk/) | 82 | - [Cloudpunk](https://store.steampowered.com/app/746850/Cloudpunk/) |
| 86 | - [Need for Speed: | 83 | - [Need for Speed: |
| 87 | Heat](https://store.steampowered.com/app/1222680/Need_for_Speed_Heat/) | 84 | Heat](https://store.steampowered.com/app/1222680/Need_for_Speed_Heat/) |
| 88 | - [VirtuaVerse](https://store.steampowered.com/app/1019310/VirtuaVerse/) | 85 | - [VirtuaVerse](https://store.steampowered.com/app/1019310/VirtuaVerse/) |
| 89 | 86 | ||
| 90 | Of course, if all you really care about is the arcade aspect of these | 87 | Of course, if all you really care about is the arcade aspect of these games, you |
| 91 | games, you can check out the [Atari | 88 | can check out the [Atari |
| 92 | Vault](https://store.steampowered.com/app/400020/Atari_Vault/) or any of | 89 | Vault](https://store.steampowered.com/app/400020/Atari_Vault/) or any of the |
| 93 | the other classic games sold on Steam by companies like Namco, Atari. | 90 | other classic games sold on Steam by companies like Namco, Atari. For something |
| 94 | For something like Nintendo, you\'d have to settle for buying used | 91 | like Nintendo, you'd have to settle for buying used classic consoles or delve |
| 95 | classic consoles or delve into the world of emulation. | 92 | into the world of emulation. |
content/blog/2020-12-29-zork.md +59 −68
| @@ -7,34 +7,33 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Download (Free) | 8 | # Download (Free) |
| 9 | 9 | ||
| 10 | Before we get into the game itself, you should know that you can | 10 | Before we get into the game itself, you should know that you can download Zork |
| 11 | download Zork for free from Infocom\'s [download | 11 | for free from Infocom's [download |
| 12 | page](http://infocom-if.org/downloads/downloads.html). So feel free to | 12 | page](http://infocom-if.org/downloads/downloads.html). So feel free to boot it |
| 13 | boot it up and take a ride back to the 1980s with this masterpiece. | 13 | up and take a ride back to the 1980s with this masterpiece. |
| 14 | 14 | ||
| 15 | # Game Description | 15 | # Game Description |
| 16 | 16 | ||
| 17 | Zork is an interactive, text-based computer game originally released in | 17 | Zork is an interactive, text-based computer game originally released in |
| 18 | 1980. This series, split into three separate games, introduced a robust | 18 | 1980. This series, split into three separate games, introduced a robust and |
| 19 | and sophisticated text parser to gamers. People were largely used to the | 19 | sophisticated text parser to gamers. People were largely used to the simple |
| 20 | simple commands used in the popular game [Colossal Cave | 20 | commands used in the popular game [Colossal Cave |
| 21 | Adventure](https://en.wikipedia.org/wiki/Colossal_Cave_Adventure), but | 21 | Adventure](https://en.wikipedia.org/wiki/Colossal_Cave_Adventure), but Zork |
| 22 | Zork allowed users to send more complex commands that included | 22 | allowed users to send more complex commands that included prepositions and |
| 23 | prepositions and conjunctions. | 23 | conjunctions. |
| 24 | 24 | ||
| 25 | Zork tracks your score as you explore the map, find tools, and collect | 25 | Zork tracks your score as you explore the map, find tools, and collect trophy |
| 26 | trophy items (e.g., a jewel-encrusted egg). When you place your trophy | 26 | items (e.g., a jewel-encrusted egg). When you place your trophy items in the |
| 27 | items in the trophy case found in the Living Room area, you gain score | 27 | trophy case found in the Living Room area, you gain score points. Collecting the |
| 28 | points. Collecting the Twenty Treasures of Zork and placing them within | 28 | Twenty Treasures of Zork and placing them within the trophy case wins the game. |
| 29 | the trophy case wins the game. However, you must explore the map, solve | 29 | However, you must explore the map, solve puzzles, and avoid being eaten by a |
| 30 | puzzles, and avoid being eaten by a grue to collect these treasures. | 30 | grue to collect these treasures. |
| 31 | 31 | ||
| 32 | # The Map | 32 | # The Map |
| 33 | 33 | ||
| 34 | Since Zork is a vast and complex game, it helps to have a map as you | 34 | Since Zork is a vast and complex game, it helps to have a map as you explore and |
| 35 | explore and collect your trophies. However, if you want to play the game | 35 | collect your trophies. However, if you want to play the game as it was truly |
| 36 | as it was truly intended, you should try to play it without using the | 36 | intended, you should try to play it without using the map. |
| 37 | map. | ||
| 38 | 37 | ||
| 39 |  | 38 |  |
| 40 | 39 | ||
| @@ -42,55 +41,47 @@ map. | |||
| 42 | 41 | ||
| 43 | # In-Game Screenshots | 42 | # In-Game Screenshots |
| 44 | 43 | ||
| 45 | After playing the game (for the first time ever) for several weeks | 44 | After playing the game (for the first time ever) for several weeks around 2014, |
| 46 | around 2014, I was finally able to beat the game with some online help | 45 | I was finally able to beat the game with some online help to find the last |
| 47 | to find the last couple items. As I was writing this post, I installed | 46 | couple items. As I was writing this post, I installed the game again to grab |
| 48 | the game again to grab some screenshots to show off the true glory of | 47 | some screenshots to show off the true glory of this game. As noted in [Jimmy |
| 49 | this game. As noted in [Jimmy Maher\'s | 48 | Maher's playthrough](https://www.filfre.net/2012/01/exploring-zork-part-1/), |
| 50 | playthrough](https://www.filfre.net/2012/01/exploring-zork-part-1/), the | 49 | the original Zork games looked quite a bit different due to the older hardware |
| 51 | original Zork games looked quite a bit different due to the older | 50 | of computers like the Apple II and multiple bug fixes that Infocom pushed out |
| 52 | hardware of computers like the Apple II and multiple bug fixes that | 51 | after the game's initial release. My play-through uses the [Zork |
| 53 | Infocom pushed out after the game\'s initial release. My play-through | 52 | Anthology](https://store.steampowered.com/app/570580/Zork_Anthology/) version, |
| 54 | uses the [Zork | 53 | which utilizes DOSBox on Windows. |
| 55 | Anthology](https://store.steampowered.com/app/570580/Zork_Anthology/) | 54 | |
| 56 | version, which utilizes DOSBox on Windows. | 55 | The first screenshot here shows the introductory information, which doesn't |
| 57 | 56 | include instructions of any kind for the player. If you haven't played text | |
| 58 | The first screenshot here shows the introductory information, which | 57 | adventures before, try to use simple commands like "go west," "look around," |
| 59 | doesn\'t include instructions of any kind for the player. If you | 58 | or "hit troll with elvish sword." |
| 60 | haven\'t played text adventures before, try to use simple commands like | 59 | |
| 61 | \"go west,\" \"look around,\" or \"hit troll with elvish sword.\" | 60 |  |
| 62 | 61 | ||
| 63 |  | 63 | trophy case in the living room. The lantern and sword in this room allow the |
| 65 | 64 | player to explore dark areas and attack enemies. If you don't use the lantern, | |
| 66 | In this second screenshot, we see the player has entered the house and | 65 | you won't be able to see anything in dark areas, and you may be eaten by a |
| 67 | found the trophy case in the living room. The lantern and sword in this | 66 | grue. |
| 68 | room allow the player to explore dark areas and attack enemies. If you | 67 | |
| 69 | don\'t use the lantern, you won\'t be able to see anything in dark | 68 |  |
| 70 | areas, and you may be eaten by a grue. | 69 | |
| 71 | 70 | Finally, we see that the player has found the first treasure: a jewel-encrusted | |
| 72 |  | 72 | case or carried until you feel like you want to put things away. |
| 74 | 73 | ||
| 75 | Finally, we see that the player has found the first treasure: a | 74 |  |
| 76 | jewel-encrusted egg. These treasures can be taken back to the house and | ||
| 77 | placed in the trophy case or carried until you feel like you want to put | ||
| 78 | things away. | ||
| 79 | |||
| 80 |  | ||
| 82 | 75 | ||
| 83 | # Conclusion | 76 | # Conclusion |
| 84 | 77 | ||
| 85 | It\'s been quite a few years since I first played Zork, but I clearly | 78 | It's been quite a few years since I first played Zork, but I clearly remember |
| 86 | remember the late nights and bloodshot eyes that helped me find all the | 79 | the late nights and bloodshot eyes that helped me find all the treasures. This |
| 87 | treasures. This game is well worth the time and effort, even though the | 80 | game is well worth the time and effort, even though the text-based aspect may be |
| 88 | text-based aspect may be off-putting to gamers who didn\'t have to grow | 81 | off-putting to gamers who didn't have to grow up playing games without |
| 89 | up playing games without graphics. However, I believe that the strategy | 82 | graphics. However, I believe that the strategy and skills learned in early video |
| 90 | and skills learned in early video games like Zork can actually help you, | 83 | games like Zork can actually help you, even when playing newer games. |
| 91 | even when playing newer games. | ||
| 92 | 84 | ||
| 93 | If you do decide to play Zork, you can download Zork I, II, and III from | 85 | If you do decide to play Zork, you can download Zork I, II, and III from |
| 94 | Infocom\'s [download | 86 | Infocom's [download page](http://infocom-if.org/downloads/downloads.html) for |
| 95 | page](http://infocom-if.org/downloads/downloads.html) for free or search | 87 | free or search the internet for an online version. |
| 96 | the internet for an online version. | ||
content/blog/2021-01-01-seum.md +51 −58
| @@ -8,86 +8,79 @@ draft = false | |||
| 8 | # Game Description | 8 | # Game Description |
| 9 | 9 | ||
| 10 | [SEUM: Speedrunners from | 10 | [SEUM: Speedrunners from |
| 11 | Hell](https://store.steampowered.com/app/457210/SEUM_Speedrunners_from_Hell/) | 11 | Hell](https://store.steampowered.com/app/457210/SEUM_Speedrunners_from_Hell/) is |
| 12 | is an incredibly fast-paced mashup of a puzzle game and a free-running | 12 | an incredibly fast-paced mashup of a puzzle game and a free-running game. |
| 13 | game. Created by [Pine Studio](https://pinestudio.co) in early 2016 and | 13 | Created by [Pine Studio](https://pinestudio.co) in early 2016 and first released |
| 14 | first released as a [demo on | 14 | as a [demo on |
| 15 | GameJolt](https://gamejolt.com/games/seum-speedrunners-from-hell-demo/154868), | 15 | GameJolt](https://gamejolt.com/games/seum-speedrunners-from-hell-demo/154868), |
| 16 | this game was successfully green-lit on Steam and has amassed a cult | 16 | this game was successfully green-lit on Steam and has amassed a cult following |
| 17 | following on multiple consoles. | 17 | on multiple consoles. |
| 18 | 18 | ||
| 19 | Here\'s the game description straight from the developers: | 19 | Here's the game description straight from the developers: |
| 20 | 20 | ||
| 21 | > Like a bastard child of Quake 3 and Super Meat Boy, SEUM: Speedrunners | 21 | > Like a bastard child of Quake 3 and Super Meat Boy, SEUM: Speedrunners from |
| 22 | > from Hell is truly hardcore and focuses on speed and fast reaction. | 22 | > Hell is truly hardcore and focuses on speed and fast reaction. |
| 23 | 23 | ||
| 24 | # Story | 24 | # Story |
| 25 | 25 | ||
| 26 | SEUM does a great job setting the stage when you open the game for the | 26 | SEUM does a great job setting the stage when you open the game for the first |
| 27 | first time, playing an animated video in the form of comic book images. | 27 | time, playing an animated video in the form of comic book images. You see Marty, |
| 28 | You see Marty, the protagonist, sitting around drinking his beer as | 28 | the protagonist, sitting around drinking his beer as Satan busts down the door, |
| 29 | Satan busts down the door, cuts his hand off, and steals all his beer | 29 | cuts his hand off, and steals all his beer and bacon. As Satan is leaving, Marty |
| 30 | and bacon. As Satan is leaving, Marty whips a vinyl record across the | 30 | whips a vinyl record across the room and cuts off one of Satan's hands. This |
| 31 | room and cuts off one of Satan\'s hands. This hand is what allows you to | 31 | hand is what allows you to use all the powers in the game. |
| 32 | use all the powers in the game. | ||
| 33 | 32 | ||
| 34 | Check out the screenshot below for one of the first panels of the | 33 | Check out the screenshot below for one of the first panels of the storyline: |
| 35 | storyline: | ||
| 36 | 34 | ||
| 37 |  | 35 |  |
| 38 | 36 | ||
| 39 | # Gameplay | 37 | # Gameplay |
| 40 | 38 | ||
| 41 | To accomplish each level, you will need to get to the final blue portal | 39 | To accomplish each level, you will need to get to the final blue portal under a |
| 42 | under a certain time limit. You can beat a level by getting to the | 40 | certain time limit. You can beat a level by getting to the portal before the |
| 43 | portal before the time meter runs out or \"Dominate\" a level by beating | 41 | time meter runs out or "Dominate" a level by beating it within a shorter time |
| 44 | it within a shorter time limit (noted by a bright red/orange color in | 42 | limit (noted by a bright red/orange color in the time meter). |
| 45 | the time meter). | 43 | |
| 46 | 44 | The portal is usually set behind locked gates, protected by dangerous defenses, | |
| 47 | The portal is usually set behind locked gates, protected by dangerous | 45 | or in hard-to-reach places. To reach the portal, you'll need to go through any |
| 48 | defenses, or in hard-to-reach places. To reach the portal, you\'ll need | 46 | existing orange portals, light all yellow beacons, avoid things like fireballs |
| 49 | to go through any existing orange portals, light all yellow beacons, | 47 | and blades, or use any satanic power orbs lying around. These special abilities |
| 50 | avoid things like fireballs and blades, or use any satanic power orbs | 48 | include: |
| 51 | lying around. These special abilities include: | 49 | |
| 52 | 50 | - Gravity | |
| 53 | - Gravity | 51 | - Teleport |
| 54 | - Teleport | 52 | - Rewind |
| 55 | - Rewind | 53 | - Spawn platform |
| 56 | - Spawn platform | 54 | - Roar (DLC) |
| 57 | - Roar (DLC) | 55 | - Rocket (DLC) |
| 58 | - Rocket (DLC) | 56 | - Shadow world (DLC) |
| 59 | - Shadow world (DLC) | 57 | |
| 60 | 58 | For the main storyline, there are nine floors to beat. Each floor contains nine | |
| 61 | For the main storyline, there are nine floors to beat. Each floor | 59 | regular levels, one boss level, and one bonus level; although you don't |
| 62 | contains nine regular levels, one boss level, and one bonus level; | 60 | technically need to beat all levels to advance to the next floor. |
| 63 | although you don\'t technically need to beat all levels to advance to | 61 | |
| 64 | the next floor. | 62 |  |
| 65 | |||
| 66 |  | ||
| 68 | 63 | ||
| 69 | # In-Game Screenshots | 64 | # In-Game Screenshots |
| 70 | 65 | ||
| 71 | The main menu gives you plenty of options for tuning your system, | 66 | The main menu gives you plenty of options for tuning your system, playing main |
| 72 | playing main levels, playing the DLC, or exploring the other game modes. | 67 | levels, playing the DLC, or exploring the other game modes. |
| 73 | 68 | ||
| 74 |  |
| 75 | Menu](https://img.cleberg.net/blog/20210101-seum/seum_menu.png) | ||
| 76 | 70 | ||
| 77 | Once you enter a level, you can look around and strategize before | 71 | Once you enter a level, you can look around and strategize before starting. |
| 78 | starting. Clicking any button will start the menu, and you\'ll have to | 72 | Clicking any button will start the menu, and you'll have to restart if you die. |
| 79 | restart if you die. One of the great things about SEUM is that it has | 73 | One of the great things about SEUM is that it has great keyboard shortcuts. You |
| 80 | great keyboard shortcuts. You can quickly smash `R` to | 74 | can quickly smash `R` to restart the level or `M` to return to the level menu. |
| 81 | restart the level or `M` to return to the level menu. | ||
| 82 | 75 | ||
| 83 |  | 76 |  |
| 84 | 77 | ||
| 85 | Once you\'re able to win a level, you\'ll see the high scores and can | 78 | Once you're able to win a level, you'll see the high scores and can watch |
| 86 | watch replays of the best scores. | 79 | replays of the best scores. |
| 87 | 80 | ||
| 88 |  | 81 |  |
| 89 | 82 | ||
| 90 | Each regular level contains a beer in a disguised location that may take | 83 | Each regular level contains a beer in a disguised location that may take some |
| 91 | some out-of-the-box thinking. | 84 | out-of-the-box thinking. |
| 92 | 85 | ||
| 93 |  | 86 |  |
content/blog/2021-01-04-fediverse.md +56 −60
| @@ -7,101 +7,97 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # What is the Fediverse? | 8 | # What is the Fediverse? |
| 9 | 9 | ||
| 10 | The fediverse is a federated universe of servers commonly used for | 10 | The fediverse is a federated universe of servers commonly used for sharing |
| 11 | sharing content, like social media. So, instead of having to rely on a | 11 | content, like social media. So, instead of having to rely on a single |
| 12 | single organization to run the server (e.g. Facebook), the fediverse is | 12 | organization to run the server (e.g. Facebook), the fediverse is a giant |
| 13 | a giant collection of servers across the world, owned by many people and | 13 | collection of servers across the world, owned by many people and organizations. |
| 14 | organizations. | 14 | |
| 15 | 15 | Take a look at this depiction of a federated network. Each server in this photo | |
| 16 | Take a look at this depiction of a federated network. Each server in | 16 | is owned and run by different administrators/owners. Federated networks are best |
| 17 | this photo is owned and run by different administrators/owners. | 17 | explained as email servers: you have an email account that exists on a server |
| 18 | Federated networks are best explained as email servers: you have an | 18 | (e.g. Outlook), your friend has an account on a different server (e.g. GMail), |
| 19 | email account that exists on a server (e.g. Outlook), your friend has an | 19 | and another friend has an account on a third server (e.g. ProtonMail). All three |
| 20 | account on a different server (e.g. GMail), and another friend has an | 20 | of you can talk and communicate back and forth without having to be on the same |
| 21 | account on a third server (e.g. ProtonMail). All three of you can talk | 21 | server. However, responsible email admins are there to set rules and control the |
| 22 | and communicate back and forth without having to be on the same server. | ||
| 23 | However, responsible email admins are there to set rules and control the | ||
| 24 | traffic going in/out of the server. | 22 | traffic going in/out of the server. |
| 25 | 23 | ||
| 26 |  | 25 | diagram](https://img.cleberg.net/blog/20210104-a-simple-guide-to-the-fediverse/federated-example.svg) |
| 28 | 26 | ||
| 29 | The main objective of this architecture is to decentralize the control | 27 | The main objective of this architecture is to decentralize the control within |
| 30 | within the internet connections. For example, if you run your own | 28 | the internet connections. For example, if you run your own Mastodon instance, |
| 31 | Mastodon instance, you and your users can\'t be censored or impacted in | 29 | you and your users can't be censored or impacted in any way by authorities of |
| 32 | any way by authorities of another Mastodon instance. Some users have | 30 | another Mastodon instance. Some users have praised these features due to recent |
| 33 | praised these features due to recent criticism of popular social media | 31 | criticism of popular social media websites that may be over-censoring their |
| 34 | websites that may be over-censoring their users. | 32 | users. |
| 35 | 33 | ||
| 36 | This strategy is great for making sure control of the social web isn\'t | 34 | This strategy is great for making sure control of the social web isn't |
| 37 | controlled by a single organization, but it also has some downsides. If | 35 | controlled by a single organization, but it also has some downsides. If I create |
| 38 | I create a Mastodon instance and get a ton of users to sign up, I can | 36 | a Mastodon instance and get a ton of users to sign up, I can shut the server |
| 39 | shut the server down at any time. That means you\'re at risk of losing | 37 | down at any time. That means you're at risk of losing the content you've |
| 40 | the content you\'ve created unless you back it up, or the server backs | 38 | created unless you back it up, or the server backs it up for you. Also, |
| 41 | it up for you. Also, depending on the software used (e.g. Mastodon, | 39 | depending on the software used (e.g. Mastodon, Pixelfed, etc.), censorship may |
| 42 | Pixelfed, etc.), censorship may still be an issue if the server admins | 40 | still be an issue if the server admins decide they want to censor their users. |
| 43 | decide they want to censor their users. Now, censorship isn\'t always a | 41 | Now, censorship isn't always a bad thing and can even benefit the community as |
| 44 | bad thing and can even benefit the community as a whole, but you\'ll | 42 | a whole, but you'll want to determine which servers align with your idea of |
| 45 | want to determine which servers align with your idea of proper | 43 | proper censorship. |
| 46 | censorship. | 44 | |
| 47 | 45 | However, these are risks that we take when we sign up for any online platform. | |
| 48 | However, these are risks that we take when we sign up for any online | 46 | Whatever your reason is for trying out federated social networks, they are part |
| 49 | platform. Whatever your reason is for trying out federated social | 47 | of the future of the internet. However, the popularity of these services is |
| 50 | networks, they are part of the future of the internet. However, the | 48 | still yet to be determined, especially with the increased difficulty |
| 51 | popularity of these services is still yet to be determined, especially | 49 | understanding and signing up for these platforms. Perhaps increased regulation |
| 52 | with the increased difficulty understanding and signing up for these | 50 | and litigation against current social media sites will push more users into the |
| 53 | platforms. Perhaps increased regulation and litigation against current | 51 | fediverse. |
| 54 | social media sites will push more users into the fediverse. | ||
| 55 | 52 | ||
| 56 | # Federated Alternatives to Popular Sites | 53 | # Federated Alternatives to Popular Sites |
| 57 | 54 | ||
| 58 | The list below is a small guide that will show you federated | 55 | The list below is a small guide that will show you federated alternatives to |
| 59 | alternatives to current popular websites. There are many more out there, | 56 | current popular websites. There are many more out there, so go and explore: you |
| 60 | so go and explore: you might just find the perfect home. | 57 | might just find the perfect home. |
| 61 | 58 | ||
| 62 | 59 | ||
| 63 | 60 | ||
| 64 | - [Lemmy](https://lemmy.ml/instances) | 61 | - [Lemmy](https://lemmy.ml/instances) |
| 65 | 62 | ||
| 66 | ## Twitter/Facebook/Tumblr | 63 | ## Twitter/Facebook/Tumblr |
| 67 | 64 | ||
| 68 | - [Mastodon](https://joinmastodon.org) | 65 | - [Mastodon](https://joinmastodon.org) |
| 69 | - [Diaspora](https://diasporafoundation.org) | 66 | - [Diaspora](https://diasporafoundation.org) |
| 70 | - [Friendica](https://friendi.ca) | 67 | - [Friendica](https://friendi.ca) |
| 71 | - [GNU Social](https://gnusocial.network) | 68 | - [GNU Social](https://gnusocial.network) |
| 72 | - [Pleroma](https://pleroma.social) | 69 | - [Pleroma](https://pleroma.social) |
| 73 | 70 | ||
| 74 | 71 | ||
| 75 | 72 | ||
| 76 | - [Pixelfed](https://pixelfed.org) | 73 | - [Pixelfed](https://pixelfed.org) |
| 77 | 74 | ||
| 78 | ## Slack/Discord | 75 | ## Slack/Discord |
| 79 | 76 | ||
| 80 | - [Matrix](https://element.io) | 77 | - [Matrix](https://element.io) |
| 81 | 78 | ||
| 82 | ## Youtube/Vimeo | 79 | ## Youtube/Vimeo |
| 83 | 80 | ||
| 84 | - [Peertube](https://joinpeertube.org) | 81 | - [Peertube](https://joinpeertube.org) |
| 85 | 82 | ||
| 86 | ## Spotify/Soundcloud | 83 | ## Spotify/Soundcloud |
| 87 | 84 | ||
| 88 | - [Funkwhale](https://funkwhale.audio) | 85 | - [Funkwhale](https://funkwhale.audio) |
| 89 | 86 | ||
| 90 | ## Podcasting | 87 | ## Podcasting |
| 91 | 88 | ||
| 92 | - [Pubcast](https://pubcast.pub) | 89 | - [Pubcast](https://pubcast.pub) |
| 93 | 90 | ||
| 94 | ## Medium/Blogger | 91 | ## Medium/Blogger |
| 95 | 92 | ||
| 96 | - [WriteFreely](https://writefreely.org) | 93 | - [WriteFreely](https://writefreely.org) |
| 97 | 94 | ||
| 98 | # Get Started | 95 | # Get Started |
| 99 | 96 | ||
| 100 | The best way to get started is to simply sign up and learn as you go. If | 97 | The best way to get started is to simply sign up and learn as you go. If you're |
| 101 | you\'re comfortable signing up through a Mastodon, Pleroma, or Friendica | 98 | comfortable signing up through a Mastodon, Pleroma, or Friendica server, here is |
| 102 | server, here is [a list of themed | 99 | [a list of themed servers](https://fediverse.party/en/portal/servers) to choose |
| 103 | servers](https://fediverse.party/en/portal/servers) to choose from. If | 100 | from. If you're looking for something else, try a web search for a federated |
| 104 | you\'re looking for something else, try a web search for a federated | ||
| 105 | alternative to your favorite sites. | 101 | alternative to your favorite sites. |
| 106 | 102 | ||
| 107 | Find a server that focuses on your passions and start there! | 103 | Find a server that focuses on your passions and start there! |
content/blog/2021-01-07-ufw.md +52 −57
| @@ -7,30 +7,29 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Uncomplicated Firewall | 8 | # Uncomplicated Firewall |
| 9 | 9 | ||
| 10 | Uncomplicated Firewall, also known as ufw, is a convenient and | 10 | Uncomplicated Firewall, also known as ufw, is a convenient and beginner-friendly |
| 11 | beginner-friendly way to enforce OS-level firewall rules. For those who | 11 | way to enforce OS-level firewall rules. For those who are hosting servers or any |
| 12 | are hosting servers or any device that is accessible to the world (i.e., | 12 | device that is accessible to the world (i.e., by public IP or domain name), |
| 13 | by public IP or domain name), it\'s critical that a firewall is properly | 13 | it's critical that a firewall is properly implemented and active. |
| 14 | implemented and active. | 14 | |
| 15 | 15 | Ufw is available by default in all Ubuntu installations after 8.04 LTS. For | |
| 16 | Ufw is available by default in all Ubuntu installations after 8.04 LTS. | 16 | other distributions, you can look to install ufw or check if there are |
| 17 | For other distributions, you can look to install ufw or check if there | 17 | alternative firewalls installed already. There are usually alternatives |
| 18 | are alternative firewalls installed already. There are usually | 18 | available, such as Fedora's `firewall` and the package available on most |
| 19 | alternatives available, such as Fedora\'s `firewall` and the | 19 | distributions: `iptables`. Ufw is considered a beginner-friendly front-end to |
| 20 | package available on most distributions: `iptables`. Ufw is | 20 | iptables. |
| 21 | considered a beginner-friendly front-end to iptables. | 21 | |
| 22 | 22 | [Gufw](https://gufw.org) is available as a graphical user interface (GUI) | |
| 23 | [Gufw](https://gufw.org) is available as a graphical user interface | 23 | application for users who are uncomfortable setting up a firewall through a |
| 24 | (GUI) application for users who are uncomfortable setting up a firewall | 24 | terminal. |
| 25 | through a terminal. | ||
| 26 | 25 | ||
| 27 |  | 27 | Screenshot](https://img.cleberg.net/blog/20210107-secure-your-network-with-the-uncomplicated-firewall/gufw.png) |
| 29 | 28 | ||
| 30 | # Getting Help | 29 | # Getting Help |
| 31 | 30 | ||
| 32 | If you need help figuring out commands, remember that you can run the | 31 | If you need help figuring out commands, remember that you can run the `--help` |
| 33 | `--help` flag to get a list of options. | 32 | flag to get a list of options. |
| 34 | 33 | ||
| 35 | ```sh | 34 | ```sh |
| 36 | sudo ufw --help | 35 | sudo ufw --help |
| @@ -38,20 +37,19 @@ sudo ufw --help | |||
| 38 | 37 | ||
| 39 | # Set Default State | 38 | # Set Default State |
| 40 | 39 | ||
| 41 | The proper way to run a firewall is to set a strict default state and | 40 | The proper way to run a firewall is to set a strict default state and slowly |
| 42 | slowly open up ports that you want to allow. This helps prevent anything | 41 | open up ports that you want to allow. This helps prevent anything malicious from |
| 43 | malicious from slipping through the cracks. The following command | 42 | slipping through the cracks. The following command prevents all incoming traffic |
| 44 | prevents all incoming traffic (other than the rules we specify later), | 43 | (other than the rules we specify later), but you can also set this for outgoing |
| 45 | but you can also set this for outgoing connections, if necessary. | 44 | connections, if necessary. |
| 46 | 45 | ||
| 47 | ```sh | 46 | ```sh |
| 48 | sudo ufw default deny incoming | 47 | sudo ufw default deny incoming |
| 49 | ``` | 48 | ``` |
| 50 | 49 | ||
| 51 | You should also allow outgoing traffic if you want to allow the device | 50 | You should also allow outgoing traffic if you want to allow the device to |
| 52 | to communicate back to you or other parties. For example, media servers | 51 | communicate back to you or other parties. For example, media servers like Plex |
| 53 | like Plex need to be able to send out data related to streaming the | 52 | need to be able to send out data related to streaming the media. |
| 54 | media. | ||
| 55 | 53 | ||
| 56 | ```sh | 54 | ```sh |
| 57 | sudo ufw default allow outgoing | 55 | sudo ufw default allow outgoing |
| @@ -59,24 +57,23 @@ sudo ufw default allow outgoing | |||
| 59 | 57 | ||
| 60 | # Adding Port Rules | 58 | # Adding Port Rules |
| 61 | 59 | ||
| 62 | Now that we\'ve disabled all incoming traffic by default, we need to | 60 | Now that we've disabled all incoming traffic by default, we need to open up |
| 63 | open up some ports (or else no traffic would be able to come in). If you | 61 | some ports (or else no traffic would be able to come in). If you need to be able |
| 64 | need to be able to `ssh` into the machine, you\'ll need to | 62 | to `ssh` into the machine, you'll need to open up port 22. |
| 65 | open up port 22. | ||
| 66 | 63 | ||
| 67 | ```sh | 64 | ```sh |
| 68 | sudo ufw allow 22 | 65 | sudo ufw allow 22 |
| 69 | ``` | 66 | ``` |
| 70 | 67 | ||
| 71 | You can also issue more restrictive rules. The following rule will allow | 68 | You can also issue more restrictive rules. The following rule will allow `ssh` |
| 72 | `ssh` connections only from machines on the local subnet. | 69 | connections only from machines on the local subnet. |
| 73 | 70 | ||
| 74 | ```sh | 71 | ```sh |
| 75 | sudo ufw allow proto tcp from 192.168.0.0/24 to any port 22 | 72 | sudo ufw allow proto tcp from 192.168.0.0/24 to any port 22 |
| 76 | ``` | 73 | ``` |
| 77 | 74 | ||
| 78 | If you need to set a rule that isn\'t tcp, just append your connection | 75 | If you need to set a rule that isn't tcp, just append your connection type to |
| 79 | type to the end of the rule. | 76 | the end of the rule. |
| 80 | 77 | ||
| 81 | ```sh | 78 | ```sh |
| 82 | sudo ufw allow 1900/udp | 79 | sudo ufw allow 1900/udp |
| @@ -99,8 +96,7 @@ sudo reboot now | |||
| 99 | 96 | ||
| 100 | # Checking Status | 97 | # Checking Status |
| 101 | 98 | ||
| 102 | Now that the firewall is enabled, let\'s check and see what the rules | 99 | Now that the firewall is enabled, let's check and see what the rules look like. |
| 103 | look like. | ||
| 104 | 100 | ||
| 105 | ```sh | 101 | ```sh |
| 106 | sudo ufw status numbered | 102 | sudo ufw status numbered |
| @@ -117,9 +113,9 @@ Status: active | |||
| 117 | 113 | ||
| 118 | # Deleting Rules | 114 | # Deleting Rules |
| 119 | 115 | ||
| 120 | If you need to delete a rule, you need to know the number associated | 116 | If you need to delete a rule, you need to know the number associated with that |
| 121 | with that rule. Let\'s delete the first rule in the table above. You\'ll | 117 | rule. Let's delete the first rule in the table above. You'll be asked to |
| 122 | be asked to confirm the deletion as part of this process. | 118 | confirm the deletion as part of this process. |
| 123 | 119 | ||
| 124 | ```sh | 120 | ```sh |
| 125 | sudo ufw delete 1 | 121 | sudo ufw delete 1 |
| @@ -127,11 +123,10 @@ sudo ufw delete 1 | |||
| 127 | 123 | ||
| 128 | # Managing App Rules | 124 | # Managing App Rules |
| 129 | 125 | ||
| 130 | Luckily, there\'s a convenient way for installed applications to create | 126 | Luckily, there's a convenient way for installed applications to create files |
| 131 | files that ufw can easily implement so that you don\'t have to search | 127 | that ufw can easily implement so that you don't have to search and find which |
| 132 | and find which ports your application requires. To see if your device | 128 | ports your application requires. To see if your device has any applications with |
| 133 | has any applications with pre-installed ufw rules, execute the following | 129 | pre-installed ufw rules, execute the following command: |
| 134 | command: | ||
| 135 | 130 | ||
| 136 | ```sh | 131 | ```sh |
| 137 | sudo ufw app list | 132 | sudo ufw app list |
| @@ -148,14 +143,14 @@ Available applications: | |||
| 148 | plexmediaserver-dlna | 143 | plexmediaserver-dlna |
| 149 | ``` | 144 | ``` |
| 150 | 145 | ||
| 151 | If you want to get more information on a specific app rule, use the | 146 | If you want to get more information on a specific app rule, use the `info` |
| 152 | `info` command. | 147 | command. |
| 153 | 148 | ||
| 154 | ```sh | 149 | ```sh |
| 155 | sudo ufw app info plexmediaserver-dlna | 150 | sudo ufw app info plexmediaserver-dlna |
| 156 | ``` | 151 | ``` |
| 157 | 152 | ||
| 158 | You\'ll get a blurb of info back like this: | 153 | You'll get a blurb of info back like this: |
| 159 | 154 | ||
| 160 | ``` txt | 155 | ``` txt |
| 161 | Profile: plexmediaserver-dlna | 156 | Profile: plexmediaserver-dlna |
| @@ -167,8 +162,8 @@ Ports: | |||
| 167 | 32469/tcp | 162 | 32469/tcp |
| 168 | ``` | 163 | ``` |
| 169 | 164 | ||
| 170 | You can add or delete app rules the same way that you\'d add or delete | 165 | You can add or delete app rules the same way that you'd add or delete specific |
| 171 | specific port rules. | 166 | port rules. |
| 172 | 167 | ||
| 173 | ```sh | 168 | ```sh |
| 174 | sudo ufw allow plexmediaserver-dlna | 169 | sudo ufw allow plexmediaserver-dlna |
| @@ -180,12 +175,12 @@ sudo ufw delete RULE|NUM | |||
| 180 | 175 | ||
| 181 | # Creating App Rules | 176 | # Creating App Rules |
| 182 | 177 | ||
| 183 | If you\'d like to create you own app rule, you\'ll need to create a file | 178 | If you'd like to create you own app rule, you'll need to create a file in the |
| 184 | in the `/etc/ufw/applications.d` directory. Within the file | 179 | `/etc/ufw/applications.d` directory. Within the file you create, you need to |
| 185 | you create, you need to make sure the content is properly formatted. | 180 | make sure the content is properly formatted. |
| 186 | 181 | ||
| 187 | For example, here are the contents my `plexmediaserver` file, | 182 | For example, here are the contents my `plexmediaserver` file, which creates |
| 188 | which creates three distinct app rules for ufw: | 183 | three distinct app rules for ufw: |
| 189 | 184 | ||
| 190 | ``` config | 185 | ``` config |
| 191 | [plexmediaserver] | 186 | [plexmediaserver] |
| @@ -204,8 +199,8 @@ description=The Plex Media Server (with additional DLNA capability) | |||
| 204 | ports=32400/tcp|3005/tcp|5353/udp|8324/tcp|32410:32414/udp|1900/udp|32469/tcp | 199 | ports=32400/tcp|3005/tcp|5353/udp|8324/tcp|32410:32414/udp|1900/udp|32469/tcp |
| 205 | ``` | 200 | ``` |
| 206 | 201 | ||
| 207 | So, if I wanted to create a custom app rule called \"mycustomrule,\" | 202 | So, if I wanted to create a custom app rule called "mycustomrule," I'd create |
| 208 | I\'d create a file and add my content like this: | 203 | a file and add my content like this: |
| 209 | 204 | ||
| 210 | ```sh | 205 | ```sh |
| 211 | sudo nano /etc/ufw/applications.d/mycustomrule | 206 | sudo nano /etc/ufw/applications.d/mycustomrule |
content/blog/2021-02-19-macos.md +79 −92
| @@ -7,79 +7,74 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Diving into macOS | 8 | # Diving into macOS |
| 9 | 9 | ||
| 10 | After spending nearly 15 years working with Windows and 8 years on | 10 | After spending nearly 15 years working with Windows and 8 years on Linux, I have |
| 11 | Linux, I have experienced macOS for the first time. By chance, my spouse | 11 | experienced macOS for the first time. By chance, my spouse happened to buy a new |
| 12 | happened to buy a new MacBook and gifted me their 2013 model. Of course, | 12 | MacBook and gifted me their 2013 model. Of course, I still consider my Linux |
| 13 | I still consider my Linux desktop to be my daily driver and keep Windows | 13 | desktop to be my daily driver and keep Windows around for gaming needs, but over |
| 14 | around for gaming needs, but over the past week I\'ve found myself using | 14 | the past week I've found myself using the MacBook more and more for things that |
| 15 | the MacBook more and more for things that don\'t require gaming specs or | 15 | don't require gaming specs or advanced dev tools. |
| 16 | advanced dev tools. | ||
| 17 | 16 | ||
| 18 | # Initial Thoughts | 17 | # Initial Thoughts |
| 19 | 18 | ||
| 20 | Before I move on to the technical aspects of my set-up, I want to take | 19 | Before I move on to the technical aspects of my set-up, I want to take some time |
| 21 | some time and express my thoughts on the overall OS. | 20 | and express my thoughts on the overall OS. |
| 22 | 21 | ||
| 23 |  | 23 | Desktop](https://img.cleberg.net/blog/20210219-macos-testing-out-a-new-os/macos-desktop.png) |
| 25 | 24 | ||
| 26 | As expected, the initial computer setup is a breeze with Mac\'s guided | 25 | As expected, the initial computer setup is a breeze with Mac's guided GUI |
| 27 | GUI installer. | 26 | installer. |
| 28 | 27 | ||
| 29 | The desktop itself reminds me of GNOME more than anything else I\'ve | 28 | The desktop itself reminds me of GNOME more than anything else I've seen: even |
| 30 | seen: even Pantheon from [ElementaryOS](https://elementary.io/), which | 29 | Pantheon from [ElementaryOS](https://elementary.io/), which people commonly |
| 31 | people commonly refer to as the closest Linux distro to macOS. The | 30 | refer to as the closest Linux distro to macOS. The desktop toolbar is great and |
| 32 | desktop toolbar is great and far surpasses the utility of the GNOME | 31 | far surpasses the utility of the GNOME toolbar due to the fact that the |
| 33 | toolbar due to the fact that the extensions and icons *actually work*. I | 32 | extensions and icons *actually work*. I launch macOS and immediately see my |
| 34 | launch macOS and immediately see my shortcuts for Tresorit, Bitwarden, | 33 | shortcuts for Tresorit, Bitwarden, and Mullvad pop up as the computer loads. |
| 35 | and Mullvad pop up as the computer loads. | 34 | |
| 36 | 35 | Even further, the app dock is very useful and will be yet another familiarity | |
| 37 | Even further, the app dock is very useful and will be yet another | 36 | for GNOME users. I know many people like panels instead of docks, but I've |
| 38 | familiarity for GNOME users. I know many people like panels instead of | 37 | always found docks to have a more pleasing UI. However, I had to disable the |
| 39 | docks, but I\'ve always found docks to have a more pleasing UI. However, | 38 | "Show recent applications in Dock" preference; I can't stand items taking up |
| 40 | I had to disable the \"Show recent applications in Dock\" preference; I | 39 | precious screen space if I'm not currently using them. On that same note, it's |
| 41 | can\'t stand items taking up precious screen space if I\'m not currently | 40 | taking me some time to get use to the fact that I have to manually quit an app |
| 42 | using them. On that same note, it\'s taking me some time to get use to | 41 | or else it will still stay open/active in the dock, even if I've closed out all |
| 43 | the fact that I have to manually quit an app or else it will still stay | 42 | windows for that app (e.g. Firefox). |
| 44 | open/active in the dock, even if I\'ve closed out all windows for that | 43 | |
| 45 | app (e.g. Firefox). | 44 | Overall, I'm having a lot of fun and for users who spend a large majority of |
| 46 | 45 | their time performing basic tasks like web browsing, writing, watching media, | |
| 47 | Overall, I\'m having a lot of fun and for users who spend a large | 46 | etc., macOS is a fantastic option. |
| 48 | majority of their time performing basic tasks like web browsing, | ||
| 49 | writing, watching media, etc., macOS is a fantastic option. | ||
| 50 | 47 | ||
| 51 | The rest of this post explains the technicalities of how I set up my CLI | 48 | The rest of this post explains the technicalities of how I set up my CLI |
| 52 | environment to make me feel more at-home, similar to the environments I | 49 | environment to make me feel more at-home, similar to the environments I set up |
| 53 | set up on Fedora, Ubuntu, etc. | 50 | on Fedora, Ubuntu, etc. |
| 54 | 51 | ||
| 55 | # Making it Feel Like Home | 52 | # Making it Feel Like Home |
| 56 | 53 | ||
| 57 | If you\'re someone who uses Linux primarily, no doubt your first thought | 54 | If you're someone who uses Linux primarily, no doubt your first thought when |
| 58 | when booting macOS will be the same as mine was: \"Where is the terminal | 55 | booting macOS will be the same as mine was: "Where is the terminal and how do I |
| 59 | and how do I set up my favorite utilities?\" | 56 | set up my favorite utilities?" |
| 60 | 57 | ||
| 61 | Luckily, macOS hasn\'t completely hidden away the development tools from | 58 | Luckily, macOS hasn't completely hidden away the development tools from the |
| 62 | the average user. You can easily find the Terminal app in the Launchpad | 59 | average user. You can easily find the Terminal app in the Launchpad area, but |
| 63 | area, but it\'s probably not what you\'re used to. I was surprised (and | 60 | it's probably not what you're used to. I was surprised (and happy) to see that |
| 64 | happy) to see that the default shell is `zsh`, the shell I | 61 | the default shell is `zsh`, the shell I use on all of my Linux distros. However, |
| 65 | use on all of my Linux distros. However, the commands are not the same - | 62 | the commands are not the same - even the ones you may think are native to the |
| 66 | even the ones you may think are native to the shell. Commands like | 63 | shell. Commands like `dir` do not exist, so other native commands like `ls -la` |
| 67 | `dir` do not exist, so other native commands like | 64 | or `pwd` are more useful here. |
| 68 | `ls -la` or `pwd` are more useful here. | ||
| 69 | 65 | ||
| 70 | With only a few minutes of installing and tweaking a few packages, I was | 66 | With only a few minutes of installing and tweaking a few packages, I was able to |
| 71 | able to recreate a terminal environment that I feel very comfortable | 67 | recreate a terminal environment that I feel very comfortable using. See the |
| 72 | using. See the image below for a preview of the iTerm2 app with a split | 68 | image below for a preview of the iTerm2 app with a split view between my macOS |
| 73 | view between my macOS desktop shell and an SSH session into my server. | 69 | desktop shell and an SSH session into my server. |
| 74 | 70 | ||
| 75 |  | 71 |  |
| 76 | 72 | ||
| 77 | # Xcode | 73 | # Xcode |
| 78 | 74 | ||
| 79 | My first step was to search the web for any hints on how to get | 75 | My first step was to search the web for any hints on how to get `zsh` back up to |
| 80 | `zsh` back up to the state I like, with extensions, themes, | 76 | the state I like, with extensions, themes, etc. My first step was to install the |
| 81 | etc. My first step was to install the CLI tools for | 77 | CLI tools for [Xcode](https://developer.apple.com/xcode/), Apple's suite of |
| 82 | [Xcode](https://developer.apple.com/xcode/), Apple\'s suite of | ||
| 83 | development tools. | 78 | development tools. |
| 84 | 79 | ||
| 85 | ```sh | 80 | ```sh |
| @@ -92,8 +87,8 @@ sudo xcode-select --install | |||
| 92 | 87 | ||
| 93 | # Homebrew | 88 | # Homebrew |
| 94 | 89 | ||
| 95 | Next up is to install [Homebrew](https://brew.sh), a nifty package | 90 | Next up is to install [Homebrew](https://brew.sh), a nifty package manager for |
| 96 | manager for macOS. | 91 | macOS. |
| 97 | 92 | ||
| 98 | ```sh | 93 | ```sh |
| 99 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | 94 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
| @@ -107,10 +102,9 @@ Error: Failed to link all completions, docs and manpages: | |||
| 107 | Failed during: /usr/local/bin/brew update --force --quiet | 102 | Failed during: /usr/local/bin/brew update --force --quiet |
| 108 | ``` | 103 | ``` |
| 109 | 104 | ||
| 110 | I found that the following permission modification worked like a charm. | 105 | I found that the following permission modification worked like a charm. However, |
| 111 | However, I noted that some users online discussed the fact that this | 106 | I noted that some users online discussed the fact that this solution may not |
| 112 | solution may not work if your system has multiple users who use | 107 | work if your system has multiple users who use Homebrew. |
| 113 | Homebrew. | ||
| 114 | 108 | ||
| 115 | ```sh | 109 | ```sh |
| 116 | sudo chown -R $(whoami) $(brew --prefix)/* | 110 | sudo chown -R $(whoami) $(brew --prefix)/* |
| @@ -128,17 +122,16 @@ brew cleanup | |||
| 128 | 122 | ||
| 129 | # iTerm2 | 123 | # iTerm2 |
| 130 | 124 | ||
| 131 | Now that I\'ve installed the basic utilities for development, I moved | 125 | Now that I've installed the basic utilities for development, I moved onto |
| 132 | onto installing iTerm2, a much better terminal than the default. | 126 | installing iTerm2, a much better terminal than the default. |
| 133 | 127 | ||
| 134 | ```sh | 128 | ```sh |
| 135 | brew install --cask iterm2 | 129 | brew install --cask iterm2 |
| 136 | ``` | 130 | ``` |
| 137 | 131 | ||
| 138 | I also used the `Make iTerm2 Default Term` and | 132 | I also used the `Make iTerm2 Default Term` and `Install Shell Integration` |
| 139 | `Install Shell Integration` options in the iTerm2 application | 133 | options in the iTerm2 application menu to make sure I don't run into any issues |
| 140 | menu to make sure I don\'t run into any issues later on with different | 134 | later on with different terminals. |
| 141 | terminals. | ||
| 142 | 135 | ||
| 143 | We will also install `zsh` so we can use it in iTerm2. | 136 | We will also install `zsh` so we can use it in iTerm2. |
| 144 | 137 | ||
| @@ -148,9 +141,9 @@ brew install zsh | |||
| 148 | 141 | ||
| 149 | # Oh-My-Zsh | 142 | # Oh-My-Zsh |
| 150 | 143 | ||
| 151 | I\'ve shown the great aspects of [Oh My Zsh](https://ohmyz.sh) in other | 144 | I've shown the great aspects of [Oh My Zsh](https://ohmyz.sh) in other blog |
| 152 | blog posts, so I\'ll skip over that speech for now. Simply install it | 145 | posts, so I'll skip over that speech for now. Simply install it and run an |
| 153 | and run an update. | 146 | update. |
| 154 | 147 | ||
| 155 | ```sh | 148 | ```sh |
| 156 | sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | 149 | sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" |
| @@ -160,41 +153,36 @@ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/mas | |||
| 160 | omz update | 153 | omz update |
| 161 | ``` | 154 | ``` |
| 162 | 155 | ||
| 163 | Finally, restart the iTerm2 application to ensure all changes go into | 156 | Finally, restart the iTerm2 application to ensure all changes go into effect. |
| 164 | effect. | ||
| 165 | 157 | ||
| 166 | # Oh-My-Zsh Themes | 158 | # Oh-My-Zsh Themes |
| 167 | 159 | ||
| 168 | Let\'s change the theme of the terminal to make it a little more | 160 | Let's change the theme of the terminal to make it a little more friendly. |
| 169 | friendly. | ||
| 170 | 161 | ||
| 171 | ```sh | 162 | ```sh |
| 172 | open ~/.zshrc | 163 | open ~/.zshrc |
| 173 | ``` | 164 | ``` |
| 174 | 165 | ||
| 175 | The third section of this file should contain a line like the code | 166 | The third section of this file should contain a line like the code below. Change |
| 176 | below. Change that theme to [any theme you | 167 | that theme to [any theme you |
| 177 | want](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes), save the file, | 168 | want](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes), save the file, and exit. |
| 178 | and exit. | ||
| 179 | 169 | ||
| 180 | ```sh | 170 | ```sh |
| 181 | ZSH_THEME="af-magic" | 171 | ZSH_THEME="af-magic" |
| 182 | ``` | 172 | ``` |
| 183 | 173 | ||
| 184 | After changing the `.zshrc` file, you\'ll need to close your | 174 | After changing the `.zshrc` file, you'll need to close your terminal and |
| 185 | terminal and re-open it to see the changes. Optionally, just open a new | 175 | re-open it to see the changes. Optionally, just open a new tab if you're using |
| 186 | tab if you\'re using iTerm2, and you\'ll see the new shell config. | 176 | iTerm2, and you'll see the new shell config. |
| 187 | 177 | ||
| 188 | # Oh-My-Zsh Plugins | 178 | # Oh-My-Zsh Plugins |
| 189 | 179 | ||
| 190 | Of course, my customization of `zsh` would not be complete | 180 | Of course, my customization of `zsh` would not be complete without |
| 191 | without | 181 | [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions). This |
| 192 | [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions). | 182 | will bring up commands you've run in the past as you type them. For example, if |
| 193 | This will bring up commands you\'ve run in the past as you type them. | 183 | you've run `ssh user@192.168.1.99` before, the terminal will show this command |
| 194 | For example, if you\'ve run `ssh user@192.168.1.99` before, | 184 | as soon as you start typing it (e.g. `zsh u`), and you can hit the right arrow |
| 195 | the terminal will show this command as soon as you start typing it (e.g. | 185 | to autocomplete the command. |
| 196 | `zsh u`), and you can hit the right arrow to autocomplete the | ||
| 197 | command. | ||
| 198 | 186 | ||
| 199 | ```sh | 187 | ```sh |
| 200 | git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions | 188 | git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions |
| @@ -209,7 +197,6 @@ open ~/.zshrc | |||
| 209 | plugins=(git zsh-autosuggestions) | 197 | plugins=(git zsh-autosuggestions) |
| 210 | ``` | 198 | ``` |
| 211 | 199 | ||
| 212 | Remember: After changing the `.zshrc` file, you\'ll need to | 200 | Remember: After changing the `.zshrc` file, you'll need to close your terminal |
| 213 | close your terminal and re-open it to see the changes. Optionally, just | 201 | and re-open it to see the changes. Optionally, just open a new tab if you're |
| 214 | open a new tab if you\'re using iTerm2, and you\'ll see the new shell | 202 | using iTerm2, and you'll see the new shell config. |
| 215 | config. | ||
content/blog/2021-03-19-clone-github-repos.md +30 −35
| @@ -7,29 +7,27 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Cloning from GitHub | 8 | # Cloning from GitHub |
| 9 | 9 | ||
| 10 | If you\'re like me and use a lot of different devices (and sometimes | 10 | If you're like me and use a lot of different devices (and sometimes decide to |
| 11 | decide to just wipe your device and start with a new OS), you probably | 11 | just wipe your device and start with a new OS), you probably know the pain of |
| 12 | know the pain of cloning all your old code repositories down to your | 12 | cloning all your old code repositories down to your local file system. |
| 13 | local file system. | ||
| 14 | 13 | ||
| 15 | If you\'re using GitHub, you can easily clone all of your code back down | 14 | If you're using GitHub, you can easily clone all of your code back down in just |
| 16 | in just seconds. First, create a bash script. I do so by opening a new | 15 | seconds. First, create a bash script. I do so by opening a new file in `nano`, |
| 17 | file in `nano`, but you can use `gedit`, | 16 | but you can use `gedit`, `vim`, or something else: |
| 18 | `vim`, or something else: | ||
| 19 | 17 | ||
| 20 | ```sh | 18 | ```sh |
| 21 | nano clone_github_repos.sh | 19 | nano clone_github_repos.sh |
| 22 | ``` | 20 | ``` |
| 23 | 21 | ||
| 24 | Next, paste in the following information. Note that you can replace the | 22 | Next, paste in the following information. Note that you can replace the word |
| 25 | word `users` in the first line with `orgs` and | 23 | `users` in the first line with `orgs` and type an organization's name instead |
| 26 | type an organization\'s name instead of a user\'s name. | 24 | of a user's name. |
| 27 | 25 | ||
| 28 | ```sh | 26 | ```sh |
| 29 | CNTX=users; NAME=YOUR-USERNAME; PAGE=1 | 27 | CNTX=users; NAME=YOUR-USERNAME; PAGE=1 |
| 30 | curl "https://api.github.com/$CNTX/$NAME/repos?page=$PAGE&per_page=100" | | 28 | curl "https://api.github.com/$CNTX/$NAME/repos?page=$PAGE&per_page=100" | |
| 31 | grep -e 'git_url*' | | 29 | grep -e 'git_url*' | |
| 32 | cut -d \" -f 4 | | 30 | cut -d " -f 4 | |
| 33 | xargs -L1 git clone | 31 | xargs -L1 git clone |
| 34 | ``` | 32 | ``` |
| 35 | 33 | ||
| @@ -47,12 +45,12 @@ Now you can run the script and should see the cloning process begin. | |||
| 47 | 45 | ||
| 48 | # Cloning from Sourcehut | 46 | # Cloning from Sourcehut |
| 49 | 47 | ||
| 50 | I haven\'t fully figured out how to directly incorporate Sourcehut\'s | 48 | I haven't fully figured out how to directly incorporate Sourcehut's GraphQL |
| 51 | GraphQL API into a bash script yet, so this one will take two steps. | 49 | API into a bash script yet, so this one will take two steps. |
| 52 | 50 | ||
| 53 | First, log-in to Sourcehut and go to their [GraphQL playground for | 51 | First, log-in to Sourcehut and go to their [GraphQL playground for |
| 54 | Git](https://git.sr.ht/graphql). Next, paste the following query into | 52 | Git](https://git.sr.ht/graphql). Next, paste the following query into the left |
| 55 | the left box: | 53 | box: |
| 56 | 54 | ||
| 57 | ```sh | 55 | ```sh |
| 58 | query { | 56 | query { |
| @@ -68,24 +66,22 @@ query { | |||
| 68 | } | 66 | } |
| 69 | ``` | 67 | ``` |
| 70 | 68 | ||
| 71 | The output on the right side will give you an object of all your | 69 | The output on the right side will give you an object of all your repositories. |
| 72 | repositories. Just grab that text and remove all the characters such as | 70 | Just grab that text and remove all the characters such as quotation marks and |
| 73 | quotation marks and curly brackets. You will need a single-line list of | 71 | curly brackets. You will need a single-line list of space-separated values for |
| 74 | space-separated values for the next step. | 72 | the next step. |
| 75 | 73 | ||
| 76 | Now let\'s create the bash script: | 74 | Now let's create the bash script: |
| 77 | 75 | ||
| 78 | ```sh | 76 | ```sh |
| 79 | nano clone_sourcehut_repos.sh | 77 | nano clone_sourcehut_repos.sh |
| 80 | ``` | 78 | ``` |
| 81 | 79 | ||
| 82 | Next, paste the following bash script in with the list of repositories | 80 | Next, paste the following bash script in with the list of repositories you |
| 83 | you obtained above and replace `your-username` with your | 81 | obtained above and replace `your-username` with your username. |
| 84 | username. | ||
| 85 | 82 | ||
| 86 | Note that this uses the SSH-based Git cloning method (e.g. | 83 | Note that this uses the SSH-based Git cloning method (e.g. `git@git...`), so |
| 87 | `git@git...`), so you\'ll need to ensure you have set up | 84 | you'll need to ensure you have set up Sourcehut with your SSH key. |
| 88 | Sourcehut with your SSH key. | ||
| 89 | 85 | ||
| 90 | ```sh | 86 | ```sh |
| 91 | repos=(repo1 repo2 repo3) | 87 | repos=(repo1 repo2 repo3) |
| @@ -112,19 +108,18 @@ Now you can run the script and should see the cloning process begin. | |||
| 112 | 108 | ||
| 113 | # Moving Repositories to a New Host | 109 | # Moving Repositories to a New Host |
| 114 | 110 | ||
| 115 | Now that you have all of your code repositories cloned to your local | 111 | Now that you have all of your code repositories cloned to your local computer, |
| 116 | computer, you may want to change the remote host (e.g., moving from | 112 | you may want to change the remote host (e.g., moving from GitHub to GitLab). To |
| 117 | GitHub to GitLab). To do this, let\'s create another bash script: | 113 | do this, let's create another bash script: |
| 118 | 114 | ||
| 119 | ```sh | 115 | ```sh |
| 120 | nano change_remote_urls.sh | 116 | nano change_remote_urls.sh |
| 121 | ``` | 117 | ``` |
| 122 | 118 | ||
| 123 | Past the following information and be sure to change the URL information | 119 | Past the following information and be sure to change the URL information to |
| 124 | to whichever host you are moving to. For this example, I am looping | 120 | whichever host you are moving to. For this example, I am looping through all of |
| 125 | through all of my cloned GitHub directories and changing them to | 121 | my cloned GitHub directories and changing them to Sourcehut (e.g. |
| 126 | Sourcehut (e.g. `<YOUR_NEW_REMOTE_URL>` -\> | 122 | `<YOUR_NEW_REMOTE_URL>` -> `git@git.sr.ht:~myusername`). |
| 127 | `git@git.sr.ht:~myusername`). | ||
| 128 | 123 | ||
| 129 | ```sh | 124 | ```sh |
| 130 | # List all sub-directories in the current directory | 125 | # List all sub-directories in the current directory |
content/blog/2021-03-28-gemini-capsule.md +67 −78
| @@ -7,23 +7,20 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # What is Gemini? | 8 | # What is Gemini? |
| 9 | 9 | ||
| 10 | [Gemini](https://gemini.circumlunar.space/) is an internet protocol | 10 | [Gemini](https://gemini.circumlunar.space/) is an internet protocol introduced |
| 11 | introduced in June 2019 as an alternative to HTTP(S) or Gopher. In | 11 | in June 2019 as an alternative to HTTP(S) or Gopher. In layman's terms, it's |
| 12 | layman\'s terms, it\'s an alternative way to browse sites (called | 12 | an alternative way to browse sites (called capsules) that requires a special |
| 13 | capsules) that requires a special browser. Since Gemini is not | 13 | browser. Since Gemini is not standardized as an internet standard, normal web |
| 14 | standardized as an internet standard, normal web browsers won\'t be able | 14 | browsers won't be able to load a Gemini capsule. Instead, you'll need to use |
| 15 | to load a Gemini capsule. Instead, you\'ll need to use [a | 15 | [a Gemini-specific browser](https://gemini.%20circumlunar.space/clients.html). |
| 16 | Gemini-specific | ||
| 17 | browser](https://gemini.%20circumlunar.space/clients.html). | ||
| 18 | 16 | ||
| 19 | The content found within a Gemini page is called | 17 | The content found within a Gemini page is called |
| 20 | [Gemtext](https://gemini.circumlunar.space/docs/cheatsheet.gmi) and is | 18 | [Gemtext](https://gemini.circumlunar.space/docs/cheatsheet.gmi) and is |
| 21 | *extremely* basic (on purpose). Gemini only processes the text, no media | 19 | *extremely* basic (on purpose). Gemini only processes the text, no media content |
| 22 | content like images. However, you\'re able to style 3 levels of | 20 | like images. However, you're able to style 3 levels of headings, regular text, |
| 23 | headings, regular text, links (which will display on their own line), | 21 | links (which will display on their own line), quotes, and an unordered list. |
| 24 | quotes, and an unordered list. | ||
| 25 | 22 | ||
| 26 | Here\'s a complete listing of valid Gemtext: | 23 | Here's a complete listing of valid Gemtext: |
| 27 | 24 | ||
| 28 | ``` txt | 25 | ``` txt |
| 29 | # Heading 1 | 26 | # Heading 1 |
| @@ -46,79 +43,72 @@ My List: | |||
| 46 | 43 | ||
| 47 | ### Free Option | 44 | ### Free Option |
| 48 | 45 | ||
| 49 | There are probably numerous websites that allow you to create your | 46 | There are probably numerous websites that allow you to create your personal |
| 50 | personal Gemini capsule, but I\'m going to focus on the two sites that I | 47 | Gemini capsule, but I'm going to focus on the two sites that I have personally |
| 51 | have personally tested. The first option below, Midnight Pub, allows you | 48 | tested. The first option below, Midnight Pub, allows you to create/edit any |
| 52 | to create/edit any Gemini files you want in your account. This is | 49 | Gemini files you want in your account. This is essentially a GUI option with a |
| 53 | essentially a GUI option with a built-in text box for editing. The | 50 | built-in text box for editing. The second option below, Sourcehut, allows you to |
| 54 | second option below, Sourcehut, allows you to use a Git repository and | 51 | use a Git repository and automatic build process to deploy your personal Gemini |
| 55 | automatic build process to deploy your personal Gemini capsule every | 52 | capsule every time you push a commit. |
| 56 | time you push a commit. | ||
| 57 | 53 | ||
| 58 | ## Midnight Pub - Beginner Friendly | 54 | ## Midnight Pub - Beginner Friendly |
| 59 | 55 | ||
| 60 | [Midnight Pub](https://midnight.pub/) is a small, virtual community | 56 | [Midnight Pub](https://midnight.pub/) is a small, virtual community meant to |
| 61 | meant to reflect the atmosphere of wandering into a small alley pub. The | 57 | reflect the atmosphere of wandering into a small alley pub. The site is built in |
| 62 | site is built in Gemtext and has a server-side process to convert | 58 | Gemtext and has a server-side process to convert Gemtext to HTML if someone |
| 63 | Gemtext to HTML if someone loads the site in an HTTP(S) browser. | 59 | loads the site in an HTTP(S) browser. |
| 64 | 60 | ||
| 65 | To create an account, you\'ll need to email the owner of the website to | 61 | To create an account, you'll need to email the owner of the website to obtain a |
| 66 | obtain a key. You can find their email on the Midnight Pub homepage. | 62 | key. You can find their email on the Midnight Pub homepage. Once registered, |
| 67 | Once registered, head to [your account](https://midnight.pub/account) | 63 | head to [your account](https://midnight.pub/account) and select [manage |
| 68 | and select [manage site](https://midnight.pub/site). This is the screen | 64 | site](https://midnight.pub/site). This is the screen where you can upload or |
| 69 | where you can upload or create any files to be displayed on the | 65 | create any files to be displayed on the internet. |
| 70 | internet. | ||
| 71 | 66 | ||
| 72 | For example, I\'ve created both an HTML file and a Gemini file. Remember | 67 | For example, I've created both an HTML file and a Gemini file. Remember that |
| 73 | that Gemini is automatically converted to HTML on the Pub, so you don\'t | 68 | Gemini is automatically converted to HTML on the Pub, so you don't need an HTML |
| 74 | need an HTML version. For example, I created an HTML version to add in | 69 | version. For example, I created an HTML version to add in some extra styling. |
| 75 | some extra styling. | ||
| 76 | 70 | ||
| 77 | All you need to do is create a page like `index.gmi` and use | 71 | All you need to do is create a page like `index.gmi` and use your Gemini browser |
| 78 | your Gemini browser to head over to your-username.midnight.pub to see | 72 | to head over to your-username.midnight.pub to see the result. |
| 79 | the result. | ||
| 80 | 73 | ||
| 81 | That\'s all there is to it! Easy enough, right? Let\'s check out a more | 74 | That's all there is to it! Easy enough, right? Let's check out a more advanced |
| 82 | advanced version in the next section. | 75 | version in the next section. |
| 83 | 76 | ||
| 84 | # Paid Option | 77 | # Paid Option |
| 85 | 78 | ||
| 86 | As of 2021, Sourcehut has decided to require users to have a paid | 79 | As of 2021, Sourcehut has decided to require users to have a paid account in |
| 87 | account in order to utilize their automated build system. For now, paid | 80 | order to utilize their automated build system. For now, paid accounts can be as |
| 88 | accounts can be as low as \$2/month. | 81 | low as $2/month. |
| 89 | 82 | ||
| 90 | ## Sourcehut | 83 | ## Sourcehut |
| 91 | 84 | ||
| 92 | [Sourcehut](https://sourcehut.org/) is a collection of software | 85 | [Sourcehut](https://sourcehut.org/) is a collection of software development |
| 93 | development tools, but mostly surrounds their hosted Git repository | 86 | tools, but mostly surrounds their hosted Git repository service. Simply put, |
| 94 | service. Simply put, it\'s a minimal and more private alternative to | 87 | it's a minimal and more private alternative to services like GitHub. |
| 95 | services like GitHub. | ||
| 96 | 88 | ||
| 97 | This walkthrough is more advanced and involves things like Git, SSH, the | 89 | This walkthrough is more advanced and involves things like Git, SSH, the command |
| 98 | command line. If you don\'t think you know enough to do this, check out | 90 | line. If you don't think you know enough to do this, check out my walkthrough |
| 99 | my walkthrough on creating a Gemini capsule for the Midnight Pub | 91 | on creating a Gemini capsule for the Midnight Pub instead. |
| 100 | instead. | ||
| 101 | 92 | ||
| 102 | The first thing you\'ll need to do is create an SSH key pair, if you | 93 | The first thing you'll need to do is create an SSH key pair, if you don't |
| 103 | don\'t already have one on your system. Once created, grab the contents | 94 | already have one on your system. Once created, grab the contents of `id_rsa.pub` |
| 104 | of `id_rsa.pub` and add it to your Sourcehut account | 95 | and add it to your Sourcehut account settings - this will allow you to push and |
| 105 | settings - this will allow you to push and pull code changes without | 96 | pull code changes without using a username/password. |
| 106 | using a username/password. | ||
| 107 | 97 | ||
| 108 | ```sh | 98 | ```sh |
| 109 | ssh keygen | 99 | ssh keygen |
| 110 | ``` | 100 | ``` |
| 111 | 101 | ||
| 112 | Next up, let\'s create a repository with the proper name so that the | 102 | Next up, let's create a repository with the proper name so that the Sourcehut |
| 113 | Sourcehut build system will know we want them to host a website for us. | 103 | build system will know we want them to host a website for us. Use the following |
| 114 | Use the following format exactly: | 104 | format exactly: |
| 115 | 105 | ||
| 116 | ```sh | 106 | ```sh |
| 117 | mkdir your-username.srht.site && cd your-username.srht.site | 107 | mkdir your-username.srht.site && cd your-username.srht.site |
| 118 | ``` | 108 | ``` |
| 119 | 109 | ||
| 120 | Now that we\'ve created the repo, let\'s initialize Git and add the | 110 | Now that we've created the repo, let's initialize Git and add the proper |
| 121 | proper remote URL. | 111 | remote URL. |
| 122 | 112 | ||
| 123 | ```sh | 113 | ```sh |
| 124 | git init | 114 | git init |
| @@ -128,14 +118,14 @@ git init | |||
| 128 | git remote add origin git@git.sr.ht:~your-username/your-username.srht.site | 118 | git remote add origin git@git.sr.ht:~your-username/your-username.srht.site |
| 129 | ``` | 119 | ``` |
| 130 | 120 | ||
| 131 | Now that our repository is set up and configured, we will need to create | 121 | Now that our repository is set up and configured, we will need to create at |
| 132 | at least two files: | 122 | least two files: |
| 133 | 123 | ||
| 134 | - `index.gmi` | 124 | - `index.gmi` |
| 135 | - `.build.yml` | 125 | - `.build.yml` |
| 136 | 126 | ||
| 137 | For your `.build.yml` file, use the following content and be | 127 | For your `.build.yml` file, use the following content and be sure to update the |
| 138 | sure to update the `site` line with your username! | 128 | `site` line with your username! |
| 139 | 129 | ||
| 140 | ``` yaml | 130 | ``` yaml |
| 141 | image: alpine/latest | 131 | image: alpine/latest |
| @@ -150,11 +140,11 @@ tasks: | |||
| 150 | acurl -f https://pages.sr.ht/publish/$site -Fcontent=@site.tar.gz -Fprotocol=GEMINI | 140 | acurl -f https://pages.sr.ht/publish/$site -Fcontent=@site.tar.gz -Fprotocol=GEMINI |
| 151 | ``` | 141 | ``` |
| 152 | 142 | ||
| 153 | For the `index.gmi` file, put whatever you want in there and | 143 | For the `index.gmi` file, put whatever you want in there and save it. You could |
| 154 | save it. You could even just copy and paste the Gemtext cheatsheet. | 144 | even just copy and paste the Gemtext cheatsheet. |
| 155 | 145 | ||
| 156 | If you want to serve both HTML and Gemini files from this repository, | 146 | If you want to serve both HTML and Gemini files from this repository, just add a |
| 157 | just add a second command to the `upload` section: | 147 | second command to the `upload` section: |
| 158 | 148 | ||
| 159 | ``` yaml | 149 | ``` yaml |
| 160 | - upload: | | 150 | - upload: | |
| @@ -168,19 +158,18 @@ Lastly, commit your changes and push them to the remote repo. | |||
| 168 | git add .; git commit -m "initial commit"; git push --set-upstream origin HEAD | 158 | git add .; git commit -m "initial commit"; git push --set-upstream origin HEAD |
| 169 | ``` | 159 | ``` |
| 170 | 160 | ||
| 171 | If you\'ve successfully created the files with the proper format, | 161 | If you've successfully created the files with the proper format, you'll see |
| 172 | you\'ll see the terminal print a message that lets you know where the | 162 | the terminal print a message that lets you know where the automatic build is |
| 173 | automatic build is taking place. For example, here\'s what the terminal | 163 | taking place. For example, here's what the terminal tells me: |
| 174 | tells me: | ||
| 175 | 164 | ||
| 176 | ```sh | 165 | ```sh |
| 177 | remote: Build started: | 166 | remote: Build started: |
| 178 | remote: https://builds.sr.ht/~user/job/689803 [.build.yml] | 167 | remote: https://builds.sr.ht/~user/job/689803 [.build.yml] |
| 179 | ``` | 168 | ``` |
| 180 | 169 | ||
| 181 | Now that you\'ve properly built your Sourcehut page, you can browse to | 170 | Now that you've properly built your Sourcehut page, you can browse to |
| 182 | your-username.srht.site in a Gemini browser and view the final results. | 171 | your-username.srht.site in a Gemini browser and view the final results. Take a |
| 183 | Take a look at the image below for my Sourcehut Gemini capsule. | 172 | look at the image below for my Sourcehut Gemini capsule. |
| 184 | 173 | ||
| 185 |  | 175 | browser](https://img.cleberg.net/blog/20210328-launching-a-gemini-capsule/amfora.png) |
content/blog/2021-03-28-vaporwave-vs-outrun.md +69 −76
| @@ -7,15 +7,14 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Overview | 8 | # Overview |
| 9 | 9 | ||
| 10 | When it comes to an aesthetic that originated primarily online, there | 10 | When it comes to an aesthetic that originated primarily online, there tends to |
| 11 | tends to be a lot of confusion around what falls into each specific | 11 | be a lot of confusion around what falls into each specific genre. This post |
| 12 | genre. This post discusses Vaporwave and Outrun, which have become | 12 | discusses Vaporwave and Outrun, which have become almost synonymous in the minds |
| 13 | almost synonymous in the minds of those online who aren\'t hardcore into | 13 | of those online who aren't hardcore into these genres of media. More |
| 14 | these genres of media. More specifically, Outrun is largely an unknown | 14 | specifically, Outrun is largely an unknown term while all aesthetics in these |
| 15 | term while all aesthetics in these two genres are usually attributed to | 15 | two genres are usually attributed to Vaporwave. For example, take a look at the |
| 16 | Vaporwave. For example, take a look at the image search results for | 16 | image search results for Vaporwave: the results include **a lot** of |
| 17 | Vaporwave: the results include **a lot\*** of Outrun-themed images. | 17 | Outrun-themed images. You'll find a similar trend almost everywhere. |
| 18 | You\'ll find a similar trend almost everywhere. | ||
| 19 | 18 | ||
| 20 |  | 20 | Results](https://img.cleberg.net/blog/20210328-vaporwave-vs-outrun/vaporwave-search-results.png) |
| @@ -25,99 +24,93 @@ Results](https://img.cleberg.net/blog/20210328-vaporwave-vs-outrun/vaporwave-sea | |||
| 25 |  | 25 | Cover](https://img.cleberg.net/blog/20210328-vaporwave-vs-outrun/macintosh-plus.png) |
| 27 | 26 | ||
| 28 | Okay, so what is Vaporwave? I\'m going to just copy-and-paste some | 27 | Okay, so what is Vaporwave? I'm going to just copy-and-paste some general info |
| 29 | general info from the Wikipedia article on | 28 | from the Wikipedia article on |
| 30 | [Vaporwave](https://en.wikipedia.org/wiki/Vaporwave), so that I\'m not | 29 | [Vaporwave](https://en.wikipedia.org/wiki/Vaporwave), so that I'm not repeating |
| 31 | repeating everything you can already search for online: | 30 | everything you can already search for online: |
| 32 | 31 | ||
| 33 | > Vaporwave is a microgenre of electronic music, a visual art style, and | 32 | > Vaporwave is a microgenre of electronic music, a visual art style, and an |
| 34 | > an Internet meme that emerged in the early 2010s. It is defined partly | 33 | > Internet meme that emerged in the early 2010s. It is defined partly by its |
| 35 | > by its slowed-down, chopped and screwed samples of smooth jazz, | 34 | > slowed-down, chopped and screwed samples of smooth jazz, elevator, R&B, and |
| 36 | > elevator, R&B, and lounge music from the 1980s and 1990s. The | 35 | > lounge music from the 1980s and 1990s. The surrounding subculture is sometimes |
| 37 | > surrounding subculture is sometimes associated with an ambiguous or | 36 | > associated with an ambiguous or satirical take on consumer capitalism and pop |
| 38 | > satirical take on consumer capitalism and pop culture, and tends to be | 37 | > culture, and tends to be characterized by a nostalgic or surrealist engagement |
| 39 | > characterized by a nostalgic or surrealist engagement with the popular | 38 | > with the popular entertainment, technology and advertising of previous |
| 40 | > entertainment, technology and advertising of previous decades. | 39 | > decades. Visually, it incorporates early Internet imagery, late 1990s web |
| 41 | > Visually, it incorporates early Internet imagery, late 1990s web | 40 | > design, glitch art, anime, 3D-rendered objects, and cyberpunk tropes in its |
| 42 | > design, glitch art, anime, 3D-rendered objects, and cyberpunk tropes | 41 | > cover artwork and music videos. |
| 43 | > in its cover artwork and music videos. | 42 | |
| 44 | 43 | This is an excellent summary, and it helps address my point here: there are | |
| 45 | This is an excellent summary, and it helps address my point here: there | 44 | specific aspects that make Vaporwave unique: |
| 46 | are specific aspects that make Vaporwave unique: | ||
| 47 | 45 | ||
| 48 | ## Time Frame | 46 | ## Time Frame |
| 49 | 47 | ||
| 50 | The time frame for references, logos, etc. focuses mostly on the 1990s | 48 | The time frame for references, logos, etc. focuses mostly on the 1990s in |
| 51 | in Vaporwave. You\'ll see old school Pepsi logos, Microsoft 95 screens, | 49 | Vaporwave. You'll see old school Pepsi logos, Microsoft 95 screens, tropical |
| 52 | tropical plants, classic marble sculptures, and many references from | 50 | plants, classic marble sculptures, and many references from Japan's influence |
| 53 | Japan\'s influence in the 90s. | 51 | in the 90s. |
| 54 | 52 | ||
| 55 | ## Art | 53 | ## Art |
| 56 | 54 | ||
| 57 | The color scheme is generally a soft, light palette that uses pastel | 55 | The color scheme is generally a soft, light palette that uses pastel colors. The |
| 58 | colors. The backdrop will often be in a light-pink or teal blue. | 56 | backdrop will often be in a light-pink or teal blue. |
| 59 | 57 | ||
| 60 | ## Music | 58 | ## Music |
| 61 | 59 | ||
| 62 | The musical genre of Vaporwave incorporates soft tunes, lounge music, | 60 | The musical genre of Vaporwave incorporates soft tunes, lounge music, and sound |
| 63 | and sound effects that will make the listener reminisce of the 90s. The | 61 | effects that will make the listener reminisce of the 90s. The sounds of the |
| 64 | sounds of the genre are generally slower-paced and calming. The major | 62 | genre are generally slower-paced and calming. The major breakthrough artist for |
| 65 | breakthrough artist for Vaporwave was [Macintosh | 63 | Vaporwave was [Macintosh Plus](https://en.wikipedia.org/wiki/Vektroid), who |
| 66 | Plus](https://en.wikipedia.org/wiki/Vektroid), who released the album | 64 | released the album [Floral |
| 67 | [Floral | 65 | Shoppe](https://archive.org/details/MACINTOSHPLUS-FLORALSHOPPE_complete) in |
| 68 | Shoppe](https://archive.org/details/MACINTOSHPLUS-FLORALSHOPPE_complete) | 66 | 2011. Another more recent example is the artist |
| 69 | in 2011. Another more recent example is the artist | 67 | [sadbert](https://sadbert.bandcamp.com/), whose latest album incorporates the |
| 70 | [sadbert](https://sadbert.bandcamp.com/), whose latest album | 68 | upbeat tones of the 1999 Dilbert TV series. |
| 71 | incorporates the upbeat tones of the 1999 Dilbert TV series. | 69 | |
| 72 | 70 | Notice that Vaporwave doesn't include things like racing cars, futuristic | |
| 73 | Notice that Vaporwave doesn\'t include things like racing cars, | 71 | technology, chrome, or the deep orange/purple color scheme. Vaporwave is a focus |
| 74 | futuristic technology, chrome, or the deep orange/purple color scheme. | 72 | on the idyllic state of the world when technology was becoming common in |
| 75 | Vaporwave is a focus on the idyllic state of the world when technology | 73 | households, a reality that we have already experienced. Focus on the most |
| 76 | was becoming common in households, a reality that we have already | 74 | aesthetically-pleasing parts of that past is a large part of Vaporwave. |
| 77 | experienced. Focus on the most aesthetically-pleasing parts of that past | ||
| 78 | is a large part of Vaporwave. | ||
| 79 | 75 | ||
| 80 | # Outrun | 76 | # Outrun |
| 81 | 77 | ||
| 82 |  | 78 |  |
| 83 | 79 | ||
| 84 | Now, let\'s get to Outrun. This one is a little trickier since the genre | 80 | Now, let's get to Outrun. This one is a little trickier since the genre has |
| 85 | has largely been lumped under the Vaporwave title for so long. However, | 81 | largely been lumped under the Vaporwave title for so long. However, it stems |
| 86 | it stems from the [Synthwave](https://en.wikipedia.org/wiki/Synthwave) | 82 | from the [Synthwave](https://en.wikipedia.org/wiki/Synthwave) music genre and is |
| 87 | music genre and is likely named after the 1986 racer game, [Out | 83 | likely named after the 1986 racer game, [Out |
| 88 | Run](https://en.wikipedia.org/wiki/Out_Run). | 84 | Run](https://en.wikipedia.org/wiki/Out_Run). |
| 89 | 85 | ||
| 90 | ## Time Frame | 86 | ## Time Frame |
| 91 | 87 | ||
| 92 | Outrun can be thought of as a retro-futuristic aesthetic born from the | 88 | Outrun can be thought of as a retro-futuristic aesthetic born from the 1980s. |
| 93 | 1980s. | ||
| 94 | 89 | ||
| 95 | ## Art | 90 | ## Art |
| 96 | 91 | ||
| 97 | The color scheme uses a very dark color palette with the main colors | 92 | The color scheme uses a very dark color palette with the main colors being deep |
| 98 | being deep oranges, blues, and purples. Red edges are common around | 93 | oranges, blues, and purples. Red edges are common around objects in Outrun art. |
| 99 | objects in Outrun art. The background of the Outrun aesthetic is almost | 94 | The background of the Outrun aesthetic is almost always a neon grid like you'd |
| 100 | always a neon grid like you\'d expect to see in Tron or a 1980s arcade | 95 | expect to see in Tron or a 1980s arcade machine. |
| 101 | machine. | ||
| 102 | 96 | ||
| 103 | Classic sports cars, chrome robots, computer generated graphics and | 97 | Classic sports cars, chrome robots, computer generated graphics and fonts, and |
| 104 | fonts, and the occasional use of rain or palm trees can be found in | 98 | the occasional use of rain or palm trees can be found in Outrun art. |
| 105 | Outrun art. | ||
| 106 | 99 | ||
| 107 | ## Music | 100 | ## Music |
| 108 | 101 | ||
| 109 | This aesthetic has a more aggressive and fast-paced style of music, | 102 | This aesthetic has a more aggressive and fast-paced style of music, which tends |
| 110 | which tends to match the subject of the art in this aesthetic. | 103 | to match the subject of the art in this aesthetic. |
| 111 | 104 | ||
| 112 | Outrun enthusiasts love what people in the 1980s thought the future | 105 | Outrun enthusiasts love what people in the 1980s thought the future would look |
| 113 | would look like. Take a look at a common video game discussed in Outrun | 106 | like. Take a look at a common video game discussed in Outrun circles, Far Cry 3: |
| 114 | circles, Far Cry 3: Blood Dragon: | 107 | Blood Dragon: |
| 115 | 108 | ||
| 116 |  | 110 | Dragon](https://img.cleberg.net/blog/20210328-vaporwave-vs-outrun/far-cry.png) |
| 118 | 111 | ||
| 119 | Another example that doesn\'t force the color scheme as hard as some | 112 | Another example that doesn't force the color scheme as hard as some online art |
| 120 | online art does is Kung Fury: | 113 | does is Kung Fury: |
| 121 | 114 | ||
| 122 |  | 116 | Fury](https://img.cleberg.net/blog/20210328-vaporwave-vs-outrun/kung-fury.png) |
| @@ -127,7 +120,7 @@ Scene](https://img.cleberg.net/blog/20210328-vaporwave-vs-outrun/kung-fury-hacke | |||
| 127 | 120 | ||
| 128 | # Conclusion | 121 | # Conclusion |
| 129 | 122 | ||
| 130 | While Vaporwave and Outrun share similarities, they are two distinct | 123 | While Vaporwave and Outrun share similarities, they are two distinct aesthetics |
| 131 | aesthetics with many important distinctions. Someone who enjoys one may | 124 | with many important distinctions. Someone who enjoys one may not necessarily |
| 132 | not necessarily enjoy the other, so it\'s important to make sure we | 125 | enjoy the other, so it's important to make sure we properly describe the |
| 133 | properly describe the aesthetic we\'re looking for. | 126 | aesthetic we're looking for. |
content/blog/2021-03-30-vps-web-server.md +162 −183
| @@ -7,105 +7,96 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Shared Hosting vs. VPS | 8 | # Shared Hosting vs. VPS |
| 9 | 9 | ||
| 10 | Choosing a place to host a website is one of the most confusing | 10 | Choosing a place to host a website is one of the most confusing decisions for |
| 11 | decisions for beginner web developers. Even for experienced web devs, | 11 | beginner web developers. Even for experienced web devs, choosing between |
| 12 | choosing between different forms of web hosting can be a daunting | 12 | different forms of web hosting can be a daunting choice. |
| 13 | choice. | 13 | |
| 14 | 14 | First, let's take a look at [shared web | |
| 15 | First, let\'s take a look at [shared web | 15 | hosting](https://en.wikipedia.org/wiki/Shared_web_hosting_service). Shared web |
| 16 | hosting](https://en.wikipedia.org/wiki/Shared_web_hosting_service). | 16 | hosting is a product where you are purchasing a small piece of a web server that |
| 17 | Shared web hosting is a product where you are purchasing a small piece | 17 | is being shared between many websites. As a result, the cost of shared hosting |
| 18 | of a web server that is being shared between many websites. As a result, | 18 | is extremely low. You won't have access to the server itself, which means you |
| 19 | the cost of shared hosting is extremely low. You won\'t have access to | 19 | can't install your own software on the server, such as Docker. Usually, you are |
| 20 | the server itself, which means you can\'t install your own software on | 20 | simply allowed to connect your domains to the server, set up domain security, |
| 21 | the server, such as Docker. Usually, you are simply allowed to connect | 21 | and other small utilities. |
| 22 | your domains to the server, set up domain security, and other small | ||
| 23 | utilities. | ||
| 24 | 22 | ||
| 25 | In contrast, a [virtual private | 23 | In contrast, a [virtual private |
| 26 | server](https://en.wikipedia.org/wiki/Virtual_private_server) (VPS) is a | 24 | server](https://en.wikipedia.org/wiki/Virtual_private_server) (VPS) is a virtual |
| 27 | virtual machine that replicates the environment of having a dedicated | 25 | machine that replicates the environment of having a dedicated server to |
| 28 | server to yourself. You are able to control the virtual server\'s host | 26 | yourself. You are able to control the virtual server's host names, base file |
| 29 | names, base file system, package manager, etc. Another great upside of a | 27 | system, package manager, etc. Another great upside of a VPS is that since it's |
| 30 | VPS is that since it\'s virtual, the company providing the VPS can | 28 | virtual, the company providing the VPS can dynamically increase the disk size, |
| 31 | dynamically increase the disk size, RAM size, or number of CPUs at any | 29 | RAM size, or number of CPUs at any time. However, the virtual server is still |
| 32 | time. However, the virtual server is still physically located on a | 30 | physically located on a server that is shared between multiple virtual servers. |
| 33 | server that is shared between multiple virtual servers. | 31 | |
| 34 | 32 | The choice between shared hosting and VPS mostly depends on your skill level | |
| 35 | The choice between shared hosting and VPS mostly depends on your skill | 33 | with system administration. If you're comforting working on a server that is |
| 36 | level with system administration. If you\'re comforting working on a | 34 | mostly left up to you (or you're willing to learn), then a VPS is usually a |
| 37 | server that is mostly left up to you (or you\'re willing to learn), then | 35 | better option. However, shared hosting is a fantastic option for people who |
| 38 | a VPS is usually a better option. However, shared hosting is a fantastic | 36 | don't want to have to learn how to manage their server. |
| 39 | option for people who don\'t want to have to learn how to manage their | ||
| 40 | server. | ||
| 41 | 37 | ||
| 42 | # My Situation | 38 | # My Situation |
| 43 | 39 | ||
| 44 | I had used shared hosting for approximately 5 years before trying my | 40 | I had used shared hosting for approximately 5 years before trying my first VPS. |
| 45 | first VPS. I manage a homelab and have had success running a server and | 41 | I manage a homelab and have had success running a server and performing typical |
| 46 | performing typical sysadmin duties, but I was still hesitant to get a | 42 | sysadmin duties, but I was still hesitant to get a VPS. One fear was that I |
| 47 | VPS. One fear was that I always struggled to properly set up the | 43 | always struggled to properly set up the networking part of a server - DNS and |
| 48 | networking part of a server - DNS and hostname configurations were not | 44 | hostname configurations were not my friend. |
| 49 | my friend. | ||
| 50 | 45 | ||
| 51 | As a little bit of background, I originally used | 46 | As a little bit of background, I originally used |
| 52 | [Siteground](https://www.siteground.com) for my initially shared hosting | 47 | [Siteground](https://www.siteground.com) for my initially shared hosting and |
| 53 | and stayed on that platform for at least a year. However, the UI was | 48 | stayed on that platform for at least a year. However, the UI was clunky, and I |
| 54 | clunky, and I didn\'t like how they handled certain technical aspects, | 49 | didn't like how they handled certain technical aspects, so I switched to |
| 55 | so I switched to [Namecheap](https://www.namecheap.com). Namecheap was | 50 | [Namecheap](https://www.namecheap.com). Namecheap was great because it is the |
| 56 | great because it is the service I primarily use for purchasing domain | 51 | service I primarily use for purchasing domain names, which made it incredibly |
| 57 | names, which made it incredibly easy to link them to my hosting service. | 52 | easy to link them to my hosting service. However, it was still mediocre shared |
| 58 | However, it was still mediocre shared hosting, and Namecheap is | 53 | hosting, and Namecheap is notorious for not letting you use [Let's |
| 59 | notorious for not letting you use [Let\'s | 54 | Encrypt](https://letsencrypt.org) to obtain free SSL/TLS certificates; Namecheap |
| 60 | Encrypt](https://letsencrypt.org) to obtain free SSL/TLS certificates; | 55 | wants to make you purchase certificates through their store. |
| 61 | Namecheap wants to make you purchase certificates through their store. | 56 | |
| 62 | 57 | Finally, I settled down with [iWebFusion](https://www.iwebfusion.net) for about | |
| 63 | Finally, I settled down with [iWebFusion](https://www.iwebfusion.net) | 58 | the last year of my shared hosting. This service was pretty great, came with |
| 64 | for about the last year of my shared hosting. This service was pretty | 59 | free SSL/TLS, and I never had any complaints. |
| 65 | great, came with free SSL/TLS, and I never had any complaints. | 60 | |
| 66 | 61 | However, I finally grew tired of not being able to install software on my own | |
| 67 | However, I finally grew tired of not being able to install software on | 62 | web server. I wanted to be able to try out things like |
| 68 | my own web server. I wanted to be able to try out things like | 63 | [Postmill](https://postmill.xyz) or [Matrix](https://matrix.org). This is |
| 69 | [Postmill](https://postmill.xyz) or [Matrix](https://matrix.org). This | 64 | possible with a VPS, so I decided to grab a new domain name to try it out. |
| 70 | is possible with a VPS, so I decided to grab a new domain name to try it | ||
| 71 | out. | ||
| 72 | 65 | ||
| 73 | # Getting Started: Buying a VPS | 66 | # Getting Started: Buying a VPS |
| 74 | 67 | ||
| 75 | The first step to moving over to a VPS is (you guessed it): finding a | 68 | The first step to moving over to a VPS is (you guessed it): finding a VPS |
| 76 | VPS provider. For my VPSs, I use [1984](https://1984hosting.com) and | 69 | provider. For my VPSs, I use [1984](https://1984hosting.com) and prefer their |
| 77 | prefer their services much more than any alternative, due to their | 70 | services much more than any alternative, due to their location (Iceland), their |
| 78 | location (Iceland), their [privacy | 71 | [privacy policy](https://1984hosting.com/GDPR/), their respect for GDPR, and the |
| 79 | policy](https://1984hosting.com/GDPR/), their respect for GDPR, and the | ||
| 80 | ability to remain anonymous if you pay in Bitcoin or Monero. | 72 | ability to remain anonymous if you pay in Bitcoin or Monero. |
| 81 | 73 | ||
| 82 | [Njalla](https://njal.la) is another good, privacy-oriented option for | 74 | [Njalla](https://njal.la) is another good, privacy-oriented option for VPS |
| 83 | VPS services. | 75 | services. |
| 84 | 76 | ||
| 85 | You\'ll have to decide what specifications you want on your VPS. For me, | 77 | You'll have to decide what specifications you want on your VPS. For me, I only |
| 86 | I only build and deploy low-resource HTML, PHP, and Python websites. | 78 | build and deploy low-resource HTML, PHP, and Python websites. This means I can |
| 87 | This means I can survive on the smallest VPS: 1 CPU, 1GB of RAM, and | 79 | survive on the smallest VPS: 1 CPU, 1GB of RAM, and 25GB SSD for $5.00 per |
| 88 | 25GB SSD for \$5.00 per month. | 80 | month. |
| 89 | 81 | ||
| 90 | As noted above, the great thing about a VPS is you can request your | 82 | As noted above, the great thing about a VPS is you can request your provider to |
| 91 | provider to increase the resources at any time. | 83 | increase the resources at any time. |
| 92 | 84 | ||
| 93 | # Configuring DNS Settings | 85 | # Configuring DNS Settings |
| 94 | 86 | ||
| 95 | Okay, so now let\'s get into some actual work that has to be done to get | 87 | Okay, so now let's get into some actual work that has to be done to get content |
| 96 | content moved from a shared host to a VPS. At this point, I\'m assuming | 88 | moved from a shared host to a VPS. At this point, I'm assuming you have a |
| 97 | you have a shared host with website content that you can still access, | 89 | shared host with website content that you can still access, and you've |
| 98 | and you\'ve purchased a new VPS and can SSH into that server. | 90 | purchased a new VPS and can SSH into that server. |
| 99 | 91 | ||
| 100 | The first change is minor, but it should be done immediately in order to | 92 | The first change is minor, but it should be done immediately in order to get |
| 101 | get things moving: DNS settings. Go to wherever your DNS settings are | 93 | things moving: DNS settings. Go to wherever your DNS settings are handled. If |
| 102 | handled. If your shared host also managed your DNS settings, you\'ll | 94 | your shared host also managed your DNS settings, you'll need to first move that |
| 103 | need to first move that DNS over to your new VPS provider. For me, I | 95 | DNS over to your new VPS provider. For me, I route my DNS through |
| 104 | route my DNS through [Gandi](https://www.gandi.net). | 96 | [Gandi](https://www.gandi.net). |
| 105 | 97 | ||
| 106 | Once you know where your DNS settings are, go ahead and update the | 98 | Once you know where your DNS settings are, go ahead and update the `A` records |
| 107 | `A` records to match the public IP address of your VPS. For | 99 | to match the public IP address of your VPS. For example: |
| 108 | example: | ||
| 109 | 100 | ||
| 110 | ``` txt | 101 | ``` txt |
| 111 | A example.com xxx.xxx.xxx.xxx | 102 | A example.com xxx.xxx.xxx.xxx |
| @@ -113,37 +104,36 @@ A subdomain xxx.xxx.xxx.xxx | |||
| 113 | CNAME www example.com. | 104 | CNAME www example.com. |
| 114 | ``` | 105 | ``` |
| 115 | 106 | ||
| 116 | If you have any other records that require updates, such as MX or TXT | 107 | If you have any other records that require updates, such as MX or TXT records |
| 117 | records for a mail server, be sure to update those accordingly. | 108 | for a mail server, be sure to update those accordingly. Personally, I don't |
| 118 | Personally, I don\'t host my own mail server. I route all mail on my | 109 | host my own mail server. I route all mail on my custom domains to |
| 119 | custom domains to [Migadu](https://www.migadu.com). Hosting your own | 110 | [Migadu](https://www.migadu.com). Hosting your own email server can become |
| 120 | email server can become complex quickly and is not for beginners. | 111 | complex quickly and is not for beginners. |
| 121 | 112 | ||
| 122 | DNS changes can take up to 48 hours to propagate, so be sure to give it | 113 | DNS changes can take up to 48 hours to propagate, so be sure to give it some |
| 123 | some time before assuming you\'ve made an error. | 114 | time before assuming you've made an error. |
| 124 | 115 | ||
| 125 | # Server Updates and Packages | 116 | # Server Updates and Packages |
| 126 | 117 | ||
| 127 | Now that the DNS settings have been changed, let\'s set up our server | 118 | Now that the DNS settings have been changed, let's set up our server while we |
| 128 | while we wait for the DNS to propagate. First up is to ssh into your | 119 | wait for the DNS to propagate. First up is to ssh into your server. If you've |
| 129 | server. If you\'ve signed up with a service like DigitalOcean, you can | 120 | signed up with a service like DigitalOcean, you can add your SSH key to your |
| 130 | add your SSH key to your account and to your VPS droplet so that you | 121 | account and to your VPS droplet so that you don't need a password in order to |
| 131 | don\'t need a password in order to SSH. | 122 | SSH. |
| 132 | 123 | ||
| 133 | ```sh | 124 | ```sh |
| 134 | ssh root@xxx.xxx.xxx.xxx | 125 | ssh root@xxx.xxx.xxx.xxx |
| 135 | ``` | 126 | ``` |
| 136 | 127 | ||
| 137 | The VPS that is used in this blog post runs Ubuntu 20.04 with an Apache | 128 | The VPS that is used in this blog post runs Ubuntu 20.04 with an Apache web |
| 138 | web server. If you\'re working on a different operating system (OS) or | 129 | server. If you're working on a different operating system (OS) or want a |
| 139 | want a different web server, such as Nginx, you\'ll have to use | 130 | different web server, such as Nginx, you'll have to use different commands to |
| 140 | different commands to set it up. | 131 | set it up. |
| 141 | 132 | ||
| 142 | First, let\'s update and upgrade our server. | 133 | First, let's update and upgrade our server. |
| 143 | 134 | ||
| 144 | **NOTE:** Since we have logged in to the server as `root` for | 135 | **NOTE:** Since we have logged in to the server as `root` for now, we don't |
| 145 | now, we don\'t need to use the `sudo` modifier before our | 136 | need to use the `sudo` modifier before our commands. |
| 146 | commands. | ||
| 147 | 137 | ||
| 148 | ```sh | 138 | ```sh |
| 149 | apt update && apt upgrade -y | 139 | apt update && apt upgrade -y |
| @@ -151,11 +141,11 @@ apt update && apt upgrade -y | |||
| 151 | 141 | ||
| 152 | # Create A User Account | 142 | # Create A User Account |
| 153 | 143 | ||
| 154 | While being able to use `root` can be beneficial at times, | 144 | While being able to use `root` can be beneficial at times, you shouldn't use |
| 155 | you shouldn\'t use `root` unless you have to. | 145 | `root` unless you have to. |
| 156 | 146 | ||
| 157 | So let\'s set up a new user in our system. The `-m` option | 147 | So let's set up a new user in our system. The `-m` option below tells the OS to |
| 158 | below tells the OS to create a home directory for the new user. | 148 | create a home directory for the new user. |
| 159 | 149 | ||
| 160 | ```sh | 150 | ```sh |
| 161 | adduser USERNAME | 151 | adduser USERNAME |
| @@ -167,41 +157,40 @@ Now, create a password for that user. | |||
| 167 | passwd USERNAME | 157 | passwd USERNAME |
| 168 | ``` | 158 | ``` |
| 169 | 159 | ||
| 170 | Finally, add the user to the sudoers file, so they can perform | 160 | Finally, add the user to the sudoers file, so they can perform priveleged |
| 171 | priveleged commands. | 161 | commands. |
| 172 | 162 | ||
| 173 | ```sh | 163 | ```sh |
| 174 | usermod -a -G sudo USERNAME | 164 | usermod -a -G sudo USERNAME |
| 175 | ``` | 165 | ``` |
| 176 | 166 | ||
| 177 | If you are using SSH keys and not passwords, you\'ll need to copy your | 167 | If you are using SSH keys and not passwords, you'll need to copy your SSH key |
| 178 | SSH key from your local machine to the VPS. If you haven\'t disabled | 168 | from your local machine to the VPS. If you haven't disabled password-based SSH |
| 179 | password-based SSH yet, the easiest way to do this is | 169 | yet, the easiest way to do this is `ssh-copy-id` from your local computer (not |
| 180 | `ssh-copy-id` from your local computer (not from the VPS): | 170 | from the VPS): |
| 181 | 171 | ||
| 182 | ```sh | 172 | ```sh |
| 183 | ssh-copy-id testuser@xxx.xxx.xxx.xxx | 173 | ssh-copy-id testuser@xxx.xxx.xxx.xxx |
| 184 | ``` | 174 | ``` |
| 185 | 175 | ||
| 186 | If you\'ve disabled password-based SSH, you\'ll need to manually copy | 176 | If you've disabled password-based SSH, you'll need to manually copy your SSH |
| 187 | your SSH key into the `~/.ssh/authorized_keys` file. | 177 | key into the `~/.ssh/authorized_keys` file. |
| 188 | 178 | ||
| 189 | # Install Software | 179 | # Install Software |
| 190 | 180 | ||
| 191 | Our goal here is to host a web server, so the next step is to install | 181 | Our goal here is to host a web server, so the next step is to install the Apache |
| 192 | the Apache web server and any other packages we need. | 182 | web server and any other packages we need. |
| 193 | 183 | ||
| 194 | From this point on, I will be logged in as a user (not | 184 | From this point on, I will be logged in as a user (not `root`) and will need to |
| 195 | `root`) and will need to use the `sudo` modifier | 185 | use the `sudo` modifier for most commands. |
| 196 | for most commands. | ||
| 197 | 186 | ||
| 198 | ```sh | 187 | ```sh |
| 199 | sudo apt update; sudo apt upgrade -y; sudo apt autoremove -y | 188 | sudo apt update; sudo apt upgrade -y; sudo apt autoremove -y |
| 200 | sudo apt install apache2 | 189 | sudo apt install apache2 |
| 201 | ``` | 190 | ``` |
| 202 | 191 | ||
| 203 | If you need other language support, such as PHP, you\'ll need to install | 192 | If you need other language support, such as PHP, you'll need to install that |
| 204 | that too. | 193 | too. |
| 205 | 194 | ||
| 206 | ```sh | 195 | ```sh |
| 207 | sudo apt install libapache2-mod-php php-dom | 196 | sudo apt install libapache2-mod-php php-dom |
| @@ -211,20 +200,18 @@ sudo systemctl restart apache2 | |||
| 211 | 200 | ||
| 212 | # Website Files & Folders | 201 | # Website Files & Folders |
| 213 | 202 | ||
| 214 | Next up is to create the directories for the domain(s) we want to be | 203 | Next up is to create the directories for the domain(s) we want to be hosted on |
| 215 | hosted on this web server. | 204 | this web server. |
| 216 | 205 | ||
| 217 | ```sh | 206 | ```sh |
| 218 | cd /var/www | 207 | cd /var/www |
| 219 | sudo mkdir example.com | 208 | sudo mkdir example.com |
| 220 | ``` | 209 | ``` |
| 221 | 210 | ||
| 222 | We have a folder for `example.com` now, so let\'s add an | 211 | We have a folder for `example.com` now, so let's add an `index.html` file and |
| 223 | `index.html` file and put it within a specific | 212 | put it within a specific `public_html` folder. You don't need this |
| 224 | `public_html` folder. You don\'t need this | 213 | `public_html` if you don't want it, but it helps with organizing items related |
| 225 | `public_html` if you don\'t want it, but it helps with | 214 | to `example.com` that you don't want to publish to the internet. |
| 226 | organizing items related to `example.com` that you don\'t | ||
| 227 | want to publish to the internet. | ||
| 228 | 215 | ||
| 229 | ```sh | 216 | ```sh |
| 230 | cd example.com | 217 | cd example.com |
| @@ -232,8 +219,8 @@ sudo mkdir public_html && cd public_html | |||
| 232 | sudo nano index.html | 219 | sudo nano index.html |
| 233 | ``` | 220 | ``` |
| 234 | 221 | ||
| 235 | You can put anything you want in this `index.html` file. If | 222 | You can put anything you want in this `index.html` file. If you can't think of |
| 236 | you can\'t think of anything, paste this in there: | 223 | anything, paste this in there: |
| 237 | 224 | ||
| 238 | ``` html | 225 | ``` html |
| 239 | <!DOCTYPE html> | 226 | <!DOCTYPE html> |
| @@ -249,10 +236,9 @@ you can\'t think of anything, paste this in there: | |||
| 249 | </html> | 236 | </html> |
| 250 | ``` | 237 | ``` |
| 251 | 238 | ||
| 252 | If you want something to be served at | 239 | If you want something to be served at `example.com/page01/file.txt`, you'll |
| 253 | `example.com/page01/file.txt`, you\'ll have to create the | 240 | have to create the `page01` directory under the `example.com` directory. For |
| 254 | `page01` directory under the `example.com` | 241 | example: |
| 255 | directory. For example: | ||
| 256 | 242 | ||
| 257 | ```sh | 243 | ```sh |
| 258 | cd /var/www/example.com/public_html | 244 | cd /var/www/example.com/public_html |
| @@ -262,9 +248,9 @@ sudo nano file.txt | |||
| 262 | 248 | ||
| 263 | # Apache Configuration | 249 | # Apache Configuration |
| 264 | 250 | ||
| 265 | Now, let\'s set up the files that will tell the server where to find the | 251 | Now, let's set up the files that will tell the server where to find the files |
| 266 | files for `example.com`. We will copy the default | 252 | for `example.com`. We will copy the default configuration file and create our |
| 267 | configuration file and create our own. | 253 | own. |
| 268 | 254 | ||
| 269 | ```sh | 255 | ```sh |
| 270 | cd /etc/apache2/sites-available | 256 | cd /etc/apache2/sites-available |
| @@ -272,9 +258,8 @@ sudo cp 000-default.conf example.com.conf | |||
| 272 | sudo nano example.com.conf | 258 | sudo nano example.com.conf |
| 273 | ``` | 259 | ``` |
| 274 | 260 | ||
| 275 | This configuration file will have a few default lines, but you\'ll need | 261 | This configuration file will have a few default lines, but you'll need to edit |
| 276 | to edit it to look similar to this (settings may change based on your | 262 | it to look similar to this (settings may change based on your personal needs): |
| 277 | personal needs): | ||
| 278 | 263 | ||
| 279 | ``` config | 264 | ``` config |
| 280 | <VirtualHost *:80> | 265 | <VirtualHost *:80> |
| @@ -296,35 +281,33 @@ sudo a2dissite 000-default.conf | |||
| 296 | sudo systemctl reload apache2 | 281 | sudo systemctl reload apache2 |
| 297 | ``` | 282 | ``` |
| 298 | 283 | ||
| 299 | You can always run a test to make sure no errors or warnings are found | 284 | You can always run a test to make sure no errors or warnings are found in your |
| 300 | in your configuration files. | 285 | configuration files. |
| 301 | 286 | ||
| 302 | ```sh | 287 | ```sh |
| 303 | sudo apache2ctl configtest | 288 | sudo apache2ctl configtest |
| 304 | ``` | 289 | ``` |
| 305 | 290 | ||
| 306 | Now, restart the web server entirely. After this, you should be able to | 291 | Now, restart the web server entirely. After this, you should be able to browse |
| 307 | browse to `http://example.com` and see the HTML content you | 292 | to `http://example.com` and see the HTML content you provided earlier. Note that |
| 308 | provided earlier. Note that SSL/TLS has not been enabled yet, so you | 293 | SSL/TLS has not been enabled yet, so you won't be able to use the secure |
| 309 | won\'t be able to use the secure version yet | 294 | version yet (`https://example.com`). |
| 310 | (`https://example.com`). | ||
| 311 | 295 | ||
| 312 | ```sh | 296 | ```sh |
| 313 | sudo systemctl restart apache2 | 297 | sudo systemctl restart apache2 |
| 314 | ``` | 298 | ``` |
| 315 | 299 | ||
| 316 | You can repeat this for as many websites as you need. Just create the | 300 | You can repeat this for as many websites as you need. Just create the domain |
| 317 | domain folders in `/var/www/`, add the configuration file, | 301 | folders in `/var/www/`, add the configuration file, enable the configuration, |
| 318 | enable the configuration, and restart `apache2`. | 302 | and restart `apache2`. |
| 319 | 303 | ||
| 320 | # SSL/TLS Certificates: Serve Websites Over HTTPS | 304 | # SSL/TLS Certificates: Serve Websites Over HTTPS |
| 321 | 305 | ||
| 322 | In order to serve secure content, you\'ll need to obtain SSL/TLS | 306 | In order to serve secure content, you'll need to obtain SSL/TLS certificates. |
| 323 | certificates. Luckily, there\'s a free tool called | 307 | Luckily, there's a free tool called [Certbot](https://certbot.eff.org) that |
| 324 | [Certbot](https://certbot.eff.org) that helps us with the process. | 308 | helps us with the process. |
| 325 | 309 | ||
| 326 | The first step is to install `snapd` and `core` | 310 | The first step is to install `snapd` and `core` for Ubuntu. |
| 327 | for Ubuntu. | ||
| 328 | 311 | ||
| 329 | ```sh | 312 | ```sh |
| 330 | sudo apt install snapd | 313 | sudo apt install snapd |
| @@ -338,8 +321,7 @@ Next, install the `certbot` snap package. | |||
| 338 | sudo snap install --classic certbot | 321 | sudo snap install --classic certbot |
| 339 | ``` | 322 | ``` |
| 340 | 323 | ||
| 341 | Execute the following command to ensure that the `certbot` | 324 | Execute the following command to ensure that the `certbot` command can be run. |
| 342 | command can be run. | ||
| 343 | 325 | ||
| 344 | ```sh | 326 | ```sh |
| 345 | sudo ln -s /snap/bin/certbot /usr/bin/certbot | 327 | sudo ln -s /snap/bin/certbot /usr/bin/certbot |
| @@ -347,10 +329,10 @@ sudo ln -s /snap/bin/certbot /usr/bin/certbot | |||
| 347 | 329 | ||
| 348 | Finally, you can run `certbot` one of two ways: | 330 | Finally, you can run `certbot` one of two ways: |
| 349 | 331 | ||
| 350 | 1. run it and let it alter your Apache configuration files | 332 | 1. run it and let it alter your Apache configuration files automatically to |
| 351 | automatically to enable HTTPS redirects. | 333 | enable HTTPS redirects. |
| 352 | 2. run it and only allow it to create certificates. You\'ll need to | 334 | 2. run it and only allow it to create certificates. You'll need to manually |
| 353 | manually alter the config files to enable HTTPS redirects. | 335 | alter the config files to enable HTTPS redirects. |
| 354 | 336 | ||
| 355 | Run certbot and allow automatic config changes: | 337 | Run certbot and allow automatic config changes: |
| 356 | 338 | ||
| @@ -358,18 +340,16 @@ Run certbot and allow automatic config changes: | |||
| 358 | sudo certbot --apache | 340 | sudo certbot --apache |
| 359 | ``` | 341 | ``` |
| 360 | 342 | ||
| 361 | Run certbot for certificates only and don\'t allow it to alter config | 343 | Run certbot for certificates only and don't allow it to alter config files: |
| 362 | files: | ||
| 363 | 344 | ||
| 364 | ```sh | 345 | ```sh |
| 365 | sudo certbot certonly --apache | 346 | sudo certbot certonly --apache |
| 366 | ``` | 347 | ``` |
| 367 | 348 | ||
| 368 | The Certbot packages on your system come with a cron job or systemd | 349 | The Certbot packages on your system come with a cron job or systemd timer that |
| 369 | timer that will renew your certificates automatically before they | 350 | will renew your certificates automatically before they expire. You will not need |
| 370 | expire. You will not need to run Certbot again unless you change your | 351 | to run Certbot again unless you change your configuration. You can test |
| 371 | configuration. You can test automatic renewal for your certificates by | 352 | automatic renewal for your certificates by running this command: |
| 372 | running this command: | ||
| 373 | 353 | ||
| 374 | ```sh | 354 | ```sh |
| 375 | sudo certbot renew --dry-run | 355 | sudo certbot renew --dry-run |
| @@ -379,13 +359,13 @@ Now, test your domains by going to `https://example.com`. | |||
| 379 | 359 | ||
| 380 | # Firewall Security | 360 | # Firewall Security |
| 381 | 361 | ||
| 382 | To enable better security on your server, you\'ll need to enable a basic | 362 | To enable better security on your server, you'll need to enable a basic |
| 383 | firewall. For Ubuntu, we\'ll use [the uncomplicated | 363 | firewall. For Ubuntu, we'll use [the uncomplicated |
| 384 | firewall](../secure-your-network-with-the-uncomplicated-firewall/). | 364 | firewall](../secure-your-network-with-the-uncomplicated-firewall/). |
| 385 | 365 | ||
| 386 | Now, add the following rules to the firewall allow SSH, Apache, and | 366 | Now, add the following rules to the firewall allow SSH, Apache, and HTTP(S) |
| 387 | HTTP(S) connections. If you need to, you can enable different ports for | 367 | connections. If you need to, you can enable different ports for specifics |
| 388 | specifics applications, SFTP, etc. | 368 | applications, SFTP, etc. |
| 389 | 369 | ||
| 390 | ```sh | 370 | ```sh |
| 391 | sudo ufw default deny incoming | 371 | sudo ufw default deny incoming |
| @@ -395,7 +375,7 @@ sudo ufw allow Apache | |||
| 395 | sudo ufw allow proto tcp from any to any port 80,443 | 375 | sudo ufw allow proto tcp from any to any port 80,443 |
| 396 | ``` | 376 | ``` |
| 397 | 377 | ||
| 398 | Once you\'ve added all the rules you need, enable the firewall. | 378 | Once you've added all the rules you need, enable the firewall. |
| 399 | 379 | ||
| 400 | ```sh | 380 | ```sh |
| 401 | sudo ufw enable | 381 | sudo ufw enable |
| @@ -403,16 +383,15 @@ sudo ufw enable | |||
| 403 | 383 | ||
| 404 | # Troubleshooting | 384 | # Troubleshooting |
| 405 | 385 | ||
| 406 | If you run into any issues during your VPS set-up, be sure to walk back | 386 | If you run into any issues during your VPS set-up, be sure to walk back through |
| 407 | through your actions and make sure you didn\'t miss any steps. | 387 | your actions and make sure you didn't miss any steps. |
| 408 | 388 | ||
| 409 | Many websites have fantastic guides to setting up various web servers. | 389 | Many websites have fantastic guides to setting up various web servers. This is |
| 410 | This is one of the areas [where DigitalOcean | 390 | one of the areas [where DigitalOcean |
| 411 | shines](https://www.digitalocean.%20com/community/tutorials). For | 391 | shines](https://www.digitalocean.%20com/community/tutorials). For simpler or |
| 412 | simpler or more Linux-oriented questions, I suggest using \[Linuxize\] | 392 | more Linux-oriented questions, I suggest using [Linuxize] |
| 413 | (<https://linuxize.com>). | 393 | (<https://linuxize.com>). |
| 414 | 394 | ||
| 415 | If you\'re getting certain errors (e.g. | 395 | If you're getting certain errors (e.g. `500 Internal Server Error`) and need to |
| 416 | `500 Internal Server Error`) and need to debug locally, you | 396 | debug locally, you can view the `access.log` and `error.log` files in the |
| 417 | can view the `access.log` and `error.log` files in | 397 | `/var/log/apache/` directory. |
| 418 | the `/var/log/apache/` directory. | ||
content/blog/2021-04-17-gemini-server.md +36 −40
| @@ -7,28 +7,27 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Similar Article Available | 8 | # Similar Article Available |
| 9 | 9 | ||
| 10 | To read more about Gemini and ways to test out this new protocol without | 10 | To read more about Gemini and ways to test out this new protocol without your |
| 11 | your own server, see my previous post [Launching a Gemini | 11 | own server, see my previous post [Launching a Gemini |
| 12 | Capsule](../launching-a-gemini-capsule/). | 12 | Capsule](../launching-a-gemini-capsule/). |
| 13 | 13 | ||
| 14 | # Preparation | 14 | # Preparation |
| 15 | 15 | ||
| 16 | This guide assumes you have access to a server accessible to the world | 16 | This guide assumes you have access to a server accessible to the world through a |
| 17 | through a public IP address and that you own a domain name used for this | 17 | public IP address and that you own a domain name used for this Gemini capsule. |
| 18 | Gemini capsule. | ||
| 19 | 18 | ||
| 20 | # Getting Started with Agate | 19 | # Getting Started with Agate |
| 21 | 20 | ||
| 22 | We are going to use [Agate](https://github.com/mbrubeck/agate) for this | 21 | We are going to use [Agate](https://github.com/mbrubeck/agate) for this |
| 23 | tutorial. This is a basic Gemini server written in Rust. It takes very | 22 | tutorial. This is a basic Gemini server written in Rust. It takes very little |
| 24 | little time and maintenance to get it running. | 23 | time and maintenance to get it running. |
| 25 | 24 | ||
| 26 | # Install Dependencies | 25 | # Install Dependencies |
| 27 | 26 | ||
| 28 | First, you will need to install the Rust package for your system. On | 27 | First, you will need to install the Rust package for your system. On Ubuntu, use |
| 29 | Ubuntu, use the following commands (remember to use `sudo` if | 28 | the following commands (remember to use `sudo` if you are not the root user). |
| 30 | you are not the root user). The Rust installation will give you options | 29 | The Rust installation will give you options to customize the installation; I |
| 31 | to customize the installation; I used the default installation options. | 30 | used the default installation options. |
| 32 | 31 | ||
| 33 | ```sh | 32 | ```sh |
| 34 | sudo apt update && sudo apt upgrade -y | 33 | sudo apt update && sudo apt upgrade -y |
| @@ -41,15 +40,14 @@ Remember to configure your shell with the new configuration: | |||
| 41 | source $HOME/.cargo/env | 40 | source $HOME/.cargo/env |
| 42 | ``` | 41 | ``` |
| 43 | 42 | ||
| 44 | Before we install agate, make sure you have the `gcc` package | 43 | Before we install agate, make sure you have the `gcc` package installed: |
| 45 | installed: | ||
| 46 | 44 | ||
| 47 | ```sh | 45 | ```sh |
| 48 | sudo apt install gcc | 46 | sudo apt install gcc |
| 49 | ``` | 47 | ``` |
| 50 | 48 | ||
| 51 | Next, you\'ll need to install the agate executable with Rust\'s Cargo | 49 | Next, you'll need to install the agate executable with Rust's Cargo package |
| 52 | package maintainer: | 50 | maintainer: |
| 53 | 51 | ||
| 54 | ```sh | 52 | ```sh |
| 55 | cargo install agate | 53 | cargo install agate |
| @@ -57,18 +55,17 @@ cargo install agate | |||
| 57 | 55 | ||
| 58 | # Create Symlinks | 56 | # Create Symlinks |
| 59 | 57 | ||
| 60 | Once Cargo has finished installing all the required packages, symlink | 58 | Once Cargo has finished installing all the required packages, symlink the |
| 61 | the executable to your \$PATH. | 59 | executable to your $PATH. |
| 62 | 60 | ||
| 63 | ```sh | 61 | ```sh |
| 64 | sudo ln -s $HOME/.cargo/bin/agate /usr/local/bin/agate | 62 | sudo ln -s $HOME/.cargo/bin/agate /usr/local/bin/agate |
| 65 | ``` | 63 | ``` |
| 66 | 64 | ||
| 67 | # Using Agate\'s Built-In Installation Tool | 65 | # Using Agate's Built-In Installation Tool |
| 68 | 66 | ||
| 69 | If you\'re running Ubuntu or Debian, use the Debian installation script | 67 | If you're running Ubuntu or Debian, use the Debian installation script found in |
| 70 | found in Agate\'s GitHub repository, under the `tools/debian` | 68 | Agate's GitHub repository, under the `tools/debian` folder. |
| 71 | folder. | ||
| 72 | 69 | ||
| 73 | ```sh | 70 | ```sh |
| 74 | git clone https://github.com/mbrubeck/agate | 71 | git clone https://github.com/mbrubeck/agate |
| @@ -78,11 +75,10 @@ sudo ./install.sh | |||
| 78 | 75 | ||
| 79 | # Configure the Gemini Service | 76 | # Configure the Gemini Service |
| 80 | 77 | ||
| 81 | We have a little more to do, but since this script tries to immediately | 78 | We have a little more to do, but since this script tries to immediately run the |
| 82 | run the service, it will likely fail with an exit code. Let\'s add our | 79 | service, it will likely fail with an exit code. Let's add our finishing |
| 83 | finishing touches. Edit the following file and replace the hostname with | 80 | touches. Edit the following file and replace the hostname with your desired URL. |
| 84 | your desired URL. You can also change the directory where content will | 81 | You can also change the directory where content will be served. |
| 85 | be served. | ||
| 86 | 82 | ||
| 87 | ```sh | 83 | ```sh |
| 88 | sudo nano /etc/systemd/system/gemini.service | 84 | sudo nano /etc/systemd/system/gemini.service |
| @@ -101,8 +97,8 @@ WorkingDirectory=/var/gemini/ | |||
| 101 | ExecStart=agate --hostname gemini.example.com --lang en | 97 | ExecStart=agate --hostname gemini.example.com --lang en |
| 102 | ``` | 98 | ``` |
| 103 | 99 | ||
| 104 | Since we\'ve altered the systemd configuration files, we have to reload | 100 | Since we've altered the systemd configuration files, we have to reload the |
| 105 | the daemon. Let\'s do that, restart our service, and check its status. | 101 | daemon. Let's do that, restart our service, and check its status. |
| 106 | 102 | ||
| 107 | ```sh | 103 | ```sh |
| 108 | sudo systemctl daemon-reload | 104 | sudo systemctl daemon-reload |
| @@ -112,8 +108,8 @@ sudo systemctl status gemini.service | |||
| 112 | 108 | ||
| 113 | # Fixing Systemd Errors | 109 | # Fixing Systemd Errors |
| 114 | 110 | ||
| 115 | If you\'re still getting errors, the installation process may not have | 111 | If you're still getting errors, the installation process may not have properly |
| 116 | properly enabled the gemini service. Fix it with the following commands. | 112 | enabled the gemini service. Fix it with the following commands. |
| 117 | 113 | ||
| 118 | ```sh | 114 | ```sh |
| 119 | sudo systemctl enable gemini.service | 115 | sudo systemctl enable gemini.service |
| @@ -123,9 +119,9 @@ sudo systemctl status gemini.service | |||
| 123 | 119 | ||
| 124 | # Firewall Rules | 120 | # Firewall Rules |
| 125 | 121 | ||
| 126 | Great! Our server is now functional and running. The first consideration | 122 | Great! Our server is now functional and running. The first consideration now is |
| 127 | now is that you need to be able to access port 1965 on the server. If | 123 | that you need to be able to access port 1965 on the server. If you have a |
| 128 | you have a firewall enabled, you\'ll need to open that port up. | 124 | firewall enabled, you'll need to open that port up. |
| 129 | 125 | ||
| 130 | ```sh | 126 | ```sh |
| 131 | sudo ufw allow 1965 | 127 | sudo ufw allow 1965 |
| @@ -134,19 +130,19 @@ sudo ufw reload | |||
| 134 | 130 | ||
| 135 | # Creating Content | 131 | # Creating Content |
| 136 | 132 | ||
| 137 | Let\'s create the Gemini capsule. Note that wherever you set the | 133 | Let's create the Gemini capsule. Note that wherever you set the |
| 138 | WorkingDirectory variable to earlier, Agate will expect you to put your | 134 | WorkingDirectory variable to earlier, Agate will expect you to put your Gemini |
| 139 | Gemini capsule contents in a sub-folder called \"content.\" So, I place | 135 | capsule contents in a sub-folder called "content." So, I place my files in |
| 140 | my files in \"/var/gmi/content.\" I\'m going to create that folder now | 136 | "/var/gmi/content." I'm going to create that folder now and put a file in |
| 141 | and put a file in there. | 137 | there. |
| 142 | 138 | ||
| 143 | ```sh | 139 | ```sh |
| 144 | sudo mkdir /var/gemini/content | 140 | sudo mkdir /var/gemini/content |
| 145 | sudo nano /var/gemini/content/index.gmi | 141 | sudo nano /var/gemini/content/index.gmi |
| 146 | ``` | 142 | ``` |
| 147 | 143 | ||
| 148 | You can put whatever you want in the \"index.gmi\" file, just make sure | 144 | You can put whatever you want in the "index.gmi" file, just make sure it's |
| 149 | it\'s valid Gemtext. | 145 | valid Gemtext. |
| 150 | 146 | ||
| 151 | # The Results | 147 | # The Results |
| 152 | 148 | ||
content/blog/2021-04-23-php-comment-system.md +89 −105
| @@ -7,85 +7,78 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # The Terrible-ness of Commenting Systems | 8 | # The Terrible-ness of Commenting Systems |
| 9 | 9 | ||
| 10 | The current state of affairs regarding interactive comment systems is, | 10 | The current state of affairs regarding interactive comment systems is, well, |
| 11 | well, terrible. It is especially awful if you\'re a privacy conscious | 11 | terrible. It is especially awful if you're a privacy conscious person who does |
| 12 | person who does not generally load third-party scripts or frames on the | 12 | not generally load third-party scripts or frames on the websites you visit. |
| 13 | websites you visit. | ||
| 14 | 13 | ||
| 15 | Even further, many comment systems are charging exorbitant fees for | 14 | Even further, many comment systems are charging exorbitant fees for something |
| 16 | something that should be standard. | 15 | that should be standard. |
| 17 | 16 | ||
| 18 | Of course, there are some really terrible options: | 17 | Of course, there are some really terrible options: |
| 19 | 18 | ||
| 20 | - Facebook Comments | 19 | - Facebook Comments |
| 21 | - Discourse | 20 | - Discourse |
| 22 | 21 | ||
| 23 | There are some options that are better but still use too many scripts, | 22 | There are some options that are better but still use too many scripts, frames, |
| 24 | frames, or social integrations on your web page that could impact some | 23 | or social integrations on your web page that could impact some users: |
| 25 | users: | ||
| 26 | 24 | ||
| 27 | - Disqus | 25 | - Disqus |
| 28 | - Isso | 26 | - Isso |
| 29 | - Remark42 | 27 | - Remark42 |
| 30 | 28 | ||
| 31 | Lastly, I looked into a few unique ways of generating blog comments, | 29 | Lastly, I looked into a few unique ways of generating blog comments, such as |
| 32 | such as using Twitter threads or GitHub issues to automatically post | 30 | using Twitter threads or GitHub issues to automatically post issues. However, |
| 33 | issues. However, these both rely on external third-party sites that I | 31 | these both rely on external third-party sites that I don't currently use. |
| 34 | don\'t currently use. | ||
| 35 | 32 | ||
| 36 | # Stay Static with Server-Side Comments | 33 | # Stay Static with Server-Side Comments |
| 37 | 34 | ||
| 38 | The main issue for my personal use-case is that my blog is completely, | 35 | The main issue for my personal use-case is that my blog is completely, 100% |
| 39 | 100% static. I use PHP on the back-end but website visitors only see | 36 | static. I use PHP on the back-end but website visitors only see HTML and a |
| 40 | HTML and a single CSS file. No external javascript and no embedded | 37 | single CSS file. No external javascript and no embedded frames. |
| 41 | frames. | 38 | |
| 42 | 39 | So, how do we keep a site static and still allow users to interact with blog | |
| 43 | So, how do we keep a site static and still allow users to interact with | 40 | posts? The key actually pretty simple - I'm already using PHP, so why not rely |
| 44 | blog posts? The key actually pretty simple - I\'m already using PHP, so | 41 | on the classic HTML `<form>` and a PHP script to save the comments somewhere? As |
| 45 | why not rely on the classic HTML `<form>` and a PHP script to | 42 | it turns out, this was a perfect solution for me. |
| 46 | save the comments somewhere? As it turns out, this was a perfect | 43 | |
| 47 | solution for me. | 44 | The second issue for my personal use-case is that I am trying to keep the |
| 48 | 45 | contents of my website accessible over time, as described by @brandur, in his | |
| 49 | The second issue for my personal use-case is that I am trying to keep | 46 | post entitled [Blog with Markdown + Git, and degrade gracefully through |
| 50 | the contents of my website accessible over time, as described by | ||
| 51 | @brandur, in his post entitled [Blog with Markdown + Git, and degrade | ||
| 52 | gracefully through | ||
| 53 | time](https://brandur.org/fragments/graceful-degradation-time) . | 47 | time](https://brandur.org/fragments/graceful-degradation-time) . |
| 54 | 48 | ||
| 55 | This means I cannot rely on a database for comments, since I do not rely | 49 | This means I cannot rely on a database for comments, since I do not rely on a |
| 56 | on a database for any other part of my websites. | 50 | database for any other part of my websites. |
| 57 | 51 | ||
| 58 | I blog in plain Markdown files, commit all articles to Git, and ensure | 52 | I blog in plain Markdown files, commit all articles to Git, and ensure that |
| 59 | that future readers will be able to see the source data long after I\'m | 53 | future readers will be able to see the source data long after I'm gone, or the |
| 60 | gone, or the website has gone offline. However, I still haven\'t | 54 | website has gone offline. However, I still haven't committed any images served |
| 61 | committed any images served on my blog to Git, as I\'m not entirely sold | 55 | on my blog to Git, as I'm not entirely sold on Git LFS yet - for now, images |
| 62 | on Git LFS yet - for now, images can be found at | 56 | can be found at [img.cleberg.net](https://img.cleberg.net). |
| 63 | [img.cleberg.net](https://img.cleberg.net). | ||
| 64 | 57 | ||
| 65 | Saving my comments back to the Git repository ensures that another | 58 | Saving my comments back to the Git repository ensures that another aspect of my |
| 66 | aspect of my site will degrade gracefully. | 59 | site will degrade gracefully. |
| 67 | 60 | ||
| 68 | # Create a Comment Form | 61 | # Create a Comment Form |
| 69 | 62 | ||
| 70 | Okay, let\'s get started. The first step is to create an HTML form that | 63 | Okay, let's get started. The first step is to create an HTML form that users |
| 71 | users can see and utilize to submit comments. This is fairly easy and | 64 | can see and utilize to submit comments. This is fairly easy and can be changed |
| 72 | can be changed depending on your personal preferences. | 65 | depending on your personal preferences. |
| 73 | 66 | ||
| 74 | Take a look at the code block below for the form I currently use. Note | 67 | Take a look at the code block below for the form I currently use. Note that |
| 75 | that `<current-url>` is replaced automatically in PHP with | 68 | `<current-url>` is replaced automatically in PHP with the current post's URL, |
| 76 | the current post\'s URL, so that my PHP script used later will know | 69 | so that my PHP script used later will know which blog post the comment is |
| 77 | which blog post the comment is related to. | 70 | related to. |
| 78 | 71 | ||
| 79 | The form contains the following structure: | 72 | The form contains the following structure: |
| 80 | 73 | ||
| 81 | 1. `<form>` - This is the form and will determine which PHP | 74 | 1. `<form>` - This is the form and will determine which PHP script to send the |
| 82 | script to send the comment to. | 75 | comment to. |
| 83 | 2. `<section hidden>` - This section is hidden from the user | 76 | 2. `<section hidden>` - This section is hidden from the user and is used to |
| 84 | and is used to ensure that we know which blog post sent the comment. | 77 | ensure that we know which blog post sent the comment. |
| 85 | 3. `<section>` Display Name (Optional) - Used to accept a | 78 | 3. `<section>` Display Name (Optional) - Used to accept a display name, if |
| 86 | display name, if entered. | 79 | entered. |
| 87 | 4. `<section>` Comment (Required) - Used to accept the | 80 | 4. `<section>` Comment (Required) - Used to accept the user's full comment. |
| 88 | user\'s full comment. Markdown is allowed. | 81 | Markdown is allowed. |
| 89 | 5. `<button>` - A button to submit the form. | 82 | 5. `<button>` - A button to submit the form. |
| 90 | 83 | ||
| 91 | ``` html | 84 | ``` html |
| @@ -132,13 +125,12 @@ The form contains the following structure: | |||
| 132 | 125 | ||
| 133 | # Handle Comments via POST | 126 | # Handle Comments via POST |
| 134 | 127 | ||
| 135 | Now that we have a form and can submit comments, we need to create a PHP | 128 | Now that we have a form and can submit comments, we need to create a PHP script |
| 136 | script so that the server can fetch the comment data and save it. Make | 129 | so that the server can fetch the comment data and save it. Make sure your PHP |
| 137 | sure your PHP script name matches the name you entered in the | 130 | script name matches the name you entered in the `action` field in your form. |
| 138 | `action` field in your form. | ||
| 139 | 131 | ||
| 140 | See the code block below for the contents of my `comment.php` | 132 | See the code block below for the contents of my `comment.php` script. We perform |
| 141 | script. We perform the following tasks in this script: | 133 | the following tasks in this script: |
| 142 | 134 | ||
| 143 | 1. Grab the POST data from the HTML form. | 135 | 1. Grab the POST data from the HTML form. |
| 144 | 2. Sanitize the comment data with `htmlentities`. | 136 | 2. Sanitize the comment data with `htmlentities`. |
| @@ -146,12 +138,11 @@ script. We perform the following tasks in this script: | |||
| 146 | 4. Create a PHP object that combines all of this data. | 138 | 4. Create a PHP object that combines all of this data. |
| 147 | 5. Check if our destination file `comments.json` exists. | 139 | 5. Check if our destination file `comments.json` exists. |
| 148 | 6. If so, convert the PHP object to JSON and save it to the file. | 140 | 6. If so, convert the PHP object to JSON and save it to the file. |
| 149 | 7. If the `comments.json` file does not exist, the script | 141 | 7. If the `comments.json` file does not exist, the script will exit with an |
| 150 | will exit with an error. You can alter this to ensure it creates the | 142 | error. You can alter this to ensure it creates the script, but my source |
| 151 | script, but my source code includes the file by default, so it will | 143 | code includes the file by default, so it will always exist. |
| 152 | always exist. | 144 | 8. Finally, send the user back to the `#comments` section of the blog post they |
| 153 | 8. Finally, send the user back to the `#comments` section of | 145 | just read. |
| 154 | the blog post they just read. | ||
| 155 | 146 | ||
| 156 | ``` php | 147 | ``` php |
| 157 | // Get the content sent from the comment form | 148 | // Get the content sent from the comment form |
| @@ -190,9 +181,9 @@ if (file_exists($file_name)) { | |||
| 190 | header('Location: ' . $post_url . '#comments'); | 181 | header('Location: ' . $post_url . '#comments'); |
| 191 | ``` | 182 | ``` |
| 192 | 183 | ||
| 193 | If you\'re using Apache, make sure the `www-data` user on | 184 | If you're using Apache, make sure the `www-data` user on your server has the |
| 194 | your server has the correct permissions to your website directory or | 185 | correct permissions to your website directory or else it will not be able to |
| 195 | else it will not be able to write to `comments.json`. | 186 | write to `comments.json`. |
| 196 | 187 | ||
| 197 | ```sh | 188 | ```sh |
| 198 | chgrp -R www-data /path/to/website/ | 189 | chgrp -R www-data /path/to/website/ |
| @@ -201,18 +192,15 @@ chmod -R g+w comments.json | |||
| 201 | 192 | ||
| 202 | # Display User Comments | 193 | # Display User Comments |
| 203 | 194 | ||
| 204 | Now that we can submit comments, and they are saved to the | 195 | Now that we can submit comments, and they are saved to the `comments.json` file, |
| 205 | `comments.json` file, let\'s make sure we can show those | 196 | let's make sure we can show those comments in each blog post. |
| 206 | comments in each blog post. | ||
| 207 | 197 | ||
| 208 | The code block below shows the function I use to decode my | 198 | The code block below shows the function I use to decode my `comments.json` file, |
| 209 | `comments.json` file, check if the comments apply to the | 199 | check if the comments apply to the current post, and then display them. |
| 210 | current post, and then display them. | ||
| 211 | 200 | ||
| 212 | This piece of code should **really\*** be inside a function (or at least | 201 | This piece of code should **really** be inside a function (or at least in an |
| 213 | in an organized PHP workflow). Don\'t just copy-and-paste and expect it | 202 | organized PHP workflow). Don't just copy-and-paste and expect it to work. You |
| 214 | to work. You need to at least supply a `$query` variable | 203 | need to at least supply a `$query` variable depending on the page visited. |
| 215 | depending on the page visited. | ||
| 216 | 204 | ||
| 217 | ``` php | 205 | ``` php |
| 218 | $query = 'your-blog-post.html'; | 206 | $query = 'your-blog-post.html'; |
| @@ -248,30 +236,26 @@ foreach ($comments as $comment) { | |||
| 248 | echo $comment_section; | 236 | echo $comment_section; |
| 249 | ``` | 237 | ``` |
| 250 | 238 | ||
| 251 | # Bonus: Create a \'Recent Comments\' Page | 239 | # Bonus: Create a 'Recent Comments' Page |
| 252 | 240 | ||
| 253 | Finally, the last part of my current system is to create a Recent | 241 | Finally, the last part of my current system is to create a Recent Comments page |
| 254 | Comments page so that I can easily check-in on my blog and moderate any | 242 | so that I can easily check-in on my blog and moderate any spam. As an |
| 255 | spam. As an alternative, you could use PHP\'s `mail()` | 243 | alternative, you could use PHP's `mail()` function to email you for each blog |
| 256 | function to email you for each blog comment. | 244 | comment. |
| 257 | 245 | ||
| 258 | The code to do this is literally the same code as the previous section, | 246 | The code to do this is literally the same code as the previous section, I just |
| 259 | I just make sure it is printed when someone visits | 247 | make sure it is printed when someone visits `https://example.com/comments/`. |
| 260 | `https://example.com/comments/`. | ||
| 261 | 248 | ||
| 262 | # Possible Enhancements | 249 | # Possible Enhancements |
| 263 | 250 | ||
| 264 | This comment system is by no means a fully-developed system. I have | 251 | This comment system is by no means a fully-developed system. I have noted a few |
| 265 | noted a few possible enhancements here that I may implement in the | 252 | possible enhancements here that I may implement in the future: |
| 266 | future: | 253 | |
| 267 | 254 | - Create a secure moderator page with user authentication at | |
| 268 | - Create a secure moderator page with user authentication at | 255 | `https://blog.example.com/mod/`. This page could have the option to edit or |
| 269 | `https://blog.example.com/mod/`. This page could have the | 256 | delete any comment found in `comments.json`. |
| 270 | option to edit or delete any comment found in | 257 | - Create a temporary file, such as `pending_comments.json`, that will store |
| 271 | `comments.json`. | 258 | newly-submitted comments and won't display on blog posts until approved by a |
| 272 | - Create a temporary file, such as `pending_comments.json`, | 259 | moderator. |
| 273 | that will store newly-submitted comments and won\'t display on blog | 260 | - Create a `/modlog/` page with a chronological log, showing which moderator |
| 274 | posts until approved by a moderator. | 261 | approved which comments and why certain comments were rejected. |
| 275 | - Create a `/modlog/` page with a chronological log, | ||
| 276 | showing which moderator approved which comments and why certain | ||
| 277 | comments were rejected. | ||
content/blog/2021-04-28-photography.md +42 −47
| @@ -7,67 +7,62 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Why Photography? | 8 | # Why Photography? |
| 9 | 9 | ||
| 10 | I\'ve often wondered why photography is as enticing as it is. You can | 10 | I've often wondered why photography is as enticing as it is. You can see |
| 11 | see billions of people around the world taking photographs every single | 11 | billions of people around the world taking photographs every single moment of |
| 12 | moment of the day. New technology often boasts about their photographic | 12 | the day. New technology often boasts about their photographic capabilities, |
| 13 | capabilities, especially smartphones. I would even assume that we live | 13 | especially smartphones. I would even assume that we live in a world where there |
| 14 | in a world where there is never a moment in which a photograph is not | 14 | is never a moment in which a photograph is not being taken somewhere on Earth. |
| 15 | being taken somewhere on Earth. | ||
| 16 | 15 | ||
| 17 | As for myself, I would simply say that I enjoy preserving a memory in | 16 | As for myself, I would simply say that I enjoy preserving a memory in physical |
| 18 | physical (or digital) form. I\'ve never had the best memory when it | 17 | (or digital) form. I've never had the best memory when it comes to recalling |
| 19 | comes to recalling details of places and people gone by, so it helps to | 18 | details of places and people gone by, so it helps to have a frame of reference |
| 20 | have a frame of reference lying around. | 19 | lying around. |
| 21 | 20 | ||
| 22 | Regardless of the reason, I think most people would agree that you | 21 | Regardless of the reason, I think most people would agree that you simply cannot |
| 23 | simply cannot have too many hobbies. | 22 | have too many hobbies. |
| 24 | 23 | ||
| 25 | # Older Cameras | 24 | # Older Cameras |
| 26 | 25 | ||
| 27 | I started playing around with the idea of photography when my family | 26 | I started playing around with the idea of photography when my family purchased a |
| 28 | purchased a Fujifilm camera for family-specific events. I don\'t recall | 27 | Fujifilm camera for family-specific events. I don't recall the specific model, |
| 29 | the specific model, but I do recall it was a point-and-shoot camera | 28 | but I do recall it was a point-and-shoot camera without an interchangeable lens. |
| 30 | without an interchangeable lens. However, it was of great value to | 29 | However, it was of great value to someone, like myself, who couldn't afford any |
| 31 | someone, like myself, who couldn\'t afford any other camera. I took | 30 | other camera. I took about 10,000 shots with that camera over a 3-5 year span. |
| 32 | about 10,000 shots with that camera over a 3-5 year span. Most notably, | 31 | Most notably, all of my trips to California were documented through this camera. |
| 33 | all of my trips to California were documented through this camera. | ||
| 34 | 32 | ||
| 35 | When possible, I would borrow my sister\'s camera, which is a Sony | 33 | When possible, I would borrow my sister's camera, which is a Sony SLT-A58. This |
| 36 | SLT-A58. This camera was great and allowed for some of my best early | 34 | camera was great and allowed for some of my best early shots, especially those |
| 37 | shots, especially those taken in Utah\'s and Nevada\'s parks. | 35 | taken in Utah's and Nevada's parks. |
| 38 | 36 | ||
| 39 | # My Current Kit | 37 | # My Current Kit |
| 40 | 38 | ||
| 41 | I\'ve finally come to a point in my life where I have the disposable | 39 | I've finally come to a point in my life where I have the disposable income to |
| 42 | income to invest in a solid photography kit. I played around with the | 40 | invest in a solid photography kit. I played around with the idea of a lot of |
| 43 | idea of a lot of different cameras, different types, new vs used, etc. | 41 | different cameras, different types, new vs used, etc. Finally, I settled on the |
| 44 | Finally, I settled on the [Sony α7 | 42 | [Sony α7 III](https://en.wikipedia.org/wiki/Sony_%CE%B17_III). This camera is |
| 45 | III](https://en.wikipedia.org/wiki/Sony_%CE%B17_III). This camera is | 43 | mirror-less and uses a full-frame image sensor at 24 megapixels. I don't create |
| 46 | mirror-less and uses a full-frame image sensor at 24 megapixels. I | 44 | large prints, and I am mostly focused on preserving memories in high quality for |
| 47 | don\'t create large prints, and I am mostly focused on preserving | 45 | the next 5-10 years with this camera, so the specifications here are just |
| 48 | memories in high quality for the next 5-10 years with this camera, so | 46 | perfect for me. |
| 49 | the specifications here are just perfect for me. | ||
| 50 | 47 | ||
| 51 | For lenses, I decided to buy two lenses that could carry me through most | 48 | For lenses, I decided to buy two lenses that could carry me through most |
| 52 | situations: | 49 | situations: |
| 53 | 50 | ||
| 54 | - [Vario-Tessar T\*\* FE 24-70 mm F4 ZA | 51 | - [Vario-Tessar T** FE 24-70 mm F4 ZA |
| 55 | OSS](https://electronics.sony.com/imaging/lenses/full-frame-e-mount/p/sel2470z) | 52 | OSS](https://electronics.sony.com/imaging/lenses/full-frame-e-mount/p/sel2470z) |
| 56 | - [Tamron 70-300mm f4.5-6.3 Di III | 53 | - [Tamron 70-300mm f4.5-6.3 Di III |
| 57 | RXD](https://www.tamron-usa.com/product/lenses/a047.html) | 54 | RXD](https://www.tamron-usa.com/product/lenses/a047.html) |
| 58 | 55 | ||
| 59 | In addition, I grabbed a couple [HGX Prime | 56 | In addition, I grabbed a couple [HGX Prime |
| 60 | 67mm](https://www.promaster.com/Product/6725) protection filters for the | 57 | 67mm](https://www.promaster.com/Product/6725) protection filters for the lenses. |
| 61 | lenses. | ||
| 62 | 58 | ||
| 63 | As I delve further into photography and pick up more skills, I will most | 59 | As I delve further into photography and pick up more skills, I will most likely |
| 64 | likely go back and grab a lens with a higher f-stop value, such as | 60 | go back and grab a lens with a higher f-stop value, such as f/1.8. I toyed with |
| 65 | f/1.8. I toyed with the idea of grabbing a 50 mm at `f/1.8`, | 61 | the idea of grabbing a 50 mm at `f/1.8`, but decided to keep things in a |
| 66 | but decided to keep things in a reasonable price range instead. | 62 | reasonable price range instead. |
| 67 | 63 | ||
| 68 | Finally, I made sure to buy a photography-specific backpack with a rain | 64 | Finally, I made sure to buy a photography-specific backpack with a rain guard, |
| 69 | guard, and the zipper on the back panel, to protect the equipment while | 65 | and the zipper on the back panel, to protect the equipment while wearing the |
| 70 | wearing the bag. If you\'ve ever had to haul around a DSLR (or camera of | 66 | bag. If you've ever had to haul around a DSLR (or camera of similar heft) in a |
| 71 | similar heft) in a bag that only has a shoulder strap, you\'ll know the | 67 | bag that only has a shoulder strap, you'll know the pain it can cause. Putting |
| 72 | pain it can cause. Putting all my equipment in a backpack was an easy | 68 | all my equipment in a backpack was an easy decision. |
| 73 | decision. | ||
content/blog/2021-05-30-changing-git-authors.md +12 −12
| @@ -7,25 +7,25 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Changing Git Author/Email Based on Previously Committed Email | 8 | # Changing Git Author/Email Based on Previously Committed Email |
| 9 | 9 | ||
| 10 | Here\'s the dilemma: You\'ve been committing changes to your git | 10 | Here's the dilemma: You've been committing changes to your git repository with |
| 11 | repository with an incorrect name or email (or multiple repositories), | 11 | an incorrect name or email (or multiple repositories), and now you want to fix |
| 12 | and now you want to fix it. Luckily, there\'s a semi-reliable way to fix | 12 | it. Luckily, there's a semi-reliable way to fix that. While I have never |
| 13 | that. While I have never experienced issues with this method, some | 13 | experienced issues with this method, some people have warned that it can mess |
| 14 | people have warned that it can mess with historical hashes and integrity | 14 | with historical hashes and integrity of commits, so use this method only if |
| 15 | of commits, so use this method only if you\'re okay accepting that risk. | 15 | you're okay accepting that risk. |
| 16 | 16 | ||
| 17 | Okay, let\'s create the bash script: | 17 | Okay, let's create the bash script: |
| 18 | 18 | ||
| 19 | ```sh | 19 | ```sh |
| 20 | nano change_git_authors.sh | 20 | nano change_git_authors.sh |
| 21 | ``` | 21 | ``` |
| 22 | 22 | ||
| 23 | The following information can be pasted directly into your bash script. | 23 | The following information can be pasted directly into your bash script. The only |
| 24 | The only changes you need to make are to the following variables: | 24 | changes you need to make are to the following variables: |
| 25 | 25 | ||
| 26 | - `OLD_EMAIL` | 26 | - `OLD_EMAIL` |
| 27 | - `CORRECT_NAME` | 27 | - `CORRECT_NAME` |
| 28 | - `CORRECT_EMAIL` | 28 | - `CORRECT_EMAIL` |
| 29 | 29 | ||
| 30 | ```sh | 30 | ```sh |
| 31 | #!/bin/sh | 31 | #!/bin/sh |
content/blog/2021-07-15-delete-gitlab-repos.md +21 −22
| @@ -7,31 +7,31 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Background | 8 | # Background |
| 9 | 9 | ||
| 10 | Have you ever used GitLab to host your source code, moved to a different | 10 | Have you ever used GitLab to host your source code, moved to a different host, |
| 11 | host, and wanted to delete everything from your GitLab account? Well, | 11 | and wanted to delete everything from your GitLab account? Well, this post covers |
| 12 | this post covers any scenario where you would want to delete all | 12 | any scenario where you would want to delete all repositories from your GitLab |
| 13 | repositories from your GitLab account. | 13 | account. |
| 14 | 14 | ||
| 15 | For me, I currently maintain around 30 repositories and don\'t like to | 15 | For me, I currently maintain around 30 repositories and don't like to manually |
| 16 | manually delete them whenever I switch host. GitHub has a few different | 16 | delete them whenever I switch host. GitHub has a few different tools online to |
| 17 | tools online to delete all repositories for you, but I have not found | 17 | delete all repositories for you, but I have not found anything similar for |
| 18 | anything similar for GitLab, so I needed an alternative solution. | 18 | GitLab, so I needed an alternative solution. |
| 19 | 19 | ||
| 20 | # Use a Python Script | 20 | # Use a Python Script |
| 21 | 21 | ||
| 22 | ## Requirements | 22 | ## Requirements |
| 23 | 23 | ||
| 24 | Before we look at the script, make sure you know your GitLab username. | 24 | Before we look at the script, make sure you know your GitLab username. Next, |
| 25 | Next, [create an authorization | 25 | [create an authorization |
| 26 | token](https://gitlab.com/-/profile/personal_access_tokens) so that the | 26 | token](https://gitlab.com/-/profile/personal_access_tokens) so that the Python |
| 27 | Python script can delete your repositories. Don\'t lose this token or | 27 | script can delete your repositories. Don't lose this token or else you'll need |
| 28 | else you\'ll need to create a new one. | 28 | to create a new one. |
| 29 | 29 | ||
| 30 | ## Create the Script | 30 | ## Create the Script |
| 31 | 31 | ||
| 32 | To run a Python script, you must first create it. Open a terminal and | 32 | To run a Python script, you must first create it. Open a terminal and enter the |
| 33 | enter the following commands in whichever directory you prefer to store | 33 | following commands in whichever directory you prefer to store the script. You |
| 34 | the script. You can do the same things in a file manager if you prefer. | 34 | can do the same things in a file manager if you prefer. |
| 35 | 35 | ||
| 36 | ```sh | 36 | ```sh |
| 37 | mkdir delete-gitlab | 37 | mkdir delete-gitlab |
| @@ -103,13 +103,12 @@ if __name__ == "__main__": | |||
| 103 | main() | 103 | main() |
| 104 | ``` | 104 | ``` |
| 105 | 105 | ||
| 106 | Now that you have the proper information, replace `{user-id}` | 106 | Now that you have the proper information, replace `{user-id}` with your GitLab |
| 107 | with your GitLab username and `{auth-token}` with the | 107 | username and `{auth-token}` with the authorization token you created earlier. |
| 108 | authorization token you created earlier. | ||
| 109 | 108 | ||
| 110 | Finally, simply run the script and watch the output. You can also use | 109 | Finally, simply run the script and watch the output. You can also use PyCharm |
| 111 | PyCharm Community Edition to edit and run the Python script if you | 110 | Community Edition to edit and run the Python script if you don't want to work |
| 112 | don\'t want to work in a terminal. | 111 | in a terminal. |
| 113 | 112 | ||
| 114 | ```sh | 113 | ```sh |
| 115 | python3 main.py | 114 | python3 main.py |
content/blog/2021-08-25-audit-sampling.md +92 −101
| @@ -8,44 +8,43 @@ draft = false | |||
| 8 | # Introduction | 8 | # Introduction |
| 9 | 9 | ||
| 10 | For anyone who is familiar with internal auditing, external auditing, or | 10 | For anyone who is familiar with internal auditing, external auditing, or |
| 11 | consulting, you will understand how tedious audit testing can become | 11 | consulting, you will understand how tedious audit testing can become when you |
| 12 | when you are required to test large swaths of data. When we cannot | 12 | are required to test large swaths of data. When we cannot establish an automated |
| 13 | establish an automated means of testing an entire population, we | 13 | means of testing an entire population, we generate samples to represent the |
| 14 | generate samples to represent the population of data. This helps ensure | 14 | population of data. This helps ensure we can have a small enough data pool to |
| 15 | we can have a small enough data pool to test and that our results still | 15 | test and that our results still represent the population. |
| 16 | represent the population. | 16 | |
| 17 | 17 | However, sampling data within the world of audit still seems to confuse quite a | |
| 18 | However, sampling data within the world of audit still seems to confuse | 18 | lot of people. While some audit-focused tools have introduced sampling |
| 19 | quite a lot of people. While some audit-focused tools have introduced | 19 | functionality (e.g. Wdesk), many audit departments and firms cannot use software |
| 20 | sampling functionality (e.g. Wdesk), many audit departments and firms | 20 | like this due to certain constraints, such as the team's budget or knowledge. |
| 21 | cannot use software like this due to certain constraints, such as the | 21 | Here is where this article comes in: we're going to use |
| 22 | team\'s budget or knowledge. Here is where this article comes in: we\'re | 22 | [Python](https://www.python.org), a free and open-source programming language, |
| 23 | going to use [Python](https://www.python.org), a free and open-source | 23 | to generate random samples from a dataset in order to suffice numerous audit |
| 24 | programming language, to generate random samples from a dataset in order | 24 | situations. |
| 25 | to suffice numerous audit situations. | ||
| 26 | 25 | ||
| 27 | # Audit Requirements for Sampling | 26 | # Audit Requirements for Sampling |
| 28 | 27 | ||
| 29 | Before we get into the details of how to sample with Python, I want to | 28 | Before we get into the details of how to sample with Python, I want to make sure |
| 30 | make sure I discuss the different requirements that auditors may have of | 29 | I discuss the different requirements that auditors may have of samples used |
| 31 | samples used within their projects. | 30 | within their projects. |
| 32 | 31 | ||
| 33 | ## Randomness | 32 | ## Randomness |
| 34 | 33 | ||
| 35 | First, let\'s discuss randomness. When testing out new technology to | 34 | First, let's discuss randomness. When testing out new technology to help assist |
| 36 | help assist with audit sampling, you need to understand exactly how your | 35 | with audit sampling, you need to understand exactly how your samples are being |
| 37 | samples are being generated. For example, if the underlying function is | 36 | generated. For example, if the underlying function is just picking every 57th |
| 38 | just picking every 57th element from a list, that\'s not truly random; | 37 | element from a list, that's not truly random; it's a systematic form of |
| 39 | it\'s a systematic form of sampling. Luckily, since Python is | 38 | sampling. Luckily, since Python is open-source, we have access to its codebase. |
| 40 | open-source, we have access to its codebase. Through this blog post, I | 39 | Through this blog post, I will be using the [pandas](https://pandas.pydata.org) |
| 41 | will be using the [pandas](https://pandas.pydata.org) module in order to | 40 | module in order to generate the random samples. More specifically, I will be |
| 42 | generate the random samples. More specifically, I will be using the | 41 | using the |
| 43 | [pandas.DataFrame.sample](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.sample.html) | 42 | [pandas.DataFrame.sample](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.sample.html) |
| 44 | function provided by Pandas. | 43 | function provided by Pandas. |
| 45 | 44 | ||
| 46 | Now that you know what you\'re using, you can always check out the code | 45 | Now that you know what you're using, you can always check out the code behind |
| 47 | behind `pandas.DataFrame.sample`. This function does a lot of | 46 | `pandas.DataFrame.sample`. This function does a lot of work, but we really only |
| 48 | work, but we really only care about the following snippets of code: | 47 | care about the following snippets of code: |
| 49 | 48 | ||
| 50 | ``` python | 49 | ``` python |
| 51 | # Process random_state argument | 50 | # Process random_state argument |
| @@ -61,67 +60,59 @@ result.index = ibase.default_index(len(result)) | |||
| 61 | return result | 60 | return result |
| 62 | ``` | 61 | ``` |
| 63 | 62 | ||
| 64 | The block of code above shows you that if you assign a | 63 | The block of code above shows you that if you assign a `random_state` argument |
| 65 | `random_state` argument when you run the function, that will | 64 | when you run the function, that will be used as a seed number in the random |
| 66 | be used as a seed number in the random generation and will allow you to | 65 | generation and will allow you to reproduce a sample, given that nothing else |
| 67 | reproduce a sample, given that nothing else changes. This is critical to | 66 | changes. This is critical to the posterity of audit work. After all, how can you |
| 68 | the posterity of audit work. After all, how can you say your audit | 67 | say your audit process is adequately documented if the next person can't run |
| 69 | process is adequately documented if the next person can\'t run the code | 68 | the code and get the same sample? The final piece here on randomness is to look |
| 70 | and get the same sample? The final piece here on randomness is to look | 69 | at the [choice](https://docs.%20python.org/3/library/random.html#random.choice) |
| 71 | at the | 70 | function used above. This is the crux of the generation and can also be examined |
| 72 | [choice](https://docs.%20python.org/3/library/random.html#random.choice) | 71 | for more detailed analysis on its reliability. As far as auditing goes, we will |
| 73 | function used above. This is the crux of the generation and can also be | 72 | trust that these functions are mathematically random. |
| 74 | examined for more detailed analysis on its reliability. As far as | ||
| 75 | auditing goes, we will trust that these functions are mathematically | ||
| 76 | random. | ||
| 77 | 73 | ||
| 78 | ## Sample Sizes | 74 | ## Sample Sizes |
| 79 | 75 | ||
| 80 | As mentioned in the intro, sampling is only an effective method of | 76 | As mentioned in the intro, sampling is only an effective method of auditing when |
| 81 | auditing when it truly represents the entire population. While some | 77 | it truly represents the entire population. While some audit departments or firms |
| 82 | audit departments or firms may consider certain judgmental sample sizes | 78 | may consider certain judgmental sample sizes to be adequate, you may need to |
| 83 | to be adequate, you may need to rely on statistically-significant | 79 | rely on statistically-significant confidence levels of sample testing at certain |
| 84 | confidence levels of sample testing at certain points. I will | 80 | points. I will demonstrate both here. For statistically-significant confidence |
| 85 | demonstrate both here. For statistically-significant confidence levels, | 81 | levels, most people will assume a 90% - 99% confidence level. In order to |
| 86 | most people will assume a 90% - 99% confidence level. In order to | 82 | actually calculate the correct sample size, it is best to use statistical tools |
| 87 | actually calculate the correct sample size, it is best to use | 83 | due to the tedious math work required. For example, for a population of 1000, |
| 88 | statistical tools due to the tedious math work required. For example, | 84 | and a 90% confidence level that no more than 5% of the items are nonconforming, |
| 89 | for a population of 1000, and a 90% confidence level that no more than | 85 | you would sample 45 items. |
| 90 | 5% of the items are nonconforming, you would sample 45 items. | 86 | |
| 91 | 87 | However, in my personal experience, many audit departments and firms do not use | |
| 92 | However, in my personal experience, many audit departments and firms do | 88 | statistical sampling. Most people use a predetermined, often proprietary, table |
| 93 | not use statistical sampling. Most people use a predetermined, often | 89 | that will instruct auditors which sample sizes to choose. This allows for |
| 94 | proprietary, table that will instruct auditors which sample sizes to | 90 | uniform testing and reduces overall workload. See the table below for a common |
| 95 | choose. This allows for uniform testing and reduces overall workload. | 91 | implementation of sample sizes: |
| 96 | See the table below for a common implementation of sample sizes: | ||
| 97 | 92 | ||
| 98 | Control Frequency Sample Size - High Risk Sample Size - Low Risk | 93 | Control Frequency Sample Size - High Risk Sample Size - Low Risk |
| 99 | ------------------- ------------------------- ------------------------ | 94 | ------------------- ------------------------- ------------------------ |
| 100 | More Than Daily 40 25 | 95 | More Than Daily 40 25 Daily 40 |
| 101 | Daily 40 25 | 96 | 25 Weekly 12 5 Monthly 5 |
| 102 | Weekly 12 5 | 97 | 3 Quarterly 2 2 Semi-Annually 1 |
| 103 | Monthly 5 3 | 98 | 1 Annually 1 1 Ad-hoc 1 |
| 104 | Quarterly 2 2 | 99 | 1 |
| 105 | Semi-Annually 1 1 | ||
| 106 | Annually 1 1 | ||
| 107 | Ad-hoc 1 1 | ||
| 108 | 100 | ||
| 109 | ### Sampling with Python & Pandas | 101 | ### Sampling with Python & Pandas |
| 110 | 102 | ||
| 111 | In this section, I am going to cover a few basic audit situations that | 103 | In this section, I am going to cover a few basic audit situations that require |
| 112 | require sampling. While some situations may require more effort, the | 104 | sampling. While some situations may require more effort, the syntax, |
| 113 | syntax, organization, and intellect used remain largely the same. If | 105 | organization, and intellect used remain largely the same. If you've never used |
| 114 | you\'ve never used Python before, note that lines starting with a | 106 | Python before, note that lines starting with a '`#`' symbol are called |
| 115 | \'`#`\' symbol are called comments, and they will be skipped | 107 | comments, and they will be skipped by Python. I highly recommend taking a quick |
| 116 | by Python. I highly recommend taking a quick tutorial online to | 108 | tutorial online to understand the basics of Python if any of the code below is |
| 117 | understand the basics of Python if any of the code below is confusing to | 109 | confusing to you. |
| 118 | you. | ||
| 119 | 110 | ||
| 120 | ## Simple Random Sample | 111 | ## Simple Random Sample |
| 121 | 112 | ||
| 122 | First, let\'s look at a simple, random sample. The code block below will | 113 | First, let's look at a simple, random sample. The code block below will import |
| 123 | import the `pandas` module, load a data file, sample the | 114 | the `pandas` module, load a data file, sample the data, and export the sample to |
| 124 | data, and export the sample to a file. | 115 | a file. |
| 125 | 116 | ||
| 126 | ``` python | 117 | ``` python |
| 127 | # Import the Pandas module | 118 | # Import the Pandas module |
| @@ -145,8 +136,8 @@ sample.to_excel(file_output) | |||
| 145 | 136 | ||
| 146 | ## Simple Random Sample: Using Multiple Input Files | 137 | ## Simple Random Sample: Using Multiple Input Files |
| 147 | 138 | ||
| 148 | Now that we\'ve created a simple sample, let\'s create a sample from | 139 | Now that we've created a simple sample, let's create a sample from multiple |
| 149 | multiple files. | 140 | files. |
| 150 | 141 | ||
| 151 | ``` python | 142 | ``` python |
| 152 | # Import the Pandas module | 143 | # Import the Pandas module |
| @@ -179,9 +170,9 @@ sample.to_excel(file_output) | |||
| 179 | 170 | ||
| 180 | ## Stratified Random Sample | 171 | ## Stratified Random Sample |
| 181 | 172 | ||
| 182 | Well, what if you need to sample distinct parts of a single file? For | 173 | Well, what if you need to sample distinct parts of a single file? For example, |
| 183 | example, let\'s write some code to separate our data by \"Region\" and | 174 | let's write some code to separate our data by "Region" and sample those |
| 184 | sample those regions independently. | 175 | regions independently. |
| 185 | 176 | ||
| 186 | ``` python | 177 | ``` python |
| 187 | # Import the Pandas module | 178 | # Import the Pandas module |
| @@ -213,10 +204,10 @@ sample.to_excel(file_output) | |||
| 213 | 204 | ||
| 214 | ## Stratified Systematic Sample | 205 | ## Stratified Systematic Sample |
| 215 | 206 | ||
| 216 | This next example is quite useful if you need audit coverage over a | 207 | This next example is quite useful if you need audit coverage over a certain time |
| 217 | certain time period. This code will generate samples for each month in | 208 | period. This code will generate samples for each month in the data and combine |
| 218 | the data and combine them all together at the end. Obviously, this code | 209 | them all together at the end. Obviously, this code can be modified to stratify |
| 219 | can be modified to stratify by something other than months, if needed. | 210 | by something other than months, if needed. |
| 220 | 211 | ||
| 221 | ``` python | 212 | ``` python |
| 222 | # Import the Pandas module | 213 | # Import the Pandas module |
| @@ -262,17 +253,17 @@ sample.to_excel(file_output) | |||
| 262 | 253 | ||
| 263 | ### Documenting the Results | 254 | ### Documenting the Results |
| 264 | 255 | ||
| 265 | Once you\'ve generated a proper sample, there are a few things left to | 256 | Once you've generated a proper sample, there are a few things left to do in |
| 266 | do in order to properly ensure your process is reproducible. | 257 | order to properly ensure your process is reproducible. |
| 267 | 258 | ||
| 268 | 1. Document the sample. Make sure the resulting file is readable and | 259 | 1. Document the sample. Make sure the resulting file is readable and includes |
| 269 | includes the documentation listed in the next bullet. | 260 | the documentation listed in the next bullet. |
| 270 | 2. Include documentation around the data source, extraction techniques, | 261 | 2. Include documentation around the data source, extraction techniques, any |
| 271 | any modifications made to the data, and be sure to include a copy of | 262 | modifications made to the data, and be sure to include a copy of the script |
| 272 | the script itself. | 263 | itself. |
| 273 | 3. Whenever possible, perform a completeness and accuracy test to | 264 | 3. Whenever possible, perform a completeness and accuracy test to ensure your |
| 274 | ensure your sample is coming from a complete and accurate | 265 | sample is coming from a complete and accurate population. To ensure |
| 275 | population. To ensure completeness, compare the record count from | 266 | completeness, compare the record count from the data source to the record |
| 276 | the data source to the record count loaded into Python. To ensure | 267 | count loaded into Python. To ensure accuracy, test a small sample against the |
| 277 | accuracy, test a small sample against the source data (e.g., test 5 | 268 | source data (e.g., test 5 sales against the database to see if the details |
| 278 | sales against the database to see if the details are accurate). | 269 | are accurate). |
content/blog/2021-10-09-apache-redirect.md +22 −24
| @@ -7,26 +7,25 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # The Problem | 8 | # The Problem |
| 9 | 9 | ||
| 10 | After recently switching static site generators (SSG), my blog URLs | 10 | After recently switching static site generators (SSG), my blog URLs changed with |
| 11 | changed with no option to preserve the classic `.html` | 11 | no option to preserve the classic `.html` extension at the end of my blog post |
| 12 | extension at the end of my blog post URLs. | 12 | URLs. |
| 13 | 13 | ||
| 14 | I really disliked using my old SSG ([Jekyll](https://jekyllrb.com)) and | 14 | I really disliked using my old SSG ([Jekyll](https://jekyllrb.com)) and prefer |
| 15 | prefer my new tool ([Zola](https://www.getzola.org)) much more, so I was | 15 | my new tool ([Zola](https://www.getzola.org)) much more, so I was determined to |
| 16 | determined to figure out a way to get the proper redirect set up so that | 16 | figure out a way to get the proper redirect set up so that people who find my |
| 17 | people who find my posts online aren\'t constantly met by 404 errors. | 17 | posts online aren't constantly met by 404 errors. |
| 18 | 18 | ||
| 19 | # The Solution | 19 | # The Solution |
| 20 | 20 | ||
| 21 | To solve this problem, I really needed to solve two pieces: | 21 | To solve this problem, I really needed to solve two pieces: |
| 22 | 22 | ||
| 23 | 1. Redirect all blog post URL requests from | 23 | 1. Redirect all blog post URL requests from `/blog/some-post.html` to |
| 24 | `/blog/some-post.html` to `/blog/some-post/`. | 24 | `/blog/some-post/`. |
| 25 | 2. Ensure that no other `.html` files are redirected, such | 25 | 2. Ensure that no other `.html` files are redirected, such as `index.html`. |
| 26 | as `index.html`. | ||
| 27 | 26 | ||
| 28 | After *a lot* of tweaking and testing, I believe I have finally found | 27 | After *a lot* of tweaking and testing, I believe I have finally found the |
| 29 | the solution. The solution is shown below. | 28 | solution. The solution is shown below. |
| 30 | 29 | ||
| 31 | ``` conf | 30 | ``` conf |
| 32 | RewriteEngine On | 31 | RewriteEngine On |
| @@ -34,14 +33,13 @@ RewriteCond %{REQUEST_URI} !\index.html$ [NC] | |||
| 34 | RewriteRule ^(.*).html$ https://example.com/$1 [R=301,L] | 33 | RewriteRule ^(.*).html$ https://example.com/$1 [R=301,L] |
| 35 | ``` | 34 | ``` |
| 36 | 35 | ||
| 37 | This piece of code in the Apache `.conf` or | 36 | This piece of code in the Apache `.conf` or `.htaccess` file will do the |
| 38 | `.htaccess` file will do the following: | 37 | following: |
| 39 | 38 | ||
| 40 | 1. Turn on the RewriteEngine so that we can modify URLs. | 39 | 1. Turn on the RewriteEngine so that we can modify URLs. |
| 41 | 2. Ignore any `index.html` files from the rule we are about | 40 | 2. Ignore any `index.html` files from the rule we are about to specify. |
| 42 | to specify. | 41 | 3. Find any `.html` files within the website directory and redirect it to |
| 43 | 3. Find any `.html` files within the website directory and | 42 | exclude the file extension. |
| 44 | redirect it to exclude the file extension. | 43 | 4. The final piece is adding the trailing slash (`/`) at the end of the URL - |
| 45 | 4. The final piece is adding the trailing slash (`/`) at the | 44 | you'll notice that I don't have an Apache rule for that since Apache |
| 46 | end of the URL - you\'ll notice that I don\'t have an Apache rule | 45 | handles that automatically. |
| 47 | for that since Apache handles that automatically. | ||
content/blog/2021-12-04-cisa.md +152 −167
| @@ -8,208 +8,193 @@ draft = false | |||
| 8 | # What is the CISA? | 8 | # What is the CISA? |
| 9 | 9 | ||
| 10 | For those of you lucky enough not to be knee-deep in the world of IT/IS | 10 | For those of you lucky enough not to be knee-deep in the world of IT/IS |
| 11 | Auditing, [CISA](https://www.isaca.org/credentialing/cisa) stands for | 11 | Auditing, [CISA](https://www.isaca.org/credentialing/cisa) stands for Certified |
| 12 | Certified Information Systems Auditor. This certification and exam are | 12 | Information Systems Auditor. This certification and exam are part of ISACA's |
| 13 | part of ISACA\'s suite of certifications. As I often explain it to | 13 | suite of certifications. As I often explain it to people like my family, it |
| 14 | people like my family, it basically means you\'re employed to use your | 14 | basically means you're employed to use your knowledge of information systems, |
| 15 | knowledge of information systems, regulations, common threats, risks, | 15 | regulations, common threats, risks, etc. in order to assess an organization's |
| 16 | etc. in order to assess an organization\'s current control of their | 16 | current control of their risk. If a risk isn't controlled (and the company |
| 17 | risk. If a risk isn\'t controlled (and the company doesn\'t want to | 17 | doesn't want to accept the risk), an IS auditor will suggest implementing a |
| 18 | accept the risk), an IS auditor will suggest implementing a control to | 18 | control to address that risk. |
| 19 | address that risk. | 19 | |
| 20 | 20 | Now, the CISA certification itself is, in my opinion, the main certification for | |
| 21 | Now, the CISA certification itself is, in my opinion, the main | 21 | this career. While certifications such as the CPA or CISSP are beneficial, |
| 22 | certification for this career. While certifications such as the CPA or | 22 | nothing matches the power of the CISA for an IS auditor when it comes to getting |
| 23 | CISSP are beneficial, nothing matches the power of the CISA for an IS | 23 | hired, getting a raise/bonus, or earning respect in the field. |
| 24 | auditor when it comes to getting hired, getting a raise/bonus, or | 24 | |
| 25 | earning respect in the field. | 25 | However, to be honest, I am a skeptic of most certifications. I understand the |
| 26 | 26 | value they hold in terms of how much you need to commit to studying or learning | |
| 27 | However, to be honest, I am a skeptic of most certifications. I | 27 | on the job, as well as the market value for certifications such as the CISA. But |
| 28 | understand the value they hold in terms of how much you need to commit | 28 | I also have known some very ~~incompetent~~ *less than stellar* auditors who |
| 29 | to studying or learning on the job, as well as the market value for | 29 | have CPAs, CISAs, CIAs, etc. |
| 30 | certifications such as the CISA. But I also have known some very | 30 | |
| 31 | ~~incompetent~~ *less than stellar* auditors who have CPAs, CISAs, CIAs, | 31 | The same goes for most industries: if a person is good at studying, they can |
| 32 | etc. | 32 | earn the certification. However, that knowledge means nothing unless you're |
| 33 | 33 | actually able to use it in real life and perform as expected of a certification | |
| 34 | The same goes for most industries: if a person is good at studying, they | 34 | holder. The challenge comes when people are hired or connected strictly because |
| 35 | can earn the certification. However, that knowledge means nothing unless | 35 | of their certifications or resume; you need to see a person work before you can |
| 36 | you\'re actually able to use it in real life and perform as expected of | 36 | assume them having a CISA means they're better than someone without the CISA. |
| 37 | a certification holder. The challenge comes when people are hired or | 37 | |
| 38 | connected strictly because of their certifications or resume; you need | 38 | Okay, rant over. Certifications are generally accepted as a measuring stick of |
| 39 | to see a person work before you can assume them having a CISA means | 39 | commitment and quality of an employee, so I am accepting it too. |
| 40 | they\'re better than someone without the CISA. | ||
| 41 | |||
| 42 | Okay, rant over. Certifications are generally accepted as a measuring | ||
| 43 | stick of commitment and quality of an employee, so I am accepting it | ||
| 44 | too. | ||
| 45 | 40 | ||
| 46 | # Exam Content | 41 | # Exam Content |
| 47 | 42 | ||
| 48 | The CISA is broken down into five sections, each weighted with a | 43 | The CISA is broken down into five sections, each weighted with a percentage of |
| 49 | percentage of test questions that may appear. | 44 | test questions that may appear. |
| 50 | 45 | ||
| 51 |  | 47 | sections](https://img.cleberg.net/blog/20211204-i-passed-the-cisa/cisa-exam-sections.png) |
| 53 | 48 | ||
| 54 | Since the exam contains 150 questions, here\'s how those sections break | 49 | Since the exam contains 150 questions, here's how those sections break down: |
| 55 | down: | ||
| 56 | 50 | ||
| 57 | Exam Section Percentage of Exam Questions | 51 | | Exam Section | Percentage of Exam | Questions | |
| 58 | ----------------- -------------------- ----------- | 52 | |-----------------|--------------------|-----------| |
| 59 | 1 21% 32 | 53 | | 1 | 21% | 32 | |
| 60 | 2 17% 26 | 54 | | 2 | 17% | 26 | |
| 61 | 3 12% 18 | 55 | | 3 | 12% | 18 | |
| 62 | 4 23% 34 | 56 | | 4 | 23% | 34 | |
| 63 | 5 27% 40 | 57 | | 5 | 27% | 40 | |
| 64 | **Grand Total** **100%** **150** | 58 | | **Grand Total** | **100%** | **150** | |
| 65 | 59 | ||
| 66 | # My Studying Habits | 60 | # My Studying Habits |
| 67 | 61 | ||
| 68 | This part is a little hard for me to break down into specific detail due | 62 | This part is a little hard for me to break down into specific detail due to the |
| 69 | to the craziness of the last year. While I officially purchased my | 63 | craziness of the last year. While I officially purchased my studying materials |
| 70 | studying materials in December 2020 and opened them to \"start | 64 | in December 2020 and opened them to "start studying" in January 2021, I really |
| 71 | studying\" in January 2021, I really wasn\'t able to study much due to | 65 | wasn't able to study much due to the demands of my job and personal life. |
| 72 | the demands of my job and personal life. | ||
| 73 | 66 | ||
| 74 | Let me approach this from a few different viewpoints. | 67 | Let me approach this from a few different viewpoints. |
| 75 | 68 | ||
| 76 | ## Study Materials | 69 | ## Study Materials |
| 77 | 70 | ||
| 78 | Let\'s start by discussing the study materials I purchased. I\'ll be | 71 | Let's start by discussing the study materials I purchased. I'll be referring |
| 79 | referring to #1 as the CRM and #2 as the QAE. | 72 | to #1 as the CRM and #2 as the QAE. |
| 80 | 73 | ||
| 81 | 1. [CISA Review Manual, 27th Edition \| | 74 | 1. [CISA Review Manual, 27th Edition | |
| 82 | Print](https://store.isaca.org/s/store#/store/browse/detail/a2S4w000004KoCbEAK) | 75 | Print](https://store.isaca.org/s/store#/store/browse/detail/a2S4w000004KoCbEAK) |
| 83 | 2. \[\[<https://store.isaca.org/s/store#/store/browse/detail/a2S4w000004KoCcEAK>\]\[CISA | 76 | 2. [CISA Review Questions, Answers & Explanations Manual, 12th Edition | |
| 84 | Review Questions, Answers & Explanations Manual, 12th Edition \| | 77 | Print](https://store.isaca.org/s/store#/store/browse/detail/a2S4w000004KoCcEAK) |
| 85 | Print\]\] | 78 | |
| 86 | 79 | The CRM is an excellent source of information and could honestly be used as a | |
| 87 | The CRM is an excellent source of information and could honestly be used | 80 | reference for most IS auditors as a learning reference during their daily audit |
| 88 | as a reference for most IS auditors as a learning reference during their | 81 | responsibilities. However, it is **full** of information and can be |
| 89 | daily audit responsibilities. However, it is **full\*** of information | 82 | overloading if you're not good at filtering out useless information while |
| 90 | and can be overloading if you\'re not good at filtering out useless | 83 | studying. |
| 91 | information while studying. | 84 | |
| 92 | 85 | The QAE is the real star of the show here. This book contains 1000 questions, | |
| 93 | The QAE is the real star of the show here. This book contains 1000 | 86 | separated by exam section, and a practice exam. My only complaint about the QAE |
| 94 | questions, separated by exam section, and a practice exam. My only | 87 | is that each question is immediately followed with the correct answer and |
| 95 | complaint about the QAE is that each question is immediately followed | 88 | explanations below it, which means I had to use something to constantly cover |
| 96 | with the correct answer and explanations below it, which means I had to | 89 | the answers while I was studying. |
| 97 | use something to constantly cover the answers while I was studying. | 90 | |
| 98 | 91 | I didn't use the online database version of the QAE, but I've heard that it's | |
| 99 | I didn\'t use the online database version of the QAE, but I\'ve heard | 92 | easier to use than the printed book. However, it is more expensive ($299 |
| 100 | that it\'s easier to use than the printed book. However, it is more | 93 | database vs $129 book) which might be important if you're paying for materials |
| 101 | expensive (\$299 database vs \$129 book) which might be important if | 94 | yourself. |
| 102 | you\'re paying for materials yourself. | 95 | |
| 103 | 96 | In terms of question difficulty, I felt that the QAE was a good representation | |
| 104 | In terms of question difficulty, I felt that the QAE was a good | 97 | of the actual exam. I've seen a lot of people online say it wasn't accurate to |
| 105 | representation of the actual exam. I\'ve seen a lot of people online say | 98 | the exam or that it was much easier/harder, but I disagree with all of those. |
| 106 | it wasn\'t accurate to the exam or that it was much easier/harder, but I | 99 | The exam was fairly similar to the QAE, just focusing on whichever topics they |
| 107 | disagree with all of those. The exam was fairly similar to the QAE, just | 100 | chose for my version of the exam. |
| 108 | focusing on whichever topics they chose for my version of the exam. | 101 | |
| 109 | 102 | If you understand the concepts, skim the CRM (and read in-depth on topics you | |
| 110 | If you understand the concepts, skim the CRM (and read in-depth on | 103 | struggle with), and use the QAE to continue practicing exam-like questions, you |
| 111 | topics you struggle with), and use the QAE to continue practicing | 104 | should be fine. I didn't use any online courses, videos, etc. - the ISACA |
| 112 | exam-like questions, you should be fine. I didn\'t use any online | 105 | materials are more than enough. |
| 113 | courses, videos, etc. - the ISACA materials are more than enough. | ||
| 114 | 106 | ||
| 115 | ## Studying Process | 107 | ## Studying Process |
| 116 | 108 | ||
| 117 | While I was able to briefly read through sections 1 and 2 in early 2021, | 109 | While I was able to briefly read through sections 1 and 2 in early 2021, I had |
| 118 | I had to stop and take a break from February/March to September. I | 110 | to stop and take a break from February/March to September. I switched jobs in |
| 119 | switched jobs in September, which allowed me a lot more free time to | 111 | September, which allowed me a lot more free time to study. |
| 120 | study. | ||
| 121 | 112 | ||
| 122 | In September, I studied sections 3-5, took notes, and did a quick review | 113 | In September, I studied sections 3-5, took notes, and did a quick review of the |
| 123 | of the section topics. Once I felt comfortable with my notes, I took a | 114 | section topics. Once I felt comfortable with my notes, I took a practice exam |
| 124 | practice exam from the QAE manual and scored 70% (105/150). | 115 | from the QAE manual and scored 70% (105/150). |
| 125 | 116 | ||
| 126 | Here\'s a breakdown of my initial practice exam: | 117 | Here's a breakdown of my initial practice exam: |
| 127 | 118 | ||
| 128 | Exam Section Incorrect Correct Grand Total Percent | 119 | | Exam Section | Incorrect | Correct | Grand Total | Percent | |
| 129 | ------------------- ----------- ----------- ------------- ----------- | 120 | |-----------------|-----------|---------|-------------|---------| |
| 130 | 1 8 25 33 76% | 121 | | 1 | 8 | 25 | 33 | 76% | |
| 131 | 2 5 20 25 80% | 122 | | 2 | 5 | 20 | 25 | 80% | |
| 132 | 3 6 12 18 67% | 123 | | 3 | 6 | 12 | 18 | 67% | |
| 133 | 4 10 23 33 70% | 124 | | 4 | 10 | 23 | 33 | 70% | |
| 134 | 5 16 25 41 61% | 125 | | 5 | 16 | 25 | 41 | 61% | |
| 135 | **Grand Total\*** **45\*** **105\*** **150\*** **70%\*** | 126 | | **Grand Total** | **45** | **105** | **150** | **70%** | |
| 136 | 127 | ||
| 137 | As I expected, my toughest sections were related to project management, | 128 | As I expected, my toughest sections were related to project management, |
| 138 | development, implementation, and security. | 129 | development, implementation, and security. |
| 139 | 130 | ||
| 140 | This just leaves October and November. For these months, I tried to | 131 | This just leaves October and November. For these months, I tried to practice |
| 141 | practice every few days, doing 10 questions for each section, until the | 132 | every few days, doing 10 questions for each section, until the exam. This came |
| 142 | exam. This came out to 13 practice sessions, \~140 questions per | 133 | out to 13 practice sessions, ~140 questions per section, and ~700 questions |
| 143 | section, and \~700 questions total. | 134 | total. |
| 144 | 135 | ||
| 145 | While some practice sessions were worse and some were better, the final | 136 | While some practice sessions were worse and some were better, the final results |
| 146 | results were similar to my practice exam results. As you can see below, | 137 | were similar to my practice exam results. As you can see below, my averages were |
| 147 | my averages were slightly worse than my practice exam. However, I got in | 138 | slightly worse than my practice exam. However, I got in over 700 questions of |
| 148 | over 700 questions of practice and, most importantly, \*I read through | 139 | practice and, most importantly, *I read through the explanations every time I |
| 149 | the explanations every time I answered incorrectly and learned from my | 140 | answered incorrectly and learned from my mistakes*. |
| 150 | mistakes\*. | 141 | |
| 151 | 142 | | Exam Section | Incorrect | Correct | Grand Total | Percent | | |
| 152 | Exam Section Incorrect Correct Grand Total Percent | 143 | |-----------------|-----------|---------|-------------|---------| |
| 153 | ------------------- ----------- ----------- ------------- ----------- | 144 | | 1 | 33 | 108 | 141 | 77% | |
| 154 | 1 33 108 141 77% | 145 | | 2 | 33 | 109 | 142 | 77% | |
| 155 | 2 33 109 142 77% | 146 | | 3 | 55 | 89 | 144 | 62% | |
| 156 | 3 55 89 144 62% | 147 | | 4 | 52 | 88 | 140 | 63% | |
| 157 | 4 52 88 140 63% | 148 | | 5 | 55 | 85 | 140 | 61% | |
| 158 | 5 55 85 140 61% | 149 | | **Grand Total** | **228** | **479** | **707** | **68%** | |
| 159 | **Grand Total\*** **228\*** **479\*** **707\*** **68%\*** | ||
| 160 | 150 | ||
| 161 |  | 152 | results](https://img.cleberg.net/blog/20211204-i-passed-the-cisa/cisa-practice-questions-results.png) |
| 163 | 153 | ||
| 164 | # Results | 154 | # Results |
| 165 | 155 | ||
| 166 | Now, how do the practice scores reflect my actual results? After all, | 156 | Now, how do the practice scores reflect my actual results? After all, it's hard |
| 167 | it\'s hard to tell how good a practice regimen is unless you see how it | 157 | to tell how good a practice regimen is unless you see how it turns out. |
| 168 | turns out. | 158 | |
| 169 | 159 | | Exam Section | Section Name | Score | | |
| 170 | Exam Section Section Name Score | 160 | |--------------|------------------------------------------------------------------|-------| |
| 171 | -------------- ------------------------------------------------------------------ --------- | 161 | | 1 | Information Systems Auditing Process | 678 | |
| 172 | 1 Information Systems Auditing Process 678 | 162 | | 2 | Governance and Management of IT | 590 | |
| 173 | 2 Governance and Management of IT 590 | 163 | | 3 | Information Systems Acquisition, Development, and Implementation | 721 | |
| 174 | 3 Information Systems Acquisition, Development, and Implementation 721 | 164 | | 4 | Information Systems Operations and Business Resilience | 643 | |
| 175 | 4 Information Systems Operations and Business Resilience 643 | 165 | | 5 | Protection of Information Assets | 511 | |
| 176 | 5 Protection of Information Assets 511 | 166 | |
| 177 | **TOTAL** **616** | 167 | Now, in order to pass the CISA, you need at least 450 on a sliding scale of |
| 178 | 168 | 200-800. Personally, I really have no clue what an average CISA score is. After | |
| 179 | Now, in order to pass the CISA, you need at least 450 on a sliding scale | 169 | a *very* brief look online, I can see that the high end is usually in the low |
| 180 | of 200-800. Personally, I really have no clue what an average CISA score | 170 | 700s. In addition, only about 50-60% of people pass the exam. |
| 181 | is. After a *very* brief look online, I can see that the high end is | 171 | |
| 182 | usually in the low 700s. In addition, only about 50-60% of people pass | 172 | Given this information, I feel great about my scores. 616 may not be phenomenal, |
| 183 | the exam. | 173 | and I wish I had done better on sections 2 & 5, but my practicing seems to have |
| 184 | 174 | worked very well overall. | |
| 185 | Given this information, I feel great about my scores. 616 may not be | 175 | |
| 186 | phenomenal, and I wish I had done better on sections 2 & 5, but my | 176 | However, the practice results do not conform to the actual results. Section 2 |
| 187 | practicing seems to have worked very well overall. | 177 | was one of my highest practice sections and was my second-lowest score in the |
| 188 | 178 | exam. Conversely, section 3 was my second-lowest practice section and turned out | |
| 189 | However, the practice results do not conform to the actual results. | 179 | to be my highest actual score! |
| 190 | Section 2 was one of my highest practice sections and was my | 180 | |
| 191 | second-lowest score in the exam. Conversely, section 3 was my | 181 | After reflecting, it is obvious that if you have any background on the CISA |
| 192 | second-lowest practice section and turned out to be my highest actual | 182 | topics at all, the most important part of studying is doing practice questions. |
| 193 | score! | 183 | You really need to understand how to read the questions critically and pick the |
| 194 | 184 | best answer. | |
| 195 | After reflecting, it is obvious that if you have any background on the | ||
| 196 | CISA topics at all, the most important part of studying is doing | ||
| 197 | practice questions. You really need to understand how to read the | ||
| 198 | questions critically and pick the best answer. | ||
| 199 | 185 | ||
| 200 | # Looking Forward | 186 | # Looking Forward |
| 201 | 187 | ||
| 202 | I am extremely happy that I was finally able to pass the CISA. Looking | 188 | I am extremely happy that I was finally able to pass the CISA. Looking to the |
| 203 | to the future, I\'m not sure what\'s next in terms of professional | 189 | future, I'm not sure what's next in terms of professional learning. My current |
| 204 | learning. My current company offers internal learning courses, so I will | 190 | company offers internal learning courses, so I will most likely focus on that if |
| 205 | most likely focus on that if I need to gain more knowledge in certain | 191 | I need to gain more knowledge in certain areas. |
| 206 | areas. | 192 | |
| 207 | 193 | To be fair, even if you pass the CISA, it's hard to become an expert on any | |
| 208 | To be fair, even if you pass the CISA, it\'s hard to become an expert on | 194 | specific topic found within. My career may take me in a different direction, and |
| 209 | any specific topic found within. My career may take me in a different | 195 | I might need to focus more on security or networking certifications (or possibly |
| 210 | direction, and I might need to focus more on security or networking | 196 | building a better analysis/visualization portfolio if I want to go into data |
| 211 | certifications (or possibly building a better analysis/visualization | 197 | analysis/science). |
| 212 | portfolio if I want to go into data analysis/science). | ||
| 213 | 198 | ||
| 214 | All I know is that I am content at the moment and extremely proud of my | 199 | All I know is that I am content at the moment and extremely proud of my |
| 215 | accomplishment. | 200 | accomplishment. |
content/blog/2022-02-10-leaving-the-office.md +141 −160
| @@ -7,195 +7,180 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # The Working World is Changing | 8 | # The Working World is Changing |
| 9 | 9 | ||
| 10 | There has been a trend for the past few years of companies slowly | 10 | There has been a trend for the past few years of companies slowly realizing that |
| 11 | realizing that the pandemic is not just a temporary state that will go | 11 | the pandemic is not just a temporary state that will go away eventually and let |
| 12 | away eventually and let everything return to the way it was before. In | 12 | everything return to the way it was before. In terms of business and employment, |
| 13 | terms of business and employment, this means that more and more jobs are | 13 | this means that more and more jobs are being offered as permanently remote |
| 14 | being offered as permanently remote roles. | 14 | roles. |
| 15 | 15 | ||
| 16 | I had always dreamt of working from home but thought of it as a fantasy, | 16 | I had always dreamt of working from home but thought of it as a fantasy, |
| 17 | especially since I did not want to move over into the software | 17 | especially since I did not want to move over into the software development |
| 18 | development field. However, I have found that almost all roles being | 18 | field. However, I have found that almost all roles being sent to me via |
| 19 | sent to me via recruiters are permanently remote (although most are | 19 | recruiters are permanently remote (although most are limited to US citizens or |
| 20 | limited to US citizens or even region-locked for companies who only | 20 | even region-locked for companies who only operate in select states). |
| 21 | operate in select states). | ||
| 22 | 21 | ||
| 23 | I decided to take a look back at my relatively short career so far and | 22 | I decided to take a look back at my relatively short career so far and compare |
| 24 | compare the positive and negative effects of the different work | 23 | the positive and negative effects of the different work environments I've been |
| 25 | environments I\'ve been in. | 24 | in. |
| 26 | 25 | ||
| 27 | # In-Person Offices | 26 | # In-Person Offices |
| 28 | 27 | ||
| 29 | ## Retail Internship | 28 | ## Retail Internship |
| 30 | 29 | ||
| 31 | I started my first job as a management intern at a busy retail pharmacy, | 30 | I started my first job as a management intern at a busy retail pharmacy, working |
| 32 | working my 40-hour weeks on my feet. As these retail stores don\'t | 31 | my 40-hour weeks on my feet. As these retail stores don't believe in resting or |
| 33 | believe in resting or sitting down, you can guarantee that you will | 32 | sitting down, you can guarantee that you will spend entire shifts standing, |
| 34 | spend entire shifts standing, walking, or running around the store. | 33 | walking, or running around the store. Unfortunately, I worked at a time when our |
| 35 | Unfortunately, I worked at a time when our store didn\'t have enough | 34 | store didn't have enough managers, so I spent the majority of my tenure at the |
| 36 | managers, so I spent the majority of my tenure at the store running and | 35 | store running and breaking a sweat. |
| 37 | breaking a sweat. | 36 | |
| 38 | 37 | Now, things aren't all bad in retail stores like this. It is definitely tiring | |
| 39 | Now, things aren\'t all bad in retail stores like this. It is definitely | 38 | and inefficient to force employees to work constantly, or pretend to work if |
| 40 | tiring and inefficient to force employees to work constantly, or pretend | 39 | there's nothing to do, and not allow anyone to sit down. However, if you are |
| 41 | to work if there\'s nothing to do, and not allow anyone to sit down. | 40 | able to operate a retail store with a limited crew and provide enough comfort |
| 42 | However, if you are able to operate a retail store with a limited crew | 41 | and support, I believe these jobs could be both comfortable and efficient. |
| 43 | and provide enough comfort and support, I believe these jobs could be | ||
| 44 | both comfortable and efficient. | ||
| 45 | 42 | ||
| 46 | ## Semi-Private Cubicles | 43 | ## Semi-Private Cubicles |
| 47 | 44 | ||
| 48 |  | 46 | Cubicles](https://img.cleberg.net/blog/20220210-leaving-office-based-work-in-the-past/private_cubicles.png) |
| 50 | 47 | ||
| 51 | After about a year, I was able to find another internship - this time, | 48 | After about a year, I was able to find another internship - this time, it was in |
| 52 | it was in my field of interest: internal auditing. This was for a life | 49 | my field of interest: internal auditing. This was for a life insurance company |
| 53 | insurance company that was well over 100 years old. The age of the | 50 | that was well over 100 years old. The age of the company shows if you work |
| 54 | company shows if you work there, as most people in management are well | 51 | there, as most people in management are well into their 40s-60s with little to |
| 55 | into their 40s-60s with little to no youthful leadership in the company. | 52 | no youthful leadership in the company. Likewise, they owned a large headquarters |
| 56 | Likewise, they owned a large headquarters in a nice area of town with | 53 | in a nice area of town with plenty of space, parking, etc. |
| 57 | plenty of space, parking, etc. | 54 | |
| 58 | 55 | One upside is that each person gets their own large L-shaped desk, formed into | |
| 59 | One upside is that each person gets their own large L-shaped desk, | 56 | cubicles that house 4 desks/employees. These "pods" of 4-person cubicles are |
| 60 | formed into cubicles that house 4 desks/employees. These \"pods\" of | 57 | linked throughout each floor of the headquarters (except the sales people, who |
| 61 | 4-person cubicles are linked throughout each floor of the headquarters | 58 | had that open-floor concept going on). The walls of the cubicle were tall and |
| 62 | (except the sales people, who had that open-floor concept going on). The | 59 | provided a lot of privacy and sound-proofing, except when I used the standing |
| 63 | walls of the cubicle were tall and provided a lot of privacy and | 60 | desk feature (I'm over 6 feet tall, so probably not an issue for most people). |
| 64 | sound-proofing, except when I used the standing desk feature (I\'m over | ||
| 65 | 6 feet tall, so probably not an issue for most people). | ||
| 66 | 61 | ||
| 67 | I loved this environment, it allowed me to focus on my work with minimal | 62 | I loved this environment, it allowed me to focus on my work with minimal |
| 68 | distractions, but also allowed easy access, so I could spin around in my | 63 | distractions, but also allowed easy access, so I could spin around in my chair |
| 69 | chair and chat with my friends without leaving my chair. This is the | 64 | and chat with my friends without leaving my chair. This is the closest I've |
| 70 | closest I\'ve been to a home office environment (which is my personal | 65 | been to a home office environment (which is my personal favorite, as I'll get |
| 71 | favorite, as I\'ll get to later in this post). | 66 | to later in this post). |
| 72 | 67 | ||
| 73 | ## Semi-Open Floor Concept | 68 | ## Semi-Open Floor Concept |
| 74 | 69 | ||
| 75 |  | 71 | Concept](https://img.cleberg.net/blog/20220210-leaving-office-based-work-in-the-past/semi_open_office.png) |
| 77 | 72 | ||
| 78 | When I shifted to my first full-time internal audit job out of college, | 73 | When I shifted to my first full-time internal audit job out of college, I was |
| 79 | I was working at a company that was headquartered on a floor in a | 74 | working at a company that was headquartered on a floor in a downtown high-rise |
| 80 | downtown high-rise building. The company was only about 20 years old | 75 | building. The company was only about 20 years old when I worked there and were |
| 81 | when I worked there and were trying a lot of new things to attract young | 76 | trying a lot of new things to attract young talent, one of which was a semi-open |
| 82 | talent, one of which was a semi-open floor concept for the office. My | 77 | floor concept for the office. My department worked just around the hallway |
| 83 | department worked just around the hallway corner from the executive | 78 | corner from the executive offices and used that "modern" layout young tech |
| 84 | offices and used that \"modern\" layout young tech companies started | 79 | companies started using in the 2000s/2010s. |
| 85 | using in the 2000s/2010s. | 80 | |
| 86 | 81 | Each desk was brief, and you could look most coworkers in the face without | |
| 87 | Each desk was brief, and you could look most coworkers in the face | 82 | moving from your chair, I hated this so much. Directly to my left was the Chief |
| 88 | without moving from your chair, I hated this so much. Directly to my | 83 | Audit Executive (our department's leading boss), and his desk was pointed so |
| 89 | left was the Chief Audit Executive (our department\'s leading boss), and | 84 | that his face would stare straight at my desk all day. I spent more time |
| 90 | his desk was pointed so that his face would stare straight at my desk | 85 | thinking about who was looking at me or checking on me than actually working. |
| 91 | all day. I spent more time thinking about who was looking at me or | 86 | |
| 92 | checking on me than actually working. | 87 | The other annoying part of the open concept they used was that the kitchen area |
| 93 | 88 | and pathways were too close to everyone's desks (since the desks were spread | |
| 94 | The other annoying part of the open concept they used was that the | 89 | out, to provide space or something), so noise and conversation would be constant |
| 95 | kitchen area and pathways were too close to everyone\'s desks (since the | 90 | throughout the day while you try to work. For someone like me, who needs silence |
| 96 | desks were spread out, to provide space or something), so noise and | 91 | to get work done, that was a non-starter. |
| 97 | conversation would be constant throughout the day while you try to work. | ||
| 98 | For someone like me, who needs silence to get work done, that was a | ||
| 99 | non-starter. | ||
| 100 | 92 | ||
| 101 | ## Hotel Office Concept | 93 | ## Hotel Office Concept |
| 102 | 94 | ||
| 103 |  | 96 | Concept](https://img.cleberg.net/blog/20220210-leaving-office-based-work-in-the-past/hotel_desks.png) |
| 105 | 97 | ||
| 106 | I currently work for a company remotely (for now) and travel to the | 98 | I currently work for a company remotely (for now) and travel to the office every |
| 107 | office every once in a while for events and to help coach the staff | 99 | once in a while for events and to help coach the staff underneath me. The office |
| 108 | underneath me. The office I visit uses the hotel desk concept, where you | 100 | I visit uses the hotel desk concept, where you need to check in at a touch |
| 109 | need to check in at a touch screen when you enter the office and | 101 | screen when you enter the office and "rent" a desk for the day. The same goes |
| 110 | \"rent\" a desk for the day. The same goes for offices and meeting | 102 | for offices and meeting rooms. |
| 111 | rooms. | 103 | |
| 112 | 104 | These desks are flat-top only and do not have any walls at all. In addition, | |
| 113 | These desks are flat-top only and do not have any walls at all. In | 105 | they're stacked with one row of 4 desks facing another row of 4 desks. These |
| 114 | addition, they\'re stacked with one row of 4 desks facing another row of | 106 | pairs of desk rows are repeated through the office. |
| 115 | 4 desks. These pairs of desk rows are repeated through the office. | 107 | |
| 116 | 108 | This means that when I go, I need to rent a random desk or try to remember the | |
| 117 | This means that when I go, I need to rent a random desk or try to | 109 | unique ID numbers on desks I like. Once I rent it, I have to make sure no one |
| 118 | remember the unique ID numbers on desks I like. Once I rent it, I have | 110 | sat down in that desk without renting it. Then, I can sit down and work, but |
| 119 | to make sure no one sat down in that desk without renting it. Then, I | 111 | will probably need to adjust the monitors so that I'm not staring in the face |
| 120 | can sit down and work, but will probably need to adjust the monitors so | 112 | of the person across from me all day. Finally, I need to wear headphones as this |
| 121 | that I\'m not staring in the face of the person across from me all day. | 113 | environment does nothing to provide you with peace or quiet. |
| 122 | Finally, I need to wear headphones as this environment does nothing to | 114 | |
| 123 | provide you with peace or quiet. | 115 | Luckily, you can rent offices with doors that offer quiet and privacy, which can |
| 124 | 116 | be very nice if you have a lot of meetings or webinars on a certain day. | |
| 125 | Luckily, you can rent offices with doors that offer quiet and privacy, | ||
| 126 | which can be very nice if you have a lot of meetings or webinars on a | ||
| 127 | certain day. | ||
| 128 | 117 | ||
| 129 | # Home Office | 118 | # Home Office |
| 130 | 119 | ||
| 131 |  | 121 | Office](https://img.cleberg.net/blog/20220210-leaving-office-based-work-in-the-past/home_office.png) |
| 133 | 122 | ||
| 134 | Okay, now let\'s finally get to the home office concept. I have worked | 123 | Okay, now let's finally get to the home office concept. I have worked from home |
| 135 | from home for a little over two years at this point, across three | 124 | for a little over two years at this point, across three different |
| 136 | different jobs/employers. Over this time, I have experimented with a | 125 | jobs/employers. Over this time, I have experimented with a plethora of different |
| 137 | plethora of different organizational ideas, desks, and room layouts to | 126 | organizational ideas, desks, and room layouts to find what works best for me. |
| 138 | find what works best for me. | ||
| 139 | 127 | ||
| 140 | These things might not apply to you, and that\'s fine. Everyone has a | 128 | These things might not apply to you, and that's fine. Everyone has a different |
| 141 | different situation, and I really don\'t think you\'ll know what works | 129 | situation, and I really don't think you'll know what works until you try. |
| 142 | until you try. | ||
| 143 | 130 | ||
| 144 | ## Tip #1 | 131 | ## Tip #1 |
| 145 | 132 | ||
| 146 | Let\'s start with my top rule for a home office: | 133 | Let's start with my top rule for a home office: |
| 147 | 134 | ||
| 148 | > If you live with others, working in a shared space is not effective. | 135 | > If you live with others, working in a shared space is not effective. |
| 149 | 136 | ||
| 150 | It just does not work. If you have another person sleeping in your | 137 | It just does not work. If you have another person sleeping in your bedroom, it |
| 151 | bedroom, it is difficult to manage your work schedule with their | 138 | is difficult to manage your work schedule with their sleeping/work/school |
| 152 | sleeping/work/school schedule. If they wake up after you need to start | 139 | schedule. If they wake up after you need to start work, you might wake them up |
| 153 | work, you might wake them up or have to suffer the agony of staring at | 140 | or have to suffer the agony of staring at bright screens in a dark room. |
| 154 | bright screens in a dark room. | ||
| 155 | 141 | ||
| 156 | In a similar vein, working from a location such as the living room | 142 | In a similar vein, working from a location such as the living room likely won't |
| 157 | likely won\'t work either. Distractions will come far more frequently: | 143 | work either. Distractions will come far more frequently: televisions, cooking, |
| 158 | televisions, cooking, cleaning, deliveries, etc. If you\'re like me, | 144 | cleaning, deliveries, etc. If you're like me, you'll end up playing a game |
| 159 | you\'ll end up playing a game instead of actually doing any work. | 145 | instead of actually doing any work. |
| 160 | 146 | ||
| 161 | ## Tip #2 | 147 | ## Tip #2 |
| 162 | 148 | ||
| 163 | Okay, the second thing I\'ve discovered that works for me: | 149 | Okay, the second thing I've discovered that works for me: |
| 164 | 150 | ||
| 165 | > Use the pomodoro method (or something similar) to balance work tasks | 151 | > Use the pomodoro method (or something similar) to balance work tasks with |
| 166 | > with personal tasks. | 152 | > personal tasks. |
| 167 | 153 | ||
| 168 | I use a very casual version of the pomodoro method where I will work for | 154 | I use a very casual version of the pomodoro method where I will work for 1-2 |
| 169 | 1-2 hours (usually set in strict intervals like 1, 1.5, 2 hours) and | 155 | hours (usually set in strict intervals like 1, 1.5, 2 hours) and then will allow |
| 170 | then will allow myself 30-60 minutes for personal tasks. This schedule | 156 | myself 30-60 minutes for personal tasks. This schedule works for me, since my |
| 171 | works for me, since my work schedule really only comes to 3-6 hours of | 157 | work schedule really only comes to 3-6 hours of work per day. |
| 172 | work per day. | ||
| 173 | 158 | ||
| 174 | In this case, I\'ll work through my list of tasks for an hour or two and | 159 | In this case, I'll work through my list of tasks for an hour or two and then |
| 175 | then give myself personal time to get drinks and food, wash dishes, put | 160 | give myself personal time to get drinks and food, wash dishes, put clothes in |
| 176 | clothes in the washer, get the mail, etc. If you\'re in a convenient | 161 | the washer, get the mail, etc. If you're in a convenient location, this usually |
| 177 | location, this usually gives time for things like getting groceries (as | 162 | gives time for things like getting groceries (as long as you're not a slow |
| 178 | long as you\'re not a slow shopper). | 163 | shopper). |
| 179 | 164 | ||
| 180 | ## Tip #3 | 165 | ## Tip #3 |
| 181 | 166 | ||
| 182 | While I listed this one as number three, I don\'t think I\'d accomplish | 167 | While I listed this one as number three, I don't think I'd accomplish anything |
| 183 | anything without it: | 168 | without it: |
| 184 | 169 | ||
| 185 | > Document everything: even things you didn\'t before - such as task | 170 | > Document everything: even things you didn't before - such as task lists and |
| 186 | > lists and notes from casual calls or meetings. | 171 | > notes from casual calls or meetings. |
| 187 | 172 | ||
| 188 | I\'ve noticed that staying in an office gave me more constant reminders | 173 | I've noticed that staying in an office gave me more constant reminders of |
| 189 | of outstanding tasks or facts I had learned in a conversation. | 174 | outstanding tasks or facts I had learned in a conversation. Translating |
| 190 | Translating everything to a digital world has made me lose a bit of that | 175 | everything to a digital world has made me lose a bit of that focus (perhaps |
| 191 | focus (perhaps since I don\'t have visual reminders?). | 176 | since I don't have visual reminders?). |
| 192 | 177 | ||
| 193 | Keeping a running task list of all things I have to do - even potential | 178 | Keeping a running task list of all things I have to do - even potential tasks! - |
| 194 | tasks! - has helped me keep up without missing anything small. Likewise, | 179 | has helped me keep up without missing anything small. Likewise, keeping notes |
| 195 | keeping notes for ALL meetings and calls, no matter how casual/quick, | 180 | for ALL meetings and calls, no matter how casual/quick, has improved my |
| 196 | has improved my retention immensely. Beyond helping my mental | 181 | retention immensely. Beyond helping my mental recollection, it has saved me |
| 197 | recollection, it has saved me numerous times when I need to do a keyword | 182 | numerous times when I need to do a keyword search for some topic that was |
| 198 | search for some topic that was discussed 6+ months ago. | 183 | discussed 6+ months ago. |
| 199 | 184 | ||
| 200 | ## Tip #4 | 185 | ## Tip #4 |
| 201 | 186 | ||
| @@ -203,39 +188,35 @@ Okay, last one for now. | |||
| 203 | 188 | ||
| 204 | > Keep your work area clean. | 189 | > Keep your work area clean. |
| 205 | 190 | ||
| 206 | This one is straightforward, but I know some people struggle with | 191 | This one is straightforward, but I know some people struggle with cleanliness or |
| 207 | cleanliness or may not believe it makes a difference. Trust me, keeping | 192 | may not believe it makes a difference. Trust me, keeping your desk area clean |
| 208 | your desk area clean and organized makes a huge difference, both | 193 | and organized makes a huge difference, both mentally and emotionally. |
| 209 | mentally and emotionally. | ||
| 210 | 194 | ||
| 211 | Just think about it, you walk into your home office and see a clean desk | 195 | Just think about it, you walk into your home office and see a clean desk with a |
| 212 | with a laptop, dock, monitors, keyboard, mouse, and a notepad with a pen | 196 | laptop, dock, monitors, keyboard, mouse, and a notepad with a pen on top. |
| 213 | on top. | ||
| 214 | 197 | ||
| 215 | Now imagine the opposite, there\'s an office with the same equipment, | 198 | Now imagine the opposite, there's an office with the same equipment, but there |
| 216 | but there are clothes hanging on the chair, empty drink bottles, candy | 199 | are clothes hanging on the chair, empty drink bottles, candy wrappers and dirty |
| 217 | wrappers and dirty plates. This can take both a mental and emotional | 200 | plates. This can take both a mental and emotional toll by bringing constant |
| 218 | toll by bringing constant disarray and stress into your working | 201 | disarray and stress into your working environment. |
| 219 | environment. | ||
| 220 | 202 | ||
| 221 | Just keep things clean each day, and you won\'t need to do any big | 203 | Just keep things clean each day, and you won't need to do any big cleaning days |
| 222 | cleaning days to recover. | 204 | to recover. |
| 223 | 205 | ||
| 224 | # My Preferences | 206 | # My Preferences |
| 225 | 207 | ||
| 226 | I\'ve talked about the different environments I\'ve worked in and | 208 | I've talked about the different environments I've worked in and expressed some |
| 227 | expressed some honest thoughts on pros or cons to each, but what do I | 209 | honest thoughts on pros or cons to each, but what do I prefer? Well, if you're |
| 228 | prefer? Well, if you\'re reading along, you should be able to tell that | 210 | reading along, you should be able to tell that I much prefer a home office above |
| 229 | I much prefer a home office above all else. | 211 | all else. |
| 230 | 212 | ||
| 231 | Being able to control my own day and allot my time as needed has brought | 213 | Being able to control my own day and allot my time as needed has brought a |
| 232 | a calmness to my life and has allowed me to maximize each day. I feel | 214 | calmness to my life and has allowed me to maximize each day. I feel far more |
| 233 | far more effective and efficient in a home office than any other office, | 215 | effective and efficient in a home office than any other office, especially |
| 234 | especially open-office layouts. | 216 | open-office layouts. |
| 235 | 217 | ||
| 236 | If I do need to return to an office part-time in the future, I really | 218 | If I do need to return to an office part-time in the future, I really hope the |
| 237 | hope the office will have privacy and quietness in order for me to get | 219 | office will have privacy and quietness in order for me to get my work done. |
| 238 | my work done. | ||
| 239 | 220 | ||
| 240 | Cubicles are good! I agree with Alice (from the comic Dilbert): | 221 | Cubicles are good! I agree with Alice (from the comic Dilbert): |
| 241 | 222 | ||
content/blog/2022-02-10-njalla-dns-api.md +47 −56
| @@ -5,48 +5,46 @@ description = "" | |||
| 5 | draft = false | 5 | draft = false |
| 6 | +++ | 6 | +++ |
| 7 | 7 | ||
| 8 | # Njalla\'s API | 8 | # Njalla's API |
| 9 | 9 | ||
| 10 | As noted in my recent post about [switching to Njalla from | 10 | As noted in my recent post about [switching to Njalla from |
| 11 | Cloudflare](file:///blog/ditching-cloudflare/), I was searching for a | 11 | Cloudflare](file:///blog/ditching-cloudflare/), I was searching for a way to |
| 12 | way to replace my very easy-to-use bash script to [update Cloudflare\'s | 12 | replace my very easy-to-use bash script to [update Cloudflare's DNS via their |
| 13 | DNS via their API](file:///blog/cloudflare-dns-api/). | 13 | API](file:///blog/cloudflare-dns-api/). |
| 14 | 14 | ||
| 15 | To reiterate what I said in those posts, this is a common necessity for | 15 | To reiterate what I said in those posts, this is a common necessity for those of |
| 16 | those of us who have non-static IP addresses that can change at any | 16 | us who have non-static IP addresses that can change at any moment due to ISP |
| 17 | moment due to ISP policy. | 17 | policy. |
| 18 | 18 | ||
| 19 | In order to keep a home server running smoothly, the server admin needs | 19 | In order to keep a home server running smoothly, the server admin needs to have |
| 20 | to have a process to constantly monitor their public IP address and | 20 | a process to constantly monitor their public IP address and update their |
| 21 | update their domain\'s DNS records if it changes. | 21 | domain's DNS records if it changes. |
| 22 | 22 | ||
| 23 | This post explains how to use Python to update Njalla\'s DNS records | 23 | This post explains how to use Python to update Njalla's DNS records whenever a |
| 24 | whenever a machine\'s public IP address changes. | 24 | machine's public IP address changes. |
| 25 | 25 | ||
| 26 | ## Creating a Token | 26 | ## Creating a Token |
| 27 | 27 | ||
| 28 | To use Njalla\'s API, you will first need to create a token that will be | 28 | To use Njalla's API, you will first need to create a token that will be used to |
| 29 | used to authenticate you every time you call the API. Luckily, this is | 29 | authenticate you every time you call the API. Luckily, this is very easy to do |
| 30 | very easy to do if you have an account with Njalla. | 30 | if you have an account with Njalla. |
| 31 | 31 | ||
| 32 | Simply go the [API Settings](https://njal.la/settings/api/) page and | 32 | Simply go the [API Settings](https://njal.la/settings/api/) page and click the |
| 33 | click the `Add Token` button. Next, enter a name for the | 33 | `Add Token` button. Next, enter a name for the token and click `Add`. |
| 34 | token and click `Add`. | ||
| 35 | 34 | ||
| 36 | Finally, click the `Manage` button next to your newly created | 35 | Finally, click the `Manage` button next to your newly created token and copy the |
| 37 | token and copy the `API Token` field. | 36 | `API Token` field. |
| 38 | 37 | ||
| 39 | ## Finding the Correct API Request | 38 | ## Finding the Correct API Request |
| 40 | 39 | ||
| 41 | Once you have a token, you\'re ready to call the Njalla API for any | 40 | Once you have a token, you're ready to call the Njalla API for any number of |
| 42 | number of requests. For a full listing of available requests, see the | 41 | requests. For a full listing of available requests, see the [Njalla API |
| 43 | [Njalla API Documentation](https://njal.la/api/). | 42 | Documentation](https://njal.la/api/). |
| 44 | 43 | ||
| 45 | For this demo, we are using the `list-records` and | 44 | For this demo, we are using the `list-records` and `edit-record` requests. |
| 46 | `edit-record` requests. | ||
| 47 | 45 | ||
| 48 | The `list-records` request requires the following payload to | 46 | The `list-records` request requires the following payload to be sent when |
| 49 | be sent when calling the API: | 47 | calling the API: |
| 50 | 48 | ||
| 51 | ``` txt | 49 | ``` txt |
| 52 | params: { | 50 | params: { |
| @@ -54,8 +52,8 @@ params: { | |||
| 54 | } | 52 | } |
| 55 | ``` | 53 | ``` |
| 56 | 54 | ||
| 57 | The `edit-record` request requires the following payload to | 55 | The `edit-record` request requires the following payload to be sent when calling |
| 58 | be sent when calling the API: | 56 | the API: |
| 59 | 57 | ||
| 60 | ``` txt | 58 | ``` txt |
| 61 | params: { | 59 | params: { |
| @@ -67,14 +65,14 @@ params: { | |||
| 67 | 65 | ||
| 68 | # Server Set-Up | 66 | # Server Set-Up |
| 69 | 67 | ||
| 70 | To create this script, we will be using Python. By default, I use Python | 68 | To create this script, we will be using Python. By default, I use Python 3 on my |
| 71 | 3 on my servers, so please note that I did not test this in Python 2, | 69 | servers, so please note that I did not test this in Python 2, and I do not know |
| 72 | and I do not know if Python 2 will work for this. | 70 | if Python 2 will work for this. |
| 73 | 71 | ||
| 74 | ## Creating the Script | 72 | ## Creating the Script |
| 75 | 73 | ||
| 76 | First, find a suitable place to create your script. Personally, I just | 74 | First, find a suitable place to create your script. Personally, I just create a |
| 77 | create a directory called `ddns` in my home directory: | 75 | directory called `ddns` in my home directory: |
| 78 | 76 | ||
| 79 | ```sh | 77 | ```sh |
| 80 | mkdir ~/ddns | 78 | mkdir ~/ddns |
| @@ -86,23 +84,17 @@ Next, create a Python script file: | |||
| 86 | nano ~/ddns/ddns.py | 84 | nano ~/ddns/ddns.py |
| 87 | ``` | 85 | ``` |
| 88 | 86 | ||
| 89 | The following code snippet is quite long, so I won\'t go into depth on | 87 | The following code snippet is quite long, so I won't go into depth on each |
| 90 | each part. However, I suggest you read through the entire script before | 88 | part. However, I suggest you read through the entire script before running it; |
| 91 | running it; it is quite simple and contains comments to help explain | 89 | it is quite simple and contains comments to help explain each code block. |
| 92 | each code block. | ||
| 93 | 90 | ||
| 94 | :warning: **Note**: You will need to update the following variables for | 91 | :warning: **Note**: You will need to update the following variables for this to |
| 95 | this to work: | 92 | work: |
| 96 | 93 | ||
| 97 | - `token`: This is the Njalla API token you created | 94 | - `token`: This is the Njalla API token you created earlier. |
| 98 | earlier. | 95 | - `user_domain`: This is the top-level domain you want to modify. |
| 99 | - `user_domain`: This is the top-level domain you want to | 96 | - `include_subdomains`: Set this to `True` if you also want to modify subdomains found under the TLD. |
| 100 | modify. | 97 | - `subdomains`: If `include_subdomains` = `True`, you can include your list of subdomains to be modified here. |
| 101 | - `include_subdomains`: Set this to `True` if | ||
| 102 | you also want to modify subdomains found under the TLD. | ||
| 103 | - `subdomains`: If `include_subdomains` = | ||
| 104 | `True`, you can include your list of subdomains to be | ||
| 105 | modified here. | ||
| 106 | 98 | ||
| 107 | ``` python | 99 | ``` python |
| 108 | #!/usr/bin/python | 100 | #!/usr/bin/python |
| @@ -187,8 +179,8 @@ for record in data['records']: | |||
| 187 | 179 | ||
| 188 | ## Running the Script | 180 | ## Running the Script |
| 189 | 181 | ||
| 190 | Once you\'ve created the script and are ready to test it, run the | 182 | Once you've created the script and are ready to test it, run the following |
| 191 | following command: | 183 | command: |
| 192 | 184 | ||
| 193 | ```sh | 185 | ```sh |
| 194 | python3 ~/ddns/ddns.py | 186 | python3 ~/ddns/ddns.py |
| @@ -196,16 +188,15 @@ python3 ~/ddns/ddns.py | |||
| 196 | 188 | ||
| 197 | ## Setting the Script to Run Automatically | 189 | ## Setting the Script to Run Automatically |
| 198 | 190 | ||
| 199 | To make sure the scripts run automatically, add it to the | 191 | To make sure the scripts run automatically, add it to the `cron` file so that it |
| 200 | `cron` file so that it will run on a schedule. To do this, | 192 | will run on a schedule. To do this, open the `cron` file: |
| 201 | open the `cron` file: | ||
| 202 | 193 | ||
| 203 | ```sh | 194 | ```sh |
| 204 | crontab -e | 195 | crontab -e |
| 205 | ``` | 196 | ``` |
| 206 | 197 | ||
| 207 | In the cron file, paste the following at the bottom of the editor in | 198 | In the cron file, paste the following at the bottom of the editor in order to |
| 208 | order to check the IP every five minutes: | 199 | check the IP every five minutes: |
| 209 | 200 | ||
| 210 | ```sh | 201 | ```sh |
| 211 | */5 ** ** ** ** python3 /home/<your_username>/ddns/ddns.py | 202 | */5 ** ** ** ** python3 /home/<your_username>/ddns/ddns.py |
content/blog/2022-02-16-debian-and-nginx.md +60 −68
| @@ -10,34 +10,33 @@ draft = false | |||
| 10 |  | 11 | neofetch](https://img.cleberg.net/blog/20220216-migrating-to-debian-and-nginx/neofetch.png) |
| 12 | 12 | ||
| 13 | I\'ve used various Linux distributions throughout the years, but I\'ve | 13 | I've used various Linux distributions throughout the years, but I've never |
| 14 | never used anything except Ubuntu for my servers. Why? I really have no | 14 | used anything except Ubuntu for my servers. Why? I really have no idea, mostly |
| 15 | idea, mostly just comfort around the commands and software availability. | 15 | just comfort around the commands and software availability. |
| 16 | 16 | ||
| 17 | However, I have always wanted to try Debian as a server OS after testing | 17 | However, I have always wanted to try Debian as a server OS after testing it out |
| 18 | it out in a VM a few years ago (side-note: I\'d love to try Alpine too, | 18 | in a VM a few years ago (side-note: I'd love to try Alpine too, but I always |
| 19 | but I always struggle with compatibility). So, I decided to launch a new | 19 | struggle with compatibility). So, I decided to launch a new VPS and use |
| 20 | VPS and use [Debian](https://www.debian.org) 11 as the OS. Spoiler | 20 | [Debian](https://www.debian.org) 11 as the OS. Spoiler alert: it feels identical |
| 21 | alert: it feels identical to Ubuntu for my purposes. | 21 | to Ubuntu for my purposes. |
| 22 | 22 | ||
| 23 | I did the normal things when first launching the VPS, such as adding a | 23 | I did the normal things when first launching the VPS, such as adding a new user, |
| 24 | new user, locking down SSH, etc. If you want to see that level of | 24 | locking down SSH, etc. If you want to see that level of detail, read my other |
| 25 | detail, read my other post about [How to Set Up a VPS Web | 25 | post about [How to Set Up a VPS Web |
| 26 | Server](https://cleberg.net/blog/how-to-set-up-a-vps-web-server/). | 26 | Server](https://cleberg.net/blog/how-to-set-up-a-vps-web-server/). |
| 27 | 27 | ||
| 28 | All of this has been similar, apart from small things such as the | 28 | All of this has been similar, apart from small things such as the location of |
| 29 | location of users\' home folders. No complaints at all from me - Debian | 29 | users' home folders. No complaints at all from me - Debian seems great. |
| 30 | seems great. | ||
| 31 | 30 | ||
| 32 | # Web Server: Nginx | 31 | # Web Server: Nginx |
| 33 | 32 | ||
| 34 |  | 34 | status](https://img.cleberg.net/blog/20220216-migrating-to-debian-and-nginx/nginx.png) |
| 36 | 35 | ||
| 37 | Once I had the baseline server configuration set-up for Debian, I moved | 36 | Once I had the baseline server configuration set-up for Debian, I moved on to |
| 38 | on to trying out [Nginx](https://nginx.org) as my web server software. | 37 | trying out [Nginx](https://nginx.org) as my web server software. This required |
| 39 | This required me to install the `nginx` and `ufw` | 38 | me to install the `nginx` and `ufw` packages, as well as setting up the initial |
| 40 | packages, as well as setting up the initial UFW config: | 39 | UFW config: |
| 41 | 40 | ||
| 42 | ```sh | 41 | ```sh |
| 43 | sudo apt install nginx ufw | 42 | sudo apt install nginx ufw |
| @@ -48,9 +47,9 @@ sudo ufw status | |||
| 48 | sudo systemctl status nginx | 47 | sudo systemctl status nginx |
| 49 | ``` | 48 | ``` |
| 50 | 49 | ||
| 51 | Once I had the firewall set, I moved on to creating the directories and | 50 | Once I had the firewall set, I moved on to creating the directories and files |
| 52 | files for my website. This is very easy and is basically the same as | 51 | for my website. This is very easy and is basically the same as setting up an |
| 53 | setting up an Apache server, so no struggles here. | 52 | Apache server, so no struggles here. |
| 54 | 53 | ||
| 55 | ```sh | 54 | ```sh |
| 56 | sudo mkdir -p /var/www/your_domain/html | 55 | sudo mkdir -p /var/www/your_domain/html |
| @@ -59,10 +58,9 @@ sudo chmod -R 755 /var/www/your_domain | |||
| 59 | nano /var/www/your_domain/html/index.html | 58 | nano /var/www/your_domain/html/index.html |
| 60 | ``` | 59 | ``` |
| 61 | 60 | ||
| 62 | The next part, creating the Nginx configuration files, is quite a bit | 61 | The next part, creating the Nginx configuration files, is quite a bit different |
| 63 | different from Apache. First, you need to create the files in the | 62 | from Apache. First, you need to create the files in the `sites-available` folder |
| 64 | `sites-available` folder and symlink it the | 63 | and symlink it the `sites-enabled` folder. |
| 65 | `sites-enabled` folder. | ||
| 66 | 64 | ||
| 67 | Creating the config file for your domain: | 65 | Creating the config file for your domain: |
| 68 | 66 | ||
| @@ -95,11 +93,10 @@ sudo ln -s /etc/nginx/sites-available/your_domain /etc/nginx/sites-enabled/ | |||
| 95 | ``` | 93 | ``` |
| 96 | 94 | ||
| 97 | This will make your site available to the public (as long as you have | 95 | This will make your site available to the public (as long as you have |
| 98 | `your_domain` DNS records pointed at the server\'s IP | 96 | `your_domain` DNS records pointed at the server's IP address)! |
| 99 | address)! | ||
| 100 | 97 | ||
| 101 | Next, I used [certbot](https://certbot.eff.org/) to issue an HTTPS | 98 | Next, I used [certbot](https://certbot.eff.org/) to issue an HTTPS certificate |
| 102 | certificate for my domains using the following commands: | 99 | for my domains using the following commands: |
| 103 | 100 | ||
| 104 | ```sh | 101 | ```sh |
| 105 | sudo apt install snapd; sudo snap install core; sudo snap refresh core | 102 | sudo apt install snapd; sudo snap install core; sudo snap refresh core |
| @@ -108,17 +105,15 @@ sudo ln -s /snap/bin/certbot /usr/bin/certbot | |||
| 108 | sudo certbot --nginx | 105 | sudo certbot --nginx |
| 109 | ``` | 106 | ``` |
| 110 | 107 | ||
| 111 | Now that certbot ran successfully and updated my Nginx config files to | 108 | Now that certbot ran successfully and updated my Nginx config files to include a |
| 112 | include a `443` server block of code, I went back in and | 109 | `443` server block of code, I went back in and edited the config file to include |
| 113 | edited the config file to include security HTTP headers. This part is | 110 | security HTTP headers. This part is optional, but is recommended for security |
| 114 | optional, but is recommended for security purposes; you can even test a | 111 | purposes; you can even test a website's HTTP header security at [Security |
| 115 | website\'s HTTP header security at [Security | ||
| 116 | Headers](https://securityheaders.com/). | 112 | Headers](https://securityheaders.com/). |
| 117 | 113 | ||
| 118 | The configuration below shows a set-up where you only want your website | 114 | The configuration below shows a set-up where you only want your website to serve |
| 119 | to serve content from its own domain, except for images and scripts, | 115 | content from its own domain, except for images and scripts, which may come from |
| 120 | which may come from `nullitics.com`. All other content would | 116 | `nullitics.com`. All other content would be blocked from loading in a browser. |
| 121 | be blocked from loading in a browser. | ||
| 122 | 117 | ||
| 123 | ```sh | 118 | ```sh |
| 124 | sudo nano /etc/nginx/sites-available/your_domain | 119 | sudo nano /etc/nginx/sites-available/your_domain |
| @@ -143,39 +138,36 @@ sudo systemctl restart nginx | |||
| 143 | 138 | ||
| 144 | ## Nginx vs. Apache | 139 | ## Nginx vs. Apache |
| 145 | 140 | ||
| 146 | As I stated at the beginning, my historical hesitation with trying Nginx | 141 | As I stated at the beginning, my historical hesitation with trying Nginx was |
| 147 | was that the differences in configuration formats scared me away from | 142 | that the differences in configuration formats scared me away from leaving |
| 148 | leaving Apache. However, I prefer Nginx to Apache for a few reasons: | 143 | Apache. However, I prefer Nginx to Apache for a few reasons: |
| 149 | 144 | ||
| 150 | 1. Nginx uses only one config file (`your_domain`) vs. | 145 | 1. Nginx uses only one config file (`your_domain`) vs. Apache's two-file |
| 151 | Apache\'s two-file approach for HTTP vs. HTTPS | 146 | approach for HTTP vs. HTTPS (`your_domain.conf` and |
| 152 | (`your_domain.conf` and | 147 | `your_domain-le-ssl.conf`). |
| 153 | `your_domain-le-ssl.conf`). | 148 | 2. Symlinking new configurations files and reloading Nginx are way easier than |
| 154 | 2. Symlinking new configurations files and reloading Nginx are way | 149 | Apache's process of having to enable headers with `a2enmod mod_headers`, |
| 155 | easier than Apache\'s process of having to enable headers with | 150 | enable PHP with `a2enmod php` (plus any other mods you need), and then |
| 156 | `a2enmod mod_headers`, enable PHP with | 151 | enabling sites with `a2ensite`, and THEN reloading Apache. |
| 157 | `a2enmod php` (plus any other mods you need), and then | 152 | 3. The contents of the Nginx config files seem more organized and logical with |
| 158 | enabling sites with `a2ensite`, and THEN reloading | 153 | the curly-bracket approach. This is a minor reason, but everything just felt |
| 159 | Apache. | 154 | cleaner while I was installing my sites and that had a big quality of life |
| 160 | 3. The contents of the Nginx config files seem more organized and | 155 | impact on the installation for me. |
| 161 | logical with the curly-bracket approach. This is a minor reason, but | 156 | |
| 162 | everything just felt cleaner while I was installing my sites and | 157 | They're both great software packages, but Nginx just seems more organized and |
| 163 | that had a big quality of life impact on the installation for me. | 158 | easier to use these days. I will certainly be exploring the Nginx docs to see |
| 164 | 159 | what other fun things I can do with all of this. | |
| 165 | They\'re both great software packages, but Nginx just seems more | ||
| 166 | organized and easier to use these days. I will certainly be exploring | ||
| 167 | the Nginx docs to see what other fun things I can do with all of this. | ||
| 168 | 160 | ||
| 169 | # Gemini Server: Agate | 161 | # Gemini Server: Agate |
| 170 | 162 | ||
| 171 |  | 164 | status](https://img.cleberg.net/blog/20220216-migrating-to-debian-and-nginx/agate.png) |
| 173 | 165 | ||
| 174 | Finally, I set up the Agate software on this server again to host my | 166 | Finally, I set up the Agate software on this server again to host my Gemini |
| 175 | Gemini server content, using Rust as I have before. You can read my | 167 | server content, using Rust as I have before. You can read my other post for more |
| 176 | other post for more information on installing Agate: [Hosting a Gemini | 168 | information on installing Agate: [Hosting a Gemini |
| 177 | Server](https://cleberg.net/blog/hosting-a-gemini-server/). | 169 | Server](https://cleberg.net/blog/hosting-a-gemini-server/). |
| 178 | 170 | ||
| 179 | All in all, Debian + Nginx is very slick and I prefer it over my old | 171 | All in all, Debian + Nginx is very slick and I prefer it over my old combination |
| 180 | combination of Ubuntu + Apache (although it\'s really just Nginx \> | 172 | of Ubuntu + Apache (although it's really just Nginx > Apache for me, since |
| 181 | Apache for me, since Debian seems mostly the same as Ubuntu is so far). | 173 | Debian seems mostly the same as Ubuntu is so far). |
content/blog/2022-02-17-exiftool.md +30 −34
| @@ -7,36 +7,34 @@ draft = false | |||
| 7 | 7 | ||
| 8 | ## Why Strip Metadata? | 8 | ## Why Strip Metadata? |
| 9 | 9 | ||
| 10 | Okay, so you want to strip metadata from your photos. Perhaps you take | 10 | Okay, so you want to strip metadata from your photos. Perhaps you take pictures |
| 11 | pictures of very rare birds, and the location metadata is a gold mine | 11 | of very rare birds, and the location metadata is a gold mine for poachers, or |
| 12 | for poachers, or perhaps you\'re just privacy-oriented like me and | 12 | perhaps you're just privacy-oriented like me and prefer to strip metadata from |
| 13 | prefer to strip metadata from publicly-available images. | 13 | publicly-available images. |
| 14 | 14 | ||
| 15 | There are various components of image metadata that you may want to | 15 | There are various components of image metadata that you may want to delete |
| 16 | delete before releasing a photo to the public. Here\'s an incomplete | 16 | before releasing a photo to the public. Here's an incomplete list of things I |
| 17 | list of things I could easily see just by inspecting a photo on my | 17 | could easily see just by inspecting a photo on my laptop: |
| 18 | laptop: | ||
| 19 | 18 | ||
| 20 | - Location (Latitude & Longitude) | 19 | - Location (Latitude & Longitude) |
| 21 | - Dimensions | 20 | - Dimensions |
| 22 | - Device Make & Model | 21 | - Device Make & Model |
| 23 | - Color Space | 22 | - Color Space |
| 24 | - Color Profile | 23 | - Color Profile |
| 25 | - Focal Length | 24 | - Focal Length |
| 26 | - Alpha Channel | 25 | - Alpha Channel |
| 27 | - Red Eye | 26 | - Red Eye |
| 28 | - Metering Mode | 27 | - Metering Mode |
| 29 | - F Number | 28 | - F Number |
| 30 | 29 | ||
| 31 | Regardless of your reasoning, I\'m going to explain how I used the | 30 | Regardless of your reasoning, I'm going to explain how I used the `exiftool` |
| 32 | `exiftool` package in Linux to automatically strip metadata | 31 | package in Linux to automatically strip metadata from all images in a directory |
| 33 | from all images in a directory (+ subdirectories). | 32 | (+ subdirectories). |
| 34 | 33 | ||
| 35 | ## Installing `exiftool` | 34 | ## Installing `exiftool` |
| 36 | 35 | ||
| 37 | First things first: we need to install the tool. I\'m running Debian 11 | 36 | First things first: we need to install the tool. I'm running Debian 11 on my |
| 38 | on my server (Ubuntu will work the same), so the command is as simple | 37 | server (Ubuntu will work the same), so the command is as simple as: |
| 39 | as: | ||
| 40 | 38 | ||
| 41 | ```sh | 39 | ```sh |
| 42 | sudo apt install exiftool | 40 | sudo apt install exiftool |
| @@ -47,22 +45,20 @@ distributions, but I really only care to test out this one package. | |||
| 47 | 45 | ||
| 48 | ## Recursively Strip Data | 46 | ## Recursively Strip Data |
| 49 | 47 | ||
| 50 | I actually use this tool extensively to strip any photos uploaded to the | 48 | I actually use this tool extensively to strip any photos uploaded to the website |
| 51 | website that serves all the images for my blog | 49 | that serves all the images for my blog (`img.cleberg.net`). |
| 52 | (`img.cleberg.net`). | ||
| 53 | 50 | ||
| 54 | The following command is incredibly useful and can be modified to | 51 | The following command is incredibly useful and can be modified to include any |
| 55 | include any image extensions that `exiftool` supports: | 52 | image extensions that `exiftool` supports: |
| 56 | 53 | ||
| 57 | ```sh | 54 | ```sh |
| 58 | exiftool -r -all= -ext jpg -ext png /path/to/directory/ | 55 | exiftool -r -all= -ext jpg -ext png /path/to/directory/ |
| 59 | ``` | 56 | ``` |
| 60 | 57 | ||
| 61 | See below for the results of my most recent usage of | 58 | See below for the results of my most recent usage of `exiftool` after I uploaded |
| 62 | `exiftool` after I uploaded the image for this blog post. You | 59 | the image for this blog post. You can see that the command will let you know how |
| 63 | can see that the command will let you know how many directories were | 60 | many directories were scanned, how many images were updated, and how many images |
| 64 | scanned, how many images were updated, and how many images were | 61 | were unchanged. |
| 65 | unchanged. | ||
| 66 | 62 | ||
| 67 |  | 64 | results](https://img.cleberg.net/blog/20220217-stripping-metadata-with-exiftool/exiftool.png) |
content/blog/2022-02-20-nginx-caching.md +30 −35
| @@ -7,16 +7,15 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Update Your Nginx Config to Cache Static Files | 8 | # Update Your Nginx Config to Cache Static Files |
| 9 | 9 | ||
| 10 | If you run a website on Nginx that serves static content (i.e., content | 10 | If you run a website on Nginx that serves static content (i.e., content that is |
| 11 | that is not dynamic and changing with interactions from the user), you | 11 | not dynamic and changing with interactions from the user), you would likely |
| 12 | would likely benefit from caching that content on the client-side. If | 12 | benefit from caching that content on the client-side. If you're used to Apache |
| 13 | you\'re used to Apache and looking for the Nginx equivalent, this post | 13 | and looking for the Nginx equivalent, this post should help. |
| 14 | should help. | ||
| 15 | 14 | ||
| 16 | Luckily, setting up the cache is as easy as identifying the file types | 15 | Luckily, setting up the cache is as easy as identifying the file types you want |
| 17 | you want to cache and determining the expiration length. To include more | 16 | to cache and determining the expiration length. To include more file types, |
| 18 | file types, simply use the bar separator (`|`) and type the | 17 | simply use the bar separator (`|`) and type the new file extension you want to |
| 19 | new file extension you want to include. | 18 | include. |
| 20 | 19 | ||
| 21 | ``` config | 20 | ``` config |
| 22 | server { | 21 | server { |
| @@ -30,44 +29,40 @@ server { | |||
| 30 | } | 29 | } |
| 31 | ``` | 30 | ``` |
| 32 | 31 | ||
| 33 | I have seen some people who prefer to set `expires` as | 32 | I have seen some people who prefer to set `expires` as `365d` or even `max`, but |
| 34 | `365d` or even `max`, but that is only for stable, | 33 | that is only for stable, infrequently changing websites. As my site often |
| 35 | infrequently changing websites. As my site often changes (i.e., I\'m | 34 | changes (i.e., I'm never content with my website), I need to know that my |
| 36 | never content with my website), I need to know that my readers are | 35 | readers are seeing the new content without waiting too long. |
| 37 | seeing the new content without waiting too long. | ||
| 38 | 36 | ||
| 39 | So, I went ahead and set the expiration date at `30d`, which | 37 | So, I went ahead and set the expiration date at `30d`, which is short enough to |
| 40 | is short enough to refresh for readers but long enough that | 38 | refresh for readers but long enough that clients/browsers won't be |
| 41 | clients/browsers won\'t be re-requesting the static files too often, | 39 | re-requesting the static files too often, hopefully resulting in faster loading |
| 42 | hopefully resulting in faster loading times, as images should be the | 40 | times, as images should be the only thing slowing down my site. |
| 43 | only thing slowing down my site. | ||
| 44 | 41 | ||
| 45 | # Testing Results | 42 | # Testing Results |
| 46 | 43 | ||
| 47 | To test my changes to the Nginx configuration, I used the [HTTP Header | 44 | To test my changes to the Nginx configuration, I used the [HTTP Header |
| 48 | Live](https://addons.mozilla.org/en-US/firefox/addon/http-header-live/) | 45 | Live](https://addons.mozilla.org/en-US/firefox/addon/http-header-live/) |
| 49 | extension on my Gecko browser and used the sidebar to inspect the | 46 | extension on my Gecko browser and used the sidebar to inspect the headers of a |
| 50 | headers of a recent image from my blog. | 47 | recent image from my blog. |
| 51 | 48 | ||
| 52 | In the image below, you can see that the `Cache-Control` | 49 | In the image below, you can see that the `Cache-Control` header is now present |
| 53 | header is now present and set to 2592000, which is 30 days represented | 50 | and set to 2592000, which is 30 days represented in seconds (30 days \_ 24 |
| 54 | in seconds (30 days \_ 24 hours/day \_ 60 minutes/hour \*\* 60 | 51 | hours/day \_ 60 minutes/hour ** 60 seconds/minute = 2,592,000 seconds). |
| 55 | seconds/minute = 2,592,000 seconds). | ||
| 56 | 52 | ||
| 57 | The `Expires` field is now showing 22 March 2022, which is 30 | 53 | The `Expires` field is now showing 22 March 2022, which is 30 days from the day |
| 58 | days from the day of this post, 20 February 2022. | 54 | of this post, 20 February 2022. |
| 59 | 55 | ||
| 60 |  | 57 | Headers](https://img.cleberg.net/blog/20220220-caching-static-content-with-nginx/image_headers.png) |
| 62 | 58 | ||
| 63 | # Caveats | 59 | # Caveats |
| 64 | 60 | ||
| 65 | Remember that this caching system is **client-side**, which means that | 61 | Remember that this caching system is **client-side**, which means that content |
| 66 | content is only cached for as long as a client allows it. For example, | 62 | is only cached for as long as a client allows it. For example, my browser purges |
| 67 | my browser purges all caches, data, etc. upon exit, so this caching | 63 | all caches, data, etc. upon exit, so this caching policy will only work as long |
| 68 | policy will only work as long as my browser remains open and running. | 64 | as my browser remains open and running. |
| 69 | 65 | ||
| 70 | If you need to test updates to your site, you\'ll need to clear the | 66 | If you need to test updates to your site, you'll need to clear the cache to see |
| 71 | cache to see updates for any file extension you configured. This can | 67 | updates for any file extension you configured. This can often be done with the |
| 72 | often be done with the `Shift + F5` or `Ctrl + F5` | 68 | `Shift + F5` or `Ctrl + F5` key combinations in most browsers. |
| 73 | key combinations in most browsers. | ||
content/blog/2022-02-22-tuesday.md +23 −30
| @@ -7,36 +7,29 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Tuesday, Twosday | 8 | # Tuesday, Twosday |
| 9 | 9 | ||
| 10 | I\'m taking a break from my usual technology-related posts and writing | 10 | I'm taking a break from my usual technology-related posts and writing about |
| 11 | about something a little more enjoyable today. | 11 | something a little more enjoyable today. |
| 12 | 12 | ||
| 13 | Today is Tuesday, February 22nd, 2022. Today is 02-22-2022. Today is | 13 | Today is Tuesday, February 22nd, 2022. Today is 02-22-2022. Today is Twosday. |
| 14 | Twosday. | ||
| 15 | 14 | ||
| 16 | Let\'s look at everything that fell in place today: | 15 | Let's look at everything that fell in place today: |
| 17 | 16 | ||
| 18 | 1. Written in the `m-dd-yy` or `dd-m-yy` formats, | 17 | 1. Written in the `m-dd-yy` or `dd-m-yy` formats, today is 2-22-22 or 22-2-22, |
| 19 | today is 2-22-22 or 22-2-22, which is a neat little palindrome in | 18 | which is a neat little palindrome in either format. (The last ubiquitous |
| 20 | either format. (The last ubiquitous six-digit palindrome was | 19 | six-digit palindrome was 1-11-11.) |
| 21 | 1-11-11.) | 20 | 2. Today is Tuesday, which is why everyone is using the nickname Twosday to call |
| 22 | 2. Today is Tuesday, which is why everyone is using the nickname | 21 | out these similarities. |
| 23 | Twosday to call out these similarities. | 22 | 3. Falling on Tuesday means today is the 2nd day of the week (for most cultures. |
| 24 | 3. Falling on Tuesday means today is the 2nd day of the week (for most | 23 | For the US, it's the 3rd day of the week since we start on Sunday). |
| 25 | cultures. For the US, it\'s the 3rd day of the week since we start | 24 | 4. The only culture I could find with a connection to a `2` is that some Slavic |
| 26 | on Sunday). | 25 | languages derived their version of Tuesday from the Old Church Slavonic word |
| 27 | 4. The only culture I could find with a connection to a `2` | 26 | `въторъ`, meaning "the second." |
| 28 | is that some Slavic languages derived their version of Tuesday from | 27 | 5. Written in the classic monospaced, digital font (think of digital clocks from |
| 29 | the Old Church Slavonic word `въторъ`, meaning \"the | 28 | the 80s/90s), there is nice symmetry to the numbers ([view the image |
| 30 | second.\" | 29 | here](https://img.cleberg.net/blog/20220222-tuesday/digital_font.png)!). |
| 31 | 5. Written in the classic monospaced, digital font (think of digital | 30 | 6. This one isn't naturally-occurring, but it seems people around the world are |
| 32 | clocks from the 80s/90s), there is nice symmetry to the numbers | 31 | celebrating the day. For example, a group is putting together [a wedding of |
| 33 | ([view the image | 32 | 222 couples at the California State Capitol in |
| 34 | here](https://img.cleberg.net/blog/20220222-tuesday/digital_font.png)!). | 33 | Sacramento](https://www.eventbrite.com/e/2-22-22-a-collective-wedding-ceremony-at-the-state-capitol-tickets-211434605597), |
| 35 | 6. This one isn\'t naturally-occurring, but it seems people around the | 34 | concluding at exactly 2:22 PM. These couples will record their marriage dates |
| 36 | world are celebrating the day. For example, a group is putting | 35 | as 2-22-22 2:22 PM. Tickets were on sale for $222.22. |
| 37 | together | ||
| 38 | \[\[<https://www.eventbrite.com/e/2-22-22-a-collective-wedding-ceremony-at-the-state-capitol-tickets-211434605597>\]\[a | ||
| 39 | wedding of 222 couples at the California State Capitol in | ||
| 40 | Sacramento\]\], concluding at exactly 2:22 PM. These couples will | ||
| 41 | record their marriage dates as 2-22-22 2:22 PM. Tickets were on sale | ||
| 42 | for \$222.22. | ||
content/blog/2022-03-02-reliable-notes.md +72 −83
| @@ -7,132 +7,121 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Choosing Durable File Formats | 8 | # Choosing Durable File Formats |
| 9 | 9 | ||
| 10 | > TL;DR: Write in a format that can be easily rendered and read in | 10 | > TL;DR: Write in a format that can be easily rendered and read in plain-text |
| 11 | > plain-text mode (e.g., `.txt`, `.md`, etc.). | 11 | > mode (e.g., `.txt`, `.md`, etc.). |
| 12 | 12 | ||
| 13 | As I\'ve written more and more over the years, I\'ve found that my love | 13 | As I've written more and more over the years, I've found that my love of |
| 14 | of note-taking is always growing. Everything I learn or need to remember | 14 | note-taking is always growing. Everything I learn or need to remember can be |
| 15 | can be written down in a note and saved digitally, with no cost to | 15 | written down in a note and saved digitally, with no cost to myself. Unlike paper |
| 16 | myself. Unlike paper copies that need physical storage space, digital | 16 | copies that need physical storage space, digital files simply need space on your |
| 17 | files simply need space on your local disk or cloud storage, which is | 17 | local disk or cloud storage, which is fairly abundant these days. |
| 18 | fairly abundant these days. | ||
| 19 | 18 | ||
| 20 | However, I had a historical struggle with migration of notes between | 19 | However, I had a historical struggle with migration of notes between different |
| 21 | different apps that require different formats and applied proprietary | 20 | apps that require different formats and applied proprietary styling. This meant |
| 22 | styling. This meant that I had to go through each note during migration | 21 | that I had to go through each note during migration and edit the file to look |
| 23 | and edit the file to look presentable again. | 22 | presentable again. |
| 24 | 23 | ||
| 25 | For the last year or two, I have written everything exclusively in | 24 | For the last year or two, I have written everything exclusively in |
| 26 | [Markdown](https://en.wikipedia.org/wiki/Markdown) format. Small notes, | 25 | [Markdown](https://en.wikipedia.org/wiki/Markdown) format. Small notes, |
| 27 | long-form writings, and even these blog posts are all written in | 26 | long-form writings, and even these blog posts are all written in Markdown. |
| 28 | Markdown. | 27 | |
| 29 | 28 | Why Markdown? While I do appreciate the simplicity of plain-text files without | |
| 30 | Why Markdown? While I do appreciate the simplicity of plain-text files | 29 | any formatting, I often need visual cues such as heading and code blocks to keep |
| 31 | without any formatting, I often need visual cues such as heading and | 30 | my thoughts straight. Markdown provides a minimal set of styling indicators for |
| 32 | code blocks to keep my thoughts straight. Markdown provides a minimal | 31 | me to style my notes without adding any proprietary, embedded data into the |
| 33 | set of styling indicators for me to style my notes without adding any | 32 | files. If I want a top-level heading, I simply add a hash (`#`) before the line. |
| 34 | proprietary, embedded data into the files. If I want a top-level | 33 | An added bonus is that even if a system doesn't understand Markdown, it will |
| 35 | heading, I simply add a hash (`#`) before the line. An added | ||
| 36 | bonus is that even if a system doesn\'t understand Markdown, it will | ||
| 37 | render it as plain-text and I can read it just as easily. | 34 | render it as plain-text and I can read it just as easily. |
| 38 | 35 | ||
| 39 | For example, here\'s how TextEdit on macOS will open and display a | 36 | For example, here's how TextEdit on macOS will open and display a Markdown file |
| 40 | Markdown file in plain-text, since it does contain any features to | 37 | in plain-text, since it does contain any features to preview Markdown as HTML: |
| 41 | preview Markdown as HTML: | ||
| 42 | 38 | ||
| 43 |  | 40 | Markdown](https://img.cleberg.net/blog/20220302-easy-reliable-note-taking/plain_markdown.png) |
| 45 | 41 | ||
| 46 | ## Saving & Syncing Files | 42 | ## Saving & Syncing Files |
| 47 | 43 | ||
| 48 | In order to read and edit my notes across platforms, I use my personal | 44 | In order to read and edit my notes across platforms, I use my personal cloud |
| 49 | cloud storage through Tresorit due to its native integration with macOS | 45 | storage through Tresorit due to its native integration with macOS and iOS file |
| 50 | and iOS file managers. In addition, Tresorit works well on Debian-based | 46 | managers. In addition, Tresorit works well on Debian-based Linux distros, which |
| 51 | Linux distros, which I used before macOS (and will likely switch back to | 47 | I used before macOS (and will likely switch back to in a few years). |
| 52 | in a few years). | ||
| 53 | 48 | ||
| 54 | You can use whatever sync software you want - syncing plain-text or | 49 | You can use whatever sync software you want - syncing plain-text or markdown |
| 55 | markdown files is incredibly easy and fast, since the files are | 50 | files is incredibly easy and fast, since the files are generally tiny. |
| 56 | generally tiny. | ||
| 57 | 51 | ||
| 58 | Since the cloud storage syncs files automatically, there is no need for | 52 | Since the cloud storage syncs files automatically, there is no need for me to |
| 59 | me to sync anything manually or kick-off a sync job to update my files. | 53 | sync anything manually or kick-off a sync job to update my files. This means |
| 60 | This means that I can edit on mobile, and it takes about 5-10 seconds to | 54 | that I can edit on mobile, and it takes about 5-10 seconds to see the changes on |
| 61 | see the changes on desktop. | 55 | desktop. |
| 62 | 56 | ||
| 63 | ### Version Control with Git | 57 | ### Version Control with Git |
| 64 | 58 | ||
| 65 | A different approach I\'ve contemplated is storing my notes and | 59 | A different approach I've contemplated is storing my notes and attachments is |
| 66 | attachments is using a hosted Git repository to track changes to the | 60 | using a hosted Git repository to track changes to the files. However, I don't |
| 67 | files. However, I don\'t want to rely on an external service that could | 61 | want to rely on an external service that could potentially see into my data, |
| 68 | potentially see into my data, even if the repository is private. | 62 | even if the repository is private. |
| 69 | 63 | ||
| 70 | I might just do `git init` locally and then commit my changes | 64 | I might just do `git init` locally and then commit my changes each time I write |
| 71 | each time I write or update a note, but that seems to be a lot of work | 65 | or update a note, but that seems to be a lot of work just for tracking changes - |
| 72 | just for tracking changes - which I don\'t necessarily care to know. | 66 | which I don't necessarily care to know. |
| 73 | 67 | ||
| 74 | ### Backups! | 68 | ### Backups! |
| 75 | 69 | ||
| 76 | One small addition to the storage/sync conversation is the idea of | 70 | One small addition to the storage/sync conversation is the idea of backups. |
| 77 | backups. Personally, I manually create periodic backups of my entire | 71 | Personally, I manually create periodic backups of my entire cloud storage, |
| 78 | cloud storage, compress it into an archive, and store it on my home | 72 | compress it into an archive, and store it on my home server. |
| 79 | server. | ||
| 80 | 73 | ||
| 81 | To improve my workflow, I am going to be exploring options to | 74 | To improve my workflow, I am going to be exploring options to automatically |
| 82 | automatically compress the mounted cloud directory and send it over to | 75 | compress the mounted cloud directory and send it over to my server on a set |
| 83 | my server on a set schedule. | 76 | schedule. |
| 84 | 77 | ||
| 85 | ## Writing on Desktop | 78 | ## Writing on Desktop |
| 86 | 79 | ||
| 87 | > **Update (06.14.22)**: Since writing this post, I have reverted to | 80 | > **Update (06.14.22)**: Since writing this post, I have reverted to simply |
| 88 | > simply keeping my `notes` folder open and opening notes | 81 | > keeping my `notes` folder open and opening notes individually in TextEdit for |
| 89 | > individually in TextEdit for a more minimal and relaxing writing | 82 | > a more minimal and relaxing writing experience on the desktop. |
| 90 | > experience on the desktop. | ||
| 91 | 83 | ||
| 92 | The bulk of my writing occurs in a desktop environment, with a full | 84 | The bulk of my writing occurs in a desktop environment, with a full keyboard |
| 93 | keyboard layout and wide screen. I don\'t illustrate with a smart pen, I | 85 | layout and wide screen. I don't illustrate with a smart pen, I rarely use |
| 94 | rarely use embedded images, and I love being able to see all of my | 86 | embedded images, and I love being able to see all of my notes/directories in a |
| 95 | notes/directories in a sidebar. | 87 | sidebar. |
| 96 | 88 | ||
| 97 | With this simple set of requirements, I chose | 89 | With this simple set of requirements, I chose [Obsidian](https://obsidian.md) as |
| 98 | [Obsidian](https://obsidian.md) as my desktop text editor. Obsidian has | 90 | my desktop text editor. Obsidian has some in-depth tools like a graph view, |
| 99 | some in-depth tools like a graph view, command palette, mentions, etc., | 91 | command palette, mentions, etc., but I've found that using it as a simple |
| 100 | but I\'ve found that using it as a simple Markdown editor is incredibly | 92 | Markdown editor is incredibly easy and straightforward. |
| 101 | easy and straightforward. | ||
| 102 | 93 | ||
| 103 | Here\'s an example of how my Markdown notes look when opened in | 94 | Here's an example of how my Markdown notes look when opened in plain-text mode: |
| 104 | plain-text mode: | ||
| 105 | 95 | ||
| 106 |  | 97 | Mode](https://img.cleberg.net/blog/20220302-easy-reliable-note-taking/obsidian_source_mode.png) |
| 108 | 98 | ||
| 109 | Here\'s the \"live preview\" version, where the Markdown is rendered | 99 | Here's the "live preview" version, where the Markdown is rendered into its |
| 110 | into its HTML format: | 100 | HTML format: |
| 111 | 101 | ||
| 112 |  | 103 | Preview](https://img.cleberg.net/blog/20220302-easy-reliable-note-taking/obsidian_live_preview.png) |
| 114 | 104 | ||
| 115 | ### Programming on Desktop | 105 | ### Programming on Desktop |
| 116 | 106 | ||
| 117 | While I was writing this, I realized I should specify that I don\'t use | 107 | While I was writing this, I realized I should specify that I don't use the same |
| 118 | the same editor for writing notes and for writing code. For programming | 108 | editor for writing notes and for writing code. For programming purposes, I use |
| 119 | purposes, I use [VSCodium](https://vscodium.com) as my development IDE. | 109 | [VSCodium](https://vscodium.com) as my development IDE. |
| 120 | 110 | ||
| 121 | ## Writing on Mobile | 111 | ## Writing on Mobile |
| 122 | 112 | ||
| 123 | Personally, I write very little on mobile, except when needing to take | 113 | Personally, I write very little on mobile, except when needing to take important |
| 124 | important notes on-the-go. Any long-form writing, journals, etc. are | 114 | notes on-the-go. Any long-form writing, journals, etc. are done at home, where I |
| 125 | done at home, where I always have my laptop available. | 115 | always have my laptop available. |
| 126 | 116 | ||
| 127 | I wanted a simple and foolproof editor for iOS, preferably open-source. | 117 | I wanted a simple and foolproof editor for iOS, preferably open-source. After a |
| 128 | After a long journey of testing the few (& terrible) open-source iOS | 118 | long journey of testing the few (& terrible) open-source iOS note-taking apps, I |
| 129 | note-taking apps, I finally found a phenomenal one: | 119 | finally found a phenomenal one: |
| 130 | [Runestone](https://github.com/simonbs/runestone). This app is fantastic | 120 | [Runestone](https://github.com/simonbs/runestone). This app is fantastic for |
| 131 | for note-taking, has plenty of optional features, and integrates | 121 | note-taking, has plenty of optional features, and integrates natively with the |
| 132 | natively with the iOS file manager. | 122 | iOS file manager. |
| 133 | 123 | ||
| 134 | This app opens the iOS file manager and allows you to click any file you | 124 | This app opens the iOS file manager and allows you to click any file you want, |
| 135 | want, opens it up in an editor, and lets me save and close out of that | 125 | opens it up in an editor, and lets me save and close out of that note. |
| 136 | note. | ||
| 137 | 126 | ||
| 138 | Quite simple but effective. | 127 | Quite simple but effective. |
content/blog/2022-03-03-financial-database.md +157 −173
| @@ -7,54 +7,50 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Personal Financial Tracking | 8 | # Personal Financial Tracking |
| 9 | 9 | ||
| 10 | For the last 6-ish years, I\'ve tracked my finances in a spreadsheet. | 10 | For the last 6-ish years, I've tracked my finances in a spreadsheet. This is |
| 11 | This is common practice in the business world, but any good dev will | 11 | common practice in the business world, but any good dev will cringe at the |
| 12 | cringe at the thought of storing long-term data in a spreadsheet. A | 12 | thought of storing long-term data in a spreadsheet. A spreadsheet is not for |
| 13 | spreadsheet is not for long-term storage or as a source of data to pull | 13 | long-term storage or as a source of data to pull data/reports. |
| 14 | data/reports. | 14 | |
| 15 | 15 | As I wanted to expand the functionality of my financial data (e.g., adding more | |
| 16 | As I wanted to expand the functionality of my financial data (e.g., | 16 | reports), I decided to migrate the data into a database. To run reports, I would |
| 17 | adding more reports), I decided to migrate the data into a database. To | 17 | query the database and use a language like Python or Javascript to process the |
| 18 | run reports, I would query the database and use a language like Python | 18 | data, perform calculations, and visualize the data. |
| 19 | or Javascript to process the data, perform calculations, and visualize | ||
| 20 | the data. | ||
| 21 | 19 | ||
| 22 | # SQLite | 20 | # SQLite |
| 23 | 21 | ||
| 24 | When choosing the type of database I wanted to use for this project, I | 22 | When choosing the type of database I wanted to use for this project, I was split |
| 25 | was split between three options: | 23 | between three options: |
| 26 | 24 | ||
| 27 | 1. MySQL: The database I have the most experience with and have used | 25 | 1. MySQL: The database I have the most experience with and have used for years. |
| 28 | for years. | 26 | 2. PostgreSQL: A database I'm new to, but want to learn. |
| 29 | 2. PostgreSQL: A database I\'m new to, but want to learn. | 27 | 3. SQLite: A database that I've used for a couple projects and have moderate |
| 30 | 3. SQLite: A database that I\'ve used for a couple projects and have | 28 | experience. |
| 31 | moderate experience. | ||
| 32 | 29 | ||
| 33 | I ended up choosing SQLite since it can be maintained within a single | 30 | I ended up choosing SQLite since it can be maintained within a single `.sqlite` |
| 34 | `.sqlite` file, which allows me more flexibility for storage | 31 | file, which allows me more flexibility for storage and backup. I keep this file |
| 35 | and backup. I keep this file in my cloud storage and pull it up whenever | 32 | in my cloud storage and pull it up whenever needed. |
| 36 | needed. | ||
| 37 | 33 | ||
| 38 | ## GUI Editing | 34 | ## GUI Editing |
| 39 | 35 | ||
| 40 | Since I didn\'t want to try and import 1000--1500 records into my new | 36 | Since I didn't want to try and import 1000--1500 records into my new database |
| 41 | database via the command line, I opted to use [DB Browser for SQLite | 37 | via the command line, I opted to use [DB Browser for SQLite |
| 42 | (DB4S)](https://sqlitebrowser.org/) as a GUI tool. This application is | 38 | (DB4S)](https://sqlitebrowser.org/) as a GUI tool. This application is |
| 43 | excellent, and I don\'t see myself going back to the CLI when working in | 39 | excellent, and I don't see myself going back to the CLI when working in this |
| 44 | this database. | 40 | database. |
| 45 | 41 | ||
| 46 | DB4S allows you to copy a range of cells from a spreadsheet and paste it | 42 | DB4S allows you to copy a range of cells from a spreadsheet and paste it |
| 47 | straight into the SQL table. I used this process for all 36 accounts, | 43 | straight into the SQL table. I used this process for all 36 accounts, 1290 |
| 48 | 1290 account statements, and 126 pay statements. Overall, I\'m guessing | 44 | account statements, and 126 pay statements. Overall, I'm guessing this took |
| 49 | this took anywhere between 4--8 hours. In comparison, it probably took | 45 | anywhere between 4--8 hours. In comparison, it probably took me 2-3 days to |
| 50 | me 2-3 days to initially create the spreadsheet. | 46 | initially create the spreadsheet. |
| 51 | 47 | ||
| 52 |  | 48 |  |
| 53 | 49 | ||
| 54 | ## Schema | 50 | ## Schema |
| 55 | 51 | ||
| 56 | The schema for this database is actually extremely simple and involves | 52 | The schema for this database is actually extremely simple and involves only |
| 57 | only three tables (for now): | 53 | three tables (for now): |
| 58 | 54 | ||
| 59 | 1. Accounts | 55 | 1. Accounts |
| 60 | 2. Statements | 56 | 2. Statements |
| @@ -62,9 +58,9 @@ only three tables (for now): | |||
| 62 | 58 | ||
| 63 | **Accounts** | 59 | **Accounts** |
| 64 | 60 | ||
| 65 | The Accounts table contains summary information about an account, such | 61 | The Accounts table contains summary information about an account, such as a car |
| 66 | as a car loan or a credit card. By viewing this table, you can find | 62 | loan or a credit card. By viewing this table, you can find high-level data, such |
| 67 | high-level data, such as interest rate, credit line, or owner. | 63 | as interest rate, credit line, or owner. |
| 68 | 64 | ||
| 69 | ``` sql | 65 | ``` sql |
| 70 | CREATE TABLE "Accounts" ( | 66 | CREATE TABLE "Accounts" ( |
| @@ -82,10 +78,10 @@ CREATE TABLE "Accounts" ( | |||
| 82 | 78 | ||
| 83 | **Statements** | 79 | **Statements** |
| 84 | 80 | ||
| 85 | The Statements table uses the same unique identifier as the Accounts | 81 | The Statements table uses the same unique identifier as the Accounts table, |
| 86 | table, meaning you can join the tables to find a monthly statement for | 82 | meaning you can join the tables to find a monthly statement for any of the |
| 87 | any of the accounts listed in the Accounts table. Each statement has an | 83 | accounts listed in the Accounts table. Each statement has an account ID, |
| 88 | account ID, statement date, and total balance. | 84 | statement date, and total balance. |
| 89 | 85 | ||
| 90 | ``` sql | 86 | ``` sql |
| 91 | CREATE TABLE "Statements" ( | 87 | CREATE TABLE "Statements" ( |
| @@ -100,10 +96,10 @@ CREATE TABLE "Statements" ( | |||
| 100 | 96 | ||
| 101 | **Payroll** | 97 | **Payroll** |
| 102 | 98 | ||
| 103 | The Payroll table is a separate entity, unrelated to the Accounts or | 99 | The Payroll table is a separate entity, unrelated to the Accounts or Statements |
| 104 | Statements tables. This table contains all information you would find on | 100 | tables. This table contains all information you would find on a pay statement |
| 105 | a pay statement from an employer. As you change employers or obtain new | 101 | from an employer. As you change employers or obtain new perks/benefits, just add |
| 106 | perks/benefits, just add new columns to adapt to the new data. | 102 | new columns to adapt to the new data. |
| 107 | 103 | ||
| 108 | ``` sql | 104 | ``` sql |
| 109 | CREATE TABLE "Payroll" ( | 105 | CREATE TABLE "Payroll" ( |
| @@ -139,134 +135,122 @@ CREATE TABLE "Payroll" ( | |||
| 139 | 135 | ||
| 140 | ## Python Reporting | 136 | ## Python Reporting |
| 141 | 137 | ||
| 142 | Once I created the database tables and imported all my data, the only | 138 | Once I created the database tables and imported all my data, the only step left |
| 143 | step left was to create a process to report and visualize on various | 139 | was to create a process to report and visualize on various aspects of the data. |
| 144 | aspects of the data. | 140 | |
| 145 | 141 | In order to explore and create the reports I'm interested in, I utilized a | |
| 146 | In order to explore and create the reports I\'m interested in, I | 142 | two-part process involving Jupyter Notebooks and Python scripts. |
| 147 | utilized a two-part process involving Jupyter Notebooks and Python | 143 | |
| 148 | scripts. | 144 | ### Step 1: Jupyter Notebooks |
| 149 | 145 | ||
| 150 | 1. Step 1: Jupyter Notebooks | 146 | When I need to explore data, try different things, and re-run my code |
| 151 | 147 | cell-by-cell, I use Jupyter Notebooks. For example, I explored the | |
| 152 | When I need to explore data, try different things, and re-run my | 148 | `Accounts` table until I found the following useful information: |
| 153 | code cell-by-cell, I use Jupyter Notebooks. For example, I explored | 149 | |
| 154 | the `Accounts` table until I found the following useful | 150 | ``` python |
| 155 | information: | 151 | import sqlite3 |
| 156 | 152 | import pandas as pd | |
| 157 | ``` python | 153 | import matplotlib |
| 158 | import sqlite3 | 154 | |
| 159 | import pandas as pd | 155 | # Set up database filename and connect |
| 160 | import matplotlib | 156 | db = "finances.sqlite" |
| 161 | 157 | connection = sqlite3.connect(db) | |
| 162 | # Set up database filename and connect | 158 | df = pd.read_sql_query("SELECT ** FROM Accounts", connection) |
| 163 | db = "finances.sqlite" | 159 | |
| 164 | connection = sqlite3.connect(db) | 160 | # Set global matplotlib variables |
| 165 | df = pd.read_sql_query("SELECT ** FROM Accounts", connection) | 161 | %matplotlib inline |
| 166 | 162 | matplotlib.rcParams['text.color'] = 'white' | |
| 167 | # Set global matplotlib variables | 163 | matplotlib.rcParams['axes.labelcolor'] = 'white' |
| 168 | %matplotlib inline | 164 | matplotlib.rcParams['xtick.color'] = 'white' |
| 169 | matplotlib.rcParams['text.color'] = 'white' | 165 | matplotlib.rcParams['ytick.color'] = 'white' |
| 170 | matplotlib.rcParams['axes.labelcolor'] = 'white' | 166 | matplotlib.rcParams['legend.labelcolor'] = 'black' |
| 171 | matplotlib.rcParams['xtick.color'] = 'white' | 167 | |
| 172 | matplotlib.rcParams['ytick.color'] = 'white' | 168 | # Display graph |
| 173 | matplotlib.rcParams['legend.labelcolor'] = 'black' | 169 | df.groupby(['AccountType']).sum().plot.pie(title='Credit Line by Account Type', y='CreditLine', figsize=(5,5), autopct='%1.1f%%') |
| 174 | 170 | ``` | |
| 175 | # Display graph | 171 | |
| 176 | df.groupby(['AccountType']).sum().plot.pie(title='Credit Line by Account Type', y='CreditLine', figsize=(5,5), autopct='%1.1f%%') | 172 | ### Step 2: Python Scripts |
| 177 | ``` | 173 | |
| 178 | 174 | Once I explored enough through the notebooks and had a list of reports I | |
| 179 | 2. Step 2: Python Scripts | 175 | wanted, I moved on to create a Python project with the following structure: |
| 180 | 176 | ||
| 181 | Once I explored enough through the notebooks and had a list of | 177 | ``` txt |
| 182 | reports I wanted, I moved on to create a Python project with the | 178 | finance/ |
| 183 | following structure: | 179 | ├── notebooks/ |
| 184 | 180 | │ │ ├── account_summary.ipynb | |
| 185 | ``` txt | 181 | │ │ ├── account_details.ipynb |
| 186 | finance/ | 182 | │ │ └── payroll.ipynb |
| 187 | ├── notebooks/ | 183 | ├── public/ |
| 188 | │ │ ├── account_summary.ipynb | 184 | │ │ ├── image-01.png |
| 189 | │ │ ├── account_details.ipynb | 185 | │ │ └── image-0X.png |
| 190 | │ │ └── payroll.ipynb | 186 | ├── src/ |
| 191 | ├── public/ | 187 | │ └── finance.sqlite |
| 192 | │ │ ├── image-01.png | 188 | ├── venv/ |
| 193 | │ │ └── image-0X.png | 189 | ├── _init.py |
| 194 | ├── src/ | 190 | ├── database.py |
| 195 | │ └── finance.sqlite | 191 | ├── process.py |
| 196 | ├── venv/ | 192 | ├── requirements.txt |
| 197 | ├── _init.py | 193 | └── README.md |
| 198 | ├── database.py | 194 | ``` |
| 199 | ├── process.py | 195 | |
| 200 | ├── requirements.txt | 196 | This structure allows me to: |
| 201 | └── README.md | 197 | |
| 202 | ``` | 198 | 1. Compile all required python packages into `requirements.txt` for easy |
| 203 | 199 | installation if I move to a new machine. | |
| 204 | This structure allows me to: | 200 | 2. Activate a virtual environment in `venv/` so I don't need to maintain a |
| 205 | 201 | system-wide Python environment just for this project. | |
| 206 | 1. Compile all required python packages into | 202 | 3. Keep my `notebooks/` folder to continuously explore the data as I see |
| 207 | `requirements.txt` for easy installation if I move to | 203 | fit. |
| 208 | a new machine. | 204 | 4. Maintain a local copy of the database in `src/` for easy access. |
| 209 | 2. Activate a virtual environment in `venv/` so I don\'t | 205 | 5. Export reports, images, HTML files, etc. to `public/`. |
| 210 | need to maintain a system-wide Python environment just for this | 206 | |
| 211 | project. | 207 | Now, onto the differences between the code in a Jupyter Notebook and the |
| 212 | 3. Keep my `notebooks/` folder to continuously explore | 208 | actual Python files. To create the report in the Notebook snippet above, I |
| 213 | the data as I see fit. | 209 | created the following function inside `process.py`: |
| 214 | 4. Maintain a local copy of the database in `src/` for | 210 | |
| 215 | easy access. | 211 | ``` python |
| 216 | 5. Export reports, images, HTML files, etc. to | 212 | # Create summary pie chart |
| 217 | `public/`. | 213 | def summary_data(accounts: pandas.DataFrame) -> None: |
| 218 | 214 | accounts_01 = accounts[accounts["Owner"] == "Person01"] | |
| 219 | Now, onto the differences between the code in a Jupyter Notebook and | 215 | accounts_02 = accounts[accounts["Owner"] == "Person02"] |
| 220 | the actual Python files. To create the report in the Notebook | 216 | for x in range(1, 4): |
| 221 | snippet above, I created the following function inside | 217 | if x == 1: |
| 222 | `process.py`: | 218 | df = accounts |
| 223 | 219 | account_string = "All Accounts" | |
| 224 | ``` python | 220 | elif x == 2: |
| 225 | # Create summary pie chart | 221 | df = accounts_01 |
| 226 | def summary_data(accounts: pandas.DataFrame) -> None: | 222 | account_string = "Person01's Accounts" |
| 227 | accounts_01 = accounts[accounts["Owner"] == "Person01"] | 223 | elif x == 3: |
| 228 | accounts_02 = accounts[accounts["Owner"] == "Person02"] | 224 | df = accounts_02 |
| 229 | for x in range(1, 4): | 225 | account_string = "Person02's Accounts" |
| 230 | if x == 1: | 226 | print(f"Generating pie chart summary image for {account_string}...") |
| 231 | df = accounts | 227 | summary_chart = ( |
| 232 | account_string = "All Accounts" | 228 | df.groupby(["AccountType"]) |
| 233 | elif x == 2: | 229 | .sum() |
| 234 | df = accounts_01 | 230 | .plot.pie( |
| 235 | account_string = "Person01's Accounts" | 231 | title=f"Credit Line by Type for {account_string}", |
| 236 | elif x == 3: | 232 | y="CreditLine", |
| 237 | df = accounts_02 | 233 | autopct="%1.1f%%", |
| 238 | account_string = "Person02's Accounts" | ||
| 239 | print(f"Generating pie chart summary image for {account_string}...") | ||
| 240 | summary_chart = ( | ||
| 241 | df.groupby(["AccountType"]) | ||
| 242 | .sum() | ||
| 243 | .plot.pie( | ||
| 244 | title=f"Credit Line by Type for {account_string}", | ||
| 245 | y="CreditLine", | ||
| 246 | autopct="%1.1f%%", | ||
| 247 | ) | ||
| 248 | ) | 234 | ) |
| 249 | summary_chart.figure.savefig(f"public/summary_chart_{x}.png", dpi=1200) | 235 | ) |
| 250 | ``` | 236 | summary_chart.figure.savefig(f"public/summary_chart_{x}.png", dpi=1200) |
| 251 | 237 | ``` | |
| 252 | The result? A high-quality pie chart that is read directly by the | 238 | |
| 253 | `public/index.html` template I use. | 239 | The result? A high-quality pie chart that is read directly by the |
| 254 | 240 | `public/index.html` template I use. | |
| 255 |  | 242 |  | |
| 258 | Other charts generated by this project include: | 244 | |
| 259 | 245 | Other charts generated by this project include: | |
| 260 | - Charts of account balances over time. | 246 | |
| 261 | - Line chart of effective tax rate (taxes divided by taxable | 247 | - Charts of account balances over time. |
| 262 | income). | 248 | - Line chart of effective tax rate (taxes divided by taxable income). |
| 263 | - Salary projections and error limits using past income and | 249 | - Salary projections and error limits using past income and inflation |
| 264 | inflation rates. | 250 | rates. |
| 265 | - Multi-line chart of gross income, taxable income, and net | 251 | - Multi-line chart of gross income, taxable income, and net income. |
| 266 | income. | 252 | |
| 267 | 253 | The best thing about this project? I can improve it at any given time, | |
| 268 | The best thing about this project? I can improve it at any given | 254 | shaping it into whatever helps me the most for that time. I imagine that I |
| 269 | time, shaping it into whatever helps me the most for that time. I | 255 | will be introducing an asset tracking table soon to track the depreciating |
| 270 | imagine that I will be introducing an asset tracking table soon to | 256 | value of cars, houses, etc. Who knows what's next? |
| 271 | track the depreciating value of cars, houses, etc. Who knows what\'s | ||
| 272 | next? | ||
content/blog/2022-03-08-plex-migration.md +86 −102
| @@ -7,15 +7,13 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Migration Phases | 8 | # Migration Phases |
| 9 | 9 | ||
| 10 | I recently decided to migrate my server from an old OptiPlex desktop | 10 | I recently decided to migrate my server from an old OptiPlex desktop machine to |
| 11 | machine to a custom-built tower with better hardware in every category. | 11 | a custom-built tower with better hardware in every category. In order to do |
| 12 | In order to do this, I would need to properly migrate a full Plex | 12 | this, I would need to properly migrate a full Plex installation. |
| 13 | installation. | ||
| 14 | 13 | ||
| 15 | The second part of this migration is that the new server uses an Nvidia | 14 | The second part of this migration is that the new server uses an Nvidia GPU and |
| 16 | GPU and does not have any integrated graphics, which requires extra work | 15 | does not have any integrated graphics, which requires extra work for |
| 17 | for installation, but provides much better hardware transcoding options | 16 | installation, but provides much better hardware transcoding options for Plex. |
| 18 | for Plex. | ||
| 19 | 17 | ||
| 20 | Therefore, I have broken this migration down into three phases: | 18 | Therefore, I have broken this migration down into three phases: |
| 21 | 19 | ||
| @@ -28,42 +26,38 @@ Therefore, I have broken this migration down into three phases: | |||
| 28 | ## Choosing an OS | 26 | ## Choosing an OS |
| 29 | 27 | ||
| 30 | In order to migrate Plex to my new server, I first needed to choose an | 28 | In order to migrate Plex to my new server, I first needed to choose an |
| 31 | appropriate operating system (OS) and install it on the machine. Given | 29 | appropriate operating system (OS) and install it on the machine. Given that I |
| 32 | that I have encountered numerous issues installing other Linux | 30 | have encountered numerous issues installing other Linux distributions properly |
| 33 | distributions properly with Nvidia graphics, I chose [Ubuntu | 31 | with Nvidia graphics, I chose [Ubuntu |
| 34 | Server](https://ubuntu.com/download/server). | 32 | Server](https://ubuntu.com/download/server). |
| 35 | 33 | ||
| 36 | The first step is to create a bootable USB with Ubuntu Server. This is | 34 | The first step is to create a bootable USB with Ubuntu Server. This is easy with |
| 37 | easy with [Etcher](https://www.balena.io/etcher/), an app that runs on | 35 | [Etcher](https://www.balena.io/etcher/), an app that runs on many different |
| 38 | many different platforms. Just download the Ubuntu Server | 36 | platforms. Just download the Ubuntu Server `.iso` image, launch Etcher, and |
| 39 | `.iso` image, launch Etcher, and install the | 37 | install the `.iso` on the USB. |
| 40 | `.iso` on the USB. | ||
| 41 | 38 | ||
| 42 | Once the USB is created, insert it into my server, reboot, and click | 39 | Once the USB is created, insert it into my server, reboot, and click `Esc` (or |
| 43 | `Esc` (or any of the `F1-12` keys) until the BIOS | 40 | any of the `F1-12` keys) until the BIOS menu appears. Finally, launch the USB |
| 44 | menu appears. Finally, launch the USB boot drive. | 41 | boot drive. |
| 45 | 42 | ||
| 46 | ## Booting with Nvidia | 43 | ## Booting with Nvidia |
| 47 | 44 | ||
| 48 | In order to install Ubuntu Server with an Nvidia Graphics card (and no | 45 | In order to install Ubuntu Server with an Nvidia Graphics card (and no |
| 49 | integrated graphics on this device for some reason), you\'ll have to | 46 | integrated graphics on this device for some reason), you'll have to configure |
| 50 | configure the boot menu to allow different graphics drivers to be | 47 | the boot menu to allow different graphics drivers to be loaded. |
| 51 | loaded. | ||
| 52 | 48 | ||
| 53 | When booting from the USB, the machine will launch the initial | 49 | When booting from the USB, the machine will launch the initial installation |
| 54 | installation menu. From this menu, type `e` to view the | 50 | menu. From this menu, type `e` to view the default command options that come |
| 55 | default command options that come with the device - it\'s a good idea to | 51 | with the device - it's a good idea to take a photo of this screen, so you can |
| 56 | take a photo of this screen, so you can enter these commands on the next | 52 | enter these commands on the next screen (along with adding support for Nvidia). |
| 57 | screen (along with adding support for Nvidia). | ||
| 58 | 53 | ||
| 59 | Finally, type `Ctrl + C` to enter the command line. From this | 54 | Finally, type `Ctrl + C` to enter the command line. From this command line, |
| 60 | command line, enter the commands found on the `e` screen. | 55 | enter the commands found on the `e` screen. *Remember to add `nomodeset` to the |
| 61 | \*Remember to add `nomodeset` to the `linux ...` | 56 | `linux ...` line so that your Nvidia device will display the installation |
| 62 | line so that your Nvidia device will display the installation screens | 57 | screens properly!* |
| 63 | properly!\* | ||
| 64 | 58 | ||
| 65 | Here\'s an example of the commands I pulled from the `e` | 59 | Here's an example of the commands I pulled from the `e` screen and entered on |
| 66 | screen and entered on the command line. | 60 | the command line. |
| 67 | 61 | ||
| 68 | ```sh | 62 | ```sh |
| 69 | setparams 'Install Ubuntu Server' | 63 | setparams 'Install Ubuntu Server' |
| @@ -79,12 +73,11 @@ boot | |||
| 79 |  | 74 | 02](https://img.cleberg.net/blog/20220308-plex-media-server-migration/ubuntu_server_installation_02.png) |
| 81 | 75 | ||
| 82 | Once the machine is rebooted, enter the `e` screen again and | 76 | Once the machine is rebooted, enter the `e` screen again and add `nomodeset` to |
| 83 | add `nomodeset` to the `linux ...` line again and | 77 | the `linux ...` line again and press `Ctrl + X` to save the boot options. |
| 84 | press `Ctrl + X` to save the boot options. | ||
| 85 | 78 | ||
| 86 | The machine is now fully installed and can properly display on an | 79 | The machine is now fully installed and can properly display on an external |
| 87 | external display using the Nvidia GPU. | 80 | display using the Nvidia GPU. |
| 88 | 81 | ||
| 89 | Always remember to update and upgrade on a new installation: | 82 | Always remember to update and upgrade on a new installation: |
| 90 | 83 | ||
| @@ -94,33 +87,30 @@ sudo apt update; sudo apt upgrade -y; sudo apt autoremove -y | |||
| 94 | 87 | ||
| 95 | # Phase 2: Migrate Plex Data & Devices | 88 | # Phase 2: Migrate Plex Data & Devices |
| 96 | 89 | ||
| 97 | This phase uses the great Plex article on migrations ([Move an | 90 | This phase uses the great Plex article on migrations ([Move an Installation to |
| 98 | Installation to Another | 91 | Another |
| 99 | System](https://support.plex.tv/articles/201370363-move-an-install-to-another-system/)) | 92 | System](https://support.plex.tv/articles/201370363-move-an-install-to-another-system/)) |
| 100 | and adds a bit more information to help with commands and context. | 93 | and adds a bit more information to help with commands and context. |
| 101 | 94 | ||
| 102 | ## Terminology | 95 | ## Terminology |
| 103 | 96 | ||
| 104 | **Source:\*** The original server that is being replaced.\ | 97 | **Source:** The original server that is being replaced.\ |
| 105 | **Destination:\*** The new server.\ | 98 | **Destination:** The new server.\ |
| 106 | **Client:\*** Any application that can be used to modify settings for | 99 | **Client:** Any application that can be used to modify settings for both |
| 107 | both source/destination. | 100 | source/destination. |
| 108 | 101 | ||
| 109 | ## Step 01: \[Client\] Update Settings | 102 | ## Step 01: [Client] Update Settings |
| 110 | 103 | ||
| 111 | Open up a Plex app and *disable* the `Account` \> | 104 | Open up a Plex app and *disable* the `Account` > `Library` > `Empty trash |
| 112 | `Library` \> | 105 | automatically after every scan` preference for the source server. |
| 113 | `Empty trash automatically after every scan` preference for | ||
| 114 | the source server. | ||
| 115 | 106 | ||
| 116 | ## Step 02: \[Destination\] Install Plex | 107 | ## Step 02: [Destination] Install Plex |
| 117 | 108 | ||
| 118 | Open up the [Plex Media Server download | 109 | Open up the [Plex Media Server download |
| 119 | page](https://www.plex.tv/media-server-downloads/) and copy the link for | 110 | page](https://www.plex.tv/media-server-downloads/) and copy the link for the |
| 120 | the appropriate platform. | 111 | appropriate platform. |
| 121 | 112 | ||
| 122 | Execute the following commands on the destination server to install | 113 | Execute the following commands on the destination server to install Plex: |
| 123 | Plex: | ||
| 124 | 114 | ||
| 125 | ```sh | 115 | ```sh |
| 126 | wget <url> | 116 | wget <url> |
| @@ -128,48 +118,45 @@ sudo dpkg -i <filename> | |||
| 128 | sudo systemctl stop plexmediaserver.service | 118 | sudo systemctl stop plexmediaserver.service |
| 129 | ``` | 119 | ``` |
| 130 | 120 | ||
| 131 | ## Step 03: \[Source\] Stop Plex & Migrate Data | 121 | ## Step 03: [Source] Stop Plex & Migrate Data |
| 132 | 122 | ||
| 133 | First, stop the Plex service so that no data is created or modified | 123 | First, stop the Plex service so that no data is created or modified during the |
| 134 | during the migration. | 124 | migration. |
| 135 | 125 | ||
| 136 | ```sh | 126 | ```sh |
| 137 | sudo systemctl stop plexmediaserver.service | 127 | sudo systemctl stop plexmediaserver.service |
| 138 | ``` | 128 | ``` |
| 139 | 129 | ||
| 140 | Next, copy the data to the new server. To find where the Plex data | 130 | Next, copy the data to the new server. To find where the Plex data directory is |
| 141 | directory is located, Plex has another excellent article available: | 131 | located, Plex has another excellent article available: [Where is the Plex Media |
| 142 | [Where is the Plex Media Server data directory | 132 | Server data directory |
| 143 | located?](https://support.plex.tv/articles/202915258-where-is-the-plex-media-server-data-directory-located/). | 133 | located?](https://support.plex.tv/articles/202915258-where-is-the-plex-media-server-data-directory-located/). |
| 144 | 134 | ||
| 145 | There are many ways to copy the data to the new server and will largely | 135 | There are many ways to copy the data to the new server and will largely depend |
| 146 | depend on the size of the folder being copied. Personally, my data | 136 | on the size of the folder being copied. Personally, my data folder was ~23GB |
| 147 | folder was \~23GB and I opted to simply use the `scp` command | 137 | and I opted to simply use the `scp` command to copy the files over SSH. |
| 148 | to copy the files over SSH. | ||
| 149 | 138 | ||
| 150 | This process was throttled by the old server\'s slow HDD and ports and | 139 | This process was throttled by the old server's slow HDD and ports and took |
| 151 | took approximately 90 minutes to complete. In comparison, moving the | 140 | approximately 90 minutes to complete. In comparison, moving the data from the |
| 152 | data from the new server\'s `home/user/` directory to the | 141 | new server's `home/user/` directory to the `/var/.../Plex Media Server` |
| 153 | `/var/.../Plex Media Server` directory took 2-3 minutes. | 142 | directory took 2-3 minutes. |
| 154 | 143 | ||
| 155 | ```sh | 144 | ```sh |
| 156 | scp -r "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server" your_user@xxx.xxx.xxx.xxx:"'/path/to/destination/'" | 145 | scp -r "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server" your_user@xxx.xxx.xxx.xxx:"'/path/to/destination/'" |
| 157 | ``` | 146 | ``` |
| 158 | 147 | ||
| 159 | ## Step 04: \[Destination\] Update File Permissions | 148 | ## Step 04: [Destination] Update File Permissions |
| 160 | 149 | ||
| 161 | In case you move the data directory to a common area on the new server, | 150 | In case you move the data directory to a common area on the new server, it will |
| 162 | it will have to be moved to the proper location before Plex can function | 151 | have to be moved to the proper location before Plex can function properly: |
| 163 | properly: | ||
| 164 | 152 | ||
| 165 | ```sh | 153 | ```sh |
| 166 | mv "Plex Media Server" /var/lib/plexmediaserver/Library/Application Support/ | 154 | mv "Plex Media Server" /var/lib/plexmediaserver/Library/Application Support/ |
| 167 | ``` | 155 | ``` |
| 168 | 156 | ||
| 169 | To ensure permissions were retained properly, the server will need to | 157 | To ensure permissions were retained properly, the server will need to show that |
| 170 | show that all files and folders in the data directory are owned by | 158 | all files and folders in the data directory are owned by `plex:plex` (or |
| 171 | `plex:plex` (or whichever user is running the Plex | 159 | whichever user is running the Plex application). |
| 172 | application). | ||
| 173 | 160 | ||
| 174 | ```sh | 161 | ```sh |
| 175 | sudo chown -R plex:plex "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server" | 162 | sudo chown -R plex:plex "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server" |
| @@ -182,43 +169,40 @@ sudo systemctl start plexmediaserver.service | |||
| 182 | sudo systemctl status plexmediaserver.service | 169 | sudo systemctl status plexmediaserver.service |
| 183 | ``` | 170 | ``` |
| 184 | 171 | ||
| 185 | ## Step 05: \[Client\] Update Libraries & Metadata | 172 | ## Step 05: [Client] Update Libraries & Metadata |
| 186 | 173 | ||
| 187 | The first step - now that the new server is up and running - is to sign | 174 | The first step - now that the new server is up and running - is to sign out of |
| 188 | out of the client and sign back in. Once this is done, update any | 175 | the client and sign back in. Once this is done, update any library locations, if |
| 189 | library locations, if necessary. This was unnecessary in my case since I | 176 | necessary. This was unnecessary in my case since I simply moved my storage |
| 190 | simply moved my storage drives from the source server to the destination | 177 | drives from the source server to the destination server. |
| 191 | server. | ||
| 192 | 178 | ||
| 193 | Next, perform the following actions in the client: | 179 | Next, perform the following actions in the client: |
| 194 | 180 | ||
| 195 | 1. On the left sidebar, click `More` \> Three-Dot Menu \> | 181 | 1. On the left sidebar, click `More` > Three-Dot Menu > `Scan Library Files` |
| 196 | `Scan Library Files` | 182 | 2. *Enable* the `Account` > `Library` > `Empty trash automatically after every |
| 197 | 2. *Enable* the `Account` \> `Library` \> | 183 | scan` preference for the source server. |
| 198 | `Empty trash automatically after every scan` preference | 184 | 3. On the left sidebar, click `More` > Three-Dot Menu > `Manage Server` > |
| 199 | for the source server. | 185 | `Empty Trash` |
| 200 | 3. On the left sidebar, click `More` \> Three-Dot Menu \> | 186 | 4. On the left sidebar, click `More` > Three-Dot Menu > `Manage Server` > |
| 201 | `Manage Server` \> `Empty Trash` | 187 | `Clean Bundles` |
| 202 | 4. On the left sidebar, click `More` \> Three-Dot Menu \> | 188 | 5. On the left sidebar, click `More` > Three-Dot Menu > `Manage Server` > |
| 203 | `Manage Server` \> `Clean Bundles` | 189 | `Optimize Database` |
| 204 | 5. On the left sidebar, click `More` \> Three-Dot Menu \> | ||
| 205 | `Manage Server` \> `Optimize Database` | ||
| 206 | 190 | ||
| 207 | Finally, double-check the Remote Access settings to make sure no changes | 191 | Finally, double-check the Remote Access settings to make sure no changes have |
| 208 | have caused issues with accessing the server from outside the network. | 192 | caused issues with accessing the server from outside the network. |
| 209 | 193 | ||
| 210 | In my case, I use a single port forwarding rule in my router and needed | 194 | In my case, I use a single port forwarding rule in my router and needed to |
| 211 | to update the Local LAN IP Address to the new server IP address. | 195 | update the Local LAN IP Address to the new server IP address. |
| 212 | 196 | ||
| 213 |  | 198 | forwarding](https://img.cleberg.net/blog/20220308-plex-media-server-migration/port_forwarding.png) |
| 215 | 199 | ||
| 216 | # Phase 3: Configure GPU Transcoding | 200 | # Phase 3: Configure GPU Transcoding |
| 217 | 201 | ||
| 218 | The final piece to the migration is enabling hardware transcoding so | 202 | The final piece to the migration is enabling hardware transcoding so that Plex |
| 219 | that Plex can fully utilize the new Nvidia GPU available in the server. | 203 | can fully utilize the new Nvidia GPU available in the server. The first step is |
| 220 | The first step is to install Nvidia graphics drivers. This process may | 204 | to install Nvidia graphics drivers. This process may take a few minutes, but the |
| 221 | take a few minutes, but the commands are pretty simple: | 205 | commands are pretty simple: |
| 222 | 206 | ||
| 223 | ```sh | 207 | ```sh |
| 224 | sudo add-apt-repository ppa:graphics-drivers/ppa | 208 | sudo add-apt-repository ppa:graphics-drivers/ppa |
content/blog/2022-03-23-cloudflare-dns-api.md +18 −23
| @@ -7,15 +7,14 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # DDNS: Dynamic DNS | 8 | # DDNS: Dynamic DNS |
| 9 | 9 | ||
| 10 | If you\'re hosting a service from a location with dynamic DNS (where | 10 | If you're hosting a service from a location with dynamic DNS (where your IP may |
| 11 | your IP may change at any time), you must have a solution to update the | 11 | change at any time), you must have a solution to update the DNS so that you can |
| 12 | DNS so that you can access your service even when the IP of the server | 12 | access your service even when the IP of the server changes. |
| 13 | changes. | ||
| 14 | 13 | ||
| 15 | The process below uses the [Cloudflare API](https://api.cloudflare.com/) | 14 | The process below uses the [Cloudflare API](https://api.cloudflare.com/) to |
| 16 | to update DNS `A` and `AAAA` records with the | 15 | update DNS `A` and `AAAA` records with the server's current IP. If you use |
| 17 | server\'s current IP. If you use another DNS provider, you will have to | 16 | another DNS provider, you will have to find a way to update your DNS (or find a |
| 18 | find a way to update your DNS (or find a way to get a static IP). | 17 | way to get a static IP). |
| 19 | 18 | ||
| 20 | First, install `jq` since we will use it in the next script: | 19 | First, install `jq` since we will use it in the next script: |
| 21 | 20 | ||
| @@ -23,18 +22,16 @@ First, install `jq` since we will use it in the next script: | |||
| 23 | sudo apt install jq | 22 | sudo apt install jq |
| 24 | ``` | 23 | ``` |
| 25 | 24 | ||
| 26 | Next, create a location for your DDNS update scripts and open the first | 25 | Next, create a location for your DDNS update scripts and open the first script: |
| 27 | script: | ||
| 28 | 26 | ||
| 29 | ```sh | 27 | ```sh |
| 30 | mkdir ~/ddns | 28 | mkdir ~/ddns |
| 31 | nano ~/ddns/update.sh | 29 | nano ~/ddns/update.sh |
| 32 | ``` | 30 | ``` |
| 33 | 31 | ||
| 34 | The following `update.sh` script will take all of your | 32 | The following `update.sh` script will take all of your domains and subdomains |
| 35 | domains and subdomains and check Cloudflare to see if the current | 33 | and check Cloudflare to see if the current `A` and `AAAA` records match your |
| 36 | `A` and `AAAA` records match your server\'s IP | 34 | server's IP address. If not, it will update the records. |
| 37 | address. If not, it will update the records. | ||
| 38 | 35 | ||
| 39 | ```sh | 36 | ```sh |
| 40 | # file: update.sh | 37 | # file: update.sh |
| @@ -60,17 +57,16 @@ do | |||
| 60 | done | 57 | done |
| 61 | ``` | 58 | ``` |
| 62 | 59 | ||
| 63 | Next, open up the `ddns.sh` script. Paste the following into | 60 | Next, open up the `ddns.sh` script. Paste the following into the script and |
| 64 | the script and update the `api_token` and `email` | 61 | update the `api_token` and `email` variables. |
| 65 | variables. | ||
| 66 | 62 | ||
| 67 | ```sh | 63 | ```sh |
| 68 | nano ~/ddns/ddns.sh | 64 | nano ~/ddns/ddns.sh |
| 69 | ``` | 65 | ``` |
| 70 | 66 | ||
| 71 | **Note**: If you want your DNS records to be proxied through Cloudflare, | 67 | **Note**: If you want your DNS records to be proxied through Cloudflare, find |
| 72 | find and update the following snippet: `"proxied":false}"` to | 68 | and update the following snippet: `"proxied":false}"` to say `true` instead of |
| 73 | say `true` instead of `false`. | 69 | `false`. |
| 74 | 70 | ||
| 75 | ```sh | 71 | ```sh |
| 76 | # file: ddns.sh | 72 | # file: ddns.sh |
| @@ -180,9 +176,8 @@ You can test the script by running it manually: | |||
| 180 | ./update.sh | 176 | ./update.sh |
| 181 | ``` | 177 | ``` |
| 182 | 178 | ||
| 183 | To make sure the scripts run automatically, add it to the | 179 | To make sure the scripts run automatically, add it to the `cron` file so that it |
| 184 | `cron` file so that it will run on a schedule. To do this, | 180 | will run on a schedule. To do this, open the cron file: |
| 185 | open the cron file: | ||
| 186 | 181 | ||
| 187 | ```sh | 182 | ```sh |
| 188 | crontab -e | 183 | crontab -e |
content/blog/2022-03-23-nextcloud-on-ubuntu.md +27 −35
| @@ -7,8 +7,8 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # What is Nextcloud? | 8 | # What is Nextcloud? |
| 9 | 9 | ||
| 10 | [Nextcloud](https://nextcloud.com/) is a self-hosted solution for | 10 | [Nextcloud](https://nextcloud.com/) is a self-hosted solution for storage, |
| 11 | storage, communications, editing, calendar, contacts, and more. | 11 | communications, editing, calendar, contacts, and more. |
| 12 | 12 | ||
| 13 | This tutorial assumes that you have an Ubuntu server and a domain name | 13 | This tutorial assumes that you have an Ubuntu server and a domain name |
| 14 | configured to point toward the server. | 14 | configured to point toward the server. |
| @@ -25,16 +25,14 @@ sudo apt install php7.4-gmp php7.4-bcmath php-imagick php7.4-xml php7.4-zip | |||
| 25 | 25 | ||
| 26 | # Set Up MySQL | 26 | # Set Up MySQL |
| 27 | 27 | ||
| 28 | Next, you will need to log in to MySQL as the `root` user of | 28 | Next, you will need to log in to MySQL as the `root` user of the machine. |
| 29 | the machine. | ||
| 30 | 29 | ||
| 31 | ```sh | 30 | ```sh |
| 32 | sudo mysql -uroot -p | 31 | sudo mysql -uroot -p |
| 33 | ``` | 32 | ``` |
| 34 | 33 | ||
| 35 | Once you\'ve logged in, you must create a new user so that Nextcloud can | 34 | Once you've logged in, you must create a new user so that Nextcloud can manage |
| 36 | manage the database. You will also create a `nextcloud` | 35 | the database. You will also create a `nextcloud` database and assign privileges: |
| 37 | database and assign privileges: | ||
| 38 | 36 | ||
| 39 | ``` sql | 37 | ``` sql |
| 40 | CREATE USER 'username'@'localhost' IDENTIFIED BY 'password'; | 38 | CREATE USER 'username'@'localhost' IDENTIFIED BY 'password'; |
| @@ -47,14 +45,12 @@ quit; | |||
| 47 | # Download & Install Nextcloud | 45 | # Download & Install Nextcloud |
| 48 | 46 | ||
| 49 | To download Nextcloud, go the [Nextcloud downloads | 47 | To download Nextcloud, go the [Nextcloud downloads |
| 50 | page](https://nextcloud.com/install/#instructions-server), click on | 48 | page](https://nextcloud.com/install/#instructions-server), click on `Archive |
| 51 | `Archive File` and right-click the big blue button to copy | 49 | File` and right-click the big blue button to copy the link. |
| 52 | the link. | ||
| 53 | 50 | ||
| 54 | Then, go to your server and enter the following commands to download, | 51 | Then, go to your server and enter the following commands to download, unzip, and |
| 55 | unzip, and move the files to your destination directory. This example | 52 | move the files to your destination directory. This example uses `example.com` as |
| 56 | uses `example.com` as the destination, but you can put it | 53 | the destination, but you can put it wherever you want to server your files from. |
| 57 | wherever you want to server your files from. | ||
| 58 | 54 | ||
| 59 | ```sh | 55 | ```sh |
| 60 | wget https://download.nextcloud.com/server/releases/nextcloud-23.0.3.zip | 56 | wget https://download.nextcloud.com/server/releases/nextcloud-23.0.3.zip |
| @@ -65,9 +61,9 @@ sudo cp -r nextcloud /var/www/example.com | |||
| 65 | 61 | ||
| 66 | # Configure the Apache Web Server | 62 | # Configure the Apache Web Server |
| 67 | 63 | ||
| 68 | Now that the database is set up and Nextcloud is installed, you need to | 64 | Now that the database is set up and Nextcloud is installed, you need to set up |
| 69 | set up the Apache configuration files to tell the server how to handle | 65 | the Apache configuration files to tell the server how to handle requests for |
| 70 | requests for `example.com/nextcloud`. | 66 | `example.com/nextcloud`. |
| 71 | 67 | ||
| 72 | First, open the following file in the editor: | 68 | First, open the following file in the editor: |
| 73 | 69 | ||
| @@ -75,8 +71,8 @@ First, open the following file in the editor: | |||
| 75 | sudo nano /etc/apache2/sites-available/nextcloud.conf | 71 | sudo nano /etc/apache2/sites-available/nextcloud.conf |
| 76 | ``` | 72 | ``` |
| 77 | 73 | ||
| 78 | Once the editor is open, paste the following information in. Then, save | 74 | Once the editor is open, paste the following information in. Then, save and |
| 79 | and close the file. | 75 | close the file. |
| 80 | 76 | ||
| 81 | ``` config | 77 | ``` config |
| 82 | <VirtualHost *:80> | 78 | <VirtualHost *:80> |
| @@ -111,16 +107,15 @@ Next, enable the Apache mods required by Nextcloud: | |||
| 111 | sudo a2enmod rewrite headers env dir mime | 107 | sudo a2enmod rewrite headers env dir mime |
| 112 | ``` | 108 | ``` |
| 113 | 109 | ||
| 114 | Finally, restart Apache. If any errors arise, you must solve those | 110 | Finally, restart Apache. If any errors arise, you must solve those before |
| 115 | before continuing. | 111 | continuing. |
| 116 | 112 | ||
| 117 | ```sh | 113 | ```sh |
| 118 | sudo systemctl restart apache2 | 114 | sudo systemctl restart apache2 |
| 119 | ``` | 115 | ``` |
| 120 | 116 | ||
| 121 | For the app to work, you must have the correct file permissions on your | 117 | For the app to work, you must have the correct file permissions on your |
| 122 | `nextcloud` directory. Set the owner to be | 118 | `nextcloud` directory. Set the owner to be `www-data`: |
| 123 | `www-data`: | ||
| 124 | 119 | ||
| 125 | ```sh | 120 | ```sh |
| 126 | sudo chown -R www-data:www-data /var/www/example.com/nextcloud/ | 121 | sudo chown -R www-data:www-data /var/www/example.com/nextcloud/ |
| @@ -129,17 +124,15 @@ sudo chown -R www-data:www-data /var/www/example.com/nextcloud/ | |||
| 129 | # DNS | 124 | # DNS |
| 130 | 125 | ||
| 131 | If you do not have a static IP address, you will need to update your DNS | 126 | If you do not have a static IP address, you will need to update your DNS |
| 132 | settings (at your DNS provider) whenever your dynamic IP address | 127 | settings (at your DNS provider) whenever your dynamic IP address changes. |
| 133 | changes. | ||
| 134 | 128 | ||
| 135 | For an example on how I do that with Cloudflare, see my other post: | 129 | For an example on how I do that with Cloudflare, see my other post: [Updating |
| 136 | [Updating Dynamic DNS with Cloudflare | 130 | Dynamic DNS with Cloudflare API](../updating-dynamic-dns-with-cloudflare-api/) |
| 137 | API](../updating-dynamic-dns-with-cloudflare-api/) | ||
| 138 | 131 | ||
| 139 | # Certbot | 132 | # Certbot |
| 140 | 133 | ||
| 141 | If you want to serve Nextcloud from HTTPS rather than plain HTTP, use | 134 | If you want to serve Nextcloud from HTTPS rather than plain HTTP, use the |
| 142 | the following commands to issue Let\'s Encrypt SSL certificates: | 135 | following commands to issue Let's Encrypt SSL certificates: |
| 143 | 136 | ||
| 144 | ```sh | 137 | ```sh |
| 145 | sudo apt install snapd | 138 | sudo apt install snapd |
| @@ -152,12 +145,11 @@ sudo certbot --apache | |||
| 152 | 145 | ||
| 153 | # Results | 146 | # Results |
| 154 | 147 | ||
| 155 | Voilà! You\'re all done and should be able to access Nextcloud from your | 148 | Voilà! You're all done and should be able to access Nextcloud from your domain |
| 156 | domain or IP address. | 149 | or IP address. |
| 157 | 150 | ||
| 158 | See the screenshots below for the dashboard and a settings page on my | 151 | See the screenshots below for the dashboard and a settings page on my instance |
| 159 | instance of Nextcloud, using the `Breeze Dark` theme I | 152 | of Nextcloud, using the `Breeze Dark` theme I installed from the Apps page. |
| 160 | installed from the Apps page. | ||
| 161 | 153 | ||
| 162 |  | 155 | Dashboard](https://img.cleberg.net/blog/20220323-installing-nextcloud-on-ubuntu/nextcloud_dashboard.png) |
content/blog/2022-03-24-server-hardening.md +209 −211
| @@ -7,11 +7,10 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Post Updates | 8 | # Post Updates |
| 9 | 9 | ||
| 10 | > After reviewing this post today (2022-10-04), I noticed quite a few | 10 | > After reviewing this post today (2022-10-04), I noticed quite a few gaps in my |
| 11 | > gaps in my write-up and wanted to add a few things, even though this | 11 | > write-up and wanted to add a few things, even though this blog is really just |
| 12 | > blog is really just a retrospective and knowledge dump for myself. I | 12 | > a retrospective and knowledge dump for myself. I left things intact and simply |
| 13 | > left things intact and simply crossed them out (~~like this~~) for | 13 | > crossed them out (~~like this~~) for posterity. |
| 14 | > posterity. | ||
| 15 | 14 | ||
| 16 | # Planning Data Flows & Security | 15 | # Planning Data Flows & Security |
| 17 | 16 | ||
| @@ -31,104 +30,97 @@ draft = false | |||
| 31 | 30 | ||
| 32 | ## Thought Process | 31 | ## Thought Process |
| 33 | 32 | ||
| 34 | To serve content from your home server and harden your security posture, | 33 | To serve content from your home server and harden your security posture, you |
| 35 | you have to think about the transport of data from `server` | 34 | have to think about the transport of data from `server` to `client`. |
| 36 | to `client`. | 35 | |
| 37 | 36 | Let's start with the actual server itself. Think about the following: | |
| 38 | Let\'s start with the actual server itself. Think about the following: | 37 | |
| 39 | 38 | - Do I have a firewall enabled? Do I need to update this to allow new ports or | |
| 40 | - Do I have a firewall enabled? Do I need to update this to allow new | 39 | IPs? |
| 41 | ports or IPs? | 40 | - Do I have an IPS/IDS that may prevent outside traffic? |
| 42 | - Do I have an IPS/IDS that may prevent outside traffic? | 41 | - Do I have any other security software installed? |
| 43 | - Do I have any other security software installed? | 42 | - Are the services hosted inside Docker containers, behind a reverse proxy, or |
| 44 | - Are the services hosted inside Docker containers, behind a reverse | 43 | virtualized? If so, are they configured to allow outside traffic? |
| 45 | proxy, or virtualized? If so, are they configured to allow outside | 44 | |
| 46 | traffic? | 45 | Once the data leaves the server, where does it go? In my case, it goes to a |
| 47 | 46 | managed switch. In this case, I asked the following: | |
| 48 | Once the data leaves the server, where does it go? In my case, it goes | 47 | |
| 49 | to a managed switch. In this case, I asked the following: | 48 | - What configurations is the switch using? |
| 50 | 49 | - Am I using VLANs? | |
| 51 | - What configurations is the switch using? | 50 | - Yes, I am using 802.1Q VLANs. |
| 52 | - Am I using VLANs? | 51 | - Are the VLANs configured properly? |
| 53 | - Yes, I am using 802.1Q VLANs. | 52 | - Yes, as shown in the Switch section below, I have a separate VLAN to allow |
| 54 | - Are the VLANs configured properly? | 53 | outside traffic to and from the server alone. No other devices, except for |
| 55 | - Yes, as shown in the Switch section below, I have a separate | 54 | a service port, and in that VLAN. |
| 56 | VLAN to allow outside traffic to and from the server alone. No | 55 | |
| 57 | other devices, except for a service port, and in that VLAN. | 56 | At this point, the data has been processed through the switch. Where does it go |
| 58 | 57 | next? In my case, it's pretty simple: it goes to the router/modem device. | |
| 59 | At this point, the data has been processed through the switch. Where | 58 | |
| 60 | does it go next? In my case, it\'s pretty simple: it goes to the | 59 | - Does my ISP block any ports that I need? |
| 61 | router/modem device. | 60 | - This is an important step that a lot of people run into when self-hosting |
| 62 | 61 | at home. Use an online port-checker tool for your IP or call your ISP if | |
| 63 | - Does my ISP block any ports that I need? | 62 | you think ports are blocked. |
| 64 | - This is an important step that a lot of people run into when | 63 | - Is there a router firewall? |
| 65 | self-hosting at home. Use an online port-checker tool for your | 64 | - Yes, I checked that it's configured to allow the ports I need to run my |
| 66 | IP or call your ISP if you think ports are blocked. | 65 | services publicly. Common web servers and reverse proxies require ports 80 |
| 67 | - Is there a router firewall? | 66 | and 443, but other services like media servers or games can require unique |
| 68 | - Yes, I checked that it\'s configured to allow the ports I need | 67 | ports, so be sure to check the documentation for your service(s). |
| 69 | to run my services publicly. Common web servers and reverse | 68 | - Are there any other settings affecting inbound/outbound traffic? |
| 70 | proxies require ports 80 and 443, but other services like media | 69 | - Schedules or access blocks |
| 71 | servers or games can require unique ports, so be sure to check | 70 | - Static Routing |
| 72 | the documentation for your service(s). | 71 | - QoS |
| 73 | - Are there any other settings affecting inbound/outbound traffic? | 72 | - Port Forwarding |
| 74 | - Schedules or access blocks | 73 | - DMZ Hosting |
| 75 | - Static Routing | 74 | - Remote Management (this can sometimes mess with services that also require |
| 76 | - QoS | 75 | the use of ports 80 and 443) |
| 77 | - Port Forwarding | 76 | |
| 78 | - DMZ Hosting | 77 | Once the data leaves my router, it goes to the upstream ISP and can be accessed |
| 79 | - Remote Management (this can sometimes mess with services that | 78 | publicly. |
| 80 | also require the use of ports 80 and 443) | ||
| 81 | |||
| 82 | Once the data leaves my router, it goes to the upstream ISP and can be | ||
| 83 | accessed publicly. | ||
| 84 | 79 | ||
| 85 | ### Server | 80 | ### Server |
| 86 | 81 | ||
| 87 | +The services I run on my server are installed straight into the OS, | 82 | +The services I run on my server are installed straight into the OS, without any |
| 88 | without any use of Docker or VMs, so I don\'t need any extra application | 83 | use of Docker or VMs, so I don't need any extra application configuration to |
| 89 | configuration to make them accessible to the outside world.+ | 84 | make them accessible to the outside world.+ |
| 90 | 85 | ||
| 91 | As of 2022-10-04, the paragraph above is no longer true as I now run a | 86 | As of 2022-10-04, the paragraph above is no longer true as I now run a reverse |
| 92 | reverse proxy with Nginx and host many services inside Docker. However, | 87 | proxy with Nginx and host many services inside Docker. However, it doesn't |
| 93 | it doesn\'t change anything regarding this post as I still just need to | 88 | change anything regarding this post as I still just need to open ports 80 & 443 |
| 94 | open ports 80 & 443 and create the necessary website configuration | 89 | and create the necessary website configuration files. |
| 95 | files. | 90 | |
| 96 | 91 | When creating new services - either installed directly on bare metal or within | |
| 97 | When creating new services - either installed directly on bare metal or | 92 | something like Docker - I ensure that I read through the documentation |
| 98 | within something like Docker - I ensure that I read through the | 93 | thoroughly to understand a few key things: - What network activities should this |
| 99 | documentation thoroughly to understand a few key things: - What network | 94 | app perform (if any)? Using which ports and protocols? - Does this app require |
| 100 | activities should this app perform (if any)? Using which ports and | 95 | any commands/services to be run as `root`? - Does this app log errors, |
| 101 | protocols? - Does this app require any commands/services to be run as | 96 | authentication failures/successes, or anything else that would be useful for an |
| 102 | `root`? - Does this app log errors, authentication | ||
| 103 | failures/successes, or anything else that would be useful for an | ||
| 104 | investigation? | 97 | investigation? |
| 105 | 98 | ||
| 106 | For extra security, I use limit all incoming connections to SSH | 99 | For extra security, I use limit all incoming connections to SSH connections |
| 107 | connections through my server firewall (`ufw`) and disable | 100 | through my server firewall (`ufw`) and disable common SSH settings. After all of |
| 108 | common SSH settings. After all of that, I use `fail2ban` as a | 101 | that, I use `fail2ban` as a preventative measure against brute-force login |
| 109 | preventative measure against brute-force login attempts. | 102 | attempts. |
| 110 | 103 | ||
| 111 | As another piece of security, you can randomize your SSH port to ensure | 104 | As another piece of security, you can randomize your SSH port to ensure that |
| 112 | that random scanners or attackers can\'t easily try to force their way | 105 | random scanners or attackers can't easily try to force their way into your |
| 113 | into your network. For example, you can edit the port rules in your | 106 | network. For example, you can edit the port rules in your server to block all |
| 114 | server to block all connection requests to port `22` but | 107 | connection requests to port `22` but forward all remote connections from port |
| 115 | forward all remote connections from port `12345` to your | 108 | `12345` to your server's port `22`. Then you just need to SSH to your network |
| 116 | server\'s port `22`. Then you just need to SSH to your | 109 | via your randomized port. |
| 117 | network via your randomized port. | ||
| 118 | 110 | ||
| 119 | ## `ufw` | 111 | ## `ufw` |
| 120 | 112 | ||
| 121 | To see how to configure `ufw`, see my other post: [Secure | 113 | To see how to configure `ufw`, see my other post: [Secure Your Network with the |
| 122 | Your Network with the Uncomplicated | 114 | Uncomplicated |
| 123 | Firewall](../secure-your-network-with-the-uncomplicated-firewall/). | 115 | Firewall](../secure-your-network-with-the-uncomplicated-firewall/). |
| 124 | 116 | ||
| 125 | The general notion with an on-device firewall is that you want to deny | 117 | The general notion with an on-device firewall is that you want to deny all |
| 126 | all incoming connections by default and then selectively open certain | 118 | incoming connections by default and then selectively open certain ports for |
| 127 | ports for services or users that you know need access. | 119 | services or users that you know need access. |
| 128 | 120 | ||
| 129 | If you know that you will only be logging into this server from a | 121 | If you know that you will only be logging into this server from a certain set or |
| 130 | certain set or list of IPs, you can always set the firewall to only | 122 | list of IPs, you can always set the firewall to only allow connections to port |
| 131 | allow connections to port 22 from those IPs. | 123 | 22 from those IPs. |
| 132 | 124 | ||
| 133 | For a quick start to only allow SSH connections to the server, use this: | 125 | For a quick start to only allow SSH connections to the server, use this: |
| 134 | 126 | ||
| @@ -145,31 +137,30 @@ sudo ufw enable | |||
| 145 | 137 | ||
| 146 | 1. Using SSH Keys | 138 | 1. Using SSH Keys |
| 147 | 139 | ||
| 148 | First, make sure you have an SSH keypair generated on the device(s) | 140 | First, make sure you have an SSH keypair generated on the device(s) that |
| 149 | that you\'ll be using to log in to the server. If you don\'t have an | 141 | you'll be using to log in to the server. If you don't have an SSH key, run |
| 150 | SSH key, run this command: | 142 | this command: |
| 151 | 143 | ||
| 152 | ```sh | 144 | ```sh |
| 153 | ssh-keygen | 145 | ssh-keygen |
| 154 | ``` | 146 | ``` |
| 155 | 147 | ||
| 156 | Now that we have an SSH key, copy it to the server with the | 148 | Now that we have an SSH key, copy it to the server with the following |
| 157 | following command, which will ask for the user\'s password before | 149 | command, which will ask for the user's password before accepting the key: |
| 158 | accepting the key: | ||
| 159 | 150 | ||
| 160 | ```sh | 151 | ```sh |
| 161 | ssh-copy-id my_user@my_server | 152 | ssh-copy-id my_user@my_server |
| 162 | ``` | 153 | ``` |
| 163 | 154 | ||
| 164 | If you have multiple keys, you\'ll need to specify which to use. | 155 | If you have multiple keys, you'll need to specify which to use. After it's |
| 165 | After it\'s complete, `ssh` back into the server as that | 156 | complete, `ssh` back into the server as that user and make sure it doesn't |
| 166 | user and make sure it doesn\'t ask for a password. | 157 | ask for a password. |
| 167 | 158 | ||
| 168 | 2. Disable Password & Root Authentication | 159 | 2. Disable Password & Root Authentication |
| 169 | 160 | ||
| 170 | Now that we can access the server without a password, we will | 161 | Now that we can access the server without a password, we will disable |
| 171 | disable password authentication and disable anyone from using | 162 | password authentication and disable anyone from using `ssh` to login as |
| 172 | `ssh` to login as `root`. | 163 | `root`. |
| 173 | 164 | ||
| 174 | To do this, open the `sshd_config` file: | 165 | To do this, open the `sshd_config` file: |
| 175 | 166 | ||
| @@ -177,9 +168,9 @@ sudo ufw enable | |||
| 177 | sudo nano /etc/ssh/sshd_config | 168 | sudo nano /etc/ssh/sshd_config |
| 178 | ``` | 169 | ``` |
| 179 | 170 | ||
| 180 | You\'ll need to update the parameters to the values below. If one of | 171 | You'll need to update the parameters to the values below. If one of these |
| 181 | these rules is commented-out or doesn\'t exist, create the rule at | 172 | rules is commented-out or doesn't exist, create the rule at the bottom of |
| 182 | the bottom of the file. | 173 | the file. |
| 183 | 174 | ||
| 184 | ``` config | 175 | ``` config |
| 185 | PermitRootLogin no | 176 | PermitRootLogin no |
| @@ -193,36 +184,33 @@ sudo ufw enable | |||
| 193 | sudo systemctl restart sshd.service | 184 | sudo systemctl restart sshd.service |
| 194 | ``` | 185 | ``` |
| 195 | 186 | ||
| 196 | To test that everything\'s working so far, open ANOTHER terminal and | 187 | To test that everything's working so far, open ANOTHER terminal and try |
| 197 | try logging in as `root` over SSH. It is very important | 188 | logging in as `root` over SSH. It is very important that you keep your |
| 198 | that you keep your current SSH session open and test with an | 189 | current SSH session open and test with an additional session, or you will |
| 199 | additional session, or you will lock yourself out at some point and | 190 | lock yourself out at some point and will need to use a recovery method |
| 200 | will need to use a recovery method (e.g., hooking monitor up to home | 191 | (e.g., hooking monitor up to home server) to get yourself back in. |
| 201 | server) to get yourself back in. | ||
| 202 | 192 | ||
| 203 | 3. Enable MFA for `ssh` | 193 | 3. Enable MFA for `ssh` |
| 204 | 194 | ||
| 205 | This part is optional, but I highly recommend it. So far, we\'ve | 195 | This part is optional, but I highly recommend it. So far, we've ensured |
| 206 | ensured that no one can log into our user on the server without | 196 | that no one can log into our user on the server without using our secret |
| 207 | using our secret key, and we\'ve ensured that no one can log in | 197 | key, and we've ensured that no one can log in remotely as `root`. Next, you |
| 208 | remotely as `root`. Next, you can enable MFA | 198 | can enable MFA authentication for `ssh` connections. |
| 209 | authentication for `ssh` connections. | ||
| 210 | 199 | ||
| 211 | This process involves editing a couple files and installing an MFA | 200 | This process involves editing a couple files and installing an MFA package, |
| 212 | package, so I will not include all the details in this post. To see | 201 | so I will not include all the details in this post. To see how to configure |
| 213 | how to configure MFA for `ssh`, see my other post: | 202 | MFA for `ssh`, see my other post: [Enabling MFA for |
| 214 | [Enabling MFA for SSH](../enable-totp-mfa-for-ssh/). | 203 | SSH](../enable-totp-mfa-for-ssh/). |
| 215 | 204 | ||
| 216 |  | 206 | MFA](https://img.cleberg.net/blog/20220324-hardening-a-public-facing-home-server/ssh_mfa.png) |
| 218 | 207 | ||
| 219 | ## `fail2ban` | 208 | ## `fail2ban` |
| 220 | 209 | ||
| 221 | I haven\'t written a post on how I use `fail2ban`, but it\'s | 210 | I haven't written a post on how I use `fail2ban`, but it's quite simple. I use |
| 222 | quite simple. I use the default `sshd` jail, but you can | 211 | the default `sshd` jail, but you can always create new jails for respective |
| 223 | always create new jails for respective applications or ports. For | 212 | applications or ports. For example, if you use Nginx as your web server, you can |
| 224 | example, if you use Nginx as your web server, you can use the | 213 | use the `nginx-http-auth` jail. |
| 225 | `nginx-http-auth` jail. | ||
| 226 | 214 | ||
| 227 | In order to get it up and running, use the following commands: | 215 | In order to get it up and running, use the following commands: |
| 228 | 216 | ||
| @@ -232,122 +220,132 @@ sudo fail2ban-client start sshd | |||
| 232 | sudo fail2ban-client status sshd | 220 | sudo fail2ban-client status sshd |
| 233 | ``` | 221 | ``` |
| 234 | 222 | ||
| 235 | This should be used as a last-resort defense and shouldn\'t be a | 223 | This should be used as a last-resort defense and shouldn't be a replacement for |
| 236 | replacement for the security measures mentioned above. | 224 | the security measures mentioned above. |
| 237 | 225 | ||
| 238 |  | 226 |  |
| 239 | 227 | ||
| 240 | # Switch | 228 | # Switch |
| 241 | 229 | ||
| 242 | Between the router and any local devices is my managed switch, which is | 230 | Between the router and any local devices is my managed switch, which is used to |
| 243 | used to create VLANs. The example below shows how I would isolate the | 231 | create VLANs. The example below shows how I would isolate the VLANs if I were |
| 244 | VLANs if I were starting to host a single service at home. | 232 | starting to host a single service at home. |
| 245 | 233 | ||
| 246 | ## 802.1Q VLAN Configuration | 234 | ## 802.1Q VLAN Configuration |
| 247 | 235 | ||
| 248 | In this configuration, port 8 is the public server that needs to be | 236 | In this configuration, port 8 is the public server that needs to be accessed |
| 249 | accessed from the outside. Port 23 is my \'dedicated service port\' for | 237 | from the outside. Port 23 is my 'dedicated service port' for this server. In |
| 250 | this server. In order to SSH to this server, I need to plug my laptop | 238 | order to SSH to this server, I need to plug my laptop into port 23 or else I |
| 251 | into port 23 or else I cannot SSH. Otherwise, I\'d need to hook up a | 239 | cannot SSH. Otherwise, I'd need to hook up a monitor and keyboard directly to |
| 252 | monitor and keyboard directly to the server to manage it. | 240 | the server to manage it. |
| 253 | 241 | ||
| 254 | VLAN ID VLAN Name Member Ports Tagged Ports Untagged Ports | 242 | | |
| 255 | --------- ----------- -------------- -------------- ---------------- | 243 | |
| 256 | 1 Default 1-24 1-24 | 244 | | VLAN ID | VLAN Name | Member Ports | Tagged Ports | Untagged Ports | |
| 257 | 2 Server 1,8,23 1,8,23 | 245 | |---------|-----------|--------------|--------------|----------------| |
| 246 | | 1 | Default | 1-24 | 1-24 | | | ||
| 247 | | 2 | Server | 1,8,23 | 1,8,23 | | | ||
| 258 | 248 | ||
| 259 | ## 802.1Q VLAN PVID Setting | 249 | ## 802.1Q VLAN PVID Setting |
| 260 | 250 | ||
| 261 | Once the VLAN is created, I simply add the `VLAN ID` of | 251 | Once the VLAN is created, I simply add the `VLAN ID` of `2` as the `PVID` for |
| 262 | `2` as the `PVID` for any related ports (in this | 252 | any related ports (in this case, see that ports `8` and `23` have a PVID of |
| 263 | case, see that ports `8` and `23` have a PVID of | ||
| 264 | `2`). | 253 | `2`). |
| 265 | 254 | ||
| 266 | Port PVID | 255 | | Port | PVID | |
| 267 | ------ ------ | 256 | |------|------| |
| 268 | 1 1 | 257 | | 1 | 1 | |
| 269 | 2 1 | 258 | | 2 | 1 | |
| 270 | 3 1 | 259 | | 3 | 1 | |
| 271 | 4 1 | 260 | | 4 | 1 | |
| 272 | 5 1 | 261 | | 5 | 1 | |
| 273 | 6 1 | 262 | | 6 | 1 | |
| 274 | 7 1 | 263 | | 7 | 1 | |
| 275 | 8 2 | 264 | | 8 | 2 | |
| 276 | 9 1 | 265 | | 9 | 1 | |
| 277 | 10 1 | 266 | | 10 | 1 | |
| 278 | 11 1 | 267 | | 11 | 1 | |
| 279 | 12 1 | 268 | | 12 | 1 | |
| 280 | 13 1 | 269 | | 13 | 1 | |
| 281 | 14 1 | 270 | | 14 | 1 | |
| 282 | 15 1 | 271 | | 15 | 1 | |
| 283 | 16 1 | 272 | | 16 | 1 | |
| 284 | 17 1 | 273 | | 17 | 1 | |
| 285 | 18 1 | 274 | | 18 | 1 | |
| 286 | 19 1 | 275 | | 19 | 1 | |
| 287 | 20 1 | 276 | | 20 | 1 | |
| 288 | 21 1 | 277 | | 21 | 1 | |
| 289 | 22 1 | 278 | | 22 | 1 | |
| 290 | 23 2 | 279 | | 23 | 2 | |
| 291 | 24 1 | 280 | | 24 | 1 | |
| 292 | 281 | ||
| 293 | # Router | 282 | # Router |
| 294 | 283 | ||
| 295 | On my router, the configuration was as easy as opening the firewall | 284 | On my router, the configuration was as easy as opening the firewall settings and |
| 296 | settings and unblocking the ports I needed for my services (e.g., | 285 | unblocking the ports I needed for my services (e.g., HTTP/S, Plex, SSH, MySQL, |
| 297 | HTTP/S, Plex, SSH, MySQL, etc.). | 286 | etc.). |
| 298 | 287 | ||
| 299 | +Since I\'m relying on an ISP-provided modem/router combo for now (not | 288 | *Since I'm relying on an ISP-provided modem/router combo for now (not by |
| 300 | by choice), I do not use any other advanced settings on my router that | 289 | choice), I do not use any other advanced settings on my router that would |
| 301 | would inhibit any valid traffic to these services.+ | 290 | inhibit any valid traffic to these services.* |
| 302 | 291 | ||
| 303 | The paragraph above regarding the ISP-owned router is no longer accurate | 292 | The paragraph above regarding the ISP-owned router is no longer accurate as I |
| 304 | as I now use the Ubiquiti Unifi Dream Machine Pro as my router. Within | 293 | now use the Ubiquiti Unifi Dream Machine Pro as my router. Within this router, I |
| 305 | this router, I enabled port forwarding/firewall rules, segregate the | 294 | enabled port forwarding/firewall rules, segregate the network based on the |
| 306 | network based on the device, and enable traffic restrictions (e.g., | 295 | device, and enable traffic restrictions (e.g., silently drop traffic from |
| 307 | silently drop traffic from certain countries and threat categories). | 296 | certain countries and threat categories). |
| 308 | 297 | ||
| 309 | If you have the option with your ISP, I recommend using a personal | 298 | If you have the option with your ISP, I recommend using a personal router with |
| 310 | router with software that you are familiar with so that you can explore | 299 | software that you are familiar with so that you can explore all the options |
| 311 | all the options available to you. | 300 | available to you. |
| 312 | 301 | ||
| 313 | # Physical Security | 302 | # Physical Security |
| 314 | 303 | ||
| 315 | One large piece of self-hosting that people generally don\'t discuss | 304 | One large piece of self-hosting that people generally don't discuss online is |
| 316 | online is physical security. However, physical security is very | 305 | physical security. However, physical security is very important for everyone who |
| 317 | important for everyone who hosts a server like this. Exactly *how* | 306 | hosts a server like this. Exactly *how* important it is depends on the server |
| 318 | important it is depends on the server use/purpose. | 307 | use/purpose. |
| 319 | 308 | ||
| 320 | If you self-host customer applications that hold protected data (HIPAA, | 309 | If you self-host customer applications that hold protected data (HIPAA, GDPR, |
| 321 | GDPR, COPPA, etc.), then physical security is extremely important and | 310 | COPPA, etc.), then physical security is extremely important and cannot be |
| 322 | cannot be ignored. If you simply host a blog and some hobby sites, then | 311 | ignored. If you simply host a blog and some hobby sites, then it's a relatively |
| 323 | it\'s a relatively minor consideration, but one you still need to think | 312 | minor consideration, but one you still need to think about. |
| 324 | about. | ||
| 325 | 313 | ||
| 326 | ## Location | 314 | ## Location |
| 327 | 315 | ||
| 328 | The first consideration is quite simple: location. - Is the server | 316 | The first consideration is quite simple: location. |
| 329 | within a property you own or housed on someone else\'s property? - Is it | 317 | |
| 330 | nearby (in your house, in your work office, in your neighbor\'s garage, | 318 | - Is the server within a property you own or housed on someone else's property? |
| 331 | in a storage unit, etc.)? - Do you have 24/7 access to the server? - Are | 319 | - Is it nearby (in your house, in your work office, in your neighbor's garage, |
| 332 | there climate considerations, such as humidity, fires, tornadoes, | 320 | in a storage unit, etc.)? |
| 333 | monsoons? - Do you have emergency equipment nearby in case of emergency? | 321 | - Do you have 24/7 access to the server? |
| 322 | - Are there climate considerations, such as humidity, fires, tornadoes, | ||
| 323 | monsoons? | ||
| 324 | - Do you have emergency equipment nearby in case of emergency? | ||
| 334 | 325 | ||
| 335 | ## Hardware Ownership | 326 | ## Hardware Ownership |
| 336 | 327 | ||
| 337 | Secondly, consider the hardware itself: - Do you own the server in its | 328 | Secondly, consider the hardware itself: |
| 338 | entirety? - Are any other users able to access the server, even if your | 329 | |
| 339 | data/space is segregated? - If you\'re utilizing a third party, do they | 330 | - Do you own the server in its entirety? |
| 340 | have any documentation to show responsibility? This could be a SOC 1/2/3 | 331 | - Are any other users able to access the server, even if your data/space is |
| 341 | report, ISO compliance report, internal security/safety documentation. | 332 | segregated? |
| 333 | - If you're utilizing a third party, do they have any documentation to show | ||
| 334 | responsibility? This could be a SOC 1/2/3 report, ISO compliance report, | ||
| 335 | internal security/safety documentation. | ||
| 342 | 336 | ||
| 343 | ## Physical Controls | 337 | ## Physical Controls |
| 344 | 338 | ||
| 345 | Regardless of who owns the hardware, ensure that there are adequate | 339 | Regardless of who owns the hardware, ensure that there are adequate safeguards |
| 346 | safeguards in place, if necessary. These usually don\'t apply to small | 340 | in place, if necessary. These usually don't apply to small home servers and are |
| 347 | home servers and are usually covered already if you\'re utilizing a | 341 | usually covered already if you're utilizing a third party. |
| 348 | third party. | 342 | |
| 343 | These can include: | ||
| 349 | 344 | ||
| 350 | These can include: - Server bezel locks - Server room locks - physical, | 345 | - Server bezel locks |
| 351 | digital, or biometric authentication - Security cameras - Raised | 346 | - Server room locks - physical, digital, or biometric authentication |
| 352 | floors/lowered ceilings with proper guards/gates in-place within the | 347 | - Security cameras |
| 353 | floors or ceilings - Security personnel - Log sheets and/or guest badges | 348 | - Raised floors/lowered ceilings with proper guards/gates in-place within the |
| 349 | floors or ceilings | ||
| 350 | - Security personnel | ||
| 351 | - Log sheets and/or guest badges | ||
content/blog/2022-03-26-ssh-mfa.md +40 −43
| @@ -1,35 +1,33 @@ | |||
| 1 | +++ | 1 | +++ |
| 2 | date = 2022-03-26 | 2 | date = 2022-03-26 |
| 3 | title = "Enablt TOTP MFA for SSH" | 3 | title = "Enable TOTP MFA for SSH" |
| 4 | description = "" | 4 | description = "" |
| 5 | draft = false | 5 | draft = false |
| 6 | +++ | 6 | +++ |
| 7 | 7 | ||
| 8 | # Why Do I Need MFA for SSH? | 8 | # Why Do I Need MFA for SSH? |
| 9 | 9 | ||
| 10 | If you are a sysadmin of a server anywhere (that includes at home!), you | 10 | If you are a sysadmin of a server anywhere (that includes at home!), you may |
| 11 | may want an added layer of protection against intruders. This is not a | 11 | want an added layer of protection against intruders. This is not a replacement |
| 12 | replacement for other security measures, such as: | 12 | for other security measures, such as: |
| 13 | 13 | ||
| 14 | - Disable root SSH | 14 | - Disable root SSH |
| 15 | - Disable SSH password authentication | 15 | - Disable SSH password authentication |
| 16 | - Allow only certain users to login via SSH | 16 | - Allow only certain users to login via SSH |
| 17 | - Allow SSH only from certain IPs | 17 | - Allow SSH only from certain IPs |
| 18 | 18 | ||
| 19 | However, MFA can be added as an additional security measure to ensure | 19 | However, MFA can be added as an additional security measure to ensure that your |
| 20 | that your server is protected. This is especially important if you need | 20 | server is protected. This is especially important if you need to allow password |
| 21 | to allow password authentication for SSH. | 21 | authentication for SSH. |
| 22 | 22 | ||
| 23 | For more guidance on server security measures, see my other post: | 23 | For more guidance on server security measures, see my other post: [Hardening a |
| 24 | [Hardening a Public-Facing Home | 24 | Public-Facing Home Server](../hardening-a-public-facing-home-server/). |
| 25 | Server](../hardening-a-public-facing-home-server/). | ||
| 26 | 25 | ||
| 27 | # Install MFA PAM Module | 26 | # Install MFA PAM Module |
| 28 | 27 | ||
| 29 | PAM, which stands for Pluggable Authentication Module, is an | 28 | PAM, which stands for Pluggable Authentication Module, is an authentication |
| 30 | authentication infrastructure used on Linux systems to authenticate a | 29 | infrastructure used on Linux systems to authenticate a user. In order to use |
| 31 | user. In order to use this technology, let\'s install the | 30 | this technology, let's install the `libpam-google-authenticator` package: |
| 32 | `libpam-google-authenticator` package: | ||
| 33 | 31 | ||
| 34 | ```sh | 32 | ```sh |
| 35 | sudo apt-get update | 33 | sudo apt-get update |
| @@ -43,16 +41,16 @@ sudo apt-get install libpam-google-authenticator | |||
| 43 | 41 | ||
| 44 | ## Interactive Method | 42 | ## Interactive Method |
| 45 | 43 | ||
| 46 | Once the package is installed, initialize it and following the | 44 | Once the package is installed, initialize it and following the interactive |
| 47 | interactive prompts to generate your OTP or TOTP: | 45 | prompts to generate your OTP or TOTP: |
| 48 | 46 | ||
| 49 | ```sh | 47 | ```sh |
| 50 | google-authenticator | 48 | google-authenticator |
| 51 | ``` | 49 | ``` |
| 52 | 50 | ||
| 53 | If you are not sure how to answer, read the prompts carefully and think | 51 | If you are not sure how to answer, read the prompts carefully and think about |
| 54 | about having to how each situation would affect your normal login | 52 | having to how each situation would affect your normal login attempts. If you are |
| 55 | attempts. If you are still not sure, use my default responses below. | 53 | still not sure, use my default responses below. |
| 56 | 54 | ||
| 57 | ``` txt | 55 | ``` txt |
| 58 | OUTPUT | 56 | OUTPUT |
| @@ -60,9 +58,9 @@ OUTPUT | |||
| 60 | Do you want authentication tokens to be time-based (y/n) y | 58 | Do you want authentication tokens to be time-based (y/n) y |
| 61 | ``` | 59 | ``` |
| 62 | 60 | ||
| 63 | At this point, use an authenticator app somewhere one of your devices to | 61 | At this point, use an authenticator app somewhere one of your devices to scan |
| 64 | scan the QR code. Any future login attempts after our upcoming | 62 | the QR code. Any future login attempts after our upcoming configuration changes |
| 65 | configuration changes will require that TOTP. | 63 | will require that TOTP. |
| 66 | 64 | ||
| 67 | ``` txt | 65 | ``` txt |
| 68 | OUTPUT | 66 | OUTPUT |
| @@ -104,9 +102,9 @@ Do you want to enable rate-limiting? (y/n) y | |||
| 104 | 102 | ||
| 105 | ## Non-Interactive Method | 103 | ## Non-Interactive Method |
| 106 | 104 | ||
| 107 | If you need to do this quickly, know your responses to the prompts, or | 105 | If you need to do this quickly, know your responses to the prompts, or are |
| 108 | are setting this up for numerous users, the non-interactive method can | 106 | setting this up for numerous users, the non-interactive method can be much |
| 109 | be much faster: | 107 | faster: |
| 110 | 108 | ||
| 111 | ```sh | 109 | ```sh |
| 112 | google-authenticator -t -d -f -r 3 -R 30 -w 3 | 110 | google-authenticator -t -d -f -r 3 -R 30 -w 3 |
| @@ -136,23 +134,23 @@ google-authenticator [<options>] | |||
| 136 | -e, --emergency-codes=N Number of emergency codes to generate | 134 | -e, --emergency-codes=N Number of emergency codes to generate |
| 137 | ``` | 135 | ``` |
| 138 | 136 | ||
| 139 | This fully configures the authenticator, saves it to a file, and then | 137 | This fully configures the authenticator, saves it to a file, and then outputs |
| 140 | outputs the secret key, QR code, and recovery codes. (If you add the | 138 | the secret key, QR code, and recovery codes. (If you add the flag `-q`, then |
| 141 | flag `-q`, then there won\'t be any output). If you use this | 139 | there won't be any output). If you use this command in an automated fashion, |
| 142 | command in an automated fashion, make sure your script captures the | 140 | make sure your script captures the secret key and/or recovery codes and makes |
| 143 | secret key and/or recovery codes and makes them available to the user. | 141 | them available to the user. |
| 144 | 142 | ||
| 145 | # PAM Configuration Settings | 143 | # PAM Configuration Settings |
| 146 | 144 | ||
| 147 | Once you\'ve enabled the T/OTP and have it saved to an MFA app on your | 145 | Once you've enabled the T/OTP and have it saved to an MFA app on your phone or |
| 148 | phone or other device, open the PAM `sshd` file: | 146 | other device, open the PAM `sshd` file: |
| 149 | 147 | ||
| 150 | ```sh | 148 | ```sh |
| 151 | sudo nano /etc/pam.d/sshd | 149 | sudo nano /etc/pam.d/sshd |
| 152 | ``` | 150 | ``` |
| 153 | 151 | ||
| 154 | You need to do two things in this file. First, add the following lines | 152 | You need to do two things in this file. First, add the following lines to the |
| 155 | to the bottom of the file: | 153 | bottom of the file: |
| 156 | 154 | ||
| 157 | ``` config | 155 | ``` config |
| 158 | auth required pam_google_authenticator.so nullok | 156 | auth required pam_google_authenticator.so nullok |
| @@ -161,8 +159,8 @@ auth required pam_permit.so | |||
| 161 | 159 | ||
| 162 | Second, comment-out the following line near the top of the file. | 160 | Second, comment-out the following line near the top of the file. |
| 163 | 161 | ||
| 164 | If you leave this line uncommented, every SSH login attempt will ask for | 162 | If you leave this line uncommented, every SSH login attempt will ask for the |
| 165 | the following three authentication factors: | 163 | following three authentication factors: |
| 166 | 164 | ||
| 167 | 1. Publickey | 165 | 1. Publickey |
| 168 | 2. Password | 166 | 2. Password |
| @@ -180,9 +178,8 @@ Finally, edit the `sshd_config` file again: | |||
| 180 | sudo nano /etc/ssh/sshd_config | 178 | sudo nano /etc/ssh/sshd_config |
| 181 | ``` | 179 | ``` |
| 182 | 180 | ||
| 183 | You\'ll need to change `ChallengeResponseAuthentication` to | 181 | You'll need to change `ChallengeResponseAuthentication` to yes and add the |
| 184 | yes and add the `AuthenticationMethods` line to the bottom of | 182 | `AuthenticationMethods` line to the bottom of the file. |
| 185 | the file. | ||
| 186 | 183 | ||
| 187 | ``` config | 184 | ``` config |
| 188 | ChallengeResponseAuthentication yes | 185 | ChallengeResponseAuthentication yes |
content/blog/2022-04-02-nginx-reverse-proxy.md +83 −92
| @@ -7,36 +7,34 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # What is a Reverse Proxy? | 8 | # What is a Reverse Proxy? |
| 9 | 9 | ||
| 10 | A reverse proxy is a server that is placed between local servers or | 10 | A reverse proxy is a server that is placed between local servers or services and |
| 11 | services and clients/users (e.g., the internet). The reverse proxy | 11 | clients/users (e.g., the internet). The reverse proxy intercepts all requests |
| 12 | intercepts all requests from clients at the network edge and uses its | 12 | from clients at the network edge and uses its configuration files to determine |
| 13 | configuration files to determine where each request should be sent. | 13 | where each request should be sent. |
| 14 | 14 | ||
| 15 | ## A Brief Example | 15 | ## A Brief Example |
| 16 | 16 | ||
| 17 | For example, let\'s say that I run three servers in my home: | 17 | For example, let's say that I run three servers in my home: |
| 18 | 18 | ||
| 19 | - Server~01~ (`example.com`) | 19 | - Server01 (`example.com`) |
| 20 | - Server~02~ (`service01.example.com`) | 20 | - Server02 (`service01.example.com`) |
| 21 | - Server~03~ (`service02.example.com`) | 21 | - Server03 (`service02.example.com`) |
| 22 | 22 | ||
| 23 | I also run a reverse proxy in my home that intercepts all public | 23 | I also run a reverse proxy in my home that intercepts all public traffic: |
| 24 | traffic: | ||
| 25 | 24 | ||
| 26 | - Reverse Proxy | 25 | - Reverse Proxy |
| 27 | 26 | ||
| 28 | Assume that I have a domain name (`example.com`) that allows | 27 | Assume that I have a domain name (`example.com`) that allows clients to request |
| 29 | clients to request websites or services from my home servers. | 28 | websites or services from my home servers. |
| 30 | 29 | ||
| 31 | In this case, the reverse proxy will intercept all traffic from | 30 | In this case, the reverse proxy will intercept all traffic from `example.com` |
| 32 | `example.com` that enters my network and determine if the | 31 | that enters my network and determine if the client is requesting valid data, |
| 33 | client is requesting valid data, based on my configuration. | 32 | based on my configuration. |
| 34 | 33 | ||
| 35 | If the user is requesting `example.com` and my configuration | 34 | If the user is requesting `example.com` and my configuration files say that |
| 36 | files say that Server~01~ holds that data, Nginx will send the user to | 35 | Server~01~ holds that data, Nginx will send the user to Server~01~. If I were to |
| 37 | Server~01~. If I were to change the configuration so that | 36 | change the configuration so that `example.com` is routed to Server~02~, that |
| 38 | `example.com` is routed to Server~02~, that same user would | 37 | same user would be sent to Server~02~ instead. |
| 39 | be sent to Server~02~ instead. | ||
| 40 | 38 | ||
| 41 | ``` txt | 39 | ``` txt |
| 42 | ┌──────┐ ┌───────────┐ | 40 | ┌──────┐ ┌───────────┐ |
| @@ -52,62 +50,61 @@ be sent to Server~02~ instead. | |||
| 52 | 50 | ||
| 53 | # Reverse Proxy Options | 51 | # Reverse Proxy Options |
| 54 | 52 | ||
| 55 | There are a lot of options when it comes to reverse proxy servers, so | 53 | There are a lot of options when it comes to reverse proxy servers, so I'm just |
| 56 | I\'m just going to list a few of the options I\'ve heard recommended | 54 | going to list a few of the options I've heard recommended over the last few |
| 57 | over the last few years: | 55 | years: |
| 58 | 56 | ||
| 59 | - [Nginx](https://nginx.com) | 57 | - [Nginx](https://nginx.com) |
| 60 | - [Caddy](https://caddyserver.com) | 58 | - [Caddy](https://caddyserver.com) |
| 61 | - [Traefik](https://traefik.io/) | 59 | - [Traefik](https://traefik.io/) |
| 62 | - [HAProxy](https://www.haproxy.org/) | 60 | - [HAProxy](https://www.haproxy.org/) |
| 63 | - [Squid](https://ubuntu.com/server/docs/proxy-servers-squid) | 61 | - [Squid](https://ubuntu.com/server/docs/proxy-servers-squid) |
| 64 | 62 | ||
| 65 | In this post, we will be using Nginx as our reverse proxy, running on | 63 | In this post, we will be using Nginx as our reverse proxy, running on Ubuntu |
| 66 | Ubuntu Server 20.04.4 LTS. | 64 | Server 20.04.4 LTS. |
| 67 | 65 | ||
| 68 | # Nginx Reverse Proxy Example | 66 | # Nginx Reverse Proxy Example |
| 69 | 67 | ||
| 70 | ## Local Applications | 68 | ## Local Applications |
| 71 | 69 | ||
| 72 | You may be like me and have a lot of applications running on your local | 70 | You may be like me and have a lot of applications running on your local network |
| 73 | network that you\'d like to expose publicly with a domain. | 71 | that you'd like to expose publicly with a domain. |
| 74 | 72 | ||
| 75 | In my case, I have services running in multiple Docker containers within | 73 | In my case, I have services running in multiple Docker containers within a |
| 76 | a single server and want a way to visit those services from anywhere | 74 | single server and want a way to visit those services from anywhere with a URL. |
| 77 | with a URL. For example, on my local network, [Dashy](https://dashy.to) | 75 | For example, on my local network, [Dashy](https://dashy.to) runs through port |
| 78 | runs through port 4000 (`localhost:4000`) and [Uptime | 76 | 4000 (`localhost:4000`) and [Uptime |
| 79 | Kuma](https://github.com/louislam/uptime-kuma) runs through port 3001 | 77 | Kuma](https://github.com/louislam/uptime-kuma) runs through port 3001 |
| 80 | (`localhost:3001`). | 78 | (`localhost:3001`). |
| 81 | 79 | ||
| 82 | In order to expose these services to the public, I will need to do the | 80 | In order to expose these services to the public, I will need to do the |
| 83 | following: | 81 | following: |
| 84 | 82 | ||
| 85 | 1. Set up DNS records for a domain or subdomain (one per service) to | 83 | 1. Set up DNS records for a domain or subdomain (one per service) to point |
| 86 | point toward the IP address of the server. | 84 | toward the IP address of the server. |
| 87 | 2. Open up the server network\'s HTTP and HTTPS ports (80 & 443) so | 85 | 2. Open up the server network's HTTP and HTTPS ports (80 & 443) so that the |
| 88 | that the reverse proxy can accept traffic and determine where to | 86 | reverse proxy can accept traffic and determine where to send it. |
| 89 | send it. | 87 | 3. Install the reverse proxy software. |
| 90 | 3. Install the reverse proxy software. | 88 | 4. Configure the reverse proxy to recognize which service should get traffic |
| 91 | 4. Configure the reverse proxy to recognize which service should get | 89 | from any of the domains or subdomains. |
| 92 | traffic from any of the domains or subdomains. | ||
| 93 | 90 | ||
| 94 | ## Step 1: DNS Configuration | 91 | ## Step 1: DNS Configuration |
| 95 | 92 | ||
| 96 | To start, update your DNS configuration so that you have an | 93 | To start, update your DNS configuration so that you have an `A` record for each |
| 97 | `A` record for each domain or subdomain. | 94 | domain or subdomain. |
| 98 | 95 | ||
| 99 | The `A` records should point toward the public IP address of | 96 | The `A` records should point toward the public IP address of the server. If you |
| 100 | the server. If you don\'t know the public IP address, log in to the | 97 | don't know the public IP address, log in to the server and run the following |
| 101 | server and run the following command: | 98 | command: |
| 102 | 99 | ||
| 103 | ```sh | 100 | ```sh |
| 104 | curl ifconfig.co | 101 | curl ifconfig.co |
| 105 | ``` | 102 | ``` |
| 106 | 103 | ||
| 107 | In the DNS example below, `xxx.xxx.xxx.xxx` is the public IP | 104 | In the DNS example below, `xxx.xxx.xxx.xxx` is the public IP address of the |
| 108 | address of the server. | 105 | server. |
| 109 | 106 | ||
| 110 | ``` config | 107 | ```conf |
| 111 | example.com A xxx.xxx.xxx.xxx | 108 | example.com A xxx.xxx.xxx.xxx |
| 112 | uptime.example.com A xxx.xxx.xxx.xxx | 109 | uptime.example.com A xxx.xxx.xxx.xxx |
| 113 | dashy.example.com A xxx.xxx.xxx.xxx | 110 | dashy.example.com A xxx.xxx.xxx.xxx |
| @@ -115,33 +112,30 @@ www CNAME example.com | |||
| 115 | ``` | 112 | ``` |
| 116 | 113 | ||
| 117 | Finally, ensure the DNS has propagated correctly with [DNS | 114 | Finally, ensure the DNS has propagated correctly with [DNS |
| 118 | Checker](https://dnschecker.org) by entering your domains or subdomains | 115 | Checker](https://dnschecker.org) by entering your domains or subdomains in the |
| 119 | in the search box and ensuring the results are showing the correct IP | 116 | search box and ensuring the results are showing the correct IP address. |
| 120 | address. | ||
| 121 | 117 | ||
| 122 | ## Step 2: Open Network Ports | 118 | ## Step 2: Open Network Ports |
| 123 | 119 | ||
| 124 | This step will be different depending on which router you have in your | 120 | This step will be different depending on which router you have in your home. If |
| 125 | home. If you\'re not sure, try to visit | 121 | you're not sure, try to visit [192.168.1.1](http://192.168.1.1) in your |
| 126 | [192.168.1.1](http://192.168.1.1) in your browser. Login credentials are | 122 | browser. Login credentials are usually written on a sticker somewhere on your |
| 127 | usually written on a sticker somewhere on your modem/router. | 123 | modem/router. |
| 128 | 124 | ||
| 129 | Once you\'re able to log in to your router, find the Port Forwarding | 125 | Once you're able to log in to your router, find the Port Forwarding settings. |
| 130 | settings. You will need to forward ports `80` and | 126 | You will need to forward ports `80` and `443` to whichever machine is running |
| 131 | `443` to whichever machine is running the reverse proxy. | 127 | the reverse proxy. |
| 132 | 128 | ||
| 133 | In my case, the table below shows the port-forwarding rules I\'ve | 129 | In my case, the table below shows the port-forwarding rules I've created. In |
| 134 | created. In this table, `xxx.xxx.xxx.xxx` is the local device | 130 | this table, `xxx.xxx.xxx.xxx` is the local device IP of the reverse proxy |
| 135 | IP of the reverse proxy server, it will probably be an IP between | 131 | server, it will probably be an IP between `192.168.1.1` and `192.168.1.255`. |
| 136 | `192.168.1.1` and `192.168.1.255`. | ||
| 137 | 132 | ||
| 138 | NAME FROM PORT DEST PORT/IP ENABLED | 133 | | NAME | FROM PORT | DEST PORT/IP | ENABLED | |
| 139 | ------- ------ ------ ----------------- --------- | 134 | |-------|-----------|-----------------|---------| |
| 140 | HTTP \*\* 80 xxx.xxx.xxx.xxx TRUE | 135 | | HTTP | 80 | xxx.xxx.xxx.xxx | TRUE | |
| 141 | HTTPS \*\* 443 xxx.xxx.xxx.xxx TRUE | 136 | | HTTPS | 443 | xxx.xxx.xxx.xxx | TRUE | |
| 142 | 137 | ||
| 143 | Once configured, these rules will direct all web traffic to your reverse | 138 | Once configured, these rules will direct all web traffic to your reverse proxy. |
| 144 | proxy. | ||
| 145 | 139 | ||
| 146 | ## Step 3: Nginx Installation | 140 | ## Step 3: Nginx Installation |
| 147 | 141 | ||
| @@ -151,12 +145,11 @@ To install Nginx, simply run the following command: | |||
| 151 | sudo apt install nginx | 145 | sudo apt install nginx |
| 152 | ``` | 146 | ``` |
| 153 | 147 | ||
| 154 | If you have a firewall enabled, open up ports `80` and | 148 | If you have a firewall enabled, open up ports `80` and `443` on your server so |
| 155 | `443` on your server so that Nginx can accept web traffic | 149 | that Nginx can accept web traffic from the router. |
| 156 | from the router. | ||
| 157 | 150 | ||
| 158 | For example, if you want to use `ufw` for web traffic and | 151 | For example, if you want to use `ufw` for web traffic and SSH, run the following |
| 159 | SSH, run the following commands: | 152 | commands: |
| 160 | 153 | ||
| 161 | ```sh | 154 | ```sh |
| 162 | sudo ufw allow 'Nginx Full' | 155 | sudo ufw allow 'Nginx Full' |
| @@ -166,14 +159,12 @@ sudo ufw enable | |||
| 166 | 159 | ||
| 167 | ## Step 4: Nginx Configuration | 160 | ## Step 4: Nginx Configuration |
| 168 | 161 | ||
| 169 | Now that we have domains pointing toward the server, the only step left | 162 | Now that we have domains pointing toward the server, the only step left is to |
| 170 | is to configure the reverse proxy to direct traffic from domains to | 163 | configure the reverse proxy to direct traffic from domains to local services. |
| 171 | local services. | ||
| 172 | 164 | ||
| 173 | To start, you\'ll need to create a configuration file for each domain in | 165 | To start, you'll need to create a configuration file for each domain in |
| 174 | `/etc/nginx/sites-available/`. They will look identical | 166 | `/etc/nginx/sites-available/`. They will look identical except for the |
| 175 | except for the `server_name` variable and the | 167 | `server_name` variable and the `proxy_pass` port. |
| 176 | `proxy_pass` port. | ||
| 177 | 168 | ||
| 178 | Dashy: | 169 | Dashy: |
| 179 | 170 | ||
| @@ -209,8 +200,8 @@ server { | |||
| 209 | } | 200 | } |
| 210 | ``` | 201 | ``` |
| 211 | 202 | ||
| 212 | Once the configuration files are created, you will need to enable them | 203 | Once the configuration files are created, you will need to enable them with the |
| 213 | with the `symlink` command: | 204 | `symlink` command: |
| 214 | 205 | ||
| 215 | ```sh | 206 | ```sh |
| 216 | sudo ln -s /etc/nginx/sites-available/dashy.example.com /etc/nginx/sites-enabled/ | 207 | sudo ln -s /etc/nginx/sites-available/dashy.example.com /etc/nginx/sites-enabled/ |
| @@ -220,12 +211,12 @@ Voilà! Your local services should now be available through their URLs. | |||
| 220 | 211 | ||
| 221 | # HTTPS with Certbot | 212 | # HTTPS with Certbot |
| 222 | 213 | ||
| 223 | If you\'ve followed along, you\'ll notice that your services are only | 214 | If you've followed along, you'll notice that your services are only available |
| 224 | available via HTTP (not HTTPS). | 215 | via HTTP (not HTTPS). |
| 225 | 216 | ||
| 226 | If you want to enable HTTPS for your new domains, you will need to | 217 | If you want to enable HTTPS for your new domains, you will need to generate |
| 227 | generate SSL/TLS certificates for them. The easiest way to generate | 218 | SSL/TLS certificates for them. The easiest way to generate certificates on Nginx |
| 228 | certificates on Nginx is [Certbot](https://certbot.eff.org): | 219 | is [Certbot](https://certbot.eff.org): |
| 229 | 220 | ||
| 230 | ```sh | 221 | ```sh |
| 231 | sudo apt install snapd; sudo snap install core; sudo snap refresh core | 222 | sudo apt install snapd; sudo snap install core; sudo snap refresh core |
content/blog/2022-04-09-pinetime.md +78 −84
| @@ -9,48 +9,46 @@ draft = false | |||
| 9 | 9 | ||
| 10 | ## Overview | 10 | ## Overview |
| 11 | 11 | ||
| 12 | The [PineTime](https://www.pine64.org/pinetime/) is an open-source | 12 | The [PineTime](https://www.pine64.org/pinetime/) is an open-source smartwatch, |
| 13 | smartwatch, created by [PINE64](https://www.pine64.org). Originally | 13 | created by [PINE64](https://www.pine64.org). Originally announced in September |
| 14 | announced in September 2019, this ARM-based watch is a fantastic option | 14 | 2019, this ARM-based watch is a fantastic option for users who want the benefits |
| 15 | for users who want the benefits of a modern smartwatch with the backing | 15 | of a modern smartwatch with the backing of open-source components and software. |
| 16 | of open-source components and software. | ||
| 17 | 16 | ||
| 18 | ## Product Specifications | 17 | ## Product Specifications |
| 19 | 18 | ||
| 20 | I won\'t dive into too many details that you can find on [the product | 19 | I won't dive into too many details that you can find on [the product |
| 21 | page](https://www.pine64.org/pinetime/), but I wanted to point out the | 20 | page](https://www.pine64.org/pinetime/), but I wanted to point out the prices |
| 22 | prices for each watch and the primary functions: | 21 | for each watch and the primary functions: |
| 23 | 22 | ||
| 24 | 1. Price: | 23 | 1. Price: |
| 25 | 24 | ||
| 26 | - \$26.99 (Sealed) | 25 | - $26.99 (Sealed) |
| 27 | - \$24.99 (Dev Kit) | 26 | - $24.99 (Dev Kit) |
| 28 | - \$51.98 (One Sealed + One Dev Kit) | 27 | - $51.98 (One Sealed + One Dev Kit) |
| 29 | 28 | ||
| 30 | 2. Primary Functionality: | 29 | 2. Primary Functionality: |
| 31 | 30 | ||
| 32 | - Clock (+ Smartphone Sync) | 31 | - Clock (+ Smartphone Sync) |
| 33 | - Pedometer | 32 | - Pedometer |
| 34 | - Heart Rate Monitor | 33 | - Heart Rate Monitor |
| 35 | - Sleep Monitor | 34 | - Sleep Monitor |
| 36 | - Calories burned | 35 | - Calories burned |
| 37 | - Messaging | 36 | - Messaging |
| 38 | - Smartphone Notifications | 37 | - Smartphone Notifications |
| 39 | - Media Controls | 38 | - Media Controls |
| 40 | 39 | ||
| 41 | # Unboxing | 40 | # Unboxing |
| 42 | 41 | ||
| 43 | Now, my PineTime was ordered on 2022-02-17, shipped on 2022-02-22, and | 42 | Now, my PineTime was ordered on 2022-02-17, shipped on 2022-02-22, and was |
| 44 | was delivered on 2022-03-23. With the current delays on shipping times | 43 | delivered on 2022-03-23. With the current delays on shipping times around the |
| 45 | around the world (and the semiconductor shortage), a month for delivery | 44 | world (and the semiconductor shortage), a month for delivery from China seems |
| 46 | from China seems reasonable to me. | 45 | reasonable to me. |
| 47 | 46 | ||
| 48 | The packaging is simple, and the watch comes with instructions, | 47 | The packaging is simple, and the watch comes with instructions, technical |
| 49 | technical information, the watch, and a charger (it does not include a | 48 | information, the watch, and a charger (it does not include a USB wall adapter). |
| 50 | USB wall adapter). | ||
| 51 | 49 | ||
| 52 | The watch itself was able to turn on immediately when I pulled it out of | 50 | The watch itself was able to turn on immediately when I pulled it out of the |
| 53 | the box, but the battery was depleted and required charging right away. | 51 | box, but the battery was depleted and required charging right away. |
| 54 | 52 | ||
| 55 |  | 54 | Contents](https://img.cleberg.net/blog/20220409-pinetime-smart-watch/pinetime_box_contents.png) |
| @@ -59,62 +57,60 @@ Contents](https://img.cleberg.net/blog/20220409-pinetime-smart-watch/pinetime_bo | |||
| 59 | 57 | ||
| 60 | ## Watch OS: InfiniTime | 58 | ## Watch OS: InfiniTime |
| 61 | 59 | ||
| 62 | While turning on the watch for the first time, some of the main design | 60 | While turning on the watch for the first time, some of the main design choices |
| 63 | choices you can see in the watch OS, | 61 | you can see in the watch OS, |
| 64 | [InfiniTime](https://wiki.pine64.org/wiki/InfiniTime), are: | 62 | [InfiniTime](https://wiki.pine64.org/wiki/InfiniTime), are: |
| 65 | 63 | ||
| 66 | - A square bezel, not too thin against the sides of the watch. | 64 | - A square bezel, not too thin against the sides of the watch. |
| 67 | - A simple, rubber band. | 65 | - A simple, rubber band. |
| 68 | - Basic font and screen pixel design. | 66 | - Basic font and screen pixel design. |
| 69 | - Swipe gestures to access other screens. | 67 | - Swipe gestures to access other screens. |
| 70 | 68 | ||
| 71 |  | 70 | Screens](https://img.cleberg.net/blog/20220409-pinetime-smart-watch/pinetime.png) |
| 73 | 71 | ||
| 74 | The OS itself is fantastic in terms of functionality for me. It does | 72 | The OS itself is fantastic in terms of functionality for me. It does exactly |
| 75 | exactly what a smartwatch should do - track time, steps, heart rates, | 73 | what a smartwatch should do - track time, steps, heart rates, and connect to |
| 76 | and connect to another smart device, without being overly burdensome to | 74 | another smart device, without being overly burdensome to the user. |
| 77 | the user. | ||
| 78 | 75 | ||
| 79 | My only gripe so far is that it\'s *really* difficult to swipe to | 76 | My only gripe so far is that it's *really* difficult to swipe to different |
| 80 | different screens, such as pulling down the notification tray. I\'m not | 77 | screens, such as pulling down the notification tray. I'm not sure if this is an |
| 81 | sure if this is an OS or hardware issue, but it makes it quite hard to | 78 | OS or hardware issue, but it makes it quite hard to quickly move around the |
| 82 | quickly move around the screens. | 79 | screens. |
| 83 | 80 | ||
| 84 | However, my absolute favorite design choice is that the button the side | 81 | However, my absolute favorite design choice is that the button the side turns |
| 85 | turns the screen on and off and tilting/waving my wrist doesn\'t | 82 | the screen on and off and tilting/waving my wrist doesn't accidentally turn on |
| 86 | accidentally turn on the screen. With other watches, I absolutely hated | 83 | the screen. With other watches, I absolutely hated not being able to turn off |
| 87 | not being able to turn off the raise-to-wake or wave features (i.e., | 84 | the raise-to-wake or wave features (i.e., blinding myself while wearing a watch |
| 88 | blinding myself while wearing a watch at night because I moved my arm). | 85 | at night because I moved my arm). |
| 89 | 86 | ||
| 90 | ## iOS App: InfiniLink | 87 | ## iOS App: InfiniLink |
| 91 | 88 | ||
| 92 | Since I am using iOS as my primary mobile device OS, I am using the | 89 | Since I am using iOS as my primary mobile device OS, I am using the |
| 93 | [InfiniLink](https://github.com/xan-m/InfiniLink) app to connect my | 90 | [InfiniLink](https://github.com/xan-m/InfiniLink) app to connect my watch. |
| 94 | watch. | ||
| 95 | 91 | ||
| 96 | This app provides the following for PineTime owners: | 92 | This app provides the following for PineTime owners: |
| 97 | 93 | ||
| 98 | - Firmware updates | 94 | - Firmware updates |
| 99 | - Steps | 95 | - Steps |
| 100 | - Charts | 96 | - Charts |
| 101 | - Notifications | 97 | - Notifications |
| 102 | 98 | ||
| 103 | I mashed up a few screenshots to show off the home page, menu, firmware | 99 | I mashed up a few screenshots to show off the home page, menu, firmware update, |
| 104 | update, and notification test screens: | 100 | and notification test screens: |
| 105 | 101 | ||
| 106 |  | 103 | Home](https://img.cleberg.net/blog/20220409-pinetime-smart-watch/infinilink_home.png) |
| 108 | 104 | ||
| 109 | Another big feature of InfiniLink is the ability to track pedometer | 105 | Another big feature of InfiniLink is the ability to track pedometer steps in a |
| 110 | steps in a collection of beautiful graphs, with the option to change | 106 | collection of beautiful graphs, with the option to change your step goal and add |
| 111 | your step goal and add in manual steps. | 107 | in manual steps. |
| 112 | 108 | ||
| 113 |  | 110 | Steps](https://img.cleberg.net/blog/20220409-pinetime-smart-watch/infinilink_steps.png) |
| 115 | 111 | ||
| 116 | Finally, there are charts to display the battery percentage and heart | 112 | Finally, there are charts to display the battery percentage and heart rates over |
| 117 | rates over time. This area also comes with an option to clear data. | 113 | time. This area also comes with an option to clear data. |
| 118 | 114 | ||
| 119 |  | 116 | Charts](https://img.cleberg.net/blog/20220409-pinetime-smart-watch/infinilink_charts.png) |
| @@ -123,36 +119,34 @@ Charts](https://img.cleberg.net/blog/20220409-pinetime-smart-watch/infinilink_ch | |||
| 123 | 119 | ||
| 124 | ## Pros | 120 | ## Pros |
| 125 | 121 | ||
| 126 | After wearing my watch for a few weeks, I have mostly positive thoughts | 122 | After wearing my watch for a few weeks, I have mostly positive thoughts about |
| 127 | about the watch so far. In the past, I have owned smartwatches by | 123 | the watch so far. In the past, I have owned smartwatches by FitBit, Fossil, |
| 128 | FitBit, Fossil, Apple, etc. - **but I prefer the PineTime over all of | 124 | Apple, etc. - **but I prefer the PineTime over all of those watches**. |
| 129 | those watches**. | ||
| 130 | 125 | ||
| 131 | The PineTime strips out all the unnecessary features and performs the | 126 | The PineTime strips out all the unnecessary features and performs the functions |
| 132 | functions that it provides effectively and efficiently. | 127 | that it provides effectively and efficiently. |
| 133 | 128 | ||
| 134 | The battery life is amazing on this device. By default, the watch seems | 129 | The battery life is amazing on this device. By default, the watch seems to last |
| 135 | to last anywhere from a few days to a week before dying. | 130 | anywhere from a few days to a week before dying. |
| 136 | 131 | ||
| 137 | And of course, it\'s open source and backed by some of the most | 132 | And of course, it's open source and backed by some of the most dedicated |
| 138 | dedicated enthusiasts and developers I\'ve seen. Watching the Matrix | 133 | enthusiasts and developers I've seen. Watching the Matrix channel, forums, and |
| 139 | channel, forums, and website have been exciting to see. | 134 | website have been exciting to see. |
| 140 | 135 | ||
| 141 | ## Cons | 136 | ## Cons |
| 142 | 137 | ||
| 143 | If I had to complain about anything, it would simply be the small bugs | 138 | If I had to complain about anything, it would simply be the small bugs in some |
| 144 | in some features that can be contributed to the companion apps more than | 139 | features that can be contributed to the companion apps more than the watch |
| 145 | the watch itself. | 140 | itself. |
| 146 | 141 | ||
| 147 | A regular user would want native notification support out-of-the-box, | 142 | A regular user would want native notification support out-of-the-box, which is |
| 148 | which is the biggest item not working for me at the moment. | 143 | the biggest item not working for me at the moment. |
| 149 | 144 | ||
| 150 | My only other complaint is that the battery indicator on the watch | 145 | My only other complaint is that the battery indicator on the watch doesn't seem |
| 151 | doesn\'t seem accurate when it\'s nearing depletion - it seems that | 146 | accurate when it's nearing depletion - it seems that there's a bit of battery |
| 152 | there\'s a bit of battery life left and then my watch is dead very | 147 | life left and then my watch is dead very suddenly after. This could just be me |
| 153 | suddenly after. This could just be me misinterpreting the battery level | 148 | misinterpreting the battery level icons, but it has fooled me a few times into |
| 154 | icons, but it has fooled me a few times into thinking I had more battery | 149 | thinking I had more battery left than I actually did. |
| 155 | left than I actually did. | ||
| 156 | 150 | ||
| 157 | Other than those small items, I really do love this watch and am glad I | 151 | Other than those small items, I really do love this watch and am glad I replaced |
| 158 | replaced my Apple Watch with the PineTime. | 152 | my Apple Watch with the PineTime. |
content/blog/2022-06-01-ditching-cloudflare.md +52 −58
| @@ -7,89 +7,83 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Registrar | 8 | # Registrar |
| 9 | 9 | ||
| 10 | After spending a year or so using Cloudflare for DNS only - no proxying | 10 | After spending a year or so using Cloudflare for DNS only - no proxying or |
| 11 | or applications - I spent the last few months using Cloudflare Tunnels | 11 | applications - I spent the last few months using Cloudflare Tunnels and |
| 12 | and Cloudflare Access to protect my self-hosted websites and | 12 | Cloudflare Access to protect my self-hosted websites and applications via their |
| 13 | applications via their proxy traffic model. | 13 | proxy traffic model. |
| 14 | 14 | ||
| 15 | However, I have never liked using Cloudflare due to their increasingly | 15 | However, I have never liked using Cloudflare due to their increasingly large |
| 16 | large share of control over web traffic, as well as their business model | 16 | share of control over web traffic, as well as their business model of being a |
| 17 | of being a MITM for all of your traffic. | 17 | MITM for all of your traffic. |
| 18 | 18 | ||
| 19 | So, as of today, I have switched over to [Njalla](https://njal.la) as my | 19 | So, as of today, I have switched over to [Njalla](https://njal.la) as my |
| 20 | registrar and DNS manager. I was able to easily transfer my domains over | 20 | registrar and DNS manager. I was able to easily transfer my domains over |
| 21 | rapidly, with only one domain taking more than 15-30 minutes to | 21 | rapidly, with only one domain taking more than 15-30 minutes to propagate. |
| 22 | propagate. | ||
| 23 | 22 | ||
| 24 | +I do still have two domains sitting at Cloudflare for the moment while | 23 | +I do still have two domains sitting at Cloudflare for the moment while I decide |
| 25 | I decide if they\'re worth the higher rates (one domain is 30€ and the | 24 | if they're worth the higher rates (one domain is 30€ and the other is 45€).+ |
| 26 | other is 45€).+ | ||
| 27 | 25 | ||
| 28 | > **Update (2022.06.03)**: I ended up transferring my final two domains | 26 | > **Update (2022.06.03)**: I ended up transferring my final two domains over to |
| 29 | > over to Njalla, clearing my Cloudflare account of personal data, and | 27 | > Njalla, clearing my Cloudflare account of personal data, and deleting the |
| 30 | > deleting the Cloudflare account entirely. *I actually feel relieved to | 28 | > Cloudflare account entirely. *I actually feel relieved to have moved on to a |
| 31 | > have moved on to a provider I trust.* | 29 | > provider I trust.* |
| 32 | 30 | ||
| 33 | # DNS | 31 | # DNS |
| 34 | 32 | ||
| 35 | As noted above, I\'m using Njalla exclusively for DNS configurations on | 33 | As noted above, I'm using Njalla exclusively for DNS configurations on my |
| 36 | my domains. | 34 | domains. |
| 37 | 35 | ||
| 38 | However, the transfer process was not ideal. As soon as the domains | 36 | However, the transfer process was not ideal. As soon as the domains transferred |
| 39 | transferred over, I switched the nameservers from Cloudflare to Njalla | 37 | over, I switched the nameservers from Cloudflare to Njalla and lost most of the |
| 40 | and lost most of the associated DNS records. So, the majority of the | 38 | associated DNS records. So, the majority of the time spent during the migration |
| 41 | time spent during the migration was simply re-typing all the DNS records | 39 | was simply re-typing all the DNS records back in one-by-one. |
| 42 | back in one-by-one. | ||
| 43 | 40 | ||
| 44 | This would be much simpler if I were able to edit the plain-text format | 41 | This would be much simpler if I were able to edit the plain-text format of the |
| 45 | of the DNS configuration. I was able to do that at a past registrar | 42 | DNS configuration. I was able to do that at a past registrar (perhaps it was |
| 46 | (perhaps it was [Gandi.net](https://gandi.net/)?) and it made life a lot | 43 | [Gandi.net](https://gandi.net/)?) and it made life a lot easier. |
| 47 | easier. | ||
| 48 | 44 | ||
| 49 | ## Dynamic DNS Updates | 45 | ## Dynamic DNS Updates |
| 50 | 46 | ||
| 51 | I have built an easy Python script to run (or set-up in | 47 | I have built an easy Python script to run (or set-up in `cron` to run |
| 52 | `cron` to run automatically) that will check my server\'s | 48 | automatically) that will check my server's IPv4 and IPv6, compare it to Njalla, |
| 53 | IPv4 and IPv6, compare it to Njalla, and update the DNS records if they | 49 | and update the DNS records if they don't match. You can see the full script and |
| 54 | don\'t match. You can see the full script and process in my other post: | 50 | process in my other post: [Updating Dynamic DNS with Njalla |
| 55 | [Updating Dynamic DNS with Njalla API](../njalla-dns-api/). | 51 | API](../njalla-dns-api/). |
| 56 | 52 | ||
| 57 | I haven\'t used this other method, but I do know that you can create | 53 | I haven't used this other method, but I do know that you can create `Dynamic` |
| 58 | `Dynamic` DNS records with Njalla that [work for updating | 54 | DNS records with Njalla that [work for updating dynamic |
| 59 | dynamic subdomains](https://njal.la/docs/ddns/). | 55 | subdomains](https://njal.la/docs/ddns/). |
| 60 | 56 | ||
| 61 | ## Njalla\'s DNS Tool | 57 | ## Njalla's DNS Tool |
| 62 | 58 | ||
| 63 | One neat upside to Njalla is that they have a [DNS lookup | 59 | One neat upside to Njalla is that they have a [DNS lookup |
| 64 | tool](https://check.njal.la/dns/) that provides a lot of great | 60 | tool](https://check.njal.la/dns/) that provides a lot of great information for |
| 65 | information for those of you (AKA: me) who hate using the | 61 | those of you (AKA: me) who hate using the `dig` command. |
| 66 | `dig` command. | ||
| 67 | 62 | ||
| 68 | This was very useful for monitoring a couple of my transferred domains | 63 | This was very useful for monitoring a couple of my transferred domains to see |
| 69 | to see when the changes in nameservers, records, and DNSSEC went into | 64 | when the changes in nameservers, records, and DNSSEC went into effect. |
| 70 | effect. | ||
| 71 | 65 | ||
| 72 | # Tunnel | 66 | # Tunnel |
| 73 | 67 | ||
| 74 | Cloudflare Tunnel is a service that acts as a reverse-proxy (hosted on | 68 | Cloudflare Tunnel is a service that acts as a reverse-proxy (hosted on |
| 75 | Cloudflare\'s servers) and allowed me to mask the private IP address of | 69 | Cloudflare's servers) and allowed me to mask the private IP address of the |
| 76 | the server hosting my various websites and apps. | 70 | server hosting my various websites and apps. |
| 77 | 71 | ||
| 78 | However, as I was moving away from Cloudflare, I was not able to find a | 72 | However, as I was moving away from Cloudflare, I was not able to find a suitable |
| 79 | suitable replacement that was both inexpensive and simple. So, I simply | 73 | replacement that was both inexpensive and simple. So, I simply went back to |
| 80 | went back to hosting [my own reverse proxy with | 74 | hosting [my own reverse proxy with |
| 81 | Nginx](file:///blog/set-up-nginx-reverse-proxy/). With the recent | 75 | Nginx](file:///blog/set-up-nginx-reverse-proxy/). With the recent additions of |
| 82 | additions of Unifi hardware in my server/network rack, I am much more | 76 | Unifi hardware in my server/network rack, I am much more protected against spam |
| 83 | protected against spam and malicious attacks at the network edge than I | 77 | and malicious attacks at the network edge than I was before I switched to |
| 84 | was before I switched to Cloudflare. | 78 | Cloudflare. |
| 85 | 79 | ||
| 86 | # Access | 80 | # Access |
| 87 | 81 | ||
| 88 | Cloudflare Access, another app I used in combination with Cloudflare | 82 | Cloudflare Access, another app I used in combination with Cloudflare Tunnel, |
| 89 | Tunnel, provided an authentication screen that required you to enter | 83 | provided an authentication screen that required you to enter valid credentials |
| 90 | valid credentials before Cloudflare would forward you to the actual | 84 | before Cloudflare would forward you to the actual website or app (if the |
| 91 | website or app (if the website/app has their own authentication, you\'d | 85 | website/app has their own authentication, you'd then have to authenticate a |
| 92 | then have to authenticate a second time). | 86 | second time). |
| 93 | 87 | ||
| 94 | I did not replace this service with anything since I only host a handful | 88 | I did not replace this service with anything since I only host a handful of |
| 95 | of non-sensitive apps that don\'t require duplicate authentication. | 89 | non-sensitive apps that don't require duplicate authentication. |
content/blog/2022-06-07-self-hosting-freshrss.md +75 −92
| @@ -7,46 +7,43 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Why RSS? | 8 | # Why RSS? |
| 9 | 9 | ||
| 10 | After noticing that I have collected 50+ blogs as bookmarks, I decided | 10 | After noticing that I have collected 50+ blogs as bookmarks, I decided to |
| 11 | to migrate back to using RSS feeds to stay up-to-date with my favorite | 11 | migrate back to using RSS feeds to stay up-to-date with my favorite websites. |
| 12 | websites. Using RSS allows me to read all of these posts in a single app | 12 | Using RSS allows me to read all of these posts in a single app (on both mobile & |
| 13 | (on both mobile & desktop) and allows me to be notified when new posts | 13 | desktop) and allows me to be notified when new posts are available. |
| 14 | are available. | ||
| 15 | 14 | ||
| 16 | However, I ran into one issue: syncing subscriptions and read/unread | 15 | However, I ran into one issue: syncing subscriptions and read/unread posts |
| 17 | posts across devices. Since I want to be able to easily read on both | 16 | across devices. Since I want to be able to easily read on both mobile and |
| 18 | mobile and desktop, I decided to look for a self-hosted RSS solution. | 17 | desktop, I decided to look for a self-hosted RSS solution. |
| 19 | 18 | ||
| 20 | Thus, I found [FreshRSS](https://www.freshrss.org/) and was able to | 19 | Thus, I found [FreshRSS](https://www.freshrss.org/) and was able to successfully |
| 21 | successfully install it on my server in about 30 minutes. | 20 | install it on my server in about 30 minutes. |
| 22 | 21 | ||
| 23 | # Documentation | 22 | # Documentation |
| 24 | 23 | ||
| 25 | While it\'s certainly not robust, the [FreshRSS | 24 | While it's certainly not robust, the [FreshRSS |
| 26 | documentation](https://freshrss.github.io/FreshRSS/) is helpful for | 25 | documentation](https://freshrss.github.io/FreshRSS/) is helpful for figuring out |
| 27 | figuring out basic information about the service. | 26 | basic information about the service. |
| 28 | 27 | ||
| 29 | However, I wanted to install this service as a Docker container and | 28 | However, I wanted to install this service as a Docker container and stumbled |
| 30 | stumbled across the [Docker | 29 | across the [Docker |
| 31 | README](https://github.com/FreshRSS/FreshRSS/tree/edge/Docker) within | 30 | README](https://github.com/FreshRSS/FreshRSS/tree/edge/Docker) within the GitHub |
| 32 | the GitHub repository. | 31 | repository. |
| 33 | 32 | ||
| 34 | This README was the documentation I actually needed. However, as you\'ll | 33 | This README was the documentation I actually needed. However, as you'll see |
| 35 | see below, I still had to manually edit one file | 34 | below, I still had to manually edit one file (`config.php`) to access the API |
| 36 | (`config.php`) to access the API externally via my RSS apps. | 35 | externally via my RSS apps. |
| 37 | 36 | ||
| 38 | # Installation | 37 | # Installation |
| 39 | 38 | ||
| 40 | ## DNS | 39 | ## DNS |
| 41 | 40 | ||
| 42 | The first step, as required by any external web service, was assigning a | 41 | The first step, as required by any external web service, was assigning a domain |
| 43 | domain name to use. I chose to use a subdomain, like | 42 | name to use. I chose to use a subdomain, like `rss.example.com`. |
| 44 | `rss.example.com`. | ||
| 45 | 43 | ||
| 46 | To assign this, I created an `A` record in my DNS settings | 44 | To assign this, I created an `A` record in my DNS settings with the IPv4 address |
| 47 | with the IPv4 address of the server and an `AAAA` record with | 45 | of the server and an `AAAA` record with the IPv6 address of the server. Note: |
| 48 | the IPv6 address of the server. Note: assigning an IPv6 | 46 | assigning an IPv6 (`AAAA`) record is optional, but I like to enable IPV6 for my |
| 49 | (`AAAA`) record is optional, but I like to enable IPV6 for my | ||
| 50 | services. | 47 | services. |
| 51 | 48 | ||
| 52 | ``` config | 49 | ``` config |
| @@ -56,15 +53,13 @@ rss.example.com AAAA xxxx:xxxx: ... :xxxx | |||
| 56 | 53 | ||
| 57 | ## Docker | 54 | ## Docker |
| 58 | 55 | ||
| 59 | I initially tried to set up a `docker-compose.yml` file with | 56 | I initially tried to set up a `docker-compose.yml` file with a `.env` file |
| 60 | a `.env` file because I prefer to have a file I can look back | 57 | because I prefer to have a file I can look back at later to see how I initially |
| 61 | at later to see how I initially started the container, but it simply | 58 | started the container, but it simply wouldn't work for me. I'm not sure why, |
| 62 | wouldn\'t work for me. I\'m not sure why, but I assume I wasn\'t telling | 59 | but I assume I wasn't telling `docker-compose` where the `.env` file was. |
| 63 | `docker-compose` where the `.env` file was. | ||
| 64 | 60 | ||
| 65 | Regardless, I chose to simply run the service with | 61 | Regardless, I chose to simply run the service with `docker run`. See the |
| 66 | `docker run`. See the following command for my | 62 | following command for my `docker run` configuration: |
| 67 | `docker run` configuration: | ||
| 68 | 63 | ||
| 69 | ```sh | 64 | ```sh |
| 70 | sudo docker run -d --restart unless-stopped --log-opt max-size=10m \ | 65 | sudo docker run -d --restart unless-stopped --log-opt max-size=10m \ |
| @@ -77,32 +72,29 @@ sudo docker run -d --restart unless-stopped --log-opt max-size=10m \ | |||
| 77 | freshrss/freshrss | 72 | freshrss/freshrss |
| 78 | ``` | 73 | ``` |
| 79 | 74 | ||
| 80 | This started the container successfully and allowed me to visit the | 75 | This started the container successfully and allowed me to visit the FreshRSS |
| 81 | FreshRSS instance at `localhost:8080`. | 76 | instance at `localhost:8080`. |
| 82 | 77 | ||
| 83 | ## Fresh RSS Set-Up | 78 | ## Fresh RSS Set-Up |
| 84 | 79 | ||
| 85 | I **HIGHLY\*** suggest that you set up your user account prior to | 80 | I **HIGHLY** suggest that you set up your user account prior to exposing this |
| 86 | exposing this service to the public. It\'s unlikely that someone is | 81 | service to the public. It's unlikely that someone is trying to access the exact |
| 87 | trying to access the exact domain or IP/port you\'re assigning here, but | 82 | domain or IP/port you're assigning here, but as soon as you expose this |
| 88 | as soon as you expose this service, the first person to open the URL | 83 | service, the first person to open the URL will be able to create the admin user. |
| 89 | will be able to create the admin user. | ||
| 90 | 84 | ||
| 91 | In order to set up your FreshRSS service, open the | 85 | In order to set up your FreshRSS service, open the `localhost:8080` URL in your |
| 92 | `localhost:8080` URL in your browser (you may need to use a | 86 | browser (you may need to use a local IP instead of `localhost` if you're |
| 93 | local IP instead of `localhost` if you\'re accessing the page | 87 | accessing the page from a different machine on the network - e.g., |
| 94 | from a different machine on the network - e.g., | ||
| 95 | `192.168.1.20:8080`). | 88 | `192.168.1.20:8080`). |
| 96 | 89 | ||
| 97 | Once the page loads, set up your default user with a strong username and | 90 | Once the page loads, set up your default user with a strong username and |
| 98 | password. You may also choose to configure other settings prior to | 91 | password. You may also choose to configure other settings prior to exposing this |
| 99 | exposing this service. | 92 | service. |
| 100 | 93 | ||
| 101 | ## Nginx Reverse-Proxy | 94 | ## Nginx Reverse-Proxy |
| 102 | 95 | ||
| 103 | In order to access this service outside my home, I needed to set up a | 96 | In order to access this service outside my home, I needed to set up a |
| 104 | reverse-proxy to connect `localhost:8080` to | 97 | reverse-proxy to connect `localhost:8080` to `rss.example.com`. |
| 105 | `rss.example.com`. | ||
| 106 | 98 | ||
| 107 | First, I created a new Nginx configuration file: | 99 | First, I created a new Nginx configuration file: |
| 108 | 100 | ||
| @@ -143,8 +135,7 @@ server { | |||
| 143 | } | 135 | } |
| 144 | ``` | 136 | ``` |
| 145 | 137 | ||
| 146 | Finally, restart Nginx and you will be able to access your service via | 138 | Finally, restart Nginx and you will be able to access your service via HTTP: |
| 147 | HTTP: | ||
| 148 | 139 | ||
| 149 | ```sh | 140 | ```sh |
| 150 | sudo systemctl restart nginx.service | 141 | sudo systemctl restart nginx.service |
| @@ -152,51 +143,46 @@ sudo systemctl restart nginx.service | |||
| 152 | 143 | ||
| 153 | ## HTTPS | 144 | ## HTTPS |
| 154 | 145 | ||
| 155 | However, I don\'t want to access my RSS feeds via HTTP. I want it | 146 | However, I don't want to access my RSS feeds via HTTP. I want it available only |
| 156 | available only via HTTPS. In order to do this, I ran the | 147 | via HTTPS. In order to do this, I ran the [certbot](https://certbot.eff.org/) |
| 157 | [certbot](https://certbot.eff.org/) program to generate SSL certificates | 148 | program to generate SSL certificates for me: |
| 158 | for me: | ||
| 159 | 149 | ||
| 160 | ```sh | 150 | ```sh |
| 161 | sudo certbot --nginx | 151 | sudo certbot --nginx |
| 162 | ``` | 152 | ``` |
| 163 | 153 | ||
| 164 | This process will automatically generate an SSL certificate for you and | 154 | This process will automatically generate an SSL certificate for you and modify |
| 165 | modify the Nginx configuration file to include a redirect from HTTP to | 155 | the Nginx configuration file to include a redirect from HTTP to HTTPS. |
| 166 | HTTPS. | ||
| 167 | 156 | ||
| 168 | # Post-Installation Fixes | 157 | # Post-Installation Fixes |
| 169 | 158 | ||
| 170 | At this point, we have a functional FreshRSS website, available from | 159 | At this point, we have a functional FreshRSS website, available from anywhere |
| 171 | anywhere and secured with HTTPS. However, attempting to connect this | 160 | and secured with HTTPS. However, attempting to connect this service to an RSS |
| 172 | service to an RSS app resulted in many errors regarding unavailable URLs | 161 | app resulted in many errors regarding unavailable URLs and incorrect |
| 173 | and incorrect credentials. | 162 | credentials. |
| 174 | 163 | ||
| 175 | ## API Set-Up | 164 | ## API Set-Up |
| 176 | 165 | ||
| 177 | First, you need to open your user profile in FreshRSS | 166 | First, you need to open your user profile in FreshRSS (`Settings` > `Profile`) |
| 178 | (`Settings` \> `Profile`) and set an API password | 167 | and set an API password in the field at the bottom. This is the password you |
| 179 | in the field at the bottom. This is the password you will need to | 168 | will need to provide to your RSS apps. |
| 180 | provide to your RSS apps. | ||
| 181 | 169 | ||
| 182 | Once that is set and saved, click the link below the API password field | 170 | Once that is set and saved, click the link below the API password field to open |
| 183 | to open the API check tool. It should look something like | 171 | the API check tool. It should look something like `https://localhost:8080/api/` |
| 184 | `https://localhost:8080/api/` or | 172 | or `https://rss.example.com/api/`. |
| 185 | `https://rss.example.com/api/`. | ||
| 186 | 173 | ||
| 187 | Within this page, you *should* see your correct external URL and | 174 | Within this page, you *should* see your correct external URL and "PASS" at the |
| 188 | \"PASS\" at the bottom of each API type. This would mean everything is | 175 | bottom of each API type. This would mean everything is set up correctly, and you |
| 189 | set up correctly, and you can now move on and login to any RSS apps that | 176 | can now move on and login to any RSS apps that support self-hosted options. |
| 190 | support self-hosted options. | ||
| 191 | 177 | ||
| 192 | In my case, the URL showed an internal URL and I had a warning that the | 178 | In my case, the URL showed an internal URL and I had a warning that the |
| 193 | `base_url` variable may be misconfigured. If this is the | 179 | `base_url` variable may be misconfigured. If this is the case, see the next |
| 194 | case, see the next section for a fix. | 180 | section for a fix. |
| 195 | 181 | ||
| 196 | ## Base URL Fix | 182 | ## Base URL Fix |
| 197 | 183 | ||
| 198 | In order to fix the `base_url` for the API, I opened up my | 184 | In order to fix the `base_url` for the API, I opened up my docker container with |
| 199 | docker container with the following command: | 185 | the following command: |
| 200 | 186 | ||
| 201 | ```sh | 187 | ```sh |
| 202 | sudo docker exec -it freshrss bash | 188 | sudo docker exec -it freshrss bash |
| @@ -209,17 +195,15 @@ apt-get update | |||
| 209 | apt-get install nano | 195 | apt-get install nano |
| 210 | ``` | 196 | ``` |
| 211 | 197 | ||
| 212 | Finally, open up `config.php` in the `data` | 198 | Finally, open up `config.php` in the `data` directory: |
| 213 | directory: | ||
| 214 | 199 | ||
| 215 | ```sh | 200 | ```sh |
| 216 | nano data/config.php | 201 | nano data/config.php |
| 217 | ``` | 202 | ``` |
| 218 | 203 | ||
| 219 | Within `config.php`, you will need to update the | 204 | Within `config.php`, you will need to update the `base_url` variable and update |
| 220 | `base_url` variable and update it to match your external URL. | 205 | it to match your external URL. In my case, I simply commented-out the incorrect |
| 221 | In my case, I simply commented-out the incorrect URL with | 206 | URL with `//` and added the correct one on a new line: |
| 222 | `//` and added the correct one on a new line: | ||
| 223 | 207 | ||
| 224 | ``` php | 208 | ``` php |
| 225 | <?php | 209 | <?php |
| @@ -232,9 +216,8 @@ In my case, I simply commented-out the incorrect URL with | |||
| 232 | > | 216 | > |
| 233 | ``` | 217 | ``` |
| 234 | 218 | ||
| 235 | You can now exit the file with `Ctrl + x`, press | 219 | You can now exit the file with `Ctrl + x`, press `y` to save the file, and then |
| 236 | `y` to save the file, and then click `Enter` to | 220 | click `Enter` to keep the same file name. |
| 237 | keep the same file name. | ||
| 238 | 221 | ||
| 239 | Finally, just exit out of the docker container: | 222 | Finally, just exit out of the docker container: |
| 240 | 223 | ||
| @@ -248,8 +231,8 @@ Next, just restart the container: | |||
| 248 | sudo docker restart freshrss | 231 | sudo docker restart freshrss |
| 249 | ``` | 232 | ``` |
| 250 | 233 | ||
| 251 | Voilà! Your API check should now \"PASS\" and you should be able to use | 234 | Voilà! Your API check should now "PASS" and you should be able to use one of |
| 252 | one of the API URLs in your RSS apps. | 235 | the API URLs in your RSS apps. |
| 253 | 236 | ||
| 254 | In my case, I use [NetNewsWire](https://netnewswire.com) on my desktop | 237 | In my case, I use [NetNewsWire](https://netnewswire.com) on my desktop and |
| 255 | and phone. | 238 | phone. |
content/blog/2022-06-16-terminal-lifestyle.md +113 −126
| @@ -7,165 +7,155 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Text-Based Simplicity | 8 | # Text-Based Simplicity |
| 9 | 9 | ||
| 10 | I\'ve detailed my views on web-based minimalism and related topics in | 10 | I've detailed my views on web-based minimalism and related topics in other |
| 11 | other posts throughout the years; e.g., JavaScript/CSS bloat slowing | 11 | posts throughout the years; e.g., JavaScript/CSS bloat slowing down websites |
| 12 | down websites that are essentially a text document. However, I have | 12 | that are essentially a text document. However, I have never really expanded |
| 13 | never really expanded beyond talking about the web and describing how I | 13 | beyond talking about the web and describing how I focus on minimizing |
| 14 | focus on minimizing distractions in other digital environments. | 14 | distractions in other digital environments. |
| 15 | 15 | ||
| 16 | This post is going to set the baseline for how I *try* to live my | 16 | This post is going to set the baseline for how I *try* to live my digital life. |
| 17 | digital life. It does not necessarily get into my physical life, which | 17 | It does not necessarily get into my physical life, which is often harder to |
| 18 | is often harder to control and contain all the noise in our modern | 18 | control and contain all the noise in our modern world. |
| 19 | world. | 19 | |
| 20 | 20 | While there are new things to do every day in our digital world, I find that | |
| 21 | While there are new things to do every day in our digital world, I find | 21 | keeping a core set of values and interests can ground you and keep you mindful |
| 22 | that keeping a core set of values and interests can ground you and keep | 22 | of *why* you are participating in the digital world. For example, if - at your |
| 23 | you mindful of *why* you are participating in the digital world. For | 23 | core - you have no interest in what strangers think about random topics, it |
| 24 | example, if - at your core - you have no interest in what strangers | 24 | would be unwise to start participating in social media. However, I am someone |
| 25 | think about random topics, it would be unwise to start participating in | 25 | who has been dragged in by effective advertising to participate in communities |
| 26 | social media. However, I am someone who has been dragged in by effective | 26 | that I realize I do not care for. |
| 27 | advertising to participate in communities that I realize I do not care | 27 | |
| 28 | for. | 28 | I won't dive much further into explaining the philosophy of all this, but I |
| 29 | 29 | will link a few helpful articles that may pique your interest if you're in | |
| 30 | I won\'t dive much further into explaining the philosophy of all this, | 30 | search of more meaningful experiences: |
| 31 | but I will link a few helpful articles that may pique your interest if | 31 | |
| 32 | you\'re in search of more meaningful experiences: | 32 | - [Mindfulness](https://en.wikipedia.org/wiki/Mindfulness) |
| 33 | 33 | - [Minimalism](https://en.wikipedia.org/wiki/Minimalism) | |
| 34 | - [Mindfulness](https://en.wikipedia.org/wiki/Mindfulness) | 34 | - [Stoicism](https://en.wikipedia.org/wiki/Stoicism) |
| 35 | - [Minimalism](https://en.wikipedia.org/wiki/Minimalism) | ||
| 36 | - [Stoicism](https://en.wikipedia.org/wiki/Stoicism) | ||
| 37 | 35 | ||
| 38 | # Living Life in the Terminal | 36 | # Living Life in the Terminal |
| 39 | 37 | ||
| 40 | My personal approach to reducing digital distractions and increasing my | 38 | My personal approach to reducing digital distractions and increasing my focus on |
| 41 | focus on the task at hand is to use a terminal for as much as I possibly | 39 | the task at hand is to use a terminal for as much as I possibly can. |
| 42 | can. | ||
| 43 | 40 | ||
| 44 | Most days, this means that I have a few tabs open constantly in my | 41 | Most days, this means that I have a few tabs open constantly in my terminal: |
| 45 | terminal: | ||
| 46 | 42 | ||
| 47 | 1. A web browser | 43 | 1. A web browser |
| 48 | 2. A chat client | 44 | 2. A chat client |
| 49 | 3. An email client | 45 | 3. An email client |
| 50 | 4. An RSS feed reader | 46 | 4. An RSS feed reader |
| 51 | 5. A local shell for navigating my computer\'s files | 47 | 5. A local shell for navigating my computer's files |
| 52 | 6. A remote shell for managing servers and other machines | 48 | 6. A remote shell for managing servers and other machines |
| 53 | 49 | ||
| 54 | Beyond this, I rarely open other tabs or GUI applications, unless | 50 | Beyond this, I rarely open other tabs or GUI applications, unless absolutely |
| 55 | absolutely necessary. If you look, you may be surprised what can be | 51 | necessary. If you look, you may be surprised what can be accomplished in the |
| 56 | accomplished in the terminal. | 52 | terminal. |
| 57 | 53 | ||
| 58 | For example, I have moved my music and entertainment downloads to the | 54 | For example, I have moved my music and entertainment downloads to the terminal, |
| 59 | terminal, along with my device VPN connections. I am exploring options | 55 | along with my device VPN connections. I am exploring options for moving my RSS |
| 60 | for moving my RSS subscriptions to something like | 56 | subscriptions to something like [Newsboat](https://newsboat.org/), so that I can |
| 61 | [Newsboat](https://newsboat.org/), so that I can read my daily articles | 57 | read my daily articles without all the fuss. |
| 62 | without all the fuss. | ||
| 63 | 58 | ||
| 64 | Now that we have some examples out of the way, let\'s dive into the | 59 | Now that we have some examples out of the way, let's dive into the specifics. |
| 65 | specifics. | ||
| 66 | 60 | ||
| 67 | ## Browsing the Web | 61 | ## Browsing the Web |
| 68 | 62 | ||
| 69 | I\'m going to start off with a hard topic for those who prefer to live | 63 | I'm going to start off with a hard topic for those who prefer to live in the |
| 70 | in the terminal: web browsing. This task is made hard mostly by websites | 64 | terminal: web browsing. This task is made hard mostly by websites and web apps |
| 71 | and web apps that require JavaScript to run. The other difficult part is | 65 | that require JavaScript to run. The other difficult part is that if you're |
| 72 | that if you\'re using a text-based browser, that means images won\'t | 66 | using a text-based browser, that means images won't load (hopefully that's |
| 73 | load (hopefully that\'s obvious). | 67 | obvious). |
| 74 | 68 | ||
| 75 | I am using [Lynx](https://lynx.invisible-island.net), a text-based | 69 | I am using [Lynx](https://lynx.invisible-island.net), a text-based browser that |
| 76 | browser that runs quickly and easily in the terminal. Lynx allows me to | 70 | runs quickly and easily in the terminal. Lynx allows me to browser most websites |
| 77 | browser most websites by simply typing `g` and then typing in | 71 | by simply typing `g` and then typing in the URL I want. |
| 78 | the URL I want. | ||
| 79 | 72 | ||
| 80 |  | 73 |  |
| 81 | 74 | ||
| 82 | If you need a search engine while in Lynx, I recommend [DuckDuckGo | 75 | If you need a search engine while in Lynx, I recommend [DuckDuckGo |
| 83 | (Lite)](https://lite.duckduckgo.com/lite/), which allows you to search | 76 | (Lite)](https://lite.duckduckgo.com/lite/), which allows you to search the web |
| 84 | the web using their text-only interface. | 77 | using their text-only interface. |
| 85 | 78 | ||
| 86 |  | 80 | !Lite](https://img.cleberg.net/blog/20220616-terminal-lifestyle/ddg.png) |
| 88 | 81 | ||
| 89 | Eventually, you will run into websites that don\'t work (or are just too | 82 | Eventually, you will run into websites that don't work (or are just too ugly |
| 90 | ugly and messy) in a text-only mode, and you\'ll be forced to switch | 83 | and messy) in a text-only mode, and you'll be forced to switch over to a GUI |
| 91 | over to a GUI browser to look at that site. Personally, I don\'t mind | 84 | browser to look at that site. Personally, I don't mind this as it doesn't |
| 92 | this as it doesn\'t happen as often as I thought it would. | 85 | happen as often as I thought it would. |
| 93 | 86 | ||
| 94 | The only time I need to do this is when I want to browse an | 87 | The only time I need to do this is when I want to browse an image/video-focused |
| 95 | image/video-focused webpage or if I need to log in to a site, and it | 88 | webpage or if I need to log in to a site, and it doesn't support a text-only |
| 96 | doesn\'t support a text-only login page. For example, I am able to | 89 | login page. For example, I am able to easily log in to |
| 97 | easily log in to [Sourcehut](https://sr.ht) in lynx. | 90 | [Sourcehut](https://sr.ht) in lynx. |
| 98 | 91 | ||
| 99 | ## Chatting with Friends | 92 | ## Chatting with Friends |
| 100 | 93 | ||
| 101 | After web browsing activities, my main form of terminal communication is | 94 | After web browsing activities, my main form of terminal communication is Matrix. |
| 102 | Matrix. I use the [gomuks](https://docs.mau.fi/gomuks/) client | 95 | I use the [gomuks](https://docs.mau.fi/gomuks/) client currently. |
| 103 | currently. | ||
| 104 | 96 | ||
| 105 | This was incredibly easy to install on macOS (but I will need to see if | 97 | This was incredibly easy to install on macOS (but I will need to see if it'll |
| 106 | it\'ll be just as easy on Linux when my new laptop arrives): | 98 | be just as easy on Linux when my new laptop arrives): |
| 107 | 99 | ||
| 108 | ```sh | 100 | ```sh |
| 109 | brew install gomuks | 101 | brew install gomuks |
| 110 | ``` | 102 | ``` |
| 111 | 103 | ||
| 112 | Once you launch gomuks, it will sync and require your username and | 104 | Once you launch gomuks, it will sync and require your username and password to |
| 113 | password to login. After doing so, the only problem I ran into was | 105 | login. After doing so, the only problem I ran into was verifying my gomuks |
| 114 | verifying my gomuks client so that I could participate in rooms with | 106 | client so that I could participate in rooms with E2EE. |
| 115 | E2EE. | ||
| 116 | 107 | ||
| 117 | Finally, I was able to verify the session by opening the Element desktop | 108 | Finally, I was able to verify the session by opening the Element desktop app (I |
| 118 | app (I assume you can do this in the browser and mobile app too, but | 109 | assume you can do this in the browser and mobile app too, but I'm not sure) and |
| 119 | I\'m not sure) and manually verifying myself with this process: | 110 | manually verifying myself with this process: |
| 120 | 111 | ||
| 121 | 1. Open the Element desktop app | 112 | 1. Open the Element desktop app |
| 122 | 2. Open a room I was a member of | 113 | 2. Open a room I was a member of |
| 123 | 3. Open the `Room Info` pane | 114 | 3. Open the `Room Info` pane |
| 124 | 4. Open the `People` menu and search for myself | 115 | 4. Open the `People` menu and search for myself |
| 125 | 5. Click on my profile name | 116 | 5. Click on my profile name |
| 126 | 6. Click on the session link under the `Security` section | 117 | 6. Click on the session link under the `Security` section and follow the prompts |
| 127 | and follow the prompts to manually verify the session | 118 | to manually verify the session |
| 128 | 119 | ||
| 129 | Overall, I like gomuks and am able to enjoy all the features I was using | 120 | Overall, I like gomuks and am able to enjoy all the features I was using in |
| 130 | in Element. The only hiccup I have occurred is manually downloading | 121 | Element. The only hiccup I have occurred is manually downloading images to view |
| 131 | images to view them, which can be annoying. | 122 | them, which can be annoying. |
| 132 | 123 | ||
| 133 |  | 124 |  |
| 134 | 125 | ||
| 135 | 126 | ||
| 136 | 127 | ||
| 137 | Moving email to the terminal has been the hardest of the tasks for me. | 128 | Moving email to the terminal has been the hardest of the tasks for me. Unlike |
| 138 | Unlike web browsing, where I can simply decide to not look at a website | 129 | web browsing, where I can simply decide to not look at a website that does not |
| 139 | that does not work in the terminal, I cannot simply ignore emails sent | 130 | work in the terminal, I cannot simply ignore emails sent to me. |
| 140 | to me. | ||
| 141 | 131 | ||
| 142 | Personally, I am experimenting with [neomutt](https://neomutt.org/) as a | 132 | Personally, I am experimenting with [neomutt](https://neomutt.org/) as a |
| 143 | potential email client. | 133 | potential email client. |
| 144 | 134 | ||
| 145 | However, this requires a **TON\*** of configuration and tweaking to get | 135 | However, this requires a **TON** of configuration and tweaking to get right. |
| 146 | right. Even when I was able to set up neomutt, configure my email | 136 | Even when I was able to set up neomutt, configure my email account, and |
| 147 | account, and customize a few personal preferences, a lot of emails still | 137 | customize a few personal preferences, a lot of emails still do not display |
| 148 | do not display correctly (mostly due to HTML and images). | 138 | correctly (mostly due to HTML and images). |
| 149 | 139 | ||
| 150 | I won\'t get into the details of configuring `neomutt`; I | 140 | I won't get into the details of configuring `neomutt`; I mostly followed this |
| 151 | mostly followed this blog post: [Email in the Terminal: Configuring | 141 | blog post: [Email in the Terminal: Configuring |
| 152 | Neomutt](https://gideonwolfe.com/posts/workflow/neomutt/intro/). | 142 | Neomutt](https://gideonwolfe.com/posts/workflow/neomutt/intro/). |
| 153 | 143 | ||
| 154 | Finally, I have yet to figure out how to connect my GPG keys to | 144 | Finally, I have yet to figure out how to connect my GPG keys to `neomutt`, but |
| 155 | `neomutt`, but that\'s a problem for another day. | 145 | that's a problem for another day. |
| 156 | 146 | ||
| 157 | ## RSS Feed Reader | 147 | ## RSS Feed Reader |
| 158 | 148 | ||
| 159 | I have just started using [Newsboat](https://newsboat.org/) to read | 149 | I have just started using [Newsboat](https://newsboat.org/) to read articles in |
| 160 | articles in my terminal and have found quick success with it. | 150 | my terminal and have found quick success with it. |
| 161 | 151 | ||
| 162 | I\'ll show you a quick screenshot first: | 152 | I'll show you a quick screenshot first: |
| 163 | 153 | ||
| 164 |  | 154 |  |
| 165 | 155 | ||
| 166 | The configuration was super easy for this app; I simply installed the | 156 | The configuration was super easy for this app; I simply installed the app, |
| 167 | app, created a file for URLs, and imported my OPML subscriptions that I | 157 | created a file for URLs, and imported my OPML subscriptions that I had exported |
| 168 | had exported out of my old feed reader: | 158 | out of my old feed reader: |
| 169 | 159 | ||
| 170 | ```sh | 160 | ```sh |
| 171 | brew install newsboat | 161 | brew install newsboat |
| @@ -181,13 +171,12 @@ newsboat -i=my_subscriptions.opml | |||
| 181 | 171 | ||
| 182 | ## Writing & Programming | 172 | ## Writing & Programming |
| 183 | 173 | ||
| 184 | Unfortunately, the weak link in my terminal-based environment right now | 174 | Unfortunately, the weak link in my terminal-based environment right now is my |
| 185 | is my grasp of the possibilities of editing files within a shell. | 175 | grasp of the possibilities of editing files within a shell. |
| 186 | 176 | ||
| 187 | I am used to the easy extensions found in VSCodium and Kate, so I am | 177 | I am used to the easy extensions found in VSCodium and Kate, so I am slowly |
| 188 | slowly learning how to mold the default editing tools to my needs. | 178 | learning how to mold the default editing tools to my needs. Currently, this |
| 189 | Currently, this means I am using `nano` with the following | 179 | means I am using `nano` with the following configuration: |
| 190 | configuration: | ||
| 191 | 180 | ||
| 192 | ``` config | 181 | ``` config |
| 193 | set breaklonglines | 182 | set breaklonglines |
| @@ -199,18 +188,16 @@ set fill 80 | |||
| 199 | ``` | 188 | ``` |
| 200 | 189 | ||
| 201 | This configuration allows nano to automatically hard-wrap lines at 80 | 190 | This configuration allows nano to automatically hard-wrap lines at 80 |
| 202 | characters, autoindent the wrapped lines (if the previous line was | 191 | characters, autoindent the wrapped lines (if the previous line was indented), |
| 203 | indented), use 2 spaces per tab, and display line numbers within each | 192 | use 2 spaces per tab, and display line numbers within each file I open. |
| 204 | file I open. | 193 | |
| 205 | 194 | I am currently looking to see if `vim` or `emacs` would be more useful for my | |
| 206 | I am currently looking to see if `vim` or `emacs` | 195 | current needs, but I'm not in any rush, so I don't expect to find an answer |
| 207 | would be more useful for my current needs, but I\'m not in any rush, so | 196 | anytime soon. |
| 208 | I don\'t expect to find an answer anytime soon. | 197 | |
| 209 | 198 | With my current life demands, I am not programming at the moment and have not | |
| 210 | With my current life demands, I am not programming at the moment and | 199 | explored the best terminal set-up for programming. However, I have seen many |
| 211 | have not explored the best terminal set-up for programming. However, I | 200 | peers find success configuring `vim` and `emacs`, so that's where I will start |
| 212 | have seen many peers find success configuring `vim` and | 201 | when I pick my projects back up. |
| 213 | `emacs`, so that\'s where I will start when I pick my | ||
| 214 | projects back up. | ||
| 215 | 202 | ||
| 216 |  | 203 |  |
content/blog/2022-06-22-daily-poetry.md +51 −59
| @@ -7,9 +7,8 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Source Code | 8 | # Source Code |
| 9 | 9 | ||
| 10 | I don\'t want to bury the lede here, so if you\'d like to see the full | 10 | I don't want to bury the lede here, so if you'd like to see the full source |
| 11 | source code I use to email myself plaintext poems daily, visit the | 11 | code I use to email myself plaintext poems daily, visit the repository: |
| 12 | repository: | ||
| 13 | [daily-poem.git](https://git.cleberg.net/?p=daily-poem.git;a=summary). | 12 | [daily-poem.git](https://git.cleberg.net/?p=daily-poem.git;a=summary). |
| 14 | 13 | ||
| 15 | # My Daily Dose of Poetry | 14 | # My Daily Dose of Poetry |
| @@ -17,36 +16,35 @@ repository: | |||
| 17 | Most of my programming projects are small, random projects that are made | 16 | Most of my programming projects are small, random projects that are made |
| 18 | strictly to fix some small problem I have or enhance my quality of life. | 17 | strictly to fix some small problem I have or enhance my quality of life. |
| 19 | 18 | ||
| 20 | In this case, I was looking for a simply and easy way to get a daily | 19 | In this case, I was looking for a simply and easy way to get a daily dose of |
| 21 | dose of literature or poetry to read in the mornings. | 20 | literature or poetry to read in the mornings. |
| 22 | 21 | ||
| 23 | However, I don\'t want to sign up for a random mailing list on just any | 22 | However, I don't want to sign up for a random mailing list on just any website. |
| 24 | website. I also don\'t want to have to work to find the reading content | 23 | I also don't want to have to work to find the reading content each morning, as |
| 25 | each morning, as I know I would simply give up and stop reading daily. | 24 | I know I would simply give up and stop reading daily. |
| 26 | 25 | ||
| 27 | Thus, I found a way to deliver poetry to myself in plain-text format, on | 26 | Thus, I found a way to deliver poetry to myself in plain-text format, on a daily |
| 28 | a daily basis, and scheduled to deliver automatically. | 27 | basis, and scheduled to deliver automatically. |
| 29 | 28 | ||
| 30 | # Prerequisites | 29 | # Prerequisites |
| 31 | 30 | ||
| 32 | This solution uses Python and email, so the following process requires | 31 | This solution uses Python and email, so the following process requires the |
| 33 | the following to be installed: | 32 | following to be installed: |
| 34 | 33 | ||
| 35 | 1. An SMTP server, which can be as easy as installing | 34 | 1. An SMTP server, which can be as easy as installing `mailutils` if you're on |
| 36 | `mailutils` if you\'re on a Debian-based distro. | 35 | a Debian-based distro. |
| 37 | 2. Python (& pip!) | 36 | 2. Python (& pip!) |
| 38 | 3. The following Python packages: `email`, | 37 | 3. The following Python packages: `email`, `smtplib`, `json`, and `requests` |
| 39 | `smtplib`, `json`, and `requests` | ||
| 40 | 38 | ||
| 41 | # Breaking Down the Logic | 39 | # Breaking Down the Logic |
| 42 | 40 | ||
| 43 | I want to break down the logic for this program, as it\'s quite simple | 41 | I want to break down the logic for this program, as it's quite simple and |
| 44 | and informational. | 42 | informational. |
| 45 | 43 | ||
| 46 | ## Required Packages | 44 | ## Required Packages |
| 47 | 45 | ||
| 48 | This program starts with a simple import of the required packages, so I | 46 | This program starts with a simple import of the required packages, so I wanted |
| 49 | wanted to explain why each package is used: | 47 | to explain why each package is used: |
| 50 | 48 | ||
| 51 | ``` python | 49 | ``` python |
| 52 | from email.mime.text import MIMEText # Required for translating MIMEText | 50 | from email.mime.text import MIMEText # Required for translating MIMEText |
| @@ -57,9 +55,9 @@ import requests # Required to send out a request to the API | |||
| 57 | 55 | ||
| 58 | ## Sending the API Request | 56 | ## Sending the API Request |
| 59 | 57 | ||
| 60 | Next, we need to actually send the API request. In my case, I\'m calling | 58 | Next, we need to actually send the API request. In my case, I'm calling a |
| 61 | a random poem from the entire API. If you want, you can call specific | 59 | random poem from the entire API. If you want, you can call specific poems or |
| 62 | poems or authors from this API. | 60 | authors from this API. |
| 63 | 61 | ||
| 64 | ``` python | 62 | ``` python |
| 65 | json_data = requests.get('https://poetrydb.org/random').json() | 63 | json_data = requests.get('https://poetrydb.org/random').json() |
| @@ -97,24 +95,22 @@ This gives us the following result in JSON: | |||
| 97 | 95 | ||
| 98 | ## Parsing the API Results | 96 | ## Parsing the API Results |
| 99 | 97 | ||
| 100 | In order to parse this into a readable format, we need to use the | 98 | In order to parse this into a readable format, we need to use the `json` package |
| 101 | `json` package and extract the fields we want. In the example | 99 | and extract the fields we want. In the example below, I am grabbing every field |
| 102 | below, I am grabbing every field presented by the API. | 100 | presented by the API. |
| 103 | 101 | ||
| 104 | For the actual poem content, we need to loop over each line in the | 102 | For the actual poem content, we need to loop over each line in the `lines` |
| 105 | `lines` variable since each line is a separate string by | 103 | variable since each line is a separate string by default. |
| 106 | default. | ||
| 107 | 104 | ||
| 108 | > You *could* also extract the title or author and make another call out | 105 | > You *could* also extract the title or author and make another call out to the |
| 109 | > to the API to avoid having to build the plaintext poem with a loop, | 106 | > API to avoid having to build the plaintext poem with a loop, but it just |
| 110 | > but it just doesn\'t make sense to me to send multiple requests when | 107 | > doesn't make sense to me to send multiple requests when we can create a |
| 111 | > we can create a simple loop on our local machine to work with the data | 108 | > simple loop on our local machine to work with the data we already have. |
| 112 | > we already have. | ||
| 113 | > | 109 | > |
| 114 | > For | 110 | > For |
| 115 | > [example](https://poetrydb.org/title/Sonnet%20XXII:%20With%20Fools%20and%20Children/lines.text), | 111 | > [example](https://poetrydb.org/title/Sonnet%20XXII:%20With%20Fools%20and%20Children/lines.text), |
| 116 | > look at the raw data response of this link to see the poem\'s lines | 112 | > look at the raw data response of this link to see the poem's lines returned |
| 117 | > returned in plaintext. | 113 | > in plaintext. |
| 118 | 114 | ||
| 119 | ``` python | 115 | ``` python |
| 120 | title = json_data[0]['title'] | 116 | title = json_data[0]['title'] |
| @@ -127,21 +123,20 @@ for line in json_data[0]['lines']: | |||
| 127 | 123 | ||
| 128 | ## Composing the Email | 124 | ## Composing the Email |
| 129 | 125 | ||
| 130 | Now that I have all the data I need, I just need to compose it into a | 126 | Now that I have all the data I need, I just need to compose it into a message |
| 131 | message and prepare the message metadata. | 127 | and prepare the message metadata. |
| 132 | 128 | ||
| 133 | For my daily email, I want to see the title of the poem first, followed | 129 | For my daily email, I want to see the title of the poem first, followed by the |
| 134 | by the author, then a blank line, and finally the full poem. This code | 130 | author, then a blank line, and finally the full poem. This code snippet combines |
| 135 | snippet combines that data and packages it into a MIMEText container, | 131 | that data and packages it into a MIMEText container, ready to be emailed. |
| 136 | ready to be emailed. | ||
| 137 | 132 | ||
| 138 | ``` python | 133 | ``` python |
| 139 | msg_body = title + "\n" + author + "\n\n" + lines | 134 | msg_body = title + "\n" + author + "\n\n" + lines |
| 140 | msg = MIMEText(msg_body) | 135 | msg = MIMEText(msg_body) |
| 141 | ``` | 136 | ``` |
| 142 | 137 | ||
| 143 | Before we send the email, we need to prepare the metadata (subject, | 138 | Before we send the email, we need to prepare the metadata (subject, from, to, |
| 144 | from, to, etc.): | 139 | etc.): |
| 145 | 140 | ||
| 146 | ``` python | 141 | ``` python |
| 147 | sender_email = 'example@server.local' | 142 | sender_email = 'example@server.local' |
| @@ -153,10 +148,9 @@ msg['To'] = recipient_email | |||
| 153 | 148 | ||
| 154 | ## Sending the Email | 149 | ## Sending the Email |
| 155 | 150 | ||
| 156 | Now that I have everything ready to be emailed, the last step is to | 151 | Now that I have everything ready to be emailed, the last step is to simply |
| 157 | simply connect to an SMTP server and send the email out to the | 152 | connect to an SMTP server and send the email out to the recipients. In my case, |
| 158 | recipients. In my case, I installed `mailutils` on Ubuntu and | 153 | I installed `mailutils` on Ubuntu and let my SMTP server be `localhost`. |
| 159 | let my SMTP server be `localhost`. | ||
| 160 | 154 | ||
| 161 | ``` python | 155 | ``` python |
| 162 | smtp_server = 'localhost' | 156 | smtp_server = 'localhost' |
| @@ -167,9 +161,8 @@ s.quit() | |||
| 167 | 161 | ||
| 168 | # The Result! | 162 | # The Result! |
| 169 | 163 | ||
| 170 | Instead of including a screenshot, I\'ve copied the contents of the | 164 | Instead of including a screenshot, I've copied the contents of the email that |
| 171 | email that was delivered to my inbox below since I set this process up | 165 | was delivered to my inbox below since I set this process up in plaintext format. |
| 172 | in plaintext format. | ||
| 173 | 166 | ||
| 174 | ``` txt | 167 | ``` txt |
| 175 | Date: Wed, 22 Jun 2022 14:37:19 +0000 (UTC) | 168 | Date: Wed, 22 Jun 2022 14:37:19 +0000 (UTC) |
| @@ -201,18 +194,17 @@ Some, wise in show, more fools indeed than they. | |||
| 201 | 194 | ||
| 202 | # Scheduling the Daily Email | 195 | # Scheduling the Daily Email |
| 203 | 196 | ||
| 204 | Last, but not least, is scheduling this Python script with | 197 | Last, but not least, is scheduling this Python script with `crontab`. To |
| 205 | `crontab`. To schedule a script to run daily, you can add it | 198 | schedule a script to run daily, you can add it to the `crontab` file. To do |
| 206 | to the `crontab` file. To do this, open `crontab` | 199 | this, open `crontab` in editing mode: |
| 207 | in editing mode: | ||
| 208 | 200 | ||
| 209 | ```sh | 201 | ```sh |
| 210 | crontab -e | 202 | crontab -e |
| 211 | ``` | 203 | ``` |
| 212 | 204 | ||
| 213 | In the file, simply paste the following snippet at the bottom of the | 205 | In the file, simply paste the following snippet at the bottom of the file and |
| 214 | file and ensure that the file path is correctly pointing to wherever you | 206 | ensure that the file path is correctly pointing to wherever you saved your |
| 215 | saved your Python script: | 207 | Python script: |
| 216 | 208 | ||
| 217 | ``` config | 209 | ``` config |
| 218 | 0 8 ** ** ** python3 /home/<your_user>/dailypoem/main.py | 210 | 0 8 ** ** ** python3 /home/<your_user>/dailypoem/main.py |
content/blog/2022-06-24-fedora-i3.md +34 −35
| @@ -15,20 +15,19 @@ world of Linux again. | |||
| 15 | My decision to leave macOS really came down to just a few important | 15 | My decision to leave macOS really came down to just a few important |
| 16 | things: | 16 | things: |
| 17 | 17 | ||
| 18 | - Apple Security (Gatekeeper) restricting me from running any software | 18 | - Apple Security (Gatekeeper) restricting me from running any software I want. |
| 19 | I want. Even if you disable Gatekeeper and allow software to bypass | 19 | Even if you disable Gatekeeper and allow software to bypass the rest of the |
| 20 | the rest of the device installation security, you still have to | 20 | device installation security, you still have to repeat that process every time |
| 21 | repeat that process every time the allowed software is updated. | 21 | the allowed software is updated. |
| 22 | - macOS sends out nearly constant connections, pings, telemetry, etc. | 22 | - macOS sends out nearly constant connections, pings, telemetry, etc. to a |
| 23 | to a myriad of mysterious Apple services. I\'m not even going to | 23 | myriad of mysterious Apple services. I'm not even going to dive into how many |
| 24 | dive into how many macOS apps have constant telemetry on, as well. | 24 | macOS apps have constant telemetry on, as well. |
| 25 | - Lastly, I just *really* missed the customization and freedom that | 25 | - Lastly, I just *really* missed the customization and freedom that comes with |
| 26 | comes with Linux. Being able to switch to entirely new kernel, OS, | 26 | Linux. Being able to switch to entirely new kernel, OS, or desktop within |
| 27 | or desktop within minutes is a freedom I took for granted when I | 27 | minutes is a freedom I took for granted when I switched to macOS. |
| 28 | switched to macOS. | 28 | |
| 29 | 29 | Now that I've covered macOS, I'm going to move on to more exciting | |
| 30 | Now that I\'ve covered macOS, I\'m going to move on to more exciting | 30 | topics: my personal choice of OS, DE, and various customizations I'm |
| 31 | topics: my personal choice of OS, DE, and various customizations I\'m | ||
| 32 | using. | 31 | using. |
| 33 | 32 | ||
| 34 | # Fedora | 33 | # Fedora |
| @@ -37,8 +36,8 @@ After trying a ton of distros (I think I booted and tested around 20-25 | |||
| 37 | distros), I finally landed on [Fedora Linux](https://getfedora.org/). I | 36 | distros), I finally landed on [Fedora Linux](https://getfedora.org/). I |
| 38 | have quite a bit of experience with Fedora and enjoy the | 37 | have quite a bit of experience with Fedora and enjoy the |
| 39 | `dnf` package manager. Fedora allows me to keep up-to-date | 38 | `dnf` package manager. Fedora allows me to keep up-to-date |
| 40 | with recent software (I\'m looking at you, Debian), but still provides a | 39 | with recent software (I'm looking at you, Debian), but still provides a |
| 41 | level of stability you don\'t find in every distro. | 40 | level of stability you don't find in every distro. |
| 42 | 41 | ||
| 43 | In a very close second place was Arch Linux, as well as its spin-off: | 42 | In a very close second place was Arch Linux, as well as its spin-off: |
| 44 | Garuda Linux (Garuda w/ sway is *beautiful*). Arch is great for | 43 | Garuda Linux (Garuda w/ sway is *beautiful*). Arch is great for |
| @@ -47,8 +46,8 @@ had the time to properly sit down and learn the methodology behind their | |||
| 47 | packaging systems. | 46 | packaging systems. |
| 48 | 47 | ||
| 49 | Basically, everything else I tested was unacceptable in at least one way | 48 | Basically, everything else I tested was unacceptable in at least one way |
| 50 | or another. Void (`glibc`) was great, but doesn\'t support | 49 | or another. Void (`glibc`) was great, but doesn't support |
| 51 | all the software I need. Slackware worked well as a tui, but I wasn\'t | 50 | all the software I need. Slackware worked well as a tui, but I wasn't |
| 52 | skilled enough to get a tiling window manager (WM) working on it. | 51 | skilled enough to get a tiling window manager (WM) working on it. |
| 53 | 52 | ||
| 54 | ## i3 | 53 | ## i3 |
| @@ -57,7 +56,7 @@ One of the reasons I settled on Fedora is that it comes with an official | |||
| 57 | i3 spin. Being able to use a tiling WM, such as i3 or sway, is one of | 56 | i3 spin. Being able to use a tiling WM, such as i3 or sway, is one of |
| 58 | the biggest things I wanted to do as soon as I adopted Linux again. | 57 | the biggest things I wanted to do as soon as I adopted Linux again. |
| 59 | 58 | ||
| 60 | I will probably set up a dotfile repository soon, so that I don\'t lose | 59 | I will probably set up a dotfile repository soon, so that I don't lose |
| 61 | any of my configurations, but nothing big has been configured thus far. | 60 | any of my configurations, but nothing big has been configured thus far. |
| 62 | 61 | ||
| 63 | The two main things I have updated in i3wm are natural scrolling and | 62 | The two main things I have updated in i3wm are natural scrolling and |
| @@ -123,37 +122,37 @@ binding my brightness keys to the `brightnessctl` program. | |||
| 123 | 122 | ||
| 124 | My config for this menu bar is basically just the default settings | 123 | My config for this menu bar is basically just the default settings |
| 125 | with modified colors and an added battery block to quickly show me | 124 | with modified colors and an added battery block to quickly show me |
| 126 | the machine\'s battery info. | 125 | the machine's battery info. |
| 127 | 126 | ||
| 128 | 4. `alacritty` | 127 | 4. `alacritty` |
| 129 | 128 | ||
| 130 | Not much to say on this part yet, as I haven\'t configured it much, | 129 | Not much to say on this part yet, as I haven't configured it much, |
| 131 | but I installed `alacritty` as my default terminal, and I | 130 | but I installed `alacritty` as my default terminal, and I |
| 132 | am using `zsh` and the shell. | 131 | am using `zsh` and the shell. |
| 133 | 132 | ||
| 134 | # Software Choices | 133 | # Software Choices |
| 135 | 134 | ||
| 136 | Again, I\'m not going to say much that I haven\'t said yet in other blog | 135 | Again, I'm not going to say much that I haven't said yet in other blog |
| 137 | posts, so I\'ll just do a quick rundown of the apps I installed | 136 | posts, so I'll just do a quick rundown of the apps I installed |
| 138 | immediately after I set up the environment. | 137 | immediately after I set up the environment. |
| 139 | 138 | ||
| 140 | Flatpak Apps: | 139 | Flatpak Apps: |
| 141 | 140 | ||
| 142 | - Cryptomator | 141 | - Cryptomator |
| 143 | - pCloud | 142 | - pCloud |
| 144 | - Signal | 143 | - Signal |
| 145 | 144 | ||
| 146 | Fedora Packages: | 145 | Fedora Packages: |
| 147 | 146 | ||
| 148 | - gomuks | 147 | - gomuks |
| 149 | - neomutt | 148 | - neomutt |
| 150 | - neofetch | 149 | - neofetch |
| 151 | - Firefox | 150 | - Firefox |
| 152 | - uBlock Origin | 151 | - uBlock Origin |
| 153 | - Bitwarden | 152 | - Bitwarden |
| 154 | - Stylus | 153 | - Stylus |
| 155 | - Privacy Redirect | 154 | - Privacy Redirect |
| 156 | 155 | ||
| 157 | Other: | 156 | Other: |
| 158 | 157 | ||
| 159 | - exiftool | 158 | - exiftool |
content/blog/2022-07-01-git-server.md +151 −182
| @@ -7,60 +7,54 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # My Approach to Self-Hosting Git | 8 | # My Approach to Self-Hosting Git |
| 9 | 9 | ||
| 10 | I have often tried to self-host my Git repositories, but have always | 10 | I have often tried to self-host my Git repositories, but have always fallen |
| 11 | fallen short when I tried to find a suitable web interface to show on | 11 | short when I tried to find a suitable web interface to show on the front-end. |
| 12 | the front-end. | 12 | |
| 13 | 13 | After a few years, I have finally found a combination of methods that allow me | |
| 14 | After a few years, I have finally found a combination of methods that | 14 | to easily self-host my projects, view them on the web, and access them from |
| 15 | allow me to easily self-host my projects, view them on the web, and | 15 | anywhere. |
| 16 | access them from anywhere. | 16 | |
| 17 | 17 | Before I dive into the details, I want to state a high-level summary of my | |
| 18 | Before I dive into the details, I want to state a high-level summary of | 18 | self-hosted Git approach: |
| 19 | my self-hosted Git approach: | 19 | |
| 20 | 20 | - This method uses the `ssh://` (read & write) and `git://` (read-only) | |
| 21 | - This method uses the `ssh://` (read & write) and | 21 | protocols for push and pull access. |
| 22 | `git://` (read-only) protocols for push and pull access. | 22 | - For the `git://` protocol, I create a `git-daemon-export-ok` file in any |
| 23 | - For the `git://` protocol, I create a | 23 | repository that I want to be cloneable by anyone. |
| 24 | `git-daemon-export-ok` file in any repository that I | 24 | - The web interface I am using (`cgit`) allows simple HTTP cloning by default. |
| 25 | want to be cloneable by anyone. | 25 | I do not disable this setting as I want beginners to be able to clone one of |
| 26 | - The web interface I am using (`cgit`) allows simple | 26 | my repositories even if they don't know the proper method. |
| 27 | HTTP cloning by default. I do not disable this setting as I want | 27 | - I am not enabling Smart HTTPS for any repositories. Updates to repositories |
| 28 | beginners to be able to clone one of my repositories even if | 28 | must be pushed via SSH. |
| 29 | they don\'t know the proper method. | 29 | - Beyond the actual repository management, I am using `cgit` for the front-end |
| 30 | - I am not enabling Smart HTTPS for any repositories. Updates to | 30 | web interface. |
| 31 | repositories must be pushed via SSH. | 31 | - If you use the `scan-path=<path>` configuration in the `cgitrc` |
| 32 | - Beyond the actual repository management, I am using | 32 | configuration file to automatically find repositories, you can't exclude a |
| 33 | `cgit` for the front-end web interface. | 33 | repository from `cgit` if it's stored within the path that `cgit` reads. To |
| 34 | - If you use the `scan-path=<path>` configuration in | 34 | host private repositories, you'd need to set up another directory that |
| 35 | the `cgitrc` configuration file to automatically find | 35 | `cgit` can't read. |
| 36 | repositories, you can\'t exclude a repository from | ||
| 37 | `cgit` if it\'s stored within the path that | ||
| 38 | `cgit` reads. To host private repositories, you\'d | ||
| 39 | need to set up another directory that `cgit` can\'t | ||
| 40 | read. | ||
| 41 | 36 | ||
| 42 | # Assumptions | 37 | # Assumptions |
| 43 | 38 | ||
| 44 | For the purposes of this walkthrough, I am assuming you have a URL | 39 | For the purposes of this walkthrough, I am assuming you have a URL |
| 45 | (`git.example.com`) or IP address | 40 | (`git.example.com`) or IP address (`207.84.26.991`) addressed to the server that |
| 46 | (`207.84.26.991`) addressed to the server that you will be | 41 | you will be using to host your git repositories. |
| 47 | using to host your git repositories. | ||
| 48 | 42 | ||
| 49 | # Adding a Git User | 43 | # Adding a Git User |
| 50 | 44 | ||
| 51 | In order to use the SSH method associated with git, we will need to add | 45 | In order to use the SSH method associated with git, we will need to add a user |
| 52 | a user named `git`. If you have used the SSH method for other | 46 | named `git`. If you have used the SSH method for other git hosting sites, you |
| 53 | git hosting sites, you are probably used to the following syntax: | 47 | are probably used to the following syntax: |
| 54 | 48 | ||
| 55 | ```sh | 49 | ```sh |
| 56 | git clone [user@]server:project.git | 50 | git clone [user@]server:project.git |
| 57 | ``` | 51 | ``` |
| 58 | 52 | ||
| 59 | The syntax above is an `scp`-like syntax for using SSH on the | 53 | The syntax above is an `scp`-like syntax for using SSH on the `git` user on the |
| 60 | `git` user on the server to access your repository. | 54 | server to access your repository. |
| 61 | 55 | ||
| 62 | Let\'s delete any remnants of an old `git` user, if any, and | 56 | Let's delete any remnants of an old `git` user, if any, and create the new user |
| 63 | create the new user account: | 57 | account: |
| 64 | 58 | ||
| 65 | ```sh | 59 | ```sh |
| 66 | sudo deluser --remove-home git | 60 | sudo deluser --remove-home git |
| @@ -69,21 +63,19 @@ sudo adduser git | |||
| 69 | 63 | ||
| 70 | ## Import Your SSH Keys to the Git User | 64 | ## Import Your SSH Keys to the Git User |
| 71 | 65 | ||
| 72 | Once the `git` user is created, you will need to copy your | 66 | Once the `git` user is created, you will need to copy your public SSH key on |
| 73 | public SSH key on your local development machine to the `git` | 67 | your local development machine to the `git` user on the server. |
| 74 | user on the server. | ||
| 75 | 68 | ||
| 76 | If you don\'t have an SSH key yet, create one with this command: | 69 | If you don't have an SSH key yet, create one with this command: |
| 77 | 70 | ||
| 78 | ```sh | 71 | ```sh |
| 79 | ssh-keygen | 72 | ssh-keygen |
| 80 | ``` | 73 | ``` |
| 81 | 74 | ||
| 82 | Once you create the key pair, the public should be saved to | 75 | Once you create the key pair, the public should be saved to `~/.ssh/id_rsa.pub`. |
| 83 | `~/.ssh/id_rsa.pub`. | ||
| 84 | 76 | ||
| 85 | If your server still has password-based authentication available, you | 77 | If your server still has password-based authentication available, you can copy |
| 86 | can copy it over to your user\'s home directory like this: | 78 | it over to your user's home directory like this: |
| 87 | 79 | ||
| 88 | ```sh | 80 | ```sh |
| 89 | ssh-copy-id git@server | 81 | ssh-copy-id git@server |
| @@ -95,8 +87,8 @@ Otherwise, copy it over to any user that you can access. | |||
| 95 | scp ~/.ssh/id_rsa.pub your_user@your_server: | 87 | scp ~/.ssh/id_rsa.pub your_user@your_server: |
| 96 | ``` | 88 | ``` |
| 97 | 89 | ||
| 98 | Once on the server, you will need to copy the contents into the | 90 | Once on the server, you will need to copy the contents into the `git` user's |
| 99 | `git` user\'s `authorized_keys` file: | 91 | `authorized_keys` file: |
| 100 | 92 | ||
| 101 | ```sh | 93 | ```sh |
| 102 | cat id_rsa.pub > /home/git/.ssh/authorized_keys | 94 | cat id_rsa.pub > /home/git/.ssh/authorized_keys |
| @@ -104,16 +96,15 @@ cat id_rsa.pub > /home/git/.ssh/authorized_keys | |||
| 104 | 96 | ||
| 105 | ## (Optional) Disable Password-Based SSH | 97 | ## (Optional) Disable Password-Based SSH |
| 106 | 98 | ||
| 107 | If you want to lock down your server and ensure that no one can | 99 | If you want to lock down your server and ensure that no one can authenticate in |
| 108 | authenticate in via SSH with a password, you will need to edit your SSH | 100 | via SSH with a password, you will need to edit your SSH configuration. |
| 109 | configuration. | ||
| 110 | 101 | ||
| 111 | ```sh | 102 | ```sh |
| 112 | sudo nano /etc/ssh/sshd_config | 103 | sudo nano /etc/ssh/sshd_config |
| 113 | ``` | 104 | ``` |
| 114 | 105 | ||
| 115 | Within this file, find the following settings and set them to the values | 106 | Within this file, find the following settings and set them to the values I am |
| 116 | I am showing below: | 107 | showing below: |
| 117 | 108 | ||
| 118 | ``` conf | 109 | ``` conf |
| 119 | PermitRootLogin no | 110 | PermitRootLogin no |
| @@ -121,19 +112,17 @@ PasswordAuthentication no | |||
| 121 | AuthenticationMethods publickey | 112 | AuthenticationMethods publickey |
| 122 | ``` | 113 | ``` |
| 123 | 114 | ||
| 124 | You may have other Authentication Methods required in your personal | 115 | You may have other Authentication Methods required in your personal set-up, so |
| 125 | set-up, so the key here is just to ensure that | 116 | the key here is just to ensure that `AuthenticationMethods` does not allow |
| 126 | `AuthenticationMethods` does not allow passwords. | 117 | passwords. |
| 127 | 118 | ||
| 128 | ### Setting up the Base Directory | 119 | ### Setting up the Base Directory |
| 129 | 120 | ||
| 130 | Now that we have set up a `git` user to handle all transport | 121 | Now that we have set up a `git` user to handle all transport methods, we need to |
| 131 | methods, we need to set up the directory that we will be using as our | 122 | set up the directory that we will be using as our base of all repositories. |
| 132 | base of all repositories. | ||
| 133 | 123 | ||
| 134 | In my case, I am using `/git` as my source folder. To create | 124 | In my case, I am using `/git` as my source folder. To create this folder and |
| 135 | this folder and assign it to the user we created, execute the following | 125 | assign it to the user we created, execute the following commands: |
| 136 | commands: | ||
| 137 | 126 | ||
| 138 | ```sh | 127 | ```sh |
| 139 | sudo mkdir /git | 128 | sudo mkdir /git |
| @@ -142,15 +131,15 @@ sudo chown -R git:git /git | |||
| 142 | 131 | ||
| 143 | ### Creating a Test Repository | 132 | ### Creating a Test Repository |
| 144 | 133 | ||
| 145 | On your server, switch over to the `git` user in order to | 134 | On your server, switch over to the `git` user in order to start managing git |
| 146 | start managing git files. | 135 | files. |
| 147 | 136 | ||
| 148 | ```sh | 137 | ```sh |
| 149 | su git | 138 | su git |
| 150 | ``` | 139 | ``` |
| 151 | 140 | ||
| 152 | Once logged-in as the `git` user, go to your base directory | 141 | Once logged-in as the `git` user, go to your base directory and create a test |
| 153 | and create a test repository. | 142 | repository. |
| 154 | 143 | ||
| 155 | ```sh | 144 | ```sh |
| 156 | cd /git | 145 | cd /git |
| @@ -158,9 +147,9 @@ mkdir test.git && cd test.git | |||
| 158 | git init --bare | 147 | git init --bare |
| 159 | ``` | 148 | ``` |
| 160 | 149 | ||
| 161 | If you want to make this repo viewable/cloneable to the public via the | 150 | If you want to make this repo viewable/cloneable to the public via the `git://` |
| 162 | `git://` protocol, you need to create a | 151 | protocol, you need to create a `git-daemon-export-ok` file inside the |
| 163 | `git-daemon-export-ok` file inside the repository. | 152 | repository. |
| 164 | 153 | ||
| 165 | ```sh | 154 | ```sh |
| 166 | touch git-daemon-export-ok | 155 | touch git-daemon-export-ok |
| @@ -168,34 +157,33 @@ touch git-daemon-export-ok | |||
| 168 | 157 | ||
| 169 | # Change the Login Shell for `git` | 158 | # Change the Login Shell for `git` |
| 170 | 159 | ||
| 171 | To make sure that the `git` user is only used for git | 160 | To make sure that the `git` user is only used for git operations and nothing |
| 172 | operations and nothing else, you need to change the user\'s login shell. | 161 | else, you need to change the user's login shell. To do this, simply use the |
| 173 | To do this, simply use the `chsh` command: | 162 | `chsh` command: |
| 174 | 163 | ||
| 175 | ```sh | 164 | ```sh |
| 176 | sudo chsh git | 165 | sudo chsh git |
| 177 | ``` | 166 | ``` |
| 178 | 167 | ||
| 179 | The interactive prompt will ask which shell you want the | 168 | The interactive prompt will ask which shell you want the `git` user to use. You |
| 180 | `git` user to use. You must use the following value: | 169 | must use the following value: |
| 181 | 170 | ||
| 182 | ```sh | 171 | ```sh |
| 183 | /usr/bin/git-shell | 172 | /usr/bin/git-shell |
| 184 | ``` | 173 | ``` |
| 185 | 174 | ||
| 186 | Once done, no one will be able to SSH to the `git` user or | 175 | Once done, no one will be able to SSH to the `git` user or execute commands |
| 187 | execute commands other than the standard git commands. | 176 | other than the standard git commands. |
| 188 | 177 | ||
| 189 | # Opening the Firewall | 178 | # Opening the Firewall |
| 190 | 179 | ||
| 191 | Don\'t forget to open up ports on the device firewall and network | 180 | Don't forget to open up ports on the device firewall and network firewall if |
| 192 | firewall if you want to access these repositories publicly. If you\'re | 181 | you want to access these repositories publicly. If you're using default ports, |
| 193 | using default ports, forward ports `22` (ssh) and | 182 | forward ports `22` (ssh) and `9418` (git) from your router to your server's IP |
| 194 | `9418` (git) from your router to your server\'s IP address. | 183 | address. |
| 195 | 184 | ||
| 196 | If your server also has a firewall, ensure that the firewall allows the | 185 | If your server also has a firewall, ensure that the firewall allows the same |
| 197 | same ports that are forwarded from the router. For example, if you use | 186 | ports that are forwarded from the router. For example, if you use `ufw`: |
| 198 | `ufw`: | ||
| 199 | 187 | ||
| 200 | ```sh | 188 | ```sh |
| 201 | sudo ufw allow 22 | 189 | sudo ufw allow 22 |
| @@ -204,12 +192,12 @@ sudo ufw allow 9418 | |||
| 204 | 192 | ||
| 205 | ## Non-Standard SSH Ports | 193 | ## Non-Standard SSH Ports |
| 206 | 194 | ||
| 207 | If you use a non-standard port for SSH, such as `9876`, you | 195 | If you use a non-standard port for SSH, such as `9876`, you will need to create |
| 208 | will need to create an SSH configuration file on your local development | 196 | an SSH configuration file on your local development machine in order to connect |
| 209 | machine in order to connect to your server\'s git repositories. | 197 | to your server's git repositories. |
| 210 | 198 | ||
| 211 | To do this, you\'ll need to define your custom port on your client | 199 | To do this, you'll need to define your custom port on your client machine in |
| 212 | machine in your `~/.ssh/config` file: | 200 | your `~/.ssh/config` file: |
| 213 | 201 | ||
| 214 | ```sh | 202 | ```sh |
| 215 | nano ~/.ssh/config | 203 | nano ~/.ssh/config |
| @@ -227,11 +215,11 @@ Host git.example.com | |||
| 227 | 215 | ||
| 228 | There are two main syntaxes you can use to manage git over SSH: | 216 | There are two main syntaxes you can use to manage git over SSH: |
| 229 | 217 | ||
| 230 | - `git clone [user@]server:project.git` | 218 | - `git clone [user@]server:project.git` |
| 231 | - `git clone ssh://[user@]server/project.git` | 219 | - `git clone ssh://[user@]server/project.git` |
| 232 | 220 | ||
| 233 | I prefer the first, which is an `scp`-like syntax. To test | 221 | I prefer the first, which is an `scp`-like syntax. To test it, try to clone the |
| 234 | it, try to clone the test repository you set up on the server: | 222 | test repository you set up on the server: |
| 235 | 223 | ||
| 236 | ```sh | 224 | ```sh |
| 237 | git clone git@git.example.com:/git/test.git | 225 | git clone git@git.example.com:/git/test.git |
| @@ -239,9 +227,8 @@ git clone git@git.example.com:/git/test.git | |||
| 239 | 227 | ||
| 240 | # Enabling Read-Only Access | 228 | # Enabling Read-Only Access |
| 241 | 229 | ||
| 242 | If you want people to be able to clone any repository where you\'ve | 230 | If you want people to be able to clone any repository where you've placed a |
| 243 | placed a `git-daemon-export-ok` file, you will need to start | 231 | `git-daemon-export-ok` file, you will need to start the git daemon. |
| 244 | the git daemon. | ||
| 245 | 232 | ||
| 246 | To do this on a system with `systemd`, create a service file: | 233 | To do this on a system with `systemd`, create a service file: |
| 247 | 234 | ||
| @@ -279,8 +266,7 @@ sudo systemctl enable git-daemon.service | |||
| 279 | sudo systemctl start git-daemon.service | 266 | sudo systemctl start git-daemon.service |
| 280 | ``` | 267 | ``` |
| 281 | 268 | ||
| 282 | To clone read-only via the `git://` protocol, you can use the | 269 | To clone read-only via the `git://` protocol, you can use the following syntax: |
| 283 | following syntax: | ||
| 284 | 270 | ||
| 285 | ```sh | 271 | ```sh |
| 286 | git clone git://git.example.com/test.git | 272 | git clone git://git.example.com/test.git |
| @@ -291,9 +277,9 @@ git clone git://git.example.com/test.git | |||
| 291 | At this point, we have a working git server that works with both SSH and | 277 | At this point, we have a working git server that works with both SSH and |
| 292 | read-only access. | 278 | read-only access. |
| 293 | 279 | ||
| 294 | For each of the repositories I had hosted a different provider, I | 280 | For each of the repositories I had hosted a different provider, I executed the |
| 295 | executed the following commands in order to place a copy on my server as | 281 | following commands in order to place a copy on my server as my new source of |
| 296 | my new source of truth: | 282 | truth: |
| 297 | 283 | ||
| 298 | Server: | 284 | Server: |
| 299 | 285 | ||
| @@ -316,23 +302,20 @@ git push | |||
| 316 | 302 | ||
| 317 | # Optional Web View: `cgit` | 303 | # Optional Web View: `cgit` |
| 318 | 304 | ||
| 319 | If you want a web viewer for your repositories, you can use various | 305 | If you want a web viewer for your repositories, you can use various tools, such |
| 320 | tools, such as `gitweb`, `cgit`, or | 306 | as `gitweb`, `cgit`, or `klaus`. I chose `cgit` due to its simple interface and |
| 321 | `klaus`. I chose `cgit` due to its simple | 307 | fairly easy set-up (compared to others). Not to mention that the [Linux kernel |
| 322 | interface and fairly easy set-up (compared to others). Not to mention | 308 | uses `cgit`](https://git.kernel.org/). |
| 323 | that the [Linux kernel uses `cgit`](https://git.kernel.org/). | ||
| 324 | 309 | ||
| 325 | ## Docker Compose | 310 | ## Docker Compose |
| 326 | 311 | ||
| 327 | Instead of using my previous method of using a `docker run` | 312 | Instead of using my previous method of using a `docker run` command, I've |
| 328 | command, I\'ve updated this section to use `docker-compose` | 313 | updated this section to use `docker-compose` instead for an easier installation |
| 329 | instead for an easier installation and simpler management and | 314 | and simpler management and configuration. |
| 330 | configuration. | ||
| 331 | 315 | ||
| 332 | In order to use Docker Compose, you will set up a | 316 | In order to use Docker Compose, you will set up a `docker-compose.yml` file to |
| 333 | `docker-compose.yml` file to automatically connect resources | 317 | automatically connect resources like the repositories, `cgitrc`, and various |
| 334 | like the repositories, `cgitrc`, and various files or folders | 318 | files or folders to the `cgit` container you're creating: |
| 335 | to the `cgit` container you\'re creating: | ||
| 336 | 319 | ||
| 337 | ```sh | 320 | ```sh |
| 338 | mkdir ~/cgit && cd ~/cgit | 321 | mkdir ~/cgit && cd ~/cgit |
| @@ -363,17 +346,16 @@ Then, just start the container: | |||
| 363 | sudo docker-compose up -d | 346 | sudo docker-compose up -d |
| 364 | ``` | 347 | ``` |
| 365 | 348 | ||
| 366 | Once it\'s finished installing, you can access the site at | 349 | Once it's finished installing, you can access the site at `<SERVER_IP>:8763` or |
| 367 | `<SERVER_IP>:8763` or use a reverse-proxy service to forward | 350 | use a reverse-proxy service to forward `cgit` to a URL, such as |
| 368 | `cgit` to a URL, such as `git.example.com`. See | 351 | `git.example.com`. See the next section for more details on reverse proxying a |
| 369 | the next section for more details on reverse proxying a URL to a local | 352 | URL to a local port. |
| 370 | port. | ||
| 371 | 353 | ||
| 372 | ## Nginx Reverse Proxy | 354 | ## Nginx Reverse Proxy |
| 373 | 355 | ||
| 374 | I am using Nginx as my reverse proxy so that the `cgit` | 356 | I am using Nginx as my reverse proxy so that the `cgit` Docker container can use |
| 375 | Docker container can use `git.example.com` as its URL. To do | 357 | `git.example.com` as its URL. To do so, I simply created the following |
| 376 | so, I simply created the following configuration file: | 358 | configuration file: |
| 377 | 359 | ||
| 378 | ```sh | 360 | ```sh |
| 379 | sudo nano /etc/nginx/sites-available/git.example.com | 361 | sudo nano /etc/nginx/sites-available/git.example.com |
| @@ -422,29 +404,26 @@ sudo ln -s /etc/nginx/sites-available/git.example.com /etc/nginx/sites-enabled/ | |||
| 422 | sudo systemctl restart nginx.service | 404 | sudo systemctl restart nginx.service |
| 423 | ``` | 405 | ``` |
| 424 | 406 | ||
| 425 | As we can see below, my site at `git.example.com` is | 407 | As we can see below, my site at `git.example.com` is available and running: |
| 426 | available and running: | ||
| 427 | 408 | ||
| 428 | ## Settings Up Git Details | 409 | ## Settings Up Git Details |
| 429 | 410 | ||
| 430 | Once you have `cgit` running, you can add some small details, | 411 | Once you have `cgit` running, you can add some small details, such as repository |
| 431 | such as repository owners and descriptions by editing the following | 412 | owners and descriptions by editing the following files within each repository. |
| 432 | files within each repository. | ||
| 433 | 413 | ||
| 434 | Alternatively, you can use the `cgitrc` file to edit these | 414 | Alternatively, you can use the `cgitrc` file to edit these details if you only |
| 435 | details if you only care to edit them for the purpose of seeing them on | 415 | care to edit them for the purpose of seeing them on your website. |
| 436 | your website. | ||
| 437 | 416 | ||
| 438 | The `description` file within the repository on your server | 417 | The `description` file within the repository on your server will display the |
| 439 | will display the description online. | 418 | description online. |
| 440 | 419 | ||
| 441 | ```sh | 420 | ```sh |
| 442 | cd /git/example.git | 421 | cd /git/example.git |
| 443 | nano description | 422 | nano description |
| 444 | ``` | 423 | ``` |
| 445 | 424 | ||
| 446 | You can add a `[gitweb]` block to the `config` | 425 | You can add a `[gitweb]` block to the `config` file in order to display the |
| 447 | file in order to display the owner of the repository. | 426 | owner of the repository. |
| 448 | 427 | ||
| 449 | ```sh | 428 | ```sh |
| 450 | cd /git/example.git | 429 | cd /git/example.git |
| @@ -456,21 +435,20 @@ nano config | |||
| 456 | owner = "YourName" | 435 | owner = "YourName" |
| 457 | ``` | 436 | ``` |
| 458 | 437 | ||
| 459 | Note that you can ignore the configuration within each repository and | 438 | Note that you can ignore the configuration within each repository and simply set |
| 460 | simply set up this information in the `cgitrc` file, if you | 439 | up this information in the `cgitrc` file, if you want to do it that way. |
| 461 | want to do it that way. | ||
| 462 | 440 | ||
| 463 | ## Editing `cgit` | 441 | ## Editing `cgit` |
| 464 | 442 | ||
| 465 | In order to edit certain items within `cgit`, you need to | 443 | In order to edit certain items within `cgit`, you need to edit the `cgitrc` |
| 466 | edit the `cgitrc` file. | 444 | file. |
| 467 | 445 | ||
| 468 | ```sh | 446 | ```sh |
| 469 | nano ~/cgit/cgitrc | 447 | nano ~/cgit/cgitrc |
| 470 | ``` | 448 | ``` |
| 471 | 449 | ||
| 472 | Below is an example configuration for `cgitrc`. You can find | 450 | Below is an example configuration for `cgitrc`. You can find all the |
| 473 | all the configuration options within the \[configuration manual\] | 451 | configuration options within the [configuration manual] |
| 474 | (<https://git.zx2c4.com/cgit/plain/cgitrc.5.txt>). | 452 | (<https://git.zx2c4.com/cgit/plain/cgitrc.5.txt>). |
| 475 | 453 | ||
| 476 | ``` conf | 454 | ``` conf |
| @@ -549,17 +527,14 @@ repo.desc=An example repository! | |||
| 549 | 527 | ||
| 550 | ## Final Fixes: Syntax Highlighting & README Rendering | 528 | ## Final Fixes: Syntax Highlighting & README Rendering |
| 551 | 529 | ||
| 552 | After completing my initial install and playing around with it for a few | 530 | After completing my initial install and playing around with it for a few days, I |
| 553 | days, I noticed two issues: | 531 | noticed two issues: |
| 554 | 532 | ||
| 555 | 1. Syntax highlighting did not work when viewing the source code within | 533 | 1. Syntax highlighting did not work when viewing the source code within a file. |
| 556 | a file. | 534 | 2. The `about` tab within a repository was not rendered to HTML. |
| 557 | 2. The `about` tab within a repository was not rendered to | ||
| 558 | HTML. | ||
| 559 | 535 | ||
| 560 | The following process fixes these issues. To start, let\'s go to the | 536 | The following process fixes these issues. To start, let's go to the `cgit` |
| 561 | `cgit` directory where we were editing our configuration file | 537 | directory where we were editing our configuration file earlier. |
| 562 | earlier. | ||
| 563 | 538 | ||
| 564 | ```sh | 539 | ```sh |
| 565 | cd ~/cgit | 540 | cd ~/cgit |
| @@ -589,15 +564,13 @@ curl https://git.zx2c4.com/cgit/plain/filters/html-converters/md2html > md2html | |||
| 589 | chmod 755 md2html | 564 | chmod 755 md2html |
| 590 | ``` | 565 | ``` |
| 591 | 566 | ||
| 592 | If you need other filters or html-converters found within [the cgit | 567 | If you need other filters or html-converters found within [the cgit project |
| 593 | project files](https://git.zx2c4.com/cgit/tree/filters), repeat the | 568 | files](https://git.zx2c4.com/cgit/tree/filters), repeat the `curl` and `chmod` |
| 594 | `curl` and `chmod` process above for whichever | 569 | process above for whichever files you need. |
| 595 | files you need. | ||
| 596 | 570 | ||
| 597 | However, formatting will not work quite yet since the Docker cgit | 571 | However, formatting will not work quite yet since the Docker cgit container |
| 598 | container we\'re using doesn\'t have the formatting package installed. | 572 | we're using doesn't have the formatting package installed. You can install |
| 599 | You can install this easily by install Python 3+ and the | 573 | this easily by install Python 3+ and the `pygments` package: |
| 600 | `pygments` package: | ||
| 601 | 574 | ||
| 602 | ```sh | 575 | ```sh |
| 603 | # Enter the container's command line | 576 | # Enter the container's command line |
| @@ -613,13 +586,11 @@ pip3 install markdown pygments && \ | |||
| 613 | exit | 586 | exit |
| 614 | ``` | 587 | ``` |
| 615 | 588 | ||
| 616 | **You will need to enter the cgit docker container and re-run these | 589 | **You will need to enter the cgit docker container and re-run these `yum` |
| 617 | `yum` commands every time you kill and restart the | 590 | commands every time you kill and restart the container!** |
| 618 | container!** | ||
| 619 | 591 | ||
| 620 | If not done already, we need to add the following variables to our | 592 | If not done already, we need to add the following variables to our `cgitrc` file |
| 621 | `cgitrc` file in order for `cgit` to know where | 593 | in order for `cgit` to know where our filtering files are: |
| 622 | our filtering files are: | ||
| 623 | 594 | ||
| 624 | ``` conf | 595 | ``` conf |
| 625 | # Highlight source code with python pygments-based highlighter | 596 | # Highlight source code with python pygments-based highlighter |
| @@ -630,26 +601,24 @@ source-filter=/var/www/htdocs/cgit/filters/syntax-highlighting.py | |||
| 630 | about-filter=/var/www/htdocs/cgit/filters/about-formatting.sh | 601 | about-filter=/var/www/htdocs/cgit/filters/about-formatting.sh |
| 631 | ``` | 602 | ``` |
| 632 | 603 | ||
| 633 | Now you should see that syntax highlighting and README rendering to the | 604 | Now you should see that syntax highlighting and README rendering to the `about` |
| 634 | `about` tab is fixed. | 605 | tab is fixed. |
| 635 | 606 | ||
| 636 | ## Theming | 607 | ## Theming |
| 637 | 608 | ||
| 638 | I won\'t go into much detail in this section, but you can fully theme | 609 | I won't go into much detail in this section, but you can fully theme your |
| 639 | your installation of `cgit` since you have access to the | 610 | installation of `cgit` since you have access to the `cgit.css` file in your web |
| 640 | `cgit.css` file in your web root. This is another file you | 611 | root. This is another file you can add as a volume to the `docker-compose.yml` |
| 641 | can add as a volume to the `docker-compose.yml` file if you | 612 | file if you want to edit this without entering the container's command line. |
| 642 | want to edit this without entering the container\'s command line. | ||
| 643 | 613 | ||
| 644 | ### :warning: Remember to Back Up Your Data! | 614 | ### :warning: Remember to Back Up Your Data! |
| 645 | 615 | ||
| 646 | The last thing to note is that running services on your own equipment | 616 | The last thing to note is that running services on your own equipment means that |
| 647 | means that you\'re assuming a level of risk that exists regarding data | 617 | you're assuming a level of risk that exists regarding data loss, catastrophes, |
| 648 | loss, catastrophes, etc. In order to reduce the impact of any such | 618 | etc. In order to reduce the impact of any such occurrence, I suggest backing up |
| 649 | occurrence, I suggest backing up your data regularly. | 619 | your data regularly. |
| 650 | 620 | ||
| 651 | Backups can be automated via `cron`, by hooking your base | 621 | Backups can be automated via `cron`, by hooking your base directory up to a |
| 652 | directory up to a cloud provider, or even setting up hooks to push all | 622 | cloud provider, or even setting up hooks to push all repository info to git |
| 653 | repository info to git mirrors on other git hosts. Whatever the method, | 623 | mirrors on other git hosts. Whatever the method, make sure that your data |
| 654 | make sure that your data doesn\'t vanish in the event that your drives | 624 | doesn't vanish in the event that your drives or servers fail. |
| 655 | or servers fail. | ||
content/blog/2022-07-14-gnupg.md +126 −140
| @@ -7,33 +7,31 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # The History of GPG | 8 | # The History of GPG |
| 9 | 9 | ||
| 10 | [GNU Privacy Guard](https://gnupg.org/), also known as GnuPG and GPG, is | 10 | [GNU Privacy Guard](https://gnupg.org/), also known as GnuPG and GPG, is a free |
| 11 | a free (\"free\" as in both speech and beer) software that fully | 11 | ("free" as in both speech and beer) software that fully implements the OpenPGP |
| 12 | implements the OpenPGP Message Format documented in [RFC | 12 | Message Format documented in [RFC 4880](https://www.rfc-editor.org/rfc/rfc4880). |
| 13 | 4880](https://www.rfc-editor.org/rfc/rfc4880). | ||
| 14 | 13 | ||
| 15 | I won\'t go in-depth on the full history of the software in this post, | 14 | I won't go in-depth on the full history of the software in this post, but it is |
| 16 | but it is important to understand that GPG is not the same as PGP | 15 | important to understand that GPG is not the same as PGP (Pretty Good Privacy), |
| 17 | (Pretty Good Privacy), which is a different implementation of RFC 4880. | 16 | which is a different implementation of RFC 4880. However, GPG was designed to |
| 18 | However, GPG was designed to interoperate with PGP. | 17 | interoperate with PGP. |
| 19 | 18 | ||
| 20 | GPG was originally developed in the late 1990s by [Werner | 19 | GPG was originally developed in the late 1990s by [Werner |
| 21 | Koch](https://en.wikipedia.org/wiki/Werner_Koch) and has historically | 20 | Koch](https://en.wikipedia.org/wiki/Werner_Koch) and has historically been |
| 22 | been funded generously by the German government. | 21 | funded generously by the German government. |
| 23 | 22 | ||
| 24 | Now that we have all the high-level info out of the way, let\'s dive | 23 | Now that we have all the high-level info out of the way, let's dive into the |
| 25 | into the different aspects of GPG and its uses. | 24 | different aspects of GPG and its uses. |
| 26 | 25 | ||
| 27 | # Encryption Algorithms | 26 | # Encryption Algorithms |
| 28 | 27 | ||
| 29 | GPG supports a wide range of different encryption algorithms, including | 28 | GPG supports a wide range of different encryption algorithms, including |
| 30 | public-key, cipher, hash, and compression algorithms. The support for | 29 | public-key, cipher, hash, and compression algorithms. The support for these |
| 31 | these algorithms has grown since the adoption of the Libgcrypt library | 30 | algorithms has grown since the adoption of the Libgcrypt library in the 2.x |
| 32 | in the 2.x versions of GPG. | 31 | versions of GPG. |
| 33 | 32 | ||
| 34 | As you will be able to see below in an example of a full key generation | 33 | As you will be able to see below in an example of a full key generation with the |
| 35 | with the GPG command line tool, GPG recommends the following algorithms | 34 | GPG command line tool, GPG recommends the following algorithms to new users: |
| 36 | to new users: | ||
| 37 | 35 | ||
| 38 | ```sh | 36 | ```sh |
| 39 | Please select what kind of key you want: | 37 | Please select what kind of key you want: |
| @@ -45,77 +43,71 @@ Please select what kind of key you want: | |||
| 45 | (10) ECC (sign only) | 43 | (10) ECC (sign only) |
| 46 | ``` | 44 | ``` |
| 47 | 45 | ||
| 48 | I am not doing an in-depth explanation here in order to keep the focus | 46 | I am not doing an in-depth explanation here in order to keep the focus on GPG |
| 49 | on GPG and not encryption algorithms. If you want a deep dive into | 47 | and not encryption algorithms. If you want a deep dive into cryptography or |
| 50 | cryptography or encryption algorithms, please read my other posts: | 48 | encryption algorithms, please read my other posts: |
| 51 | 49 | ||
| 52 | - [AES Encryption](../aes-encryption/) (2018) | 50 | - [AES Encryption](../aes-encryption/) (2018) |
| 53 | - [Cryptography Basics](../cryptography-basics/) (2020) | 51 | - [Cryptography Basics](../cryptography-basics/) (2020) |
| 54 | 52 | ||
| 55 | ## Vulnerabilities | 53 | ## Vulnerabilities |
| 56 | 54 | ||
| 57 | As of 2022-07-14, there are a few different vulnerabilities associated | 55 | As of 2022-07-14, there are a few different vulnerabilities associated with GPG |
| 58 | with GPG or the libraries it uses: | 56 | or the libraries it uses: |
| 59 | 57 | ||
| 60 | - GPG versions 1.0.2--1.2.3 contains a bug where \"as soon as one | 58 | - GPG versions 1.0.2--1.2.3 contains a bug where "as soon as one |
| 61 | (GPG-generated) ElGamal signature of an arbitrary message is | 59 | (GPG-generated) ElGamal signature of an arbitrary message is released, one can |
| 62 | released, one can recover the signer\'s private key in less than a | 60 | recover the signer's private key in less than a second on a PC." |
| 63 | second on a PC.\" | 61 | ([Source](https://www.di.ens.fr/~pnguyen/pub_Ng04.htm)) |
| 64 | ([Source](https://www.di.ens.fr/~pnguyen/pub_Ng04.htm)) | 62 | - GPG versions prior to 1.4.2.1 contain a false positive signature verification |
| 65 | - GPG versions prior to 1.4.2.1 contain a false positive signature | 63 | bug. |
| 66 | verification bug. | 64 | ([Source](https://lists.gnupg.%20org/pipermail/gnupg-announce/2006q1/000211.html)) |
| 67 | ([Source](https://lists.gnupg.%20org/pipermail/gnupg-announce/2006q1/000211.html)) | 65 | - GPG versions prior to 1.4.2.2 cannot detect injection of unsigned data. ( |
| 68 | - GPG versions prior to 1.4.2.2 cannot detect injection of unsigned | 66 | [Source](https://lists.gnupg.org/pipermail/gnupg-announce/2006q1/000218.html)) |
| 69 | data. ( | 67 | - Libgcrypt, a library used by GPG, contained a bug which enabled full key |
| 70 | [Source](https://lists.gnupg.org/pipermail/gnupg-announce/2006q1/000218.html)) | 68 | recovery for RSA-1024 and some RSA-2048 keys. This was resolved in a GPG |
| 71 | - Libgcrypt, a library used by GPG, contained a bug which enabled full | 69 | update in 2017. ([Source](https://lwn.net/Articles/727179/)) |
| 72 | key recovery for RSA-1024 and some RSA-2048 keys. This was resolved | 70 | - The [ROCA Vulnerability](https://en.wikipedia.org/wiki/ROCA_vulnerability) |
| 73 | in a GPG update in 2017. | 71 | affects RSA keys generated by YubiKey 4 tokens. |
| 74 | ([Source](https://lwn.net/Articles/727179/)) | 72 | ([Source](https://crocs.fi.%20muni.cz/_media/public/papers/nemec_roca_ccs17_preprint.pdf)) |
| 75 | - The [ROCA | 73 | - The [SigSpoof Attack](https://en.wikipedia.org/wiki/SigSpoof) allows an |
| 76 | Vulnerability](https://en.wikipedia.org/wiki/ROCA_vulnerability) | 74 | attacker to spoof digital signatures. |
| 77 | affects RSA keys generated by YubiKey 4 tokens. | 75 | ([Source](https://arstechnica.%20com/information-technology/2018/06/decades-old-pgp-bug-allowed-hackers-to-spoof-just-about-anyones-signature/)) |
| 78 | ([Source](https://crocs.fi.%20muni.cz/_media/public/papers/nemec_roca_ccs17_preprint.pdf)) | 76 | - Libgcrypt 1.9.0 contains a severe flaw related to a heap buffer overflow, |
| 79 | - The [SigSpoof Attack](https://en.wikipedia.org/wiki/SigSpoof) allows | 77 | fixed in Libgcrypt 1.9.1 |
| 80 | an attacker to spoof digital signatures. | 78 | ([Source](https://web.archive.%20org/web/20210221012505/https://www.theregister.com/2021/01/29/severe_libgcrypt_bug/)) |
| 81 | ([Source](https://arstechnica.%20com/information-technology/2018/06/decades-old-pgp-bug-allowed-hackers-to-spoof-just-about-anyones-signature/)) | ||
| 82 | - Libgcrypt 1.9.0 contains a severe flaw related to a heap buffer | ||
| 83 | overflow, fixed in Libgcrypt 1.9.1 | ||
| 84 | ([Source](https://web.archive.%20org/web/20210221012505/https://www.theregister.com/2021/01/29/severe_libgcrypt_bug/)) | ||
| 85 | 79 | ||
| 86 | ### Platforms | 80 | ### Platforms |
| 87 | 81 | ||
| 88 | Originally developed as a command-line program for \*nix systems, GPG | 82 | Originally developed as a command-line program for *nix systems, GPG now has a |
| 89 | now has a wealth of front-end applications and libraries available for | 83 | wealth of front-end applications and libraries available for end-users. However, |
| 90 | end-users. However, the most recommended programs remain the same: | 84 | the most recommended programs remain the same: |
| 91 | 85 | ||
| 92 | - [GnuPG](https://gnupg.org) for Linux (depending on distro) | 86 | - [GnuPG](https://gnupg.org) for Linux (depending on distro) |
| 93 | - [Gpg4win](https://gpg4win.org) for Windows | 87 | - [Gpg4win](https://gpg4win.org) for Windows |
| 94 | - [GPGTools](https://gpgtools.org) for macOS | 88 | - [GPGTools](https://gpgtools.org) for macOS |
| 95 | 89 | ||
| 96 | # Creating a Key Pair | 90 | # Creating a Key Pair |
| 97 | 91 | ||
| 98 | In order to create a GPG key pair, a user would first need to install | 92 | In order to create a GPG key pair, a user would first need to install GPG on |
| 99 | GPG on their system. If we\'re assuming that the user is on Fedora | 93 | their system. If we're assuming that the user is on Fedora Linux, they would |
| 100 | Linux, they would execute the following: | 94 | execute the following: |
| 101 | 95 | ||
| 102 | ```sh | 96 | ```sh |
| 103 | sudo dnf install gpg | 97 | sudo dnf install gpg |
| 104 | ``` | 98 | ``` |
| 105 | 99 | ||
| 106 | Once installed, a user can create a new key pair with the following | 100 | Once installed, a user can create a new key pair with the following command(s): |
| 107 | command(s): | ||
| 108 | 101 | ||
| 109 | ```sh | 102 | ```sh |
| 110 | gpg --full-generate-key | 103 | gpg --full-generate-key |
| 111 | ``` | 104 | ``` |
| 112 | 105 | ||
| 113 | GPG will walk the user through an interactive setup that asks for an | 106 | GPG will walk the user through an interactive setup that asks for an algorithm |
| 114 | algorithm preference, expiration date, name, and email to associate with | 107 | preference, expiration date, name, and email to associate with this key. |
| 115 | this key. | ||
| 116 | 108 | ||
| 117 | See the following example key set-up for a default key generation using | 109 | See the following example key set-up for a default key generation using the |
| 118 | the GnuPG command-line interface: | 110 | GnuPG command-line interface: |
| 119 | 111 | ||
| 120 | ```sh | 112 | ```sh |
| 121 | gpg (GnuPG) 2.3.6; Copyright (C) 2021 Free Software Foundation, Inc. | 113 | gpg (GnuPG) 2.3.6; Copyright (C) 2021 Free Software Foundation, Inc. |
| @@ -178,66 +170,63 @@ interface. | |||
| 178 | 170 | ||
| 179 | As noted in RFC 4880, the general functions of OpenPGP are as follows: | 171 | As noted in RFC 4880, the general functions of OpenPGP are as follows: |
| 180 | 172 | ||
| 181 | - digital signatures | 173 | - digital signatures |
| 182 | - encryption | 174 | - encryption |
| 183 | - compression | 175 | - compression |
| 184 | - Radix-64 conversion | 176 | - Radix-64 conversion |
| 185 | - key management and certificate services | 177 | - key management and certificate services |
| 186 | 178 | ||
| 187 | From this, you can probably gather that the main use of GPG is for | 179 | From this, you can probably gather that the main use of GPG is for encrypting |
| 188 | encrypting data and/or signing the data with a key. The purpose of | 180 | data and/or signing the data with a key. The purpose of encrypting data with GPG |
| 189 | encrypting data with GPG is to ensure that no one except the intended | 181 | is to ensure that no one except the intended recipient(s) can access the data. |
| 190 | recipient(s) can access the data. | ||
| 191 | 182 | ||
| 192 | Let\'s explore some specific GPG use-cases. | 183 | Let's explore some specific GPG use-cases. |
| 193 | 184 | ||
| 194 | 185 | ||
| 195 | 186 | ||
| 196 | One of the more popular uses of GPG is to sign and/or encrypt emails. | 187 | One of the more popular uses of GPG is to sign and/or encrypt emails. With the |
| 197 | With the use of a GPG keypair, you can encrypt a message, its subject, | 188 | use of a GPG keypair, you can encrypt a message, its subject, and even the |
| 198 | and even the attachments within. | 189 | attachments within. |
| 199 | 190 | ||
| 200 | The first process, regarding the signing of a message without any | 191 | The first process, regarding the signing of a message without any encryption, is |
| 201 | encryption, is generally used to provide assurance that an email is | 192 | generally used to provide assurance that an email is truly coming from the |
| 202 | truly coming from the sender that the message claims. When I send an | 193 | sender that the message claims. When I send an email, and it's signed with my |
| 203 | email, and it\'s signed with my public key, the recipient(s) of the | 194 | public key, the recipient(s) of the message can verify that the message was |
| 204 | message can verify that the message was signed with my personal key. | 195 | signed with my personal key. |
| 205 | 196 | ||
| 206 | The second process, regarding the actual encryption of the message and | 197 | The second process, regarding the actual encryption of the message and its |
| 207 | its contents, works by using a combination of the sender\'s keys and the | 198 | contents, works by using a combination of the sender's keys and the |
| 208 | recipient\'s keys. This process may vary slightly by implementation, but | 199 | recipient's keys. This process may vary slightly by implementation, but it most |
| 209 | it most commonly uses asymmetric cryptography, also known as public-key | 200 | commonly uses asymmetric cryptography, also known as public-key cryptography. In |
| 210 | cryptography. In this version of encryption, the sender\'s private key | 201 | this version of encryption, the sender's private key to sign the message and a |
| 211 | to sign the message and a combination of the sender\'s keys and the | 202 | combination of the sender's keys and the recipient's public key to encrypt the |
| 212 | recipient\'s public key to encrypt the message. | 203 | message. |
| 213 | 204 | ||
| 214 | If two people each have their own private keys and exchange their public | 205 | If two people each have their own private keys and exchange their public keys, |
| 215 | keys, they can send encrypted messages back and forth with GPG. This is | 206 | they can send encrypted messages back and forth with GPG. This is also possible |
| 216 | also possible with symmetric cryptography, but the process differs since | 207 | with symmetric cryptography, but the process differs since there are no key |
| 217 | there are no key pairs. | 208 | pairs. |
| 218 | 209 | ||
| 219 | Implementation of email encryption varies greatly between email clients, | 210 | Implementation of email encryption varies greatly between email clients, so you |
| 220 | so you will need to reference your email client\'s documentation to | 211 | will need to reference your email client's documentation to ensure you are |
| 221 | ensure you are setting it up correctly for that specific client. | 212 | setting it up correctly for that specific client. |
| 222 | 213 | ||
| 223 | ## File Encryption | 214 | ## File Encryption |
| 224 | 215 | ||
| 225 | As noted in the section above regarding emails, GPG enables users to be | 216 | As noted in the section above regarding emails, GPG enables users to be able to |
| 226 | able to send a message to each other if they are both set-up with GPG | 217 | send a message to each other if they are both set-up with GPG keys. In this |
| 227 | keys. In this example, I am going to show how a user could send a file | 218 | example, I am going to show how a user could send a file called |
| 228 | called `example_file.txt` to another user via the | 219 | `example_file.txt` to another user via the recipient's email. |
| 229 | recipient\'s email. | ||
| 230 | 220 | ||
| 231 | The sender would find the file they want to send and execute the | 221 | The sender would find the file they want to send and execute the following |
| 232 | following command: | 222 | command: |
| 233 | 223 | ||
| 234 | ```sh | 224 | ```sh |
| 235 | gpg --encrypt --output example_file.txt.gpg --recipient \ | 225 | gpg --encrypt --output example_file.txt.gpg --recipient \ |
| 236 | recipient@example.com example_file.txt | 226 | recipient@example.com example_file.txt |
| 237 | ``` | 227 | ``` |
| 238 | 228 | ||
| 239 | Once received, the recipient can decrypt the file with the following | 229 | Once received, the recipient can decrypt the file with the following command: |
| 240 | command: | ||
| 241 | 230 | ||
| 242 | ```sh | 231 | ```sh |
| 243 | gpg --decrypt --output example_file.txt example_file.txt.gpg | 232 | gpg --decrypt --output example_file.txt example_file.txt.gpg |
| @@ -245,29 +234,28 @@ gpg --decrypt --output example_file.txt example_file.txt.gpg | |||
| 245 | 234 | ||
| 246 | ## Ownership Signatures | 235 | ## Ownership Signatures |
| 247 | 236 | ||
| 248 | One important aspect of GPG, especially for developers, is the ability | 237 | One important aspect of GPG, especially for developers, is the ability to sign |
| 249 | to sign data without encrypting it. For example, developers often sign | 238 | data without encrypting it. For example, developers often sign code changes when |
| 250 | code changes when they commit the changes back to a central repository, | 239 | they commit the changes back to a central repository, in order to display |
| 251 | in order to display ownership of who made the changes. This allows other | 240 | ownership of who made the changes. This allows other users to look at a code |
| 252 | users to look at a code change and determine that the change was valid. | 241 | change and determine that the change was valid. |
| 253 | 242 | ||
| 254 | In order to do this using [Git](https://git-scm.com), the developer | 243 | In order to do this using [Git](https://git-scm.com), the developer simply needs |
| 255 | simply needs to alter the `git commit` command to include the | 244 | to alter the `git commit` command to include the `-S` flag. Here's an example: |
| 256 | `-S` flag. Here\'s an example: | ||
| 257 | 245 | ||
| 258 | ```sh | 246 | ```sh |
| 259 | git commit -S -m "my commit message" | 247 | git commit -S -m "my commit message" |
| 260 | ``` | 248 | ``` |
| 261 | 249 | ||
| 262 | As an expansion of the example above, Git users can configure their | 250 | As an expansion of the example above, Git users can configure their environment |
| 263 | environment with a default key to use by adding their GPG signature: | 251 | with a default key to use by adding their GPG signature: |
| 264 | 252 | ||
| 265 | ```sh | 253 | ```sh |
| 266 | git config --global user.signingkey XXXXXXXXXXXXXXXX | 254 | git config --global user.signingkey XXXXXXXXXXXXXXXX |
| 267 | ``` | 255 | ``` |
| 268 | 256 | ||
| 269 | If you\'re not sure what your signature is, you can find it titled | 257 | If you're not sure what your signature is, you can find it titled `sig` in the |
| 270 | `sig` in the output of this command: | 258 | output of this command: |
| 271 | 259 | ||
| 272 | ```sh | 260 | ```sh |
| 273 | gpg --list-signatures | 261 | gpg --list-signatures |
| @@ -275,12 +263,11 @@ gpg --list-signatures | |||
| 275 | 263 | ||
| 276 | ## File Integrity | 264 | ## File Integrity |
| 277 | 265 | ||
| 278 | When a person generates a signature for data, they are allowing users | 266 | When a person generates a signature for data, they are allowing users the |
| 279 | the ability to verify the signature on that data in the future to ensure | 267 | ability to verify the signature on that data in the future to ensure the data |
| 280 | the data has not been corrupted. This is most common with software | 268 | has not been corrupted. This is most common with software applications hosted on |
| 281 | applications hosted on the internet - developers provide signatures so | 269 | the internet - developers provide signatures so that users can verify a website |
| 282 | that users can verify a website was not hijacked and download links | 270 | was not hijacked and download links replaced with dangerous software. |
| 283 | replaced with dangerous software. | ||
| 284 | 271 | ||
| 285 | In order to verify signed data, a user needs to have: | 272 | In order to verify signed data, a user needs to have: |
| 286 | 273 | ||
| @@ -288,9 +275,8 @@ In order to verify signed data, a user needs to have: | |||
| 288 | 2. A signature file | 275 | 2. A signature file |
| 289 | 3. The public GPG key of the signer | 276 | 3. The public GPG key of the signer |
| 290 | 277 | ||
| 291 | Once the signer\'s public key is imported on the user\'s system, and | 278 | Once the signer's public key is imported on the user's system, and they have |
| 292 | they have the data and signature, they can verify the data with the | 279 | the data and signature, they can verify the data with the following commands: |
| 293 | following commands: | ||
| 294 | 280 | ||
| 295 | ```sh | 281 | ```sh |
| 296 | # If the signature is attached to the data | 282 | # If the signature is attached to the data |
| @@ -302,13 +288,13 @@ gpg --verify [signature-file] [original-file] | |||
| 302 | 288 | ||
| 303 | ### Finding Public Keys | 289 | ### Finding Public Keys |
| 304 | 290 | ||
| 305 | In order to use GPG with others, a user needs to know the other user(s) | 291 | In order to use GPG with others, a user needs to know the other user(s) keys. |
| 306 | keys. This is easy to do if the user knows the other user(s) in person, | 292 | This is easy to do if the user knows the other user(s) in person, but may be |
| 307 | but may be hard if the relationship is strictly digital. Luckily, there | 293 | hard if the relationship is strictly digital. Luckily, there are a few options. |
| 308 | are a few options. The first option is to look at a user\'s web page or | 294 | The first option is to look at a user's web page or social pages if they have |
| 309 | social pages if they have them. | 295 | them. |
| 310 | 296 | ||
| 311 | Otherwise, the best option is to use a keyserver, such as: | 297 | Otherwise, the best option is to use a keyserver, such as: |
| 312 | 298 | ||
| 313 | - [pgp.mit.edu](https://pgp.mit.edu) | 299 | - [pgp.mit.edu](https://pgp.mit.edu) |
| 314 | - [keys.openpgp.org](https://keys.openpgp.org) | 300 | - [keys.openpgp.org](https://keys.openpgp.org) |
content/blog/2022-07-25-curseradio.md +36 −42
| @@ -8,62 +8,56 @@ draft = false | |||
| 8 | # Overview | 8 | # Overview |
| 9 | 9 | ||
| 10 | While exploring some interesting Linux applications, I stumbled across | 10 | While exploring some interesting Linux applications, I stumbled across |
| 11 | [curseradio](https://github.com/chronitis/curseradio), a command-line | 11 | [curseradio](https://github.com/chronitis/curseradio), a command-line radio |
| 12 | radio player based on Python. | 12 | player based on Python. |
| 13 | 13 | ||
| 14 | This application is fantastic and incredibly easy to install, so I | 14 | This application is fantastic and incredibly easy to install, so I wanted to |
| 15 | wanted to dedicate a post today to this app. Let\'s look at the features | 15 | dedicate a post today to this app. Let's look at the features within the app |
| 16 | within the app and then walk through the installation process I took to | 16 | and then walk through the installation process I took to get `curseradio` |
| 17 | get `curseradio` working. | 17 | working. |
| 18 | 18 | ||
| 19 | # Features | 19 | # Features |
| 20 | 20 | ||
| 21 |  | 21 |  |
| 22 | 22 | ||
| 23 | The radio player itself is quite minimal. As you can see in the | 23 | The radio player itself is quite minimal. As you can see in the screenshot |
| 24 | screenshot above, it contains a simple plaintext list of all available | 24 | above, it contains a simple plaintext list of all available categories, which |
| 25 | categories, which can be broken down further and further. In addition, | 25 | can be broken down further and further. In addition, radio shows are available |
| 26 | radio shows are available for listening, alongside regular radio | 26 | for listening, alongside regular radio stations. |
| 27 | stations. | ||
| 28 | 27 | ||
| 29 | For example, the `Sports` \> `Pro Basketball` \> | 28 | For example, the `Sports` > `Pro Basketball` > `Shows` category contains a |
| 30 | `Shows` category contains a number of specific shows related | 29 | number of specific shows related to Professional Basketball. |
| 31 | to Professional Basketball. | ||
| 32 | 30 | ||
| 33 | Aside from being able to play any of the listed stations/shows, you can | 31 | Aside from being able to play any of the listed stations/shows, you can make a |
| 34 | make a channel your favorite by pressing `f`. It will now | 32 | channel your favorite by pressing `f`. It will now show up at the top of the |
| 35 | show up at the top of the radio player in the `Favourites` | 33 | radio player in the `Favourites` category. |
| 36 | category. | ||
| 37 | 34 | ||
| 38 | ## Commands/Shortcuts | 35 | ## Commands/Shortcuts |
| 39 | 36 | ||
| 40 | Key(s) Command | 37 | | Key(s) | Command | |
| 41 | ------------ --------------------------------- | 38 | |------------|---------------------------------| |
| 42 | ↑, ↓ navigate | 39 | | ↑, ↓ | navigate | |
| 43 | PgUp, PgDn navigate quickly | 40 | | PgUp, PgDn | navigate quickly | |
| 44 | Home, End to top/bottom | 41 | | Home, End | to top/bottom | |
| 45 | Enter open/close folders, play stream | 42 | | Enter | open/close folders, play stream | |
| 46 | k stop playing stream | 43 | | k | stop playing stream | |
| 47 | q quit | 44 | | q | quit | |
| 48 | f toggle favourite | 45 | | f | toggle favourite | |
| 49 | 46 | ||
| 50 | # Installation | 47 | # Installation |
| 51 | 48 | ||
| 52 | ## Dependencies | 49 | ## Dependencies |
| 53 | 50 | ||
| 54 | Before installing `curseradio`, a handful of system and | 51 | Before installing `curseradio`, a handful of system and Python packages are |
| 55 | Python packages are required. To get started, install | 52 | required. To get started, install `python3`, `pip3`, and `mpv` on your system. |
| 56 | `python3`, `pip3`, and `mpv` on your | 53 | In this example, I'm using Fedora Linux, which uses the `dnf` package manager. |
| 57 | system. In this example, I\'m using Fedora Linux, which uses the | 54 | You may need to adjust this if you're using a different system. |
| 58 | `dnf` package manager. You may need to adjust this if you\'re | ||
| 59 | using a different system. | ||
| 60 | 55 | ||
| 61 | ```sh | 56 | ```sh |
| 62 | sudo dnf install python3 pip3 mpv | 57 | sudo dnf install python3 pip3 mpv |
| 63 | ``` | 58 | ``` |
| 64 | 59 | ||
| 65 | Next, use `pip3` to install `requests`, | 60 | Next, use `pip3` to install `requests`, `xdg`, and `lxml`: |
| 66 | `xdg`, and `lxml`: | ||
| 67 | 61 | ||
| 68 | ```sh | 62 | ```sh |
| 69 | pip3 install requests xdg lxml | 63 | pip3 install requests xdg lxml |
| @@ -71,23 +65,23 @@ pip3 install requests xdg lxml | |||
| 71 | 65 | ||
| 72 | ## Repository Source Installation | 66 | ## Repository Source Installation |
| 73 | 67 | ||
| 74 | Once all the dependencies are installed, we can clone the source code | 68 | Once all the dependencies are installed, we can clone the source code and enter |
| 75 | and enter that directory: | 69 | that directory: |
| 76 | 70 | ||
| 77 | ```sh | 71 | ```sh |
| 78 | git clone https://github.com/chronitis/curseradio && cd curseradio | 72 | git clone https://github.com/chronitis/curseradio && cd curseradio |
| 79 | ``` | 73 | ``` |
| 80 | 74 | ||
| 81 | Once you\'re within the `curseradio` directory, you can | 75 | Once you're within the `curseradio` directory, you can install the application |
| 82 | install the application with the provided `setup.py` script. | 76 | with the provided `setup.py` script. |
| 83 | 77 | ||
| 84 | ```sh | 78 | ```sh |
| 85 | sudo python3 setup.py install | 79 | sudo python3 setup.py install |
| 86 | ``` | 80 | ``` |
| 87 | 81 | ||
| 88 | In my case, I ran into a few errors and needed to create the folders | 82 | In my case, I ran into a few errors and needed to create the folders that |
| 89 | that curseradio wanted to use for its installation. If you don\'t get | 83 | curseradio wanted to use for its installation. If you don't get any errors, you |
| 90 | any errors, you can skip this and run the app. | 84 | can skip this and run the app. |
| 91 | 85 | ||
| 92 | ```sh | 86 | ```sh |
| 93 | sudo mkdir /usr/local/lib/python3.10/ | 87 | sudo mkdir /usr/local/lib/python3.10/ |
content/blog/2022-07-30-flac-to-opus.md +38 −42
| @@ -11,59 +11,56 @@ I am currently rebuilding my music library from scratch so that I can | |||
| 11 | effectively archive all the music I own in the [FLAC file | 11 | effectively archive all the music I own in the [FLAC file |
| 12 | format](https://en.wikipedia.org/wiki/FLAC), a lossless audio codec. | 12 | format](https://en.wikipedia.org/wiki/FLAC), a lossless audio codec. |
| 13 | 13 | ||
| 14 | However, streaming FLAC files outside the home can be difficult due to | 14 | However, streaming FLAC files outside the home can be difficult due to the size |
| 15 | the size of the files, especially if you\'re using a weak connection. | 15 | of the files, especially if you're using a weak connection. |
| 16 | 16 | ||
| 17 | So, in order to archive the music in a lossless format and still be able | 17 | So, in order to archive the music in a lossless format and still be able to |
| 18 | to stream it easily, I opted to create a copy of my FLAC files in the | 18 | stream it easily, I opted to create a copy of my FLAC files in the [Opus audio |
| 19 | [Opus audio codec](https://en.wikipedia.org/wiki/Opus_(audio_format)). | 19 | codec](https://en.wikipedia.org/wiki/Opus_(audio_format)). This allows me to |
| 20 | This allows me to archive a quality, lossless version of the music and | 20 | archive a quality, lossless version of the music and then point my streaming |
| 21 | then point my streaming service to the smaller, stream-ready version. | 21 | service to the smaller, stream-ready version. |
| 22 | 22 | ||
| 23 | ## Dependencies | 23 | ## Dependencies |
| 24 | 24 | ||
| 25 | The process I follow utilizes the `opus-tools` package in | 25 | The process I follow utilizes the `opus-tools` package in Ubuntu. Before |
| 26 | Ubuntu. Before proceeding, install the package: | 26 | proceeding, install the package: |
| 27 | 27 | ||
| 28 | ```sh | 28 | ```sh |
| 29 | sudo apt install opus-tools | 29 | sudo apt install opus-tools |
| 30 | ``` | 30 | ``` |
| 31 | 31 | ||
| 32 | If you want to use a different conversion method, such as | 32 | If you want to use a different conversion method, such as `ffmpeg` or `avconv`, |
| 33 | `ffmpeg` or `avconv`, simply install that package | 33 | simply install that package instead. |
| 34 | instead. | ||
| 35 | 34 | ||
| 36 | ## Conversion Process | 35 | ## Conversion Process |
| 37 | 36 | ||
| 38 | The script I\'m using is stored in my home directory, but feel free to | 37 | The script I'm using is stored in my home directory, but feel free to create it |
| 39 | create it wherever you want. It does not need to be in the same | 38 | wherever you want. It does not need to be in the same directory as your music |
| 40 | directory as your music files. | 39 | files. |
| 41 | 40 | ||
| 42 | ```sh | 41 | ```sh |
| 43 | cd ~ && nano transform.sh | 42 | cd ~ && nano transform.sh |
| 44 | ``` | 43 | ``` |
| 45 | 44 | ||
| 46 | Once you have your new bash script opened in an editor, go ahead and | 45 | Once you have your new bash script opened in an editor, go ahead and paste the |
| 47 | paste the following logic into the script. | 46 | following logic into the script. |
| 48 | 47 | ||
| 49 | You **MUST** edit the following variables in order for it to work: | 48 | You **MUST** edit the following variables in order for it to work: |
| 50 | 49 | ||
| 51 | - `source`: The source directory where your FLAC files are | 50 | - `source`: The source directory where your FLAC files are stored. |
| 52 | stored. | 51 | - `dest`: The destination directory where you want the resulting Opus files to |
| 53 | - `dest`: The destination directory where you want the | 52 | be stored. |
| 54 | resulting Opus files to be stored. | ||
| 55 | 53 | ||
| 56 | You **MAY** want to edit the following variables to suit your needs: | 54 | You **MAY** want to edit the following variables to suit your needs: |
| 57 | 55 | ||
| 58 | - `filename`: If you are converting to a file format other | 56 | - `filename`: If you are converting to a file format other than Opus, you'll |
| 59 | than Opus, you\'ll need to edit this so that your resulting files | 57 | need to edit this so that your resulting files have the correct filename |
| 60 | have the correct filename extension. | 58 | extension. |
| 61 | - `reldir`: This variable can be edited to strip out more | 59 | - `reldir`: This variable can be edited to strip out more leading directories in |
| 62 | leading directories in the file path. As you\'ll see later, I ignore | 60 | the file path. As you'll see later, I ignore this for now and simply clean it |
| 63 | this for now and simply clean it up afterward. | 61 | up afterward. |
| 64 | - `opusenc`: This is the actual conversion process. You may | 62 | - `opusenc`: This is the actual conversion process. You may want to edit the |
| 65 | want to edit the bitrate to suit your needs. I set mine at 128 but | 63 | bitrate to suit your needs. I set mine at 128 but some prefer 160 or higher. |
| 66 | some prefer 160 or higher. | ||
| 67 | 64 | ||
| 68 | ```sh | 65 | ```sh |
| 69 | #!/bin/bash | 66 | #!/bin/bash |
| @@ -129,8 +126,8 @@ opusenc --vbr --bitrate 128 --date "$DATE" \ | |||
| 129 | done | 126 | done |
| 130 | ``` | 127 | ``` |
| 131 | 128 | ||
| 132 | Once you\'re done, simply save the file and exit your editor. Don\'t | 129 | Once you're done, simply save the file and exit your editor. Don't forget to |
| 133 | forget to enable execution of the script: | 130 | enable execution of the script: |
| 134 | 131 | ||
| 135 | ```sh | 132 | ```sh |
| 136 | chmod +x transform.sh | 133 | chmod +x transform.sh |
| @@ -142,17 +139,16 @@ Finally, you may now run the script: | |||
| 142 | ./transform.sh | 139 | ./transform.sh |
| 143 | ``` | 140 | ``` |
| 144 | 141 | ||
| 145 | If you used `opusenc`, you\'ll see the conversions happen | 142 | If you used `opusenc`, you'll see the conversions happen within the terminal as |
| 146 | within the terminal as it progresses. You will also see variables | 143 | it progresses. You will also see variables printed if you uncommented any of the |
| 147 | printed if you uncommented any of the bash script\'s comments. | 144 | bash script's comments. |
| 148 | 145 | ||
| 149 | ## Cleanup | 146 | ## Cleanup |
| 150 | 147 | ||
| 151 | As I noted above, I didn\'t customize my `reldir` variable in | 148 | As I noted above, I didn't customize my `reldir` variable in the script, which |
| 152 | the script, which caused my output directory to be | 149 | caused my output directory to be `/mnt/music/library/archives` instead of |
| 153 | `/mnt/music/library/archives` instead of | 150 | `/mnt/music/library`. So, I moved the output up one level and deleted the |
| 154 | `/mnt/music/library`. So, I moved the output up one level and | 151 | accidental directory. |
| 155 | deleted the accidental directory. | ||
| 156 | 152 | ||
| 157 | ```sh | 153 | ```sh |
| 158 | cd /mnt/music/library | 154 | cd /mnt/music/library |
| @@ -162,8 +158,8 @@ rm -rf archives | |||
| 162 | 158 | ||
| 163 | ## Check the Resulting Size | 159 | ## Check the Resulting Size |
| 164 | 160 | ||
| 165 | If you want to see what kind of file size savings you\'ve gained, you | 161 | If you want to see what kind of file size savings you've gained, you can always |
| 166 | can always use the `du` command to check: | 162 | use the `du` command to check: |
| 167 | 163 | ||
| 168 | ```sh | 164 | ```sh |
| 169 | cd /mnt/music | 165 | cd /mnt/music |
content/blog/2022-07-31-bash-it.md +66 −72
| @@ -8,30 +8,30 @@ draft = false | |||
| 8 | # Bash | 8 | # Bash |
| 9 | 9 | ||
| 10 | For those who are not familiar, | 10 | For those who are not familiar, |
| 11 | [Bash](https://en.wikipedia.org/wiki/Bash_(Unix_shell)) is a Unix shell | 11 | [Bash](https://en.wikipedia.org/wiki/Bash_(Unix_shell)) is a Unix shell that is |
| 12 | that is used as the default login shell for most Linux distributions. | 12 | used as the default login shell for most Linux distributions. This shell and |
| 13 | This shell and command processor should be familiar if you\'ve used | 13 | command processor should be familiar if you've used Linux (or older version of |
| 14 | Linux (or older version of macOS) before. | 14 | macOS) before. |
| 15 | 15 | ||
| 16 | However, bash is not the only option. There are numerous other shells | 16 | However, bash is not the only option. There are numerous other shells that |
| 17 | that exist. Here are some popular examples: | 17 | exist. Here are some popular examples: |
| 18 | 18 | ||
| 19 | - [zsh](https://en.wikipedia.org/wiki/Z_shell) | 19 | - [zsh](https://en.wikipedia.org/wiki/Z_shell) |
| 20 | - [fish](https://en.wikipedia.org/wiki/Fish_(Unix_shell)) | 20 | - [fish](https://en.wikipedia.org/wiki/Fish_(Unix_shell)) |
| 21 | - [oksh](https://github.com/ibara/oksh) | 21 | - [oksh](https://github.com/ibara/oksh) |
| 22 | - [mksh](https://wiki.gentoo.org/wiki/Mksh) | 22 | - [mksh](https://wiki.gentoo.org/wiki/Mksh) |
| 23 | - [dash](https://en.wikipedia.org/wiki/Debian_Almquist_shell) | 23 | - [dash](https://en.wikipedia.org/wiki/Debian_Almquist_shell) |
| 24 | 24 | ||
| 25 | While each shell has its differences, bash is POSIX compliant and the | 25 | While each shell has its differences, bash is POSIX compliant and the default |
| 26 | default for many Linux users. Because of this, I am going to explore a | 26 | for many Linux users. Because of this, I am going to explore a program called |
| 27 | program called `bash-it` below that helps bash users increase | 27 | `bash-it` below that helps bash users increase the utility of their shell |
| 28 | the utility of their shell without installing a completely new shell. | 28 | without installing a completely new shell. |
| 29 | 29 | ||
| 30 | ## Installation | 30 | ## Installation |
| 31 | 31 | ||
| 32 | First, if bash is not already installed on your system, you can | 32 | First, if bash is not already installed on your system, you can [download bash |
| 33 | [download bash from GNU](https://www.gnu.org/software/bash/) or use your | 33 | from GNU](https://www.gnu.org/software/bash/) or use your package manager to |
| 34 | package manager to install it. | 34 | install it. |
| 35 | 35 | ||
| 36 | For example, this is how you can install bash on Fedora Linux: | 36 | For example, this is how you can install bash on Fedora Linux: |
| 37 | 37 | ||
| @@ -39,29 +39,29 @@ For example, this is how you can install bash on Fedora Linux: | |||
| 39 | sudo dnf install bash | 39 | sudo dnf install bash |
| 40 | ``` | 40 | ``` |
| 41 | 41 | ||
| 42 | If you are not using bash as your default shell, use the | 42 | If you are not using bash as your default shell, use the `chsh` command to |
| 43 | `chsh` command to change your shell: | 43 | change your shell: |
| 44 | 44 | ||
| 45 | ```sh | 45 | ```sh |
| 46 | chsh | 46 | chsh |
| 47 | ``` | 47 | ``` |
| 48 | 48 | ||
| 49 | You should see a prompt like the one below. If the brackets | 49 | You should see a prompt like the one below. If the brackets (`[]`) contain |
| 50 | (`[]`) contain `bash` already, you\'re done, and | 50 | `bash` already, you're done, and you can simply continue by hitting the Enter |
| 51 | you can simply continue by hitting the Enter key. | 51 | key. |
| 52 | 52 | ||
| 53 | If the brackets contain another shell path (e.g. | 53 | If the brackets contain another shell path (e.g. `/usr/bin/zsh`), enter the path |
| 54 | `/usr/bin/zsh`), enter the path to the bash program on your | 54 | to the bash program on your system (it's most likely located at |
| 55 | system (it\'s most likely located at `/usr/bin/bash`). | 55 | `/usr/bin/bash`). |
| 56 | 56 | ||
| 57 | ```sh | 57 | ```sh |
| 58 | Changing shell for <user>. | 58 | Changing shell for <user>. |
| 59 | New shell [/usr/bin/bash]: | 59 | New shell [/usr/bin/bash]: |
| 60 | ``` | 60 | ``` |
| 61 | 61 | ||
| 62 | You must log out or restart the machine in order for the login shell to | 62 | You must log out or restart the machine in order for the login shell to be |
| 63 | be refreshed. You can do it now or wait until you\'re finished | 63 | refreshed. You can do it now or wait until you're finished customizing the |
| 64 | customizing the shell. | 64 | shell. |
| 65 | 65 | ||
| 66 | ```sh | 66 | ```sh |
| 67 | sudo reboot now | 67 | sudo reboot now |
| @@ -69,30 +69,28 @@ sudo reboot now | |||
| 69 | 69 | ||
| 70 | # Bash-it | 70 | # Bash-it |
| 71 | 71 | ||
| 72 | As noted on the [Bash-it](https://github.com/Bash-it/bash-it) | 72 | As noted on the [Bash-it](https://github.com/Bash-it/bash-it) repository: |
| 73 | repository: | ||
| 74 | 73 | ||
| 75 | > Bash-it is a collection of community Bash commands and scripts for | 74 | > Bash-it is a collection of community Bash commands and scripts for Bash 3.2+. |
| 76 | > Bash 3.2+. (And a shameless ripoff of oh-my-zsh 😃) | 75 | > (And a shameless ripoff of oh-my-zsh 😃) |
| 77 | 76 | ||
| 78 | Bash-it makes it easy to install plugins, set up aliases for common | 77 | Bash-it makes it easy to install plugins, set up aliases for common commands, |
| 79 | commands, and easily change the visual theme of your shell. | 78 | and easily change the visual theme of your shell. |
| 80 | 79 | ||
| 81 | ## Installation | 80 | ## Installation |
| 82 | 81 | ||
| 83 | To install the framework, simply copy the repository files and use the | 82 | To install the framework, simply copy the repository files and use the |
| 84 | `install.sh` script provided. If you want, you can (and | 83 | `install.sh` script provided. If you want, you can (and should!) inspect the |
| 85 | should!) inspect the contents of the installation script before you run | 84 | contents of the installation script before you run it. |
| 86 | it. | ||
| 87 | 85 | ||
| 88 | ```sh | 86 | ```sh |
| 89 | git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it | 87 | git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it |
| 90 | ~/.bash_it/install.sh | 88 | ~/.bash_it/install.sh |
| 91 | ``` | 89 | ``` |
| 92 | 90 | ||
| 93 | If you didn\'t restart your session after making bash the default, and | 91 | If you didn't restart your session after making bash the default, and are |
| 94 | are currently working within another shell, be sure to enter a bash | 92 | currently working within another shell, be sure to enter a bash session before |
| 95 | session before using `bash-it`: | 93 | using `bash-it`: |
| 96 | 94 | ||
| 97 | ```sh | 95 | ```sh |
| 98 | bash | 96 | bash |
| @@ -101,16 +99,16 @@ bash | |||
| 101 | ## Aliases | 99 | ## Aliases |
| 102 | 100 | ||
| 103 | Bash-it contains a number of aliases for common commands to help improve | 101 | Bash-it contains a number of aliases for common commands to help improve |
| 104 | efficiency in the terminal. To list all available options, use the | 102 | efficiency in the terminal. To list all available options, use the following |
| 105 | following command: | 103 | command: |
| 106 | 104 | ||
| 107 | ```sh | 105 | ```sh |
| 108 | bash-it show aliases | 106 | bash-it show aliases |
| 109 | ``` | 107 | ``` |
| 110 | 108 | ||
| 111 | This will provide you a list that looks like the following text block. | 109 | This will provide you a list that looks like the following text block. Within |
| 112 | Within this screen, you will be able to see all available options and | 110 | this screen, you will be able to see all available options and which ones are |
| 113 | which ones are currently enabled. | 111 | currently enabled. |
| 114 | 112 | ||
| 115 | ``` txt | 113 | ``` txt |
| 116 | Alias Enabled? Description | 114 | Alias Enabled? Description |
| @@ -141,9 +139,8 @@ bash-it disable alias <alias name> [alias name]... -or- $ bash-it disable alias | |||
| 141 | 139 | ||
| 142 | ## Plugins | 140 | ## Plugins |
| 143 | 141 | ||
| 144 | Similar to aliases, plugins are available with bash-it. You can find a | 142 | Similar to aliases, plugins are available with bash-it. You can find a complete |
| 145 | complete list of plugins in the same way as aliases. Simply execute the | 143 | list of plugins in the same way as aliases. Simply execute the following: |
| 146 | following: | ||
| 147 | 144 | ||
| 148 | ```sh | 145 | ```sh |
| 149 | bash-it show plugins | 146 | bash-it show plugins |
| @@ -188,9 +185,8 @@ To list all themes: | |||
| 188 | ls ~/.bash_it/themes/ | 185 | ls ~/.bash_it/themes/ |
| 189 | ``` | 186 | ``` |
| 190 | 187 | ||
| 191 | To use a new theme, you\'ll need to edit `.bashrc` and alter | 188 | To use a new theme, you'll need to edit `.bashrc` and alter the `BASH_IT_THEME` |
| 192 | the `BASH_IT_THEME` variable to your desired theme. For | 189 | variable to your desired theme. For example, I am using the `zork` theme. |
| 193 | example, I am using the `zork` theme. | ||
| 194 | 190 | ||
| 195 | ```sh | 191 | ```sh |
| 196 | nano ~/.bashrc | 192 | nano ~/.bashrc |
| @@ -200,23 +196,22 @@ nano ~/.bashrc | |||
| 200 | export BASH_IT_THEME='zork' | 196 | export BASH_IT_THEME='zork' |
| 201 | ``` | 197 | ``` |
| 202 | 198 | ||
| 203 | Once you save your changes, you just need to exit your terminal and | 199 | Once you save your changes, you just need to exit your terminal and create a new |
| 204 | create a new one in order to see your changes to the | 200 | one in order to see your changes to the `.bashrc` file. You can also `source` |
| 205 | `.bashrc` file. You can also `source` the file to | 201 | the file to see changes, but I recommend starting a completely new shell |
| 206 | see changes, but I recommend starting a completely new shell instead. | 202 | instead. |
| 207 | 203 | ||
| 208 | ### ble.sh | 204 | ### ble.sh |
| 209 | 205 | ||
| 210 | One big feature I was missing in Bash that both `zsh` and | 206 | One big feature I was missing in Bash that both `zsh` and `fish` have is an |
| 211 | `fish` have is an autosuggestion feature. To explain: as you | 207 | autosuggestion feature. To explain: as you type, an autosuggestion feature in |
| 212 | type, an autosuggestion feature in the shell will offer suggestions in a | 208 | the shell will offer suggestions in a lighter font color beyond the characters |
| 213 | lighter font color beyond the characters already typed. Once you see the | 209 | already typed. Once you see the command you want, you can click the right arrow |
| 214 | command you want, you can click the right arrow and have the shell | 210 | and have the shell auto-complete that line for you. |
| 215 | auto-complete that line for you. | ||
| 216 | 211 | ||
| 217 | Luckily, the [Bash Line Editor](https://github.com/akinomyoga/ble.sh) | 212 | Luckily, the [Bash Line Editor](https://github.com/akinomyoga/ble.sh) (ble.sh) |
| 218 | (ble.sh) exists! This program provides a wonderful autosuggestions | 213 | exists! This program provides a wonderful autosuggestions feature perfectly, |
| 219 | feature perfectly, among other features that I haven\'t tested yet. | 214 | among other features that I haven't tested yet. |
| 220 | 215 | ||
| 221 | In order to install ble.sh, execute the following: | 216 | In order to install ble.sh, execute the following: |
| 222 | 217 | ||
| @@ -226,17 +221,16 @@ make -C ble.sh install PREFIX=~/.local | |||
| 226 | echo 'source ~/.local/share/blesh/ble.sh' >> ~/.bashrc | 221 | echo 'source ~/.local/share/blesh/ble.sh' >> ~/.bashrc |
| 227 | ``` | 222 | ``` |
| 228 | 223 | ||
| 229 | Again, exit the terminal and open a new one in order to see the | 224 | Again, exit the terminal and open a new one in order to see the newly-configured |
| 230 | newly-configured shell. | 225 | shell. |
| 231 | 226 | ||
| 232 | # Restart the Session | 227 | # Restart the Session |
| 233 | 228 | ||
| 234 | Finally, as mentioned above, you\'ll need to restart the session to | 229 | Finally, as mentioned above, you'll need to restart the session to ensure that |
| 235 | ensure that your user is using bash by default. | 230 | your user is using bash by default. |
| 236 | 231 | ||
| 237 | You will also need to exit and re-open a shell (e.g., terminal or | 232 | You will also need to exit and re-open a shell (e.g., terminal or terminal tab) |
| 238 | terminal tab) any time you make changes to the `.bashrc` | 233 | any time you make changes to the `.bashrc` file. |
| 239 | file. | ||
| 240 | 234 | ||
| 241 | ```sh | 235 | ```sh |
| 242 | sudo reboot now | 236 | sudo reboot now |
content/blog/2022-08-31-privacy-com-changes.md +54 −61
| @@ -7,93 +7,86 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Privacy.com Changes Their Terms | 8 | # Privacy.com Changes Their Terms |
| 9 | 9 | ||
| 10 | Recently, Privacy.com reached out to their customers regarding a change | 10 | Recently, Privacy.com reached out to their customers regarding a change in their |
| 11 | in their terms of use. Further, all customers are required to agree to | 11 | terms of use. Further, all customers are required to agree to the changes in |
| 12 | the changes in order to continue using their accounts. | 12 | order to continue using their accounts. |
| 13 | 13 | ||
| 14 | [You can view the new cardholder agreement | 14 | [You can view the new cardholder agreement |
| 15 | here](https://privacy.com/commercial-cardholder-agreement). | 15 | here](https://privacy.com/commercial-cardholder-agreement). |
| 16 | 16 | ||
| 17 | When you log in, you\'ll be greeted with a pop-up window asking you to | 17 | When you log in, you'll be greeted with a pop-up window asking you to review |
| 18 | review and agree to the new terms of use. You will also not be able to | 18 | and agree to the new terms of use. You will also not be able to open any new |
| 19 | open any new cards until the terms are agreed to. | 19 | cards until the terms are agreed to. |
| 20 | 20 | ||
| 21 | ## Changing from a \"Prepaid Debit\" Model to a \"Charge Card\" Model | 21 | ## Changing from a "Prepaid Debit" Model to a "Charge Card" Model |
| 22 | 22 | ||
| 23 | The actual content of the changes is interesting. While the historical | 23 | The actual content of the changes is interesting. While the historical model of |
| 24 | model of using Privacy.com was akin to prepaid debit cards, the new | 24 | using Privacy.com was akin to prepaid debit cards, the new model is very similar |
| 25 | model is very similar to a credit card (they use the term \"charge | 25 | to a credit card (they use the term "charge card"). |
| 26 | card\"). | ||
| 27 | 26 | ||
| 28 | I have used Privacy.com for 1-2 years, and the process was always that | 27 | I have used Privacy.com for 1-2 years, and the process was always that you would |
| 29 | you would create a single-use or merchant-locked card. This card could | 28 | create a single-use or merchant-locked card. This card could be used for any |
| 30 | be used for any dollar limit you set and would immediately draw the | 29 | dollar limit you set and would immediately draw the funds from whatever funding |
| 31 | funds from whatever funding source you connected, e.g. PayPal account or | 30 | source you connected, e.g. PayPal account or a bank account. |
| 32 | a bank account. | ||
| 33 | 31 | ||
| 34 | The benefit this service provides with a premium account is masking the | 32 | The benefit this service provides with a premium account is masking the merchant |
| 35 | merchant names from your funding source. If you have a concern that your | 33 | names from your funding source. If you have a concern that your bank account |
| 36 | bank account uses merchant data from your account, you could direct all | 34 | uses merchant data from your account, you could direct all charges through |
| 37 | charges through Privacy.com and set the merchant as one of their pre-set | 35 | Privacy.com and set the merchant as one of their pre-set options, such as |
| 38 | options, such as \"Smiley\'s Corner Store\" or \"NSA Gift Shop.\" | 36 | "Smiley's Corner Store" or "NSA Gift Shop." |
| 39 | 37 | ||
| 40 | The new model still works with a bank account as a funding source, but | 38 | The new model still works with a bank account as a funding source, but the model |
| 41 | the model is changed so that you get a \"line of credit\" set according | 39 | is changed so that you get a "line of credit" set according to a 14-day |
| 42 | to a 14-day billing cycle. It seems that Privacy.com will now allow | 40 | billing cycle. It seems that Privacy.com will now allow charges to be incurred |
| 43 | charges to be incurred without being immediately paid. | 41 | without being immediately paid. |
| 44 | 42 | ||
| 45 | ## Daily Payments and Available Credit | 43 | ## Daily Payments and Available Credit |
| 46 | 44 | ||
| 47 | Instead of paying as charges are incurred, you must make a \"Daily | 45 | Instead of paying as charges are incurred, you must make a "Daily Payment" and |
| 48 | Payment\" and your \"Available Credit\" will be locked until you make | 46 | your "Available Credit" will be locked until you make that payment. There are |
| 49 | that payment. There are also \"End of Billing Cycle Payments\" that are | 47 | also "End of Billing Cycle Payments" that are assigned a due date. |
| 50 | assigned a due date. | ||
| 51 | 48 | ||
| 52 | Further, Privacy.com will decline charges that would cause you to exceed | 49 | Further, Privacy.com will decline charges that would cause you to exceed your |
| 53 | your Available Credit or Credit Limit. | 50 | Available Credit or Credit Limit. |
| 54 | 51 | ||
| 55 | One particular interesting section states the following: | 52 | One particular interesting section states the following: |
| 56 | 53 | ||
| 57 | > YOUR OBLIGATION TO PAY US BACK FOR ALL CARD TRANSACTIONS AND OTHER | 54 | > YOUR OBLIGATION TO PAY US BACK FOR ALL CARD TRANSACTIONS AND OTHER OBLIGATIONS |
| 58 | > OBLIGATIONS YOU INCUR IS SECURED BY THE SECURED ACCOUNT. IF YOU DO NOT | 55 | > YOU INCUR IS SECURED BY THE SECURED ACCOUNT. IF YOU DO NOT PAY US BACK FOR ANY |
| 59 | > PAY US BACK FOR ANY AMOUNT YOU OWE US WHEN YOUR PAYMENTS ARE DUE, WE | 56 | > AMOUNT YOU OWE US WHEN YOUR PAYMENTS ARE DUE, WE WILL EXERCISE OUR INTEREST |
| 60 | > WILL EXERCISE OUR INTEREST AND DEBIT THE SECURED ACCOUNT, AND YOU WILL | 57 | > AND DEBIT THE SECURED ACCOUNT, AND YOU WILL LOSE THE MONEY IN THE SECURED |
| 61 | > LOSE THE MONEY IN THE SECURED ACCOUNT. SEE SECTION 8: SECURITY | 58 | > ACCOUNT. SEE SECTION 8: SECURITY AGREEMENT FOR MORE INFORMATION. |
| 62 | > AGREEMENT FOR MORE INFORMATION. | ||
| 63 | 59 | ||
| 64 | ## Personal Information | 60 | ## Personal Information |
| 65 | 61 | ||
| 66 | Now that Privacy.com is more of a financial institution, they are | 62 | Now that Privacy.com is more of a financial institution, they are obligated to |
| 67 | obligated to comply with the [know your | 63 | comply with the [know your |
| 68 | customer](https://en.wikipedia.org/wiki/Know_your_customer) | 64 | customer](https://en.wikipedia.org/wiki/Know_your_customer) guidelines/laws. |
| 69 | guidelines/laws. | ||
| 70 | 65 | ||
| 71 | I did not proceed with the change to my Privacy.com account, but I have | 66 | I did not proceed with the change to my Privacy.com account, but I have heard |
| 72 | heard from some peers that the changes require more personal information | 67 | from some peers that the changes require more personal information to be |
| 73 | to be submitted, such as SSN. I am not aware of all new personal | 68 | submitted, such as SSN. I am not aware of all new personal information required |
| 74 | information required or if the funding source is now required to only be | 69 | or if the funding source is now required to only be a bank account. |
| 75 | a bank account. | ||
| 76 | 70 | ||
| 77 | ## Fees | 71 | ## Fees |
| 78 | 72 | ||
| 79 | Luckily, the fees section did not change much. The subscription fees for | 73 | Luckily, the fees section did not change much. The subscription fees for a |
| 80 | a premium account are still the only fees. | 74 | premium account are still the only fees. |
| 81 | 75 | ||
| 82 | # My Thoughts | 76 | # My Thoughts |
| 83 | 77 | ||
| 84 | Personally, I wiped my personal information from my account and then | 78 | Personally, I wiped my personal information from my account and then permanently |
| 85 | permanently deleted it when I heard about these changes. I have no | 79 | deleted it when I heard about these changes. I have no interest in yet another |
| 86 | interest in yet another method of credit lending offered by private | 80 | method of credit lending offered by private companies. While I accepted that |
| 87 | companies. While I accepted that they would have access to my bank | 81 | they would have access to my bank account information for the purposes of paying |
| 88 | account information for the purposes of paying off my prepaid debit | 82 | off my prepaid debit payments, I have no interest in incurring charges that will |
| 89 | payments, I have no interest in incurring charges that will need to be | 83 | need to be paid back at a later date. I also have no interest in submitting |
| 90 | paid back at a later date. I also have no interest in submitting | ||
| 91 | personal information to Privacy.com. | 84 | personal information to Privacy.com. |
| 92 | 85 | ||
| 93 | This type of change toward a \"buy it now, pay us later\" model is | 86 | This type of change toward a "buy it now, pay us later" model is concerning, |
| 94 | concerning, and I will be watching Privacy.com to see if they further | 87 | and I will be watching Privacy.com to see if they further their interests in the |
| 95 | their interests in the credit model as time goes on. | 88 | credit model as time goes on. |
| 96 | 89 | ||
| 97 | Could we see them start charging interest, fees, etc.? I\'m not sure, | 90 | Could we see them start charging interest, fees, etc.? I'm not sure, but this |
| 98 | but this change does not inspire confidence in their mission as a | 91 | change does not inspire confidence in their mission as a privacy-focused |
| 99 | privacy-focused company. | 92 | company. |
content/blog/2022-09-17-serenity-os.md +41 −47
| @@ -7,39 +7,37 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Overview | 8 | # Overview |
| 9 | 9 | ||
| 10 | [SerenityOS](https://serenityos.org) is a unique operating system (OS) | 10 | [SerenityOS](https://serenityos.org) is a unique operating system (OS) that I |
| 11 | that I have seen pop up in my news feed a few times over the last few | 11 | have seen pop up in my news feed a few times over the last few years, but I have |
| 12 | years, but I have never had time to test it out until now. | 12 | never had time to test it out until now. |
| 13 | 13 | ||
| 14 | Testing out this system brought back fond memories of yellowed, | 14 | Testing out this system brought back fond memories of yellowed, |
| 15 | modem-screeching, 100-pound computers that brought so many fond memories | 15 | modem-screeching, 100-pound computers that brought so many fond memories to my |
| 16 | to my youth. | 16 | youth. |
| 17 | 17 | ||
| 18 | Per their website: | 18 | Per their website: |
| 19 | 19 | ||
| 20 | > A graphical Unix-like operating system for desktop computers! | 20 | > A graphical Unix-like operating system for desktop computers! |
| 21 | > | 21 | > |
| 22 | > SerenityOS is a love letter to \'90s user interfaces with a custom | 22 | > SerenityOS is a love letter to '90s user interfaces with a custom Unix-like |
| 23 | > Unix-like core. It flatters with sincerity by stealing beautiful ideas | 23 | > core. It flatters with sincerity by stealing beautiful ideas from various |
| 24 | > from various other systems. | 24 | > other systems. |
| 25 | > | 25 | > |
| 26 | > Roughly speaking, the goal is a marriage between the aesthetic of | 26 | > Roughly speaking, the goal is a marriage between the aesthetic of late-1990s |
| 27 | > late-1990s productivity software and the power-user accessibility of | 27 | > productivity software and the power-user accessibility of late-2000s *nix. |
| 28 | > late-2000s \*nix. | ||
| 29 | > | 28 | > |
| 30 | > This is a system by us, for us, based on the things we like. | 29 | > This is a system by us, for us, based on the things we like. |
| 31 | 30 | ||
| 32 | # Building | 31 | # Building |
| 33 | 32 | ||
| 34 | Your first question may be \"Where\'s the iso?\" and the answer is... | 33 | Your first question may be "Where's the iso?" and the answer is... there are |
| 35 | there are none. SerenityOS does not provide pre-built images for | 34 | none. SerenityOS does not provide pre-built images for testing. You must build |
| 36 | testing. You must build the images yourself. This seems intentionally to | 35 | the images yourself. This seems intentionally to limit participation to only |
| 37 | limit participation to only those who are truly interested enough to | 36 | those who are truly interested enough to learn how to build the OS. |
| 38 | learn how to build the OS. | ||
| 39 | 37 | ||
| 40 | ## Clone | 38 | ## Clone |
| 41 | 39 | ||
| 42 | In order to get started, you\'ll need to clone the source repository: | 40 | In order to get started, you'll need to clone the source repository: |
| 43 | 41 | ||
| 44 | ```sh | 42 | ```sh |
| 45 | git clone https://github.com/SerenityOS/serenity && cd serenity | 43 | git clone https://github.com/SerenityOS/serenity && cd serenity |
| @@ -50,23 +48,21 @@ git clone https://github.com/SerenityOS/serenity && cd serenity | |||
| 50 | Note that I followed the [Build | 48 | Note that I followed the [Build |
| 51 | Instructions](https://github.com/SerenityOS/serenity/blob/master/Documentation/BuildInstructions.md) | 49 | Instructions](https://github.com/SerenityOS/serenity/blob/master/Documentation/BuildInstructions.md) |
| 52 | in the SerenityOS repository as of commit | 50 | in the SerenityOS repository as of commit |
| 53 | `660d2b53b1206e868d5470eee80b5e62d7e30da7`. Things may have | 51 | `660d2b53b1206e868d5470eee80b5e62d7e30da7`. Things may have changed since my |
| 54 | changed since my installation, and you should double-check the | 52 | installation, and you should double-check the instructions first. |
| 55 | instructions first. | ||
| 56 | 53 | ||
| 57 | Regardless, I want to repeat my steps here to illustrate any errors or | 54 | Regardless, I want to repeat my steps here to illustrate any errors or differing |
| 58 | differing commands I needed to run in order to build and run SerenityOS. | 55 | commands I needed to run in order to build and run SerenityOS. |
| 59 | 56 | ||
| 60 | Since I am running Fedora, I needed to install these packages in order | 57 | Since I am running Fedora, I needed to install these packages in order to build |
| 61 | to build the OS images: | 58 | the OS images: |
| 62 | 59 | ||
| 63 | ```sh | 60 | ```sh |
| 64 | sudo dnf install texinfo binutils-devel curl cmake mpfr-devel libmpc-devel gmp-devel e2fsprogs ninja-build patch ccache rsync @"C Development Tools and Libraries" @Virtualization | 61 | sudo dnf install texinfo binutils-devel curl cmake mpfr-devel libmpc-devel gmp-devel e2fsprogs ninja-build patch ccache rsync @"C Development Tools and Libraries" @Virtualization |
| 65 | ``` | 62 | ``` |
| 66 | 63 | ||
| 67 | Next, make sure you\'re inside the `serenity` directory | 64 | Next, make sure you're inside the `serenity` directory created earlier during |
| 68 | created earlier during the git cloning process and process to build the | 65 | the git cloning process and process to build the toolchain: |
| 69 | toolchain: | ||
| 70 | 66 | ||
| 71 | ```sh | 67 | ```sh |
| 72 | Meta/serenity.sh rebuild-toolchain | 68 | Meta/serenity.sh rebuild-toolchain |
| @@ -78,45 +74,43 @@ Once the toolchain is built, you can Build and run the OS! | |||
| 78 | Meta/serenity.sh run | 74 | Meta/serenity.sh run |
| 79 | ``` | 75 | ``` |
| 80 | 76 | ||
| 81 | After this process is completed, the image should run automatically and | 77 | After this process is completed, the image should run automatically and launch. |
| 82 | launch. | ||
| 83 | 78 | ||
| 84 | # Issues | 79 | # Issues |
| 85 | 80 | ||
| 86 | I played around in SerenityOS for an hour or two in order to see what I | 81 | I played around in SerenityOS for an hour or two in order to see what I could do |
| 87 | could do and had a lot of fun with it. The only issue I ran into was a | 82 | and had a lot of fun with it. The only issue I ran into was a lack of working |
| 88 | lack of working internet. I didn\'t try very hard, but I could tell that | 83 | internet. I didn't try very hard, but I could tell that the main network link |
| 89 | the main network link wasn\'t connecting to my Fedora host properly. | 84 | wasn't connecting to my Fedora host properly. |
| 90 | 85 | ||
| 91 | # Screenshots | 86 | # Screenshots |
| 92 | 87 | ||
| 93 | The initial launch of the image displays the SerenityOS desktop, with a | 88 | The initial launch of the image displays the SerenityOS desktop, with a simple |
| 94 | simple terminal already launched: | 89 | terminal already launched: |
| 95 | 90 | ||
| 96 |  | 92 | Terminal](https://img.cleberg.net/blog/20220917-serenityos/initial_launch.png) |
| 98 | 93 | ||
| 99 | Here you can see the Fire application (literally just shows fire | 94 | Here you can see the Fire application (literally just shows fire burning), a |
| 100 | burning), a browser with the local Serenity Browser page loaded, and a | 95 | browser with the local Serenity Browser page loaded, and a text editor. |
| 101 | text editor. | ||
| 102 | 96 | ||
| 103 |  | 98 | Fire](https://img.cleberg.net/blog/20220917-serenityos/basic_apps.png) |
| 105 | 99 | ||
| 106 | I also poked around the system utilities and found most tools you\'d | 100 | I also poked around the system utilities and found most tools you'd expect to |
| 107 | expect to find within a standard desktop. | 101 | find within a standard desktop. |
| 108 | 102 | ||
| 109 |  | 104 | Monitor](https://img.cleberg.net/blog/20220917-serenityos/system_monitor.png) |
| 111 | 105 | ||
| 112 | Lastly, I noted that the default desktop contains numerous pre-defined | 106 | Lastly, I noted that the default desktop contains numerous pre-defined themes to |
| 113 | themes to choose from. This is a small piece, but it\'s actually | 107 | choose from. This is a small piece, but it's actually wonderful to see desktop |
| 114 | wonderful to see desktop developers consider theming directly out of the | 108 | developers consider theming directly out of the box rather than using an |
| 115 | box rather than using an addon-based mentality. | 109 | addon-based mentality. |
| 116 | 110 | ||
| 117 |  | 112 | Themes](https://img.cleberg.net/blog/20220917-serenityos/themes.png) |
| 119 | 113 | ||
| 120 | I didn\'t take a screenshot of the other pre-installed games, but I did | 114 | I didn't take a screenshot of the other pre-installed games, but I did spend |
| 121 | spend nearly 30 minutes playing Solitaire before remembering that I was | 115 | nearly 30 minutes playing Solitaire before remembering that I was supposed to be |
| 122 | supposed to be writing a post about the OS. | 116 | writing a post about the OS. |
content/blog/2022-09-21-graphene-os.md +53 −62
| @@ -7,27 +7,24 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Introduction | 8 | # Introduction |
| 9 | 9 | ||
| 10 | After using iOS for a couple of years, I finally took the plunge and | 10 | After using iOS for a couple of years, I finally took the plunge and purchased a |
| 11 | purchased a Pixel 6 Pro in order to test and use \[GrapheneOS\] | 11 | Pixel 6 Pro in order to test and use [GrapheneOS] (<https://grapheneos.org>). |
| 12 | (<https://grapheneos.org>). | ||
| 13 | 12 | ||
| 14 | The installation process was rather quick once you have the tools and | 13 | The installation process was rather quick once you have the tools and files you |
| 15 | files you need. Overall, it can be done in just a few minutes. | 14 | need. Overall, it can be done in just a few minutes. |
| 16 | 15 | ||
| 17 | # Gathering Tools & Files | 16 | # Gathering Tools & Files |
| 18 | 17 | ||
| 19 | ## Android Tools | 18 | ## Android Tools |
| 20 | 19 | ||
| 21 | First, in order to interact with the device, we will need the [Android | 20 | First, in order to interact with the device, we will need the [Android platform |
| 22 | platform | 21 | tools](https://developer.android.com/studio/releases/platform-tools.html). Find |
| 23 | tools](https://developer.android.com/studio/releases/platform-tools.html). | 22 | the Linux download and save the ZIP folder to your preferred location. |
| 24 | Find the Linux download and save the ZIP folder to your preferred | ||
| 25 | location. | ||
| 26 | 23 | ||
| 27 | Once we\'ve downloaded the files, we will need to unzip them, enter the | 24 | Once we've downloaded the files, we will need to unzip them, enter the |
| 28 | directory, and move the necessary executables to a central location, | 25 | directory, and move the necessary executables to a central location, such as |
| 29 | such as `/usr/bin/`. For this installation, we only need the | 26 | `/usr/bin/`. For this installation, we only need the `fastboot` and `adb` |
| 30 | `fastboot` and `adb` executables. | 27 | executables. |
| 31 | 28 | ||
| 32 | ```sh | 29 | ```sh |
| 33 | cd ~/Downloads | 30 | cd ~/Downloads |
| @@ -42,11 +39,11 @@ sudo mv adb /usr/bin | |||
| 42 | 39 | ||
| 43 | ## GrapheneOS Files | 40 | ## GrapheneOS Files |
| 44 | 41 | ||
| 45 | Next, we need the [GrapheneOS files](https://grapheneos.org/releases) | 42 | Next, we need the [GrapheneOS files](https://grapheneos.org/releases) for our |
| 46 | for our device and model. For example, the Pixel 6 Pro is codenamed | 43 | device and model. For example, the Pixel 6 Pro is codenamed `raven` on the |
| 47 | `raven` on the release page. | 44 | release page. |
| 48 | 45 | ||
| 49 | Once we have the links, let\'s download them to our working directory: | 46 | Once we have the links, let's download them to our working directory: |
| 50 | 47 | ||
| 51 | ```sh | 48 | ```sh |
| 52 | curl -O https://releases.grapheneos.org/factory.pub | 49 | curl -O https://releases.grapheneos.org/factory.pub |
| @@ -56,9 +53,8 @@ curl -0 https://releases.grapheneos.org/raven-factory-2022091400.zip.sig | |||
| 56 | 53 | ||
| 57 | 1. Validate Integrity | 54 | 1. Validate Integrity |
| 58 | 55 | ||
| 59 | In order to validate the integrity of the downloaded files, we will | 56 | In order to validate the integrity of the downloaded files, we will need the |
| 60 | need the `signify` package and Graphene\'s | 57 | `signify` package and Graphene's `factory.pub` file. |
| 61 | `factory.pub` file. | ||
| 62 | 58 | ||
| 63 | ```sh | 59 | ```sh |
| 64 | sudo dnf install signify | 60 | sudo dnf install signify |
| @@ -68,8 +64,8 @@ curl -0 https://releases.grapheneos.org/raven-factory-2022091400.zip.sig | |||
| 68 | curl -O https://releases.grapheneos.org/factory.pub | 64 | curl -O https://releases.grapheneos.org/factory.pub |
| 69 | ``` | 65 | ``` |
| 70 | 66 | ||
| 71 | Then we can validate the files and ensure that no data was corrupted | 67 | Then we can validate the files and ensure that no data was corrupted or |
| 72 | or modified before it was saved to our device. | 68 | modified before it was saved to our device. |
| 73 | 69 | ||
| 74 | ```sh | 70 | ```sh |
| 75 | signify -Cqp factory.pub -x raven-factory-2022091400.zip.sig && echo verified | 71 | signify -Cqp factory.pub -x raven-factory-2022091400.zip.sig && echo verified |
| @@ -77,8 +73,8 @@ curl -0 https://releases.grapheneos.org/raven-factory-2022091400.zip.sig | |||
| 77 | 73 | ||
| 78 | 2. Unzip Files | 74 | 2. Unzip Files |
| 79 | 75 | ||
| 80 | Once the files are verified, we can unzip the Graphene image and | 76 | Once the files are verified, we can unzip the Graphene image and enter the |
| 81 | enter the directory: | 77 | directory: |
| 82 | 78 | ||
| 83 | ```sh | 79 | ```sh |
| 84 | unzip raven-factory-2022091400.zip && cd raven-factory-2022091400 | 80 | unzip raven-factory-2022091400.zip && cd raven-factory-2022091400 |
| @@ -88,35 +84,34 @@ curl -0 https://releases.grapheneos.org/raven-factory-2022091400.zip.sig | |||
| 88 | 84 | ||
| 89 | ## Enable Developer Debugging & OEM Unlock | 85 | ## Enable Developer Debugging & OEM Unlock |
| 90 | 86 | ||
| 91 | Before we can actually flash anything to the phone, we will need to | 87 | Before we can actually flash anything to the phone, we will need to enable OEM |
| 92 | enable OEM Unlocking, as well as either USB Debugging or Wireless | 88 | Unlocking, as well as either USB Debugging or Wireless Debugging, depending on |
| 93 | Debugging, depending on which method we will be using. | 89 | which method we will be using. |
| 94 | 90 | ||
| 95 | To start, enable developer mode by going to `Settings` \> | 91 | To start, enable developer mode by going to `Settings` > `About` and tapping |
| 96 | `About` and tapping `Build Number` seven (7) | 92 | `Build Number` seven (7) times. You may need to enter your PIN to enable this |
| 97 | times. You may need to enter your PIN to enable this mode. | 93 | mode. |
| 98 | 94 | ||
| 99 | Once developer mode is enabled, go to `Settings` \> | 95 | Once developer mode is enabled, go to `Settings` > `System` > `Devloper |
| 100 | `System` \> `Devloper Options` and enable OEM | 96 | Options` and enable OEM Unlocking, as well as USB or Wireless Debugging. In my |
| 101 | Unlocking, as well as USB or Wireless Debugging. In my case, I chose USB | 97 | case, I chose USB Debugging and performed all actions via USB cable. |
| 102 | Debugging and performed all actions via USB cable. | ||
| 103 | 98 | ||
| 104 | Once these options are enabled, plug the phone into the computer and | 99 | Once these options are enabled, plug the phone into the computer and execute the |
| 105 | execute the following command: | 100 | following command: |
| 106 | 101 | ||
| 107 | ```sh | 102 | ```sh |
| 108 | adb devices | 103 | adb devices |
| 109 | ``` | 104 | ``` |
| 110 | 105 | ||
| 111 | If an unauthorized error occurs, make sure the USB mode on the phone is | 106 | If an unauthorized error occurs, make sure the USB mode on the phone is changed |
| 112 | changed from charging to something like \"File Transfer\" or \"PTP.\" | 107 | from charging to something like "File Transfer" or "PTP." You can find the |
| 113 | You can find the USB mode in the notification tray. | 108 | USB mode in the notification tray. |
| 114 | 109 | ||
| 115 | ## Reboot Device | 110 | ## Reboot Device |
| 116 | 111 | ||
| 117 | Once we have found the device via `adb`, we can either boot | 112 | Once we have found the device via `adb`, we can either boot into the bootloader |
| 118 | into the bootloader interface by holding the volume down button while | 113 | interface by holding the volume down button while the phone reboots or by |
| 119 | the phone reboots or by executing the following command: | 114 | executing the following command: |
| 120 | 115 | ||
| 121 | ```sh | 116 | ```sh |
| 122 | adb reboot bootloader | 117 | adb reboot bootloader |
| @@ -124,17 +119,14 @@ adb reboot bootloader | |||
| 124 | 119 | ||
| 125 | ## Unlock the Bootloader | 120 | ## Unlock the Bootloader |
| 126 | 121 | ||
| 127 | The phone will reboot and load the bootloader screen upon startup. At | 122 | The phone will reboot and load the bootloader screen upon startup. At this |
| 128 | this point, we are ready to start the actual flashing of GrapheneOS onto | 123 | point, we are ready to start the actual flashing of GrapheneOS onto the device. |
| 129 | the device. | ||
| 130 | 124 | ||
| 131 | **NOTE**: In my situation, I needed to use `sudo` with every | 125 | **NOTE**: In my situation, I needed to use `sudo` with every `fastboot` command, |
| 132 | `fastboot` command, but not with `adb` commands. I | 126 | but not with `adb` commands. I am not sure if this is standard or a Fedora |
| 133 | am not sure if this is standard or a Fedora quirk, but I\'m documenting | 127 | quirk, but I'm documenting my commands verbatim in this post. |
| 134 | my commands verbatim in this post. | ||
| 135 | 128 | ||
| 136 | First, we start by unlocking the bootloader so that we can load other | 129 | First, we start by unlocking the bootloader so that we can load other ROMs: |
| 137 | ROMs: | ||
| 138 | 130 | ||
| 139 | ```sh | 131 | ```sh |
| 140 | sudo fastboot flashing unlock | 132 | sudo fastboot flashing unlock |
| @@ -142,24 +134,23 @@ sudo fastboot flashing unlock | |||
| 142 | 134 | ||
| 143 | ## Flashing Factory Images | 135 | ## Flashing Factory Images |
| 144 | 136 | ||
| 145 | Once the phone is unlocked, we can flash it with the | 137 | Once the phone is unlocked, we can flash it with the `flash-all.sh` script found |
| 146 | `flash-all.sh` script found inside the | 138 | inside the `raven-factory-2022091400` folder we entered earlier: |
| 147 | `raven-factory-2022091400` folder we entered earlier: | ||
| 148 | 139 | ||
| 149 | ```sh | 140 | ```sh |
| 150 | sudo ./flash-all.sh | 141 | sudo ./flash-all.sh |
| 151 | ``` | 142 | ``` |
| 152 | 143 | ||
| 153 | This process should take a few minutes and will print informational | 144 | This process should take a few minutes and will print informational messages as |
| 154 | messages as things progress. Avoid doing anything on the phone while | 145 | things progress. Avoid doing anything on the phone while this process is |
| 155 | this process is operating. | 146 | operating. |
| 156 | 147 | ||
| 157 | ## Lock the Bootloader | 148 | ## Lock the Bootloader |
| 158 | 149 | ||
| 159 | If everything was successful, the phone should reboot a few times and | 150 | If everything was successful, the phone should reboot a few times and finally |
| 160 | finally land back on the bootloader screen. At this point, we can | 151 | land back on the bootloader screen. At this point, we can re-lock the bootloader |
| 161 | re-lock the bootloader to enable full verified boot and protect the | 152 | to enable full verified boot and protect the device from unwanted flashing or |
| 162 | device from unwanted flashing or erasure of data. | 153 | erasure of data. |
| 163 | 154 | ||
| 164 | ```sh | 155 | ```sh |
| 165 | sudo fastboot flashing lock | 156 | sudo fastboot flashing lock |
content/blog/2022-10-04-mtp-linux.md +23 −26
| @@ -5,31 +5,30 @@ description = "" | |||
| 5 | draft = false | 5 | draft = false |
| 6 | +++ | 6 | +++ |
| 7 | 7 | ||
| 8 | I recently ran into trouble attempting to mount my GrapheneOS phone to | 8 | I recently ran into trouble attempting to mount my GrapheneOS phone to my laptop |
| 9 | my laptop running Fedora Linux via the [Media Transfer | 9 | running Fedora Linux via the [Media Transfer |
| 10 | Protocol](https://en.wikipedia.org/wiki/Media_transfer_protocol) (MTP) | 10 | Protocol](https://en.wikipedia.org/wiki/Media_transfer_protocol) (MTP) and |
| 11 | and discovered a simple and effective solution. | 11 | discovered a simple and effective solution. |
| 12 | 12 | ||
| 13 | # Use a USB 3.0 Port | 13 | # Use a USB 3.0 Port |
| 14 | 14 | ||
| 15 | First, ensure that the device was plugged in to the laptop through a USB | 15 | First, ensure that the device was plugged in to the laptop through a USB 3.0 |
| 16 | 3.0 port, if possible. From a brief glance online, it seems that USB 2.0 | 16 | port, if possible. From a brief glance online, it seems that USB 2.0 ports may |
| 17 | ports may cause issues with dropped connections over MTP. This is purely | 17 | cause issues with dropped connections over MTP. This is purely anecdotal since I |
| 18 | anecdotal since I don\'t have any evidence to link showing that USB 2.0 | 18 | don't have any evidence to link showing that USB 2.0 causes issues, but I can |
| 19 | causes issues, but I can confirm that switching to a USB 3.0 port seemed | 19 | confirm that switching to a USB 3.0 port seemed to cut out most of my issues. |
| 20 | to cut out most of my issues. | ||
| 21 | 20 | ||
| 22 | # Switch USB Preferences to MTP | 21 | # Switch USB Preferences to MTP |
| 23 | 22 | ||
| 24 | Secondly, you need to ensure that the phone\'s USB preferences/mode is | 23 | Secondly, you need to ensure that the phone's USB preferences/mode is changed |
| 25 | changed to MTP or File Transfer once the phone is plugged in. Other | 24 | to MTP or File Transfer once the phone is plugged in. Other modes will not allow |
| 26 | modes will not allow you to access the phone\'s file system. | 25 | you to access the phone's file system. |
| 27 | 26 | ||
| 28 | # Install `jmtpfs` | 27 | # Install `jmtpfs` |
| 29 | 28 | ||
| 30 | Next, I used the `jmtpfs` package to mount my phone to my | 29 | Next, I used the `jmtpfs` package to mount my phone to my laptop. There are |
| 31 | laptop. There are other packages that exist, but this one worked | 30 | other packages that exist, but this one worked perfectly for me. On Fedora |
| 32 | perfectly for me. On Fedora Linux, you can install it like this: | 31 | Linux, you can install it like this: |
| 33 | 32 | ||
| 34 | ```sh | 33 | ```sh |
| 35 | sudo dnf install jmtpfs -y | 34 | sudo dnf install jmtpfs -y |
| @@ -37,19 +36,18 @@ sudo dnf install jmtpfs -y | |||
| 37 | 36 | ||
| 38 | # Create a Mount Point | 37 | # Create a Mount Point |
| 39 | 38 | ||
| 40 | Once you have the package installed, you just need to create a folder | 39 | Once you have the package installed, you just need to create a folder for the |
| 41 | for the device to use as a mount point. In my case, I used | 40 | device to use as a mount point. In my case, I used `/mnt/pixel`: |
| 42 | `/mnt/pixel`: | ||
| 43 | 41 | ||
| 44 | ```sh | 42 | ```sh |
| 45 | sudo mkdir /mnt/pixel | 43 | sudo mkdir /mnt/pixel |
| 46 | sudo chown -R $USER:$USER /mnt/pixel | 44 | sudo chown -R $USER:$USER /mnt/pixel |
| 47 | ``` | 45 | ``` |
| 48 | 46 | ||
| 49 | # Mount & Access the Phone\'s File System | 47 | # Mount & Access the Phone's File System |
| 50 | 48 | ||
| 51 | Finally, plug-in and mount the device, and you should be able to see all | 49 | Finally, plug-in and mount the device, and you should be able to see all storage |
| 52 | storage (internal and external) inside your new folder! | 50 | (internal and external) inside your new folder! |
| 53 | 51 | ||
| 54 | ```sh | 52 | ```sh |
| 55 | jmtpfs /mnt/pixel | 53 | jmtpfs /mnt/pixel |
| @@ -62,16 +60,15 @@ Device 0 (VID=18d1 and PID=4ee1) is a Google Inc Nexus/Pixel (MTP). | |||
| 62 | Android device detected, assigning default bug flags | 60 | Android device detected, assigning default bug flags |
| 63 | ``` | 61 | ``` |
| 64 | 62 | ||
| 65 | Now you are mounted and can do anything you\'d like with the device\'s | 63 | Now you are mounted and can do anything you'd like with the device's files: |
| 66 | files: | ||
| 67 | 64 | ||
| 68 | ```sh | 65 | ```sh |
| 69 | cd /mnt/pixel | 66 | cd /mnt/pixel |
| 70 | ls -lha | 67 | ls -lha |
| 71 | ``` | 68 | ``` |
| 72 | 69 | ||
| 73 | From here, you will be able to see any internal or external storage | 70 | From here, you will be able to see any internal or external storage available on |
| 74 | available on the device: | 71 | the device: |
| 75 | 72 | ||
| 76 | ```sh | 73 | ```sh |
| 77 | total 0 | 74 | total 0 |
content/blog/2022-10-04-syncthing.md +93 −103
| @@ -7,26 +7,25 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # An Overview of Syncthing | 8 | # An Overview of Syncthing |
| 9 | 9 | ||
| 10 | If you\'ve been looking around the self-hosted cloud storage space for a | 10 | If you've been looking around the self-hosted cloud storage space for a while, |
| 11 | while, you\'ve undoubtedly run into someone suggesting | 11 | you've undoubtedly run into someone suggesting |
| 12 | [Syncthing](https://syncthing.net) as an option. However, it is an | 12 | [Syncthing](https://syncthing.net) as an option. However, it is an unusual |
| 13 | unusual alternative for those users out there who are used to having a | 13 | alternative for those users out there who are used to having a centralized cloud |
| 14 | centralized cloud server that serves as the \"controller\" of the data | 14 | server that serves as the "controller" of the data and interacts with clients |
| 15 | and interacts with clients on devices to fetch files. | 15 | on devices to fetch files. |
| 16 | 16 | ||
| 17 | This post is a walkthrough of the Syncthing software, how I set up my | 17 | This post is a walkthrough of the Syncthing software, how I set up my personal |
| 18 | personal storage, and some pros and cons of using the software. | 18 | storage, and some pros and cons of using the software. |
| 19 | 19 | ||
| 20 | # Installing Syncthing | 20 | # Installing Syncthing |
| 21 | 21 | ||
| 22 | To install Syncthing, visit the | 22 | To install Syncthing, visit the [Downloads](https://syncthing.net/downloads/) |
| 23 | [Downloads](https://syncthing.net/downloads/) page or install via your | 23 | page or install via your device's package manager. |
| 24 | device\'s package manager. | ||
| 25 | 24 | ||
| 26 | ## Server & Desktop | 25 | ## Server & Desktop |
| 27 | 26 | ||
| 28 | You can install Syncthing on servers and desktops via the Downloads page | 27 | You can install Syncthing on servers and desktops via the Downloads page linked |
| 29 | linked above or via the command-line. | 28 | above or via the command-line. |
| 30 | 29 | ||
| 31 | For Debian-based distros: | 30 | For Debian-based distros: |
| 32 | 31 | ||
| @@ -43,37 +42,36 @@ sudo dnf install syncthing | |||
| 43 | ## Mobile | 42 | ## Mobile |
| 44 | 43 | ||
| 45 | Syncthing for Android is available on | 44 | Syncthing for Android is available on |
| 46 | [F-Droid](https://f-droid.org/packages/com.nutomic.syncthingandroid/) | 45 | [F-Droid](https://f-droid.org/packages/com.nutomic.syncthingandroid/) and |
| 47 | and [Google | 46 | |
| 48 | Play](https://play.google.com/store/apps/details?id=com.nutomic.syncthingandroid). | 47 | Play](https://play.google.com/store/apps/details?id=com.nutomic.syncthingandroid). |
| 49 | Syncthing does not have an official iOS client, but there is a | 48 | Syncthing does not have an official iOS client, but there is a third-party |
| 50 | third-party client called [Möbius | 49 | client called [Möbius |
| 51 | Sync](https://apps.apple.com/us/app/m%C3%B6bius-sync/id1539203216). | 50 | Sync](https://apps.apple.com/us/app/m%C3%B6bius-sync/id1539203216). |
| 52 | 51 | ||
| 53 | # How Does Syncthing Work? | 52 | # How Does Syncthing Work? |
| 54 | 53 | ||
| 55 | To start, I wanted to include the main marketing blurb from their | 54 | To start, I wanted to include the main marketing blurb from their website: |
| 56 | website: | ||
| 57 | 55 | ||
| 58 | > Syncthing is a continuous file synchronization program. It | 56 | > Syncthing is a continuous file synchronization program. It synchronizes files |
| 59 | > synchronizes files between two or more computers in real time, safely | 57 | > between two or more computers in real time, safely protected from prying eyes. |
| 60 | > protected from prying eyes. Your data is your data alone, and you | 58 | > Your data is your data alone, and you deserve to choose where it is stored, |
| 61 | > deserve to choose where it is stored, whether it is shared with some | 59 | > whether it is shared with some third party, and how it's transmitted over the |
| 62 | > third party, and how it\'s transmitted over the internet. | 60 | > internet. |
| 63 | 61 | ||
| 64 | Let\'s break this apart and add in some other details to help explain | 62 | Let's break this apart and add in some other details to help explain what |
| 65 | what exactly Syncthing does in order to sync files between devices. | 63 | exactly Syncthing does in order to sync files between devices. |
| 66 | 64 | ||
| 67 | ## Local Syncthing Server(s) | 65 | ## Local Syncthing Server(s) |
| 68 | 66 | ||
| 69 | Syncthing syncs files between multiple devices by creating a local | 67 | Syncthing syncs files between multiple devices by creating a local server on |
| 70 | server on each device. These local servers handle a few different | 68 | each device. These local servers handle a few different things, such as watching |
| 71 | things, such as watching files and directories for changes, hosting an | 69 | files and directories for changes, hosting an administrative GUI website, and |
| 72 | administrative GUI website, and authenticating with connected devices. | 70 | authenticating with connected devices. |
| 73 | 71 | ||
| 74 | You can also start, stop, and restart the Syncthing server via the | 72 | You can also start, stop, and restart the Syncthing server via the command-line |
| 75 | command-line or web dashboard. If you\'re running Syncthing on a device | 73 | or web dashboard. If you're running Syncthing on a device with `systemd`, you |
| 76 | with `systemd`, you can use the following commands: | 74 | can use the following commands: |
| 77 | 75 | ||
| 78 | ```sh | 76 | ```sh |
| 79 | sudo systemctl start syncthing@username.service | 77 | sudo systemctl start syncthing@username.service |
| @@ -83,97 +81,89 @@ sudo systemctl stop syncthing@username.service | |||
| 83 | 81 | ||
| 84 | ## Syncthing Dashboard | 82 | ## Syncthing Dashboard |
| 85 | 83 | ||
| 86 | This biggest part of Syncthing is the admin GUI website that runs on | 84 | This biggest part of Syncthing is the admin GUI website that runs on each device |
| 87 | each device (note that mobile devices will use the Syncthing app rather | 85 | (note that mobile devices will use the Syncthing app rather than the web GUI). |
| 88 | than the web GUI). The admin GUI is available through the web browser on | 86 | The admin GUI is available through the web browser on the local device that is |
| 89 | the local device that is running Syncthing - simply go to | 87 | running Syncthing - simply go to `http://localhost:8384` or |
| 90 | `http://localhost:8384` or | 88 | `http://127.0.0.1:8384`. This web page is the place where you will change |
| 91 | `http://127.0.0.1:8384`. This web page is the place where you | 89 | settings, add/modify synced files, and add/modify connected devices. |
| 92 | will change settings, add/modify synced files, and add/modify connected | ||
| 93 | devices. | ||
| 94 | 90 | ||
| 95 | Here\'s an example web GUI dashboard: | 91 | Here's an example web GUI dashboard: |
| 96 | 92 | ||
| 97 |  | 94 | Dashboard](https://img.cleberg.net/blog/20221020-syncthing/syncthing_gui.png) |
| 99 | 95 | ||
| 100 | ## Remote Devices | 96 | ## Remote Devices |
| 101 | 97 | ||
| 102 | A cloud storage solution wouldn\'t be very useful if you aren\'t able to | 98 | A cloud storage solution wouldn't be very useful if you aren't able to share |
| 103 | share data among various devices. Syncthing does this by sharing Device | 99 | data among various devices. Syncthing does this by sharing Device IDs to connect |
| 104 | IDs to connect servers, and then by manually sharing Folders with | 100 | servers, and then by manually sharing Folders with devices that have been |
| 105 | devices that have been connected. | 101 | connected. |
| 106 | 102 | ||
| 107 | For instance, if you have a laptop running Syncthing and then install | 103 | For instance, if you have a laptop running Syncthing and then install the |
| 108 | the Syncthing mobile app on a phone, you could scan the laptop\'s QR | 104 | Syncthing mobile app on a phone, you could scan the laptop's QR code for Device |
| 109 | code for Device ID and then accept the authentication on the laptop\'s | 105 | ID and then accept the authentication on the laptop's dashboard. Next, you can |
| 110 | dashboard. Next, you can use either device to select a folder for | 106 | use either device to select a folder for sharing and dictating which device |
| 111 | sharing and dictating which device should send, receive, or both. | 107 | should send, receive, or both. |
| 112 | 108 | ||
| 113 | When you connect devices, you can set one device as an \"Introducer,\" | 109 | When you connect devices, you can set one device as an "Introducer," which can |
| 114 | which can add devices from the introducer to the device list, for | 110 | add devices from the introducer to the device list, for mutually shared folders. |
| 115 | mutually shared folders. You can also configure Auto Accept, | 111 | You can also configure Auto Accept, compression, rate limits, and more settings |
| 116 | compression, rate limits, and more settings per device. | 112 | per device. |
| 117 | 113 | ||
| 118 | # My Personal Cloud Storage Set-up | 114 | # My Personal Cloud Storage Set-up |
| 119 | 115 | ||
| 120 | Personally, I use a model similar to a traditional cloud storage | 116 | Personally, I use a model similar to a traditional cloud storage service. I have |
| 121 | service. I have a \"centralized\" server running 24/7 that acts as an | 117 | a "centralized" server running 24/7 that acts as an Introducer for my |
| 122 | Introducer for my Syncthing network. I think of this as my main storage | 118 | Syncthing network. I think of this as my main storage and all other devices as |
| 123 | and all other devices as tertiary client devices. I will likely add | 119 | tertiary client devices. I will likely add additional servers as backups as time |
| 124 | additional servers as backups as time goes on so that I don\'t have to | 120 | goes on so that I don't have to rely on my laptop or phone as the only backups. |
| 125 | rely on my laptop or phone as the only backups. | ||
| 126 | 121 | ||
| 127 | Currently, I have one desktop and one mobile device connected to the | 122 | Currently, I have one desktop and one mobile device connected to the network, |
| 128 | network, both running intermittently as they are not powered-on 24/7. | 123 | both running intermittently as they are not powered-on 24/7. |
| 129 | 124 | ||
| 130 | The initial set-up of the software was easy enough, but data transfer | 125 | The initial set-up of the software was easy enough, but data transfer rates were |
| 131 | rates were incredibly slow for me due to the Wi-Fi. Instead, I plugged | 126 | incredibly slow for me due to the Wi-Fi. Instead, I plugged my laptop into the |
| 132 | my laptop into the ethernet network that my server is on and manually | 127 | ethernet network that my server is on and manually copied my folders over to the |
| 133 | copied my folders over to the server with `scp`. Once | 128 | server with `scp`. Once complete, Syncthing validated that all files were there |
| 134 | complete, Syncthing validated that all files were there and not missing, | 129 | and not missing, and it did not need to transfer any data through the WAN. |
| 135 | and it did not need to transfer any data through the WAN. | ||
| 136 | 130 | ||
| 137 | As slow as the transfer was going, this probably saved me a few days of | 131 | As slow as the transfer was going, this probably saved me a few days of waiting |
| 138 | waiting for my \~100GB sync. | 132 | for my ~100GB sync. |
| 139 | 133 | ||
| 140 | # Pros & Cons | 134 | # Pros & Cons |
| 141 | 135 | ||
| 142 | I\'ve put together a short list of pros and cons for Syncthing. I | 136 | I've put together a short list of pros and cons for Syncthing. I thought about |
| 143 | thought about my experiences with Nextcloud, WebDAV, proprietary | 137 | my experiences with Nextcloud, WebDAV, proprietary services (Google Drive, |
| 144 | services (Google Drive, iCloud, etc.), and privacy-focused cloud | 138 | iCloud, etc.), and privacy-focused cloud solutions (pCloud, Tresorit, etc.). |
| 145 | solutions (pCloud, Tresorit, etc.). | ||
| 146 | 139 | ||
| 147 | **Pros:** | 140 | **Pros:** |
| 148 | 141 | ||
| 149 | - I\'ve faced no data loss at all through my two-month trial run. | 142 | - I've faced no data loss at all through my two-month trial run. |
| 150 | - No third-parties store your data on their servers. | 143 | - No third-parties store your data on their servers. |
| 151 | - You have full control over your data and can take your data and | 144 | - You have full control over your data and can take your data and leave at any |
| 152 | leave at any time. | 145 | time. |
| 153 | - It\'s possible to encrypt client-side easily with software like | 146 | - It's possible to encrypt client-side easily with software like Cryptomator. |
| 154 | Cryptomator. | 147 | - No proprietary clients or mounted volumes, just plain files and folders. |
| 155 | - No proprietary clients or mounted volumes, just plain files and | ||
| 156 | folders. | ||
| 157 | 148 | ||
| 158 | **Cons:** | 149 | **Cons:** |
| 159 | 150 | ||
| 160 | - The learning curve is steeper than traditional cloud services and is | 151 | - The learning curve is steeper than traditional cloud services and is focused |
| 161 | focused on a technical audience. | 152 | on a technical audience. |
| 162 | - If a device needs to modify files in a Folder, the devices will need | 153 | - If a device needs to modify files in a Folder, the devices will need to sync |
| 163 | to sync ALL files from the folder, which may be large. To avoid size | 154 | ALL files from the folder, which may be large. To avoid size restraints, split |
| 164 | restraints, split large folders into smaller folders for syncing. | 155 | large folders into smaller folders for syncing. |
| 165 | - Syncing can be slow due to the clients/servers initially connecting | 156 | - Syncing can be slow due to the clients/servers initially connecting or |
| 166 | or re-connecting after sleeping. | 157 | re-connecting after sleeping. |
| 167 | - Multiple personal devices are required and require the user to own | 158 | - Multiple personal devices are required and require the user to own or rent |
| 168 | or rent them as no third-party servers are involved in the storage | 159 | them as no third-party servers are involved in the storage of data. |
| 169 | of data. | 160 | |
| 170 | 161 | Overall, I've had a great experience with Syncthing so far. I've had no data | |
| 171 | Overall, I\'ve had a great experience with Syncthing so far. I\'ve had | 162 | loss, syncing has been quick and easy when changes are made to files, device |
| 172 | no data loss, syncing has been quick and easy when changes are made to | 163 | connections are reliable, and I love the freedom of controlling the clients and |
| 173 | files, device connections are reliable, and I love the freedom of | 164 | servers as I choose. |
| 174 | controlling the clients and servers as I choose. | 165 | |
| 175 | 166 | Not to mention that I appreciate that I - or someone else - could pull the | |
| 176 | Not to mention that I appreciate that I - or someone else - could pull | 167 | Syncthing [source code](https://github.com/syncthing) and continue |
| 177 | the Syncthing [source code](https://github.com/syncthing) and continue | 168 | development/support if the Syncthing Foundation decides to stop developing the |
| 178 | development/support if the Syncthing Foundation decides to stop | 169 | software or sells the business. |
| 179 | developing the software or sells the business. | ||
content/blog/2022-10-22-alpine-linux.md +96 −110
| @@ -7,80 +7,73 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Alpine Linux | 8 | # Alpine Linux |
| 9 | 9 | ||
| 10 | [Alpine Linux](https://alpinelinux.org) is a very small distro, built on | 10 | [Alpine Linux](https://alpinelinux.org) is a very small distro, built on musl |
| 11 | musl libc and busybox. It uses ash as the default shell, OpenRC as the | 11 | libc and busybox. It uses ash as the default shell, OpenRC as the init system, |
| 12 | init system, and apk as the package manager. According to their website, | 12 | and apk as the package manager. According to their website, an Alpine container |
| 13 | an Alpine container \"requires no more than 8 MB and a minimal | 13 | "requires no more than 8 MB and a minimal installation to disk requires around |
| 14 | installation to disk requires around 130 MB of storage.\" An actual bare | 14 | 130 MB of storage." An actual bare metal machine is recommended to have 100 MB |
| 15 | metal machine is recommended to have 100 MB of RAM and 0-700 MB of | 15 | of RAM and 0-700 MB of storage space. |
| 16 | storage space. | 16 | |
| 17 | 17 | Historically, I've used Ubuntu's minimal installation image as my server OS | |
| 18 | Historically, I\'ve used Ubuntu\'s minimal installation image as my | 18 | for the last five years. Ubuntu worked well and helped as my original server |
| 19 | server OS for the last five years. Ubuntu worked well and helped as my | 19 | contained an nVidia GPU and no onboard graphics, so quite a few distros won't |
| 20 | original server contained an nVidia GPU and no onboard graphics, so | 20 | boot or install without a lot of tinkering. |
| 21 | quite a few distros won\'t boot or install without a lot of tinkering. | 21 | |
| 22 | 22 | Alpine has given me a huge increase in performance across my Docker apps and | |
| 23 | Alpine has given me a huge increase in performance across my Docker apps | 23 | Nginx websites. CPU load for the new server I'm using to test Alpine hovers |
| 24 | and Nginx websites. CPU load for the new server I\'m using to test | 24 | around 0-5% on average with an Intel(R) Core(TM) i3-6100 CPU @ 3.70GHz. |
| 25 | Alpine hovers around 0-5% on average with an Intel(R) Core(TM) i3-6100 | 25 | |
| 26 | CPU @ 3.70GHz. | 26 | The only services I haven't moved over to Alpine are Plex Media Server and |
| 27 | 27 | Syncthing, which may increase CPU load quite a bit depending on how many streams | |
| 28 | The only services I haven\'t moved over to Alpine are Plex Media Server | 28 | are running. |
| 29 | and Syncthing, which may increase CPU load quite a bit depending on how | ||
| 30 | many streams are running. | ||
| 31 | 29 | ||
| 32 | ## Installation | 30 | ## Installation |
| 33 | 31 | ||
| 34 | In terms of installation, Alpine has an incredibly useful | 32 | In terms of installation, Alpine has an incredibly useful |
| 35 | [wiki](https://wiki.alpinelinux.org/wiki/Installation) that will guide a | 33 | [wiki](https://wiki.alpinelinux.org/wiki/Installation) that will guide a user |
| 36 | user throughout the installation and post-installation processes, as | 34 | throughout the installation and post-installation processes, as well as various |
| 37 | well as various other articles and guides. | 35 | other articles and guides. |
| 38 | 36 | ||
| 39 | To install Alpine, find an appropriate [image to | 37 | To install Alpine, find an appropriate [image to |
| 40 | download](https://alpinelinux.org/downloads/) and flash it to a USB | 38 | download](https://alpinelinux.org/downloads/) and flash it to a USB using |
| 41 | using software such as Rufus or Etcher. I opted to use the Standard | 39 | software such as Rufus or Etcher. I opted to use the Standard image for my |
| 42 | image for my x86~64~ architecture. | 40 | x86~64~ architecture. |
| 43 | 41 | ||
| 44 | Once the USB is ready, plug it into the machine and reboot. Note that | 42 | Once the USB is ready, plug it into the machine and reboot. Note that you may |
| 45 | you may have to use a key such as `Esc` or `F1-12` | 43 | have to use a key such as `Esc` or `F1-12` to access the boot menu. The Alpine |
| 46 | to access the boot menu. The Alpine Linux terminal will load quickly and | 44 | Linux terminal will load quickly and for a login. |
| 47 | for a login. | ||
| 48 | 45 | ||
| 49 | To log in to the installation image, use the `root` account; | 46 | To log in to the installation image, use the `root` account; there is no |
| 50 | there is no password. Once logged-in, execute the setup command: | 47 | password. Once logged-in, execute the setup command: |
| 51 | 48 | ||
| 52 | ```sh | 49 | ```sh |
| 53 | setup-alpine | 50 | setup-alpine |
| 54 | ``` | 51 | ``` |
| 55 | 52 | ||
| 56 | The setup script will ask a series of questions to configure the system. | 53 | The setup script will ask a series of questions to configure the system. Be sure |
| 57 | Be sure to answer carefully or else you may have to re-configure the | 54 | to answer carefully or else you may have to re-configure the system after boot. |
| 58 | system after boot. | 55 | |
| 59 | 56 | - Keyboard Layout (Local keyboard language and usage mode, e.g., us and variant | |
| 60 | - Keyboard Layout (Local keyboard language and usage mode, e.g., us | 57 | of us-nodeadkeys.) |
| 61 | and variant of us-nodeadkeys.) | 58 | - Hostname (The name for the computer.) |
| 62 | - Hostname (The name for the computer.) | 59 | - Network (For example, automatic IP address discovery with the "DHCP" |
| 63 | - Network (For example, automatic IP address discovery with the | 60 | protocol.) |
| 64 | \"DHCP\" protocol.) | 61 | - DNS Servers (Domain Name Servers to query. For privacy reasons, it is NOT |
| 65 | - DNS Servers (Domain Name Servers to query. For privacy reasons, it | 62 | recommended to route every local request to servers like Google's 8.8.8.8.) |
| 66 | is NOT recommended to route every local request to servers like | 63 | - Timezone |
| 67 | Google\'s 8.8.8.8 .) | 64 | - Proxy (Proxy server to use for accessing the web. Use "none" for direct |
| 68 | - Timezone | 65 | connections to the internet.) |
| 69 | - Proxy (Proxy server to use for accessing the web. Use \"none\" for | 66 | - Mirror (From where to download packages. Choose the organization you trust |
| 70 | direct connections to the internet.) | 67 | giving your usage patterns to.) |
| 71 | - Mirror (From where to download packages. Choose the organization you | 68 | - SSH (Secure SHell remote access server. "Openssh" is part of the default |
| 72 | trust giving your usage patterns to.) | 69 | install image. Use "none" to disable remote login, e.g. on laptops.) |
| 73 | - SSH (Secure SHell remote access server. \"Openssh\" is part of the | 70 | - NTP (Network Time Protocol client used for keeping the system clock in sync |
| 74 | default install image. Use \"none\" to disable remote login, e.g. on | 71 | with a time-server. Package "chrony" is part of the default install image.) |
| 75 | laptops.) | 72 | - Disk Mode (Select between diskless (disk="none"), "data" or "sys", as |
| 76 | - NTP (Network Time Protocol client used for keeping the system clock | 73 | described above.) |
| 77 | in sync with a time-server. Package \"chrony\" is part of the | 74 | |
| 78 | default install image.) | 75 | Once the setup script is finished, be sure to reboot the machine and remove the |
| 79 | - Disk Mode (Select between diskless (disk=\"none\"), \"data\" or | 76 | USB device. |
| 80 | \"sys\", as described above.) | ||
| 81 | |||
| 82 | Once the setup script is finished, be sure to reboot the machine and | ||
| 83 | remove the USB device. | ||
| 84 | 77 | ||
| 85 | ```sh | 78 | ```sh |
| 86 | reboot | 79 | reboot |
| @@ -89,14 +82,12 @@ reboot | |||
| 89 | ## Post-Installation | 82 | ## Post-Installation |
| 90 | 83 | ||
| 91 | There are many things you can do once your Alpine Linux system is up and | 84 | There are many things you can do once your Alpine Linux system is up and |
| 92 | running, and it largely depends on what you\'ll use the machine for. | 85 | running, and it largely depends on what you'll use the machine for. I'm going |
| 93 | I\'m going to walk through my personal post-installation setup for my | 86 | to walk through my personal post-installation setup for my web server. |
| 94 | web server. | ||
| 95 | 87 | ||
| 96 | 1. Upgrade the System | 88 | 1. Upgrade the System |
| 97 | 89 | ||
| 98 | First, login as `root` in order to update and upgrade the | 90 | First, login as `root` in order to update and upgrade the system: |
| 99 | system: | ||
| 100 | 91 | ||
| 101 | ```sh | 92 | ```sh |
| 102 | apk -U upgrade | 93 | apk -U upgrade |
| @@ -104,9 +95,9 @@ web server. | |||
| 104 | 95 | ||
| 105 | 2. Adding a User | 96 | 2. Adding a User |
| 106 | 97 | ||
| 107 | I needed to add a user so that I don\'t need to log in as root. Note | 98 | I needed to add a user so that I don't need to log in as root. Note that if |
| 108 | that if you\'re used to using the `sudo` command, you | 99 | you're used to using the `sudo` command, you will now need to use the |
| 109 | will now need to use the `doas` command on Alpine Linux. | 100 | `doas` command on Alpine Linux. |
| 110 | 101 | ||
| 111 | ```sh | 102 | ```sh |
| 112 | apk add doas | 103 | apk add doas |
| @@ -122,15 +113,14 @@ web server. | |||
| 122 | 113 | ||
| 123 | 3. Enable Community Packages | 114 | 3. Enable Community Packages |
| 124 | 115 | ||
| 125 | In order to install more common packages that aren\'t found in the | 116 | In order to install more common packages that aren't found in the `main` |
| 126 | `main` repository, you will need to enable the | 117 | repository, you will need to enable the `community` repository: |
| 127 | `community` repository: | ||
| 128 | 118 | ||
| 129 | ```sh | 119 | ```sh |
| 130 | doas nano /etc/apk/repositories | 120 | doas nano /etc/apk/repositories |
| 131 | ``` | 121 | ``` |
| 132 | 122 | ||
| 133 | Uncomment the community line for whichever version of Alpine you\'re | 123 | Uncomment the community line for whichever version of Alpine you're |
| 134 | running: | 124 | running: |
| 135 | 125 | ||
| 136 | ```sh | 126 | ```sh |
| @@ -144,9 +134,9 @@ web server. | |||
| 144 | 134 | ||
| 145 | 4. Install Required Packages | 135 | 4. Install Required Packages |
| 146 | 136 | ||
| 147 | Now that the community packages are available, you can install any | 137 | Now that the community packages are available, you can install any packages |
| 148 | packages you need. In my case, I installed the web server packages I | 138 | you need. In my case, I installed the web server packages I need for my |
| 149 | need for my services: | 139 | services: |
| 150 | 140 | ||
| 151 | ```sh | 141 | ```sh |
| 152 | doas apk add nano nginx docker docker-compose ufw | 142 | doas apk add nano nginx docker docker-compose ufw |
| @@ -154,15 +144,15 @@ web server. | |||
| 154 | 144 | ||
| 155 | 5. SSH | 145 | 5. SSH |
| 156 | 146 | ||
| 157 | If you didn\'t install OpenSSH as part of the installation, you can | 147 | If you didn't install OpenSSH as part of the installation, you can do so |
| 158 | do so now: | 148 | now: |
| 159 | 149 | ||
| 160 | ```sh | 150 | ```sh |
| 161 | doas apk add openssh | 151 | doas apk add openssh |
| 162 | ``` | 152 | ``` |
| 163 | 153 | ||
| 164 | Next, either create a new key or copy your SSH key to the server | 154 | Next, either create a new key or copy your SSH key to the server from your |
| 165 | from your current machines: | 155 | current machines: |
| 166 | 156 | ||
| 167 | ```sh | 157 | ```sh |
| 168 | # Create a new key | 158 | # Create a new key |
| @@ -178,9 +168,9 @@ web server. | |||
| 178 | 168 | ||
| 179 | 6. Firewall | 169 | 6. Firewall |
| 180 | 170 | ||
| 181 | Lastly, I installed `ufw` above as my firewall. To set | 171 | Lastly, I installed `ufw` above as my firewall. To set up, default to deny |
| 182 | up, default to deny incoming and allow outgoing connections. Then | 172 | incoming and allow outgoing connections. Then selectively allow other ports |
| 183 | selectively allow other ports or apps as needed. | 173 | or apps as needed. |
| 184 | 174 | ||
| 185 | ```sh | 175 | ```sh |
| 186 | doas ufw default deny incoming | 176 | doas ufw default deny incoming |
| @@ -192,8 +182,8 @@ web server. | |||
| 192 | 182 | ||
| 193 | 7. Change Hostname | 183 | 7. Change Hostname |
| 194 | 184 | ||
| 195 | If you don\'t like the hostname set during installation, you just | 185 | If you don't like the hostname set during installation, you just need to |
| 196 | need to edit two files. First, edit the simple hostname file: | 186 | edit two files. First, edit the simple hostname file: |
| 197 | 187 | ||
| 198 | ```sh | 188 | ```sh |
| 199 | doas nano /etc/hostname | 189 | doas nano /etc/hostname |
| @@ -216,8 +206,8 @@ web server. | |||
| 216 | 206 | ||
| 217 | # Nginx Web Server | 207 | # Nginx Web Server |
| 218 | 208 | ||
| 219 | To set up my web server, I simply created the `www` user and | 209 | To set up my web server, I simply created the `www` user and created the |
| 220 | created the necessary files. | 210 | necessary files. |
| 221 | 211 | ||
| 222 | ```sh | 212 | ```sh |
| 223 | doas adduser -D -g 'www' www | 213 | doas adduser -D -g 'www' www |
| @@ -227,17 +217,17 @@ doas chown -R www:www /var/lib/nginx/ | |||
| 227 | doas chown -R www:www /www | 217 | doas chown -R www:www /www |
| 228 | ``` | 218 | ``` |
| 229 | 219 | ||
| 230 | If you\'re running a simple webroot, you can alter the main | 220 | If you're running a simple webroot, you can alter the main `nginx.conf` file. |
| 231 | `nginx.conf` file. Otherwise, you can drop configuration | 221 | Otherwise, you can drop configuration files in the following directory. You |
| 232 | files in the following directory. You don\'t need to enable or symlink | 222 | don't need to enable or symlink the configuration file like you do in other |
| 233 | the configuration file like you do in other systems. | 223 | systems. |
| 234 | 224 | ||
| 235 | ```sh | 225 | ```sh |
| 236 | doas nano /etc/nginx/http.d/example_website.conf | 226 | doas nano /etc/nginx/http.d/example_website.conf |
| 237 | ``` | 227 | ``` |
| 238 | 228 | ||
| 239 | Once the configuration is set and pointed at the `/www` | 229 | Once the configuration is set and pointed at the `/www` directory to serve |
| 240 | directory to serve files, enable the Nginx service: | 230 | files, enable the Nginx service: |
| 241 | 231 | ||
| 242 | ```sh | 232 | ```sh |
| 243 | # Note that 'default' must be included or Nginx will not start on boot | 233 | # Note that 'default' must be included or Nginx will not start on boot |
| @@ -246,19 +236,16 @@ doas rc-update add nginx default | |||
| 246 | 236 | ||
| 247 | # Docker Containers | 237 | # Docker Containers |
| 248 | 238 | ||
| 249 | Docker works exactly the same as other systems. Either execute a | 239 | Docker works exactly the same as other systems. Either execute a `docker run` |
| 250 | `docker run` command or create a | 240 | command or create a `docker-compose.yml` file and do `docker-compose up -d`. |
| 251 | `docker-compose.yml` file and do | ||
| 252 | `docker-compose up -d`. | ||
| 253 | 241 | ||
| 254 | # Git Server | 242 | # Git Server |
| 255 | 243 | ||
| 256 | I went in-depth on how to self-host a git server in another post: | 244 | I went in-depth on how to self-host a git server in another post: [Self-Hosting |
| 257 | [Self-Hosting a Personal Git Server](../git-server/). | 245 | a Personal Git Server](../git-server/). |
| 258 | 246 | ||
| 259 | However, there are a few differences with Alpine. First note that in | 247 | However, there are a few differences with Alpine. First note that in order to |
| 260 | order to change the `git` user\'s shell, you must do a few | 248 | change the `git` user's shell, you must do a few things a little different: |
| 261 | things a little different: | ||
| 262 | 249 | ||
| 263 | ```sh | 250 | ```sh |
| 264 | doas apk add libuser | 251 | doas apk add libuser |
| @@ -270,12 +257,11 @@ doas lchsh git | |||
| 270 | 257 | ||
| 271 | # Thoughts on Alpine | 258 | # Thoughts on Alpine |
| 272 | 259 | ||
| 273 | So far, I love Alpine Linux. I have no complaints about anything at this | 260 | So far, I love Alpine Linux. I have no complaints about anything at this point, |
| 274 | point, but I\'m not completely finished with the migration yet. Once | 261 | but I'm not completely finished with the migration yet. Once I'm able to |
| 275 | I\'m able to upgrade my hardware to a rack-mounted server, I will | 262 | upgrade my hardware to a rack-mounted server, I will migrate Plex and Syncthing |
| 276 | migrate Plex and Syncthing over to Alpine as well - possibly putting | 263 | over to Alpine as well - possibly putting Plex into a container or VM. |
| 277 | Plex into a container or VM. | ||
| 278 | 264 | ||
| 279 | The performance is stellar, the `apk` package manager is | 265 | The performance is stellar, the `apk` package manager is seamless, and system |
| 280 | seamless, and system administration tasks are effortless. My only regret | 266 | administration tasks are effortless. My only regret is that I didn't install |
| 281 | is that I didn\'t install Alpine sooner. | 267 | Alpine sooner. |
content/blog/2022-10-30-linux-display-manager.md +20 −25
| @@ -8,18 +8,16 @@ draft = false | |||
| 8 | # Display Manager Services | 8 | # Display Manager Services |
| 9 | 9 | ||
| 10 | In order to change the [display | 10 | In order to change the [display |
| 11 | manager](https://en.wikipedia.org/wiki/Display_manager) on Void Linux - | 11 | manager](https://en.wikipedia.org/wiki/Display_manager) on Void Linux - or any |
| 12 | or any other Linux distro - you need to identify the currently enabled | 12 | other Linux distro - you need to identify the currently enabled display manager. |
| 13 | display manager. | ||
| 14 | 13 | ||
| 15 | ## Disabling the Current Display Manager | 14 | ## Disabling the Current Display Manager |
| 16 | 15 | ||
| 17 | Void Linux only has one ISO available for download with a pre-built | 16 | Void Linux only has one ISO available for download with a pre-built display |
| 18 | display manager at the time of this post: the XFCE ISO. If you\'ve | 17 | manager at the time of this post: the XFCE ISO. If you've installed this |
| 19 | installed this version, the pre-assigned display manager is | 18 | version, the pre-assigned display manager is `lxdm`. If you installed another |
| 20 | `lxdm`. If you installed another display manager, replace | 19 | display manager, replace `lxdm` in the following command with the display |
| 21 | `lxdm` in the following command with the display manager you | 20 | manager you have installed. |
| 22 | have installed. | ||
| 23 | 21 | ||
| 24 | To disable `lxdm`, simply remove the service symlink: | 22 | To disable `lxdm`, simply remove the service symlink: |
| 25 | 23 | ||
| @@ -29,9 +27,8 @@ sudo rm /var/service/lxdm | |||
| 29 | 27 | ||
| 30 | ## Enabling a New Display Manager | 28 | ## Enabling a New Display Manager |
| 31 | 29 | ||
| 32 | If you want to enable a new display manager, you can do so after | 30 | If you want to enable a new display manager, you can do so after `lxdm` is |
| 33 | `lxdm` is disabled. Make sure to replace | 31 | disabled. Make sure to replace `<new_display_manager>` with your new DM, such as |
| 34 | `<new_display_manager>` with your new DM, such as | ||
| 35 | `gdm`, `xdm`, etc. | 32 | `gdm`, `xdm`, etc. |
| 36 | 33 | ||
| 37 | ```sh | 34 | ```sh |
| @@ -41,8 +38,8 @@ sudo ln -s /etc/sv/<new_display_manager> /var/service | |||
| 41 | # Set Up `.xinitrc` | 38 | # Set Up `.xinitrc` |
| 42 | 39 | ||
| 43 | Depending on your setup, you may need to create a few X files, such as | 40 | Depending on your setup, you may need to create a few X files, such as |
| 44 | `~/.xinitrc`. For my personal set-up, I created this file to | 41 | `~/.xinitrc`. For my personal set-up, I created this file to launch the i3wm as |
| 45 | launch the i3wm as my desktop. | 42 | my desktop. |
| 46 | 43 | ||
| 47 | ```sh | 44 | ```sh |
| 48 | nano ~/.xinitrc | 45 | nano ~/.xinitrc |
| @@ -54,21 +51,20 @@ nano ~/.xinitrc | |||
| 54 | exec i3 | 51 | exec i3 |
| 55 | ``` | 52 | ``` |
| 56 | 53 | ||
| 57 | If you run a desktop other than i3, simply replace `i3` with | 54 | If you run a desktop other than i3, simply replace `i3` with the shell command |
| 58 | the shell command that launches that desktop. | 55 | that launches that desktop. |
| 59 | 56 | ||
| 60 | # Set Up Your Shell Profile | 57 | # Set Up Your Shell Profile |
| 61 | 58 | ||
| 62 | Finally, in order to automatically launch an X session upon login, you | 59 | Finally, in order to automatically launch an X session upon login, you will need |
| 63 | will need to edit the `.bash_profile` (bash) or | 60 | to edit the `.bash_profile` (bash) or `.zprofile` (zsh) files for your shell: |
| 64 | `.zprofile` (zsh) files for your shell: | ||
| 65 | 61 | ||
| 66 | ```sh | 62 | ```sh |
| 67 | nano ~/.zprofile | 63 | nano ~/.zprofile |
| 68 | ``` | 64 | ``` |
| 69 | 65 | ||
| 70 | Add the following snippet to the end of the shell profile file. This | 66 | Add the following snippet to the end of the shell profile file. This will |
| 71 | will execute the `startx` command upon login. | 67 | execute the `startx` command upon login. |
| 72 | 68 | ||
| 73 | ```sh | 69 | ```sh |
| 74 | if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then | 70 | if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then |
| @@ -76,7 +72,6 @@ if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then | |||
| 76 | fi | 72 | fi |
| 77 | ``` | 73 | ``` |
| 78 | 74 | ||
| 79 | Alternatively, you can ignore this step and simply choose to manually | 75 | Alternatively, you can ignore this step and simply choose to manually execute |
| 80 | execute `startx` upon login. This can be useful if you have | 76 | `startx` upon login. This can be useful if you have issues with your desktop or |
| 81 | issues with your desktop or like to manually launch different desktops | 77 | like to manually launch different desktops by choice. |
| 82 | by choice. | ||
content/blog/2022-11-07-self-hosting-matrix.md +43 −52
| @@ -7,21 +7,21 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Synpase | 8 | # Synpase |
| 9 | 9 | ||
| 10 | If you\'re reading this, you likely know that | 10 | If you're reading this, you likely know that |
| 11 | [Synapse](https://github.com/matrix-org/synapse/) is a popular | 11 | [Synapse](https://github.com/matrix-org/synapse/) is a popular |
| 12 | [Matrix](https://matrix.org/) home server software that allows users to | 12 | [Matrix](https://matrix.org/) home server software that allows users to run |
| 13 | run their own Matrix home server. | 13 | their own Matrix home server. |
| 14 | 14 | ||
| 15 | This post is a short guide describing how I was able to get Synapse | 15 | This post is a short guide describing how I was able to get Synapse working in a |
| 16 | working in a minimally-usable state on Alpine Linux. | 16 | minimally-usable state on Alpine Linux. |
| 17 | 17 | ||
| 18 | # Installation Process | 18 | # Installation Process |
| 19 | 19 | ||
| 20 | ## Dependencies | 20 | ## Dependencies |
| 21 | 21 | ||
| 22 | First, since there is no Alpine-specific package for Synapse, we need to | 22 | First, since there is no Alpine-specific package for Synapse, we need to ensure |
| 23 | ensure that Alpine has the required dependencies for the Python-based | 23 | that Alpine has the required dependencies for the Python-based installation |
| 24 | installation method. | 24 | method. |
| 25 | 25 | ||
| 26 | ```sh | 26 | ```sh |
| 27 | doas apk -U update | 27 | doas apk -U update |
| @@ -41,10 +41,9 @@ pip install matrix-synapse | |||
| 41 | 41 | ||
| 42 | ## Running Synapse | 42 | ## Running Synapse |
| 43 | 43 | ||
| 44 | Once installed, running Synapse is easy. Simply execute the following | 44 | Once installed, running Synapse is easy. Simply execute the following command, |
| 45 | command, replacing `example.com` with the domain name that | 45 | replacing `example.com` with the domain name that will be used with this home |
| 46 | will be used with this home server. This will generate the configuration | 46 | server. This will generate the configuration files needed to run the server. |
| 47 | files needed to run the server. | ||
| 48 | 47 | ||
| 49 | ```sh | 48 | ```sh |
| 50 | python -m synapse.app.homeserver \ | 49 | python -m synapse.app.homeserver \ |
| @@ -62,16 +61,14 @@ synctl start | |||
| 62 | 61 | ||
| 63 | ## Configuring Synapse | 62 | ## Configuring Synapse |
| 64 | 63 | ||
| 65 | To make any change to Synapse, we need to edit the `YAML` | 64 | To make any change to Synapse, we need to edit the `YAML` configuration file: |
| 66 | configuration file: | ||
| 67 | 65 | ||
| 68 | ```sh | 66 | ```sh |
| 69 | nano ~/synapse/homeserver.yaml | 67 | nano ~/synapse/homeserver.yaml |
| 70 | ``` | 68 | ``` |
| 71 | 69 | ||
| 72 | For now, we just need to ensure the `server_name` is | 70 | For now, we just need to ensure the `server_name` is accurate. However, there |
| 73 | accurate. However, there are a lot of other configuration options found | 71 | are a lot of other configuration options found in the [Configuring |
| 74 | in the [Configuring | ||
| 75 | Synapse](https://matrix-org.github.io/synapse/develop/usage/configuration/config_documentation.html) | 72 | Synapse](https://matrix-org.github.io/synapse/develop/usage/configuration/config_documentation.html) |
| 76 | documentation that can be enabled/disabled at any point. | 73 | documentation that can be enabled/disabled at any point. |
| 77 | 74 | ||
| @@ -87,9 +84,9 @@ synctl restart | |||
| 87 | 84 | ||
| 88 | ## Nginx Reverse-Proxy | 85 | ## Nginx Reverse-Proxy |
| 89 | 86 | ||
| 90 | To ensure that Synapse is reachable from the public, we need to connect | 87 | To ensure that Synapse is reachable from the public, we need to connect our |
| 91 | our domain to the Synapse server. In my case, I use a Nginx | 88 | domain to the Synapse server. In my case, I use a Nginx reverse-proxy for this |
| 92 | reverse-proxy for this purpose. | 89 | purpose. |
| 93 | 90 | ||
| 94 | To use Nginx, we need to create a reverse-proxy configuration file: | 91 | To use Nginx, we need to create a reverse-proxy configuration file: |
| 95 | 92 | ||
| @@ -97,9 +94,8 @@ To use Nginx, we need to create a reverse-proxy configuration file: | |||
| 97 | doas nano /etc/nginx/http.d/example.com.conf | 94 | doas nano /etc/nginx/http.d/example.com.conf |
| 98 | ``` | 95 | ``` |
| 99 | 96 | ||
| 100 | If you already have TLS certificates for this domain | 97 | If you already have TLS certificates for this domain (`example.com`), you can |
| 101 | (`example.com`), you can simply use the SSL configuration and | 98 | simply use the SSL configuration and point toward your TLS certificates. |
| 102 | point toward your TLS certificates. | ||
| 103 | 99 | ||
| 104 | ``` conf | 100 | ``` conf |
| 105 | server { | 101 | server { |
| @@ -143,10 +139,9 @@ server { | |||
| 143 | ``` | 139 | ``` |
| 144 | 140 | ||
| 145 | If you need to generate TLS certificates (I recommend | 141 | If you need to generate TLS certificates (I recommend |
| 146 | [Certbot](https://certbot.eff.org/)), you\'ll need a more minimal Nginx | 142 | [Certbot](https://certbot.eff.org/)), you'll need a more minimal Nginx conf |
| 147 | conf file before you can use the TLS-enabled example above. Instead, use | 143 | file before you can use the TLS-enabled example above. Instead, use this |
| 148 | this configuration file during the Certbot certificate generation | 144 | configuration file during the Certbot certificate generation process: |
| 149 | process: | ||
| 150 | 145 | ||
| 151 | ``` conf | 146 | ``` conf |
| 152 | server { | 147 | server { |
| @@ -158,20 +153,19 @@ server { | |||
| 158 | } | 153 | } |
| 159 | ``` | 154 | ``` |
| 160 | 155 | ||
| 161 | Once you\'re done editing the Nginx conf file, restart Nginx: | 156 | Once you're done editing the Nginx conf file, restart Nginx: |
| 162 | 157 | ||
| 163 | ```sh | 158 | ```sh |
| 164 | doas rc-service nginx restart | 159 | doas rc-service nginx restart |
| 165 | ``` | 160 | ``` |
| 166 | 161 | ||
| 167 | If you still need to generate TLS certificates, run `certbot` | 162 | If you still need to generate TLS certificates, run `certbot` now and obtain the |
| 168 | now and obtain the certificates. Certbot will ask if you want to use a | 163 | certificates. Certbot will ask if you want to use a webroot or spin up a |
| 169 | webroot or spin up a temporary web server. I **highly\*** recommend | 164 | temporary web server. I **highly** recommend using the temporary web server due |
| 170 | using the temporary web server due to the many issues with using a | 165 | to the many issues with using a webroot. |
| 171 | webroot. | ||
| 172 | 166 | ||
| 173 | You will need to stop Nginx in order to user the temporary web server | 167 | You will need to stop Nginx in order to user the temporary web server option |
| 174 | option with Certbot: | 168 | with Certbot: |
| 175 | 169 | ||
| 176 | ```sh | 170 | ```sh |
| 177 | # Stop Nginx so certbot can spin up a temp webserver for cert generation | 171 | # Stop Nginx so certbot can spin up a temp webserver for cert generation |
| @@ -182,13 +176,13 @@ doas rc-service nginx start | |||
| 182 | 176 | ||
| 183 | ## Open Firewall & Router Ports | 177 | ## Open Firewall & Router Ports |
| 184 | 178 | ||
| 185 | If you use a firewall on the server, open the `8448` port for | 179 | If you use a firewall on the server, open the `8448` port for discovery and |
| 186 | discovery and federation, as well as the normal web server ports if | 180 | federation, as well as the normal web server ports if you're using a reverse |
| 187 | you\'re using a reverse proxy. If you want additional services, such as | 181 | proxy. If you want additional services, such as voice calls, you will need to |
| 188 | voice calls, you will need to read the Synapse documentation to see | 182 | read the Synapse documentation to see which ports need to be opened for those |
| 189 | which ports need to be opened for those features. | 183 | features. |
| 190 | 184 | ||
| 191 | Here\'s an example of the Universal Firewall (UFW) software: | 185 | Here's an example of the Universal Firewall (UFW) software: |
| 192 | 186 | ||
| 193 | ```sh | 187 | ```sh |
| 194 | # Matrix port | 188 | # Matrix port |
| @@ -197,15 +191,13 @@ doas ufw allow 8448 | |||
| 197 | doas ufw allow "Nginx Full" | 191 | doas ufw allow "Nginx Full" |
| 198 | ``` | 192 | ``` |
| 199 | 193 | ||
| 200 | Remember to forward any Synapse ports, such as `8448`, | 194 | Remember to forward any Synapse ports, such as `8448`, `80`, and `443`, in your |
| 201 | `80`, and `443`, in your Router from the internet | 195 | Router from the internet to your server's IP address. |
| 202 | to your server\'s IP address. | ||
| 203 | 196 | ||
| 204 | ## Adding Matrix Users | 197 | ## Adding Matrix Users |
| 205 | 198 | ||
| 206 | Finally, if you didn\'t enable public registration in the | 199 | Finally, if you didn't enable public registration in the `homeserver.yaml` |
| 207 | `homeserver.yaml` file, you can manually create users via the | 200 | file, you can manually create users via the command-line: |
| 208 | command-line: | ||
| 209 | 201 | ||
| 210 | ```sh | 202 | ```sh |
| 211 | cd ~/synapse | 203 | cd ~/synapse |
| @@ -213,9 +205,8 @@ register_new_matrix_user -c homeserver.yaml | |||
| 213 | ``` | 205 | ``` |
| 214 | 206 | ||
| 215 | Remember that the format for federated Matrix usernames is | 207 | Remember that the format for federated Matrix usernames is |
| 216 | `@username:example.com` when logging in to client | 208 | `@username:example.com` when logging in to client applications. |
| 217 | applications. | ||
| 218 | 209 | ||
| 219 | Once Synapse is running, and you have a username, you are ready to log | 210 | Once Synapse is running, and you have a username, you are ready to log in to a |
| 220 | in to a Matrix client and start sending messages, joining rooms, and | 211 | Matrix client and start sending messages, joining rooms, and utilizing your very |
| 221 | utilizing your very own Matrix server. | 212 | own Matrix server. |
content/blog/2022-11-11-nginx-tmp-errors.md +17 −20
| @@ -5,15 +5,14 @@ description = "" | |||
| 5 | draft = false | 5 | draft = false |
| 6 | +++ | 6 | +++ |
| 7 | 7 | ||
| 8 | *This is a brief post so that I personally remember the solution as it | 8 | *This is a brief post so that I personally remember the solution as it has |
| 9 | has occurred multiple times for me.* | 9 | occurred multiple times for me.* |
| 10 | 10 | ||
| 11 | # The Problem | 11 | # The Problem |
| 12 | 12 | ||
| 13 | After migrating to a new server OS, I started receiving quite a few | 13 | After migrating to a new server OS, I started receiving quite a few permission |
| 14 | permission errors like the one below. These popped up for various | 14 | errors like the one below. These popped up for various different websites I'm |
| 15 | different websites I\'m serving via Nginx on this server, but did not | 15 | serving via Nginx on this server, but did not prevent the website from loading. |
| 16 | prevent the website from loading. | ||
| 17 | 16 | ||
| 18 | I found the errors in the standard log file: | 17 | I found the errors in the standard log file: |
| 19 | 18 | ||
| @@ -25,20 +24,18 @@ cat /var/log/nginx/error.log | |||
| 25 | 2022/11/11 11:30:34 [crit] 8970#8970: *10 open() "/var/lib/nginx/tmp/proxy/3/00/0000000003" failed (13: Permission denied) while reading upstream, client: 169.150.203.10, server: cyberchef.example.com, request: "GET /assets/main.css HTTP/2.0", upstream: "http://127.0.0.1:8111/assets/main.css", host: "cyberchef.example.com", referrer: "https://cyberchef.example.com/" | 24 | 2022/11/11 11:30:34 [crit] 8970#8970: *10 open() "/var/lib/nginx/tmp/proxy/3/00/0000000003" failed (13: Permission denied) while reading upstream, client: 169.150.203.10, server: cyberchef.example.com, request: "GET /assets/main.css HTTP/2.0", upstream: "http://127.0.0.1:8111/assets/main.css", host: "cyberchef.example.com", referrer: "https://cyberchef.example.com/" |
| 26 | ``` | 25 | ``` |
| 27 | 26 | ||
| 28 | You can see that the error is `13: Permission denied` and it | 27 | You can see that the error is `13: Permission denied` and it occurs in the |
| 29 | occurs in the `/var/lib/nginx/tmp/` directory. In my case, I | 28 | `/var/lib/nginx/tmp/` directory. In my case, I had thousands of errors where |
| 30 | had thousands of errors where Nginx was denied permission to read/write | 29 | Nginx was denied permission to read/write files in this directory. |
| 31 | files in this directory. | ||
| 32 | 30 | ||
| 33 | So how do I fix it? | 31 | So how do I fix it? |
| 34 | 32 | ||
| 35 | # The Solution | 33 | # The Solution |
| 36 | 34 | ||
| 37 | In order to resolve the issue, I had to ensure the | 35 | In order to resolve the issue, I had to ensure the `/var/lib/nginx` directory is |
| 38 | `/var/lib/nginx` directory is owned by Nginx. Mine was owned | 36 | owned by Nginx. Mine was owned by the `www` user and Nginx was not able to read |
| 39 | by the `www` user and Nginx was not able to read or write | 37 | or write files within that directory. This prevented Nginx from caching |
| 40 | files within that directory. This prevented Nginx from caching temporary | 38 | temporary files. |
| 41 | files. | ||
| 42 | 39 | ||
| 43 | ```sh | 40 | ```sh |
| 44 | # Alpine Linux | 41 | # Alpine Linux |
| @@ -48,9 +45,9 @@ doas chown -R nginx:nginx /var/lib/nginx | |||
| 48 | sudo chown -R nginx:nginx /var/lib/nginx | 45 | sudo chown -R nginx:nginx /var/lib/nginx |
| 49 | ``` | 46 | ``` |
| 50 | 47 | ||
| 51 | You *may* also be able to change the `proxy_temp_path` in | 48 | You *may* also be able to change the `proxy_temp_path` in your Nginx config, but |
| 52 | your Nginx config, but I did not try this. Here\'s a suggestion I found | 49 | I did not try this. Here's a suggestion I found online that may work if the |
| 53 | online that may work if the above solution does not: | 50 | above solution does not: |
| 54 | 51 | ||
| 55 | ```sh | 52 | ```sh |
| 56 | nano /etc/nginx/http.d/example.com.conf | 53 | nano /etc/nginx/http.d/example.com.conf |
| @@ -68,8 +65,8 @@ server { | |||
| 68 | } | 65 | } |
| 69 | ``` | 66 | ``` |
| 70 | 67 | ||
| 71 | Finally, restart Nginx and your server should be able to cache temporary | 68 | Finally, restart Nginx and your server should be able to cache temporary files |
| 72 | files again. | 69 | again. |
| 73 | 70 | ||
| 74 | ```sh | 71 | ```sh |
| 75 | # Alpine Linux (OpenRC) | 72 | # Alpine Linux (OpenRC) |
content/blog/2022-11-27-server-build.md +85 −90
| @@ -7,142 +7,137 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # The Dilemma | 8 | # The Dilemma |
| 9 | 9 | ||
| 10 | For years, I have been using desktops and a Raspberry Pi as the backbone | 10 | For years, I have been using desktops and a Raspberry Pi as the backbone of my |
| 11 | of my homelab. I have always wanted to move toward a single dedicated | 11 | homelab. I have always wanted to move toward a single dedicated server that |
| 12 | server that could handle all of my tasks, but was often put off by the | 12 | could handle all of my tasks, but was often put off by the complexity of the |
| 13 | complexity of the choices (and financial roadblocks at some times). | 13 | choices (and financial roadblocks at some times). |
| 14 | 14 | ||
| 15 | However, after purchasing a small server rack this past year, I have | 15 | However, after purchasing a small server rack this past year, I have been |
| 16 | been researching to see what kind of rack-mounted server I could buy. I | 16 | researching to see what kind of rack-mounted server I could buy. I initially |
| 17 | initially bought a Dell R720XD loaded up with everything I could ever | 17 | bought a Dell R720XD loaded up with everything I could ever want in a server - |
| 18 | want in a server - but I did not care for it. It was far too loud, and | 18 | but I did not care for it. It was far too loud, and the age of the CPU/RAM was |
| 19 | the age of the CPU/RAM was something I wanted to improve upon. | 19 | something I wanted to improve upon. |
| 20 | 20 | ||
| 21 | After returning the R720XD, I decided that I wanted to build my own | 21 | After returning the R720XD, I decided that I wanted to build my own server with |
| 22 | server with modern, consumer-grade PC components. This time, I am very | 22 | modern, consumer-grade PC components. This time, I am very happy with the |
| 23 | happy with the results of my server. | 23 | results of my server. |
| 24 | 24 | ||
| 25 | # Components | 25 | # Components |
| 26 | 26 | ||
| 27 | I\'ll start by listing all the components I used for this server build: | 27 | I'll start by listing all the components I used for this server build: |
| 28 | 28 | ||
| 29 | - **Case**: [Rosewill RSV-R4100U 4U Server Chassis Rackmount | 29 | - **Case**: [Rosewill RSV-R4100U 4U Server Chassis Rackmount |
| 30 | Case](https://www.rosewill.com/rosewill-rsv-r4100u-black/p/9SIA072GJ92825) | 30 | Case](https://www.rosewill.com/rosewill-rsv-r4100u-black/p/9SIA072GJ92825) |
| 31 | - **Motherboard**: [NZXT B550](https://nzxt.com/product/n7-b550) | 31 | - **Motherboard**: [NZXT B550](https://nzxt.com/product/n7-b550) |
| 32 | - **CPU**: AMD Ryzen 7 5700G with Radeon Graphics | 32 | - **CPU**: AMD Ryzen 7 5700G with Radeon Graphics |
| 33 | - **GPU**: N/A - I specifically chose one of the few AMD CPUs that | 33 | - **GPU**: N/A - I specifically chose one of the few AMD CPUs that support |
| 34 | support onboard graphics. | 34 | onboard graphics. |
| 35 | - **RAM**: 64GB RAM (2x32GB) *Max of 128GB RAM on this motherboard* | 35 | - **RAM**: 64GB RAM (2x32GB) *Max of 128GB RAM on this motherboard* |
| 36 | - **Boot Drive**: Western Digital 500GB M.2 NVME SSD | 36 | - **Boot Drive**: Western Digital 500GB M.2 NVME SSD |
| 37 | - **HDD Bay**: | 37 | - **HDD Bay**: |
| 38 | - 10TB WD White *(shucked, moved from previous server)* | 38 | - 10TB WD White *(shucked, moved from previous server)* |
| 39 | - 8TB WD White *(shucked, moved from previous server)* | 39 | - 8TB WD White *(shucked, moved from previous server)* |
| 40 | - 2 x 8TB WD Red Plus *(Black Friday lined up perfectly with this | 40 | - 2 x 8TB WD Red Plus *(Black Friday lined up perfectly with this build, |
| 41 | build, so I grabbed two of these)* | 41 | so I grabbed two of these)* |
| 42 | - **PSU**: Corsair RM850 PSU | 42 | - **PSU**: Corsair RM850 PSU |
| 43 | - **Extras**: | 43 | - **Extras**: |
| 44 | - Corsair TM3Q Thermal Paste | 44 | - Corsair TM3Q Thermal Paste |
| 45 | - Noctua 120mm fan *(replacement for front case fan)* | 45 | - Noctua 120mm fan *(replacement for front case fan)* |
| 46 | - 2 x Noctua 80mm fans *(replacement for rear case fans)* | 46 | - 2 x Noctua 80mm fans *(replacement for rear case fans)* |
| 47 | - CableMatters 6Gbps SATA Cables | 47 | - CableMatters 6Gbps SATA Cables |
| 48 | 48 | ||
| 49 | # Building the Server | 49 | # Building the Server |
| 50 | 50 | ||
| 51 | This took quite a while for me to build (in my opinion of time), | 51 | This took quite a while for me to build (in my opinion of time), totaling around |
| 52 | totaling around 3 hours from start to finish. The case has some peculiar | 52 | 3 hours from start to finish. The case has some peculiar construction, so you |
| 53 | construction, so you have to completely remove the ODD & HDD cages to | 53 | have to completely remove the ODD & HDD cages to install the motherboard and |
| 54 | install the motherboard and other components first. | 54 | other components first. |
| 55 | 55 | ||
| 56 | Now, I\'ve never built a computer of any kind before, so I was quite | 56 | Now, I've never built a computer of any kind before, so I was quite nervous. |
| 57 | nervous. Personally, the only challenging part was getting the CPU | 57 | Personally, the only challenging part was getting the CPU cooler to screw into |
| 58 | cooler to screw into the motherboard without sliding the thermal paste | 58 | the motherboard without sliding the thermal paste around too much underneath. |
| 59 | around too much underneath. I\'m still not entirely sure if I did a | 59 | I'm still not entirely sure if I did a great job of it, but nothing's broken |
| 60 | great job of it, but nothing\'s broken yet. | 60 | yet. |
| 61 | 61 | ||
| 62 | The main components were all fine and simple. However, installing the | 62 | The main components were all fine and simple. However, installing the hard |
| 63 | hard drives is slightly tedious as I need to power off the server and | 63 | drives is slightly tedious as I need to power off the server and completely |
| 64 | completely unscrew the HDD cage to install or remove any drives. | 64 | unscrew the HDD cage to install or remove any drives. Additionally, the drives |
| 65 | Additionally, the drives are screwed directly into the metal cage with | 65 | are screwed directly into the metal cage with small screws, which are quite a |
| 66 | small screws, which are quite a bit different from the HDD trays I\'m | 66 | bit different from the HDD trays I'm used to in other machines. |
| 67 | used to in other machines. | ||
| 68 | 67 | ||
| 69 | Seeing that the cases with hot-swap bays were 3-4x the price, I\'m okay | 68 | Seeing that the cases with hot-swap bays were 3-4x the price, I'm okay dealing |
| 70 | dealing with the tedium of removing the cage to install new drives. | 69 | with the tedium of removing the cage to install new drives. |
| 71 | 70 | ||
| 72 | # Software | 71 | # Software |
| 73 | 72 | ||
| 74 | I\'m not going to dive into the software as I have done so in other | 73 | I'm not going to dive into the software as I have done so in other recent |
| 75 | recent posts. However, I wanted to note that I am using Alpine Linux on | 74 | posts. However, I wanted to note that I am using Alpine Linux on this server and |
| 76 | this server and hosting most services inside Docker. No virtual machines | 75 | hosting most services inside Docker. No virtual machines (VMs) and very few |
| 77 | (VMs) and very few bare-metal services. | 76 | bare-metal services. |
| 78 | 77 | ||
| 79 | # The Results | 78 | # The Results |
| 80 | 79 | ||
| 81 | How did my build turn out? Well, after migrating my other servers and | 80 | How did my build turn out? Well, after migrating my other servers and their |
| 82 | their services over, I found that my server is blazing fast. The | 81 | services over, I found that my server is blazing fast. The heaviest of my |
| 83 | heaviest of my applications, Plex, is handled with ease. Even 4k | 82 | applications, Plex, is handled with ease. Even 4k streaming seems to be |
| 84 | streaming seems to be effortless. | 83 | effortless. |
| 85 | 84 | ||
| 86 | I am very happy with the results and will likely continue to improve on | 85 | I am very happy with the results and will likely continue to improve on this |
| 87 | this server as the years go by rather than buying another used server | 86 | server as the years go by rather than buying another used server online. |
| 88 | online. | ||
| 89 | 87 | ||
| 90 | ## Mistakes I Made | 88 | ## Mistakes I Made |
| 91 | 89 | ||
| 92 | This post wouldn\'t be complete unless I wrote about the mistakes I made | 90 | This post wouldn't be complete unless I wrote about the mistakes I made while |
| 93 | while building. The only real mistake I made beyond a \"whoops I dropped | 91 | building. The only real mistake I made beyond a "whoops I dropped a screw" |
| 94 | a screw\" related to airflow and fan direction. | 92 | related to airflow and fan direction. |
| 95 | 93 | ||
| 96 | While installing the two new hard drives that showed up on 2022-11-30 | 94 | While installing the two new hard drives that showed up on 2022-11-30 and |
| 97 | and getting ready to install the case in my rack, I noticed that the | 95 | getting ready to install the case in my rack, I noticed that the hard drive |
| 98 | hard drive temperatures were quite high. | 96 | temperatures were quite high. |
| 99 | 97 | ||
| 100 | I used the `smartctl` command for each of my drives | 98 | I used the `smartctl` command for each of my drives (`/dev/sda` through |
| 101 | (`/dev/sda` through `/dev/sdd`): | 99 | `/dev/sdd`): |
| 102 | 100 | ||
| 103 | ```sh | 101 | ```sh |
| 104 | doas smartctl -a /dev/sda | grep Temperature_Celsius | 102 | doas smartctl -a /dev/sda | grep Temperature_Celsius |
| 105 | ``` | 103 | ``` |
| 106 | 104 | ||
| 107 | The results were unusual - all four drives were idling at \~44-46 | 105 | The results were unusual - all four drives were idling at ~44-46 degrees |
| 108 | degrees Celsius. The only drive that was cooler was my 10TB drive, which | 106 | Celsius. The only drive that was cooler was my 10TB drive, which was at 38 |
| 109 | was at 38 degrees Celsius. I noted that this 10TB drive was also closest | 107 | degrees Celsius. I noted that this 10TB drive was also closest to the case fan. |
| 110 | to the case fan. | ||
| 111 | 108 | ||
| 112 | ```sh | 109 | ```sh |
| 113 | ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE | 110 | ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE |
| 114 | # /dev/sda | 111 | # /dev/sda |
| 115 | 194 Temperature_Celsius 0x0002 147 147 000 Old_age Always - 44 (Min/Max 22/46) | 112 | 194 Temperature_Celsius 0x0002 147 147 000 Old_age Always - 44 (Min/Max 22/46) |
| 116 | # /dev/sdb | 113 | # /dev/sdb |
| 117 | 194 Temperature_Celsius 0x0002 141 141 000 Old_age Always - 46 (Min/Max 21/48) | 114 | 194 Temperature_Celsius 0x0002 141 141 000 Old_age Always - 46 (Min/Max 21/48) |
| 118 | # /dev/sdc | 115 | # /dev/sdc |
| 119 | 194 Temperature_Celsius 0x0002 144 144 000 Old_age Always - 45 (Min/Max 19/61) | 116 | 194 Temperature_Celsius 0x0002 144 144 000 Old_age Always - 45 (Min/Max 19/61) |
| 120 | # /dev/sdd | 117 | # /dev/sdd |
| 121 | 194 Temperature_Celsius 0x0002 171 171 000 Old_age Always - 38 (Min/Max 14/56) | 118 | 194 Temperature_Celsius 0x0002 171 171 000 Old_age Always - 38 (Min/Max 14/56) |
| 122 | ``` | 119 | ``` |
| 123 | 120 | ||
| 124 | After looking to see if I could fit more fans into the case, I noticed | 121 | After looking to see if I could fit more fans into the case, I noticed that the |
| 125 | that the 120mm fan used for intake from the front of the case was | 122 | 120mm fan used for intake from the front of the case was actually pushing air |
| 126 | actually pushing air out of the case by mistake. This fan sits right in | 123 | out of the case by mistake. This fan sits right in front of the hard drive bay. |
| 127 | front of the hard drive bay. | ||
| 128 | 124 | ||
| 129 | Once I flipped the fan around to act as an intake fan, the temperatures | 125 | Once I flipped the fan around to act as an intake fan, the temperatures dropped |
| 130 | dropped immediately! They are now idling at \~31-33 degrees Celsius. A | 126 | immediately! They are now idling at ~31-33 degrees Celsius. A single fan |
| 131 | single fan spinning the wrong way caused my drives to idle 10-15 degrees | 127 | spinning the wrong way caused my drives to idle 10-15 degrees higher than they |
| 132 | higher than they should have. | 128 | should have. |
| 133 | 129 | ||
| 134 | ```sh | 130 | ```sh |
| 135 | ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE | 131 | ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE |
| 136 | # /dev/sda | 132 | # /dev/sda |
| 137 | 194 Temperature_Celsius 0x0002 209 209 000 Old_age Always - 31 (Min/Max 14/56) | 133 | 194 Temperature_Celsius 0x0002 209 209 000 Old_age Always - 31 (Min/Max 14/56) |
| 138 | # /dev/sdb | 134 | # /dev/sdb |
| 139 | 194 Temperature_Celsius 0x0002 196 196 000 Old_age Always - 33 (Min/Max 19/61) | 135 | 194 Temperature_Celsius 0x0002 196 196 000 Old_age Always - 33 (Min/Max 19/61) |
| 140 | # /dev/sdc | 136 | # /dev/sdc |
| 141 | 194 Temperature_Celsius 0x0002 203 203 000 Old_age Always - 32 (Min/Max 21/48) | 137 | 194 Temperature_Celsius 0x0002 203 203 000 Old_age Always - 32 (Min/Max 21/48) |
| 142 | # /dev/sdd | 138 | # /dev/sdd |
| 143 | 194 Temperature_Celsius 0x0002 196 196 000 Old_age Always - 33 (Min/Max 22/46) | 139 | 194 Temperature_Celsius 0x0002 196 196 000 Old_age Always - 33 (Min/Max 22/46) |
| 144 | ``` | 140 | ``` |
| 145 | 141 | ||
| 146 | This was a silly error to make, but I\'m glad I found it today before I | 142 | This was a silly error to make, but I'm glad I found it today before I screwed |
| 147 | screwed the case into the rack and made things a lot more tedious to | 143 | the case into the rack and made things a lot more tedious to fix. |
| 148 | fix. | ||
content/blog/2022-11-29-nginx-referrer-ban-list.md +25 −26
| @@ -7,9 +7,9 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Creating the Ban List | 8 | # Creating the Ban List |
| 9 | 9 | ||
| 10 | In order to ban list referral domains or websites with Nginx, you need | 10 | In order to ban list referral domains or websites with Nginx, you need to create |
| 11 | to create a ban list file. The file below will accept regexes for | 11 | a ban list file. The file below will accept regexes for different domains or |
| 12 | different domains or websites you wish to block. | 12 | websites you wish to block. |
| 13 | 13 | ||
| 14 | First, create the file in your nginx directory: | 14 | First, create the file in your nginx directory: |
| 15 | 15 | ||
| @@ -17,8 +17,8 @@ First, create the file in your nginx directory: | |||
| 17 | doas nano /etc/nginx/banlist.conf | 17 | doas nano /etc/nginx/banlist.conf |
| 18 | ``` | 18 | ``` |
| 19 | 19 | ||
| 20 | Next, paste the following contents in and fill out the regexes with | 20 | Next, paste the following contents in and fill out the regexes with whichever |
| 21 | whichever domains you\'re blocking. | 21 | domains you're blocking. |
| 22 | 22 | ||
| 23 | ``` conf | 23 | ``` conf |
| 24 | # /etc/nginx/banlist.conf | 24 | # /etc/nginx/banlist.conf |
| @@ -35,15 +35,15 @@ map $http_referer $bad_referer { | |||
| 35 | 35 | ||
| 36 | # Configuring Nginx | 36 | # Configuring Nginx |
| 37 | 37 | ||
| 38 | In order for the ban list to work, Nginx needs to know it exists and how | 38 | In order for the ban list to work, Nginx needs to know it exists and how to |
| 39 | to handle it. For this, edit the `nginx.conf` file. | 39 | handle it. For this, edit the `nginx.conf` file. |
| 40 | 40 | ||
| 41 | ```sh | 41 | ```sh |
| 42 | doas nano /etc/nginx/nginx.conf | 42 | doas nano /etc/nginx/nginx.conf |
| 43 | ``` | 43 | ``` |
| 44 | 44 | ||
| 45 | Within this file, find the `http` block and add your ban list | 45 | Within this file, find the `http` block and add your ban list file location to |
| 46 | file location to the end of the block. | 46 | the end of the block. |
| 47 | 47 | ||
| 48 | ``` conf | 48 | ``` conf |
| 49 | # /etc/nginx/nginx.conf | 49 | # /etc/nginx/nginx.conf |
| @@ -58,24 +58,23 @@ http { | |||
| 58 | 58 | ||
| 59 | # Enabling the Ban List | 59 | # Enabling the Ban List |
| 60 | 60 | ||
| 61 | Finally, we need to take action when a bad referral site is found. To do | 61 | Finally, we need to take action when a bad referral site is found. To do so, |
| 62 | so, edit the configuration file for your website. For example, I have | 62 | edit the configuration file for your website. For example, I have all website |
| 63 | all website configuration files in the `http.d` directory. | 63 | configuration files in the `http.d` directory. You may have them in the |
| 64 | You may have them in the `sites-available` directory on some | 64 | `sites-available` directory on some distributions. |
| 65 | distributions. | ||
| 66 | 65 | ||
| 67 | ```sh | 66 | ```sh |
| 68 | doas nano /etc/nginx/http.d/example.com.conf | 67 | doas nano /etc/nginx/http.d/example.com.conf |
| 69 | ``` | 68 | ``` |
| 70 | 69 | ||
| 71 | Within each website\'s configuration file, edit the `server` | 70 | Within each website's configuration file, edit the `server` blocks that are |
| 72 | blocks that are listening to ports 80 and 443 and create a check for the | 71 | listening to ports 80 and 443 and create a check for the `$bad_referrer` |
| 73 | `$bad_referrer` variable we created in the ban list file. | 72 | variable we created in the ban list file. |
| 74 | 73 | ||
| 75 | If a matching site is found, you can return any [HTTP Status | 74 | If a matching site is found, you can return any [HTTP Status |
| 76 | Code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) you want. | 75 | Code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) you want. Code |
| 77 | Code 403 (Forbidden) is logical in this case since you are preventing a | 76 | 403 (Forbidden) is logical in this case since you are preventing a client |
| 78 | client connection due to a banned domain. | 77 | connection due to a banned domain. |
| 79 | 78 | ||
| 80 | ``` conf | 79 | ``` conf |
| 81 | server { | 80 | server { |
| @@ -100,8 +99,8 @@ doas rc-service nginx restart | |||
| 100 | 99 | ||
| 101 | # Testing Results | 100 | # Testing Results |
| 102 | 101 | ||
| 103 | In order to test the results, let\'s curl the contents of our site. To | 102 | In order to test the results, let's curl the contents of our site. To start, |
| 104 | start, I\'ll curl the site normally: | 103 | I'll curl the site normally: |
| 105 | 104 | ||
| 106 | ```sh | 105 | ```sh |
| 107 | curl https://cleberg.net | 106 | curl https://cleberg.net |
| @@ -113,15 +112,15 @@ The HTML contents of the page come back successfully: | |||
| 113 | <!doctype html>...</html> | 112 | <!doctype html>...</html> |
| 114 | ``` | 113 | ``` |
| 115 | 114 | ||
| 116 | Next, let\'s include a banned referrer: | 115 | Next, let's include a banned referrer: |
| 117 | 116 | ||
| 118 | ```sh | 117 | ```sh |
| 119 | curl --referer https://news.ycombinator.com https://cleberg.net | 118 | curl --referer https://news.ycombinator.com https://cleberg.net |
| 120 | ``` | 119 | ``` |
| 121 | 120 | ||
| 122 | This time, I\'m met with a 403 Forbidden response page. That means we | 121 | This time, I'm met with a 403 Forbidden response page. That means we are |
| 123 | are successful and any clients being referred from a banned domain will | 122 | successful and any clients being referred from a banned domain will be met with |
| 124 | be met with this same response code. | 123 | this same response code. |
| 125 | 124 | ||
| 126 | ``` html | 125 | ``` html |
| 127 | <html> | 126 | <html> |
content/blog/2022-12-01-nginx-compression.md +33 −37
| @@ -7,24 +7,23 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Text Compression | 8 | # Text Compression |
| 9 | 9 | ||
| 10 | Text compression allows a web server to serve text-based resources | 10 | Text compression allows a web server to serve text-based resources faster than |
| 11 | faster than uncompressed data. This can speed up things like First | 11 | uncompressed data. This can speed up things like First Contentful Paint, Tie to |
| 12 | Contentful Paint, Tie to Interactive, and Speed Index. | 12 | Interactive, and Speed Index. |
| 13 | 13 | ||
| 14 | # Enable Nginx Compression with gzip | 14 | # Enable Nginx Compression with gzip |
| 15 | 15 | ||
| 16 | In order to enable text compression on Nginx, we need to enable it | 16 | In order to enable text compression on Nginx, we need to enable it within the |
| 17 | within the configuration file: | 17 | configuration file: |
| 18 | 18 | ||
| 19 | ```sh | 19 | ```sh |
| 20 | nano /etc/nginx/nginx.conf | 20 | nano /etc/nginx/nginx.conf |
| 21 | ``` | 21 | ``` |
| 22 | 22 | ||
| 23 | Within the `http` block, find the section that shows | 23 | Within the `http` block, find the section that shows something like the block |
| 24 | something like the block below. This is the default gzip configuration I | 24 | below. This is the default gzip configuration I found in my `nginx.conf` file on |
| 25 | found in my `nginx.conf` file on Alpine Linux 3.17. Yours may | 25 | Alpine Linux 3.17. Yours may look slightly different, just make sure that |
| 26 | look slightly different, just make sure that you\'re not creating any | 26 | you're not creating any duplicate gzip options. |
| 27 | duplicate gzip options. | ||
| 28 | 27 | ||
| 29 | ``` conf | 28 | ``` conf |
| 30 | # Enable gzipping of responses. | 29 | # Enable gzipping of responses. |
| @@ -48,33 +47,30 @@ gzip_disable "MSIE [1-6]"; | |||
| 48 | 47 | ||
| 49 | # Explanations of ngx~httpgzipmodule~ Options | 48 | # Explanations of ngx~httpgzipmodule~ Options |
| 50 | 49 | ||
| 51 | Each of the lines above enables a different aspect of the gzip response | 50 | Each of the lines above enables a different aspect of the gzip response for |
| 52 | for Nginx. Here are the full explanations: | 51 | Nginx. Here are the full explanations: |
| 53 | 52 | ||
| 54 | - `gzip` -- Enables or disables gzipping of responses. | 53 | - `gzip` -- Enables or disables gzipping of responses. |
| 55 | - `gzip_vary` -- Enables or disables inserting the \"Vary: | 54 | - `gzip_vary` -- Enables or disables inserting the "Vary: Accept-Encoding" |
| 56 | Accept-Encoding\" response header field if the directives gzip, | 55 | response header field if the directives gzip, gzip~static~, or gunzip are |
| 57 | gzip~static~, or gunzip are active. | 56 | active. |
| 58 | - `gzip_min_length` -- Sets the minimum length of a | 57 | - `gzip_min_length` -- Sets the minimum length of a response that will be |
| 59 | response that will be gzipped. The length is determined only from | 58 | gzipped. The length is determined only from the "Content-Length" response |
| 60 | the \"Content-Length\" response header field. | 59 | header field. |
| 61 | - `gzip_proxied` -- Enables or disables gzipping of | 60 | - `gzip_proxied` -- Enables or disables gzipping of responses for proxied |
| 62 | responses for proxied requests depending on the request and | 61 | requests depending on the request and response. The fact that the request is |
| 63 | response. The fact that the request is proxied is determined by the | 62 | proxied is determined by the presence of the "Via" request header field. |
| 64 | presence of the \"Via\" request header field. | 63 | - `gzip_types` -- Enables gzipping of responses for the specified MIME types in |
| 65 | - `gzip_types` -- Enables gzipping of responses for the | 64 | addition to "text/html". The special value "*" matches any MIME type |
| 66 | specified MIME types in addition to \"text/html\". The special value | 65 | (0.8.29). Responses with the "text/html" type are always compressed. |
| 67 | "\*" matches any MIME type (0.8.29). Responses with the | 66 | - `gzip_disable` -- Disables gzipping of responses for requests with |
| 68 | \"text/html\" type are always compressed. | 67 | "User-Agent" header fields matching any of the specified regular |
| 69 | - `gzip_disable` -- Disables gzipping of responses for | 68 | expressions. |
| 70 | requests with \"User-Agent\" header fields matching any of the | 69 | - The special mask "msie6" (0.7.12) corresponds to the regular expression |
| 71 | specified regular expressions. | 70 | "MSIE [4-6].", but works faster. Starting from version 0.8.11, "MSIE |
| 72 | - The special mask \"msie6\" (0.7.12) corresponds to the regular | 71 | 6.0; ... SV1" is excluded from this mask. |
| 73 | expression \"MSIE \[4-6\].\", but works faster. Starting from | ||
| 74 | version 0.8.11, \"MSIE 6.0; ... SV1\" is excluded from this | ||
| 75 | mask. | ||
| 76 | 72 | ||
| 77 | More information on these directives and their options can be found on | 73 | More information on these directives and their options can be found on the |
| 78 | the [Module | 74 | [Module |
| 79 | ngx~httpgzipmodule~](https://nginx.org/en/docs/http/ngx_http_gzip_module.html) | 75 | ngx~httpgzipmodule~](https://nginx.org/en/docs/http/ngx_http_gzip_module.html) |
| 80 | page in Nginx\'s documentation. | 76 | page in Nginx's documentation. |
content/blog/2022-12-07-nginx-wildcard-redirect.md +29 −33
| @@ -7,18 +7,18 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Problem | 8 | # Problem |
| 9 | 9 | ||
| 10 | I recently migrated domains and replaced the old webpage with a simple | 10 | I recently migrated domains and replaced the old webpage with a simple info page |
| 11 | info page with instructions to users on how to edit their bookmarks and | 11 | with instructions to users on how to edit their bookmarks and URLs to get to the |
| 12 | URLs to get to the page they were seeking. | 12 | page they were seeking. |
| 13 | 13 | ||
| 14 | This was not ideal as it left the work up to the user and may have | 14 | This was not ideal as it left the work up to the user and may have caused |
| 15 | caused friction for users who accessed my RSS feed. | 15 | friction for users who accessed my RSS feed. |
| 16 | 16 | ||
| 17 | # Solution | 17 | # Solution |
| 18 | 18 | ||
| 19 | Instead, I finally found a solution that allows me to redirect both | 19 | Instead, I finally found a solution that allows me to redirect both subdomains |
| 20 | subdomains AND trailing content. For example, both of these URLs now | 20 | AND trailing content. For example, both of these URLs now redirect properly |
| 21 | redirect properly using the logic I\'ll explain below: | 21 | using the logic I'll explain below: |
| 22 | 22 | ||
| 23 | ``` txt | 23 | ``` txt |
| 24 | # Example 1 - Simple base domain redirect with trailing content | 24 | # Example 1 - Simple base domain redirect with trailing content |
| @@ -34,15 +34,15 @@ Go ahead, try the URLs if you want to test them. | |||
| 34 | 34 | ||
| 35 | ## Nginx Config | 35 | ## Nginx Config |
| 36 | 36 | ||
| 37 | To make this possible. I needed to configure a proper redirect scheme in | 37 | To make this possible. I needed to configure a proper redirect scheme in my |
| 38 | my Nginx configuration. | 38 | Nginx configuration. |
| 39 | 39 | ||
| 40 | ```sh | 40 | ```sh |
| 41 | doas nano /etc/nginx/http.d/domain1.conf | 41 | doas nano /etc/nginx/http.d/domain1.conf |
| 42 | ``` | 42 | ``` |
| 43 | 43 | ||
| 44 | Within this file, I had one block configured to redirect HTTP requests | 44 | Within this file, I had one block configured to redirect HTTP requests to HTTPS |
| 45 | to HTTPS for the base domain and all subdomains. | 45 | for the base domain and all subdomains. |
| 46 | 46 | ||
| 47 | ``` conf | 47 | ``` conf |
| 48 | server { | 48 | server { |
| @@ -62,10 +62,9 @@ server { | |||
| 62 | } | 62 | } |
| 63 | ``` | 63 | ``` |
| 64 | 64 | ||
| 65 | For the base domain, I have another `server` block dedicated | 65 | For the base domain, I have another `server` block dedicated to redirecting all |
| 66 | to redirecting all base domain requests. You can see that the | 66 | base domain requests. You can see that the `rewrite` line is instructing Nginx |
| 67 | `rewrite` line is instructing Nginx to gather all trailing | 67 | to gather all trailing content and append it to the new `domain2.com` URL. |
| 68 | content and append it to the new `domain2.com` URL. | ||
| 69 | 68 | ||
| 70 | ``` conf | 69 | ``` conf |
| 71 | server { | 70 | server { |
| @@ -81,19 +80,16 @@ server { | |||
| 81 | } | 80 | } |
| 82 | ``` | 81 | ``` |
| 83 | 82 | ||
| 84 | Finally, the tricky part is figuring out how to tell Nginx to redirect | 83 | Finally, the tricky part is figuring out how to tell Nginx to redirect while |
| 85 | while keeping both a subdomain and trailing content intact. I found that | 84 | keeping both a subdomain and trailing content intact. I found that the easiest |
| 86 | the easiest way to do this is to give it a `server` block of | 85 | way to do this is to give it a `server` block of its own. |
| 87 | its own. | ||
| 88 | 86 | ||
| 89 | Within this block, we need to do some regex on the | 87 | Within this block, we need to do some regex on the `server_name` line before we |
| 90 | `server_name` line before we can rewrite anything. This | 88 | can rewrite anything. This creates a variable called `subdomain`. |
| 91 | creates a variable called `subdomain`. | ||
| 92 | 89 | ||
| 93 | Once the server gets to the `rewrite` line, it pulls the | 90 | Once the server gets to the `rewrite` line, it pulls the `subdomain` variable |
| 94 | `subdomain` variable from above and uses it on the new | 91 | from above and uses it on the new `domain2.com` domain before appending the |
| 95 | `domain2.com` domain before appending the trailing content | 92 | trailing content (`$request_uri`). |
| 96 | (`$request_uri`). | ||
| 97 | 93 | ||
| 98 | ``` conf | 94 | ``` conf |
| 99 | server { | 95 | server { |
| @@ -109,15 +105,15 @@ server { | |||
| 109 | } | 105 | } |
| 110 | ``` | 106 | ``` |
| 111 | 107 | ||
| 112 | That\'s all there is to it. With this, I simply restarted Nginx and | 108 | That's all there is to it. With this, I simply restarted Nginx and watched the |
| 113 | watched the redirections work in-action. | 109 | redirections work in-action. |
| 114 | 110 | ||
| 115 | ```sh | 111 | ```sh |
| 116 | doas rc-service nginx restart | 112 | doas rc-service nginx restart |
| 117 | ``` | 113 | ``` |
| 118 | 114 | ||
| 119 | Looking back on it, I wish I had done this sooner. Who knows how many | 115 | Looking back on it, I wish I had done this sooner. Who knows how many people |
| 120 | people went looking for my sites or bookmarks and gave up when they saw | 116 | went looking for my sites or bookmarks and gave up when they saw the redirect |
| 121 | the redirect instructions page. | 117 | instructions page. |
| 122 | 118 | ||
| 123 | Oh well, it\'s done now. Live and learn. | 119 | Oh well, it's done now. Live and learn. |
content/blog/2022-12-17-st.md +26 −30
| @@ -7,17 +7,15 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # st | 8 | # st |
| 9 | 9 | ||
| 10 | [st](https://st.suckless.org) standards for Simple Terminal, a simple | 10 | [st](https://st.suckless.org) standards for Simple Terminal, a simple terminal |
| 11 | terminal implementation for X made by the | 11 | implementation for X made by the [suckless](https://suckless.org) team. |
| 12 | [suckless](https://suckless.org) team. | ||
| 13 | 12 | ||
| 14 | This post walks through the dependencies needed and process to build and | 13 | This post walks through the dependencies needed and process to build and install |
| 15 | install `st` on Fedora Workstation. | 14 | `st` on Fedora Workstation. |
| 16 | 15 | ||
| 17 | ## Obtain Files | 16 | ## Obtain Files |
| 18 | 17 | ||
| 19 | To start, obtain the source files for `st` via | 18 | To start, obtain the source files for `st` via `git clone`. |
| 20 | `git clone`. | ||
| 21 | 19 | ||
| 22 | ```sh | 20 | ```sh |
| 23 | mkdir ~/suckless && cd ~/suckless | 21 | mkdir ~/suckless && cd ~/suckless |
| @@ -26,8 +24,8 @@ git clone https://git.suckless.org/st && cd st | |||
| 26 | 24 | ||
| 27 | ## Dependencies | 25 | ## Dependencies |
| 28 | 26 | ||
| 29 | Once you have the files and are in the `st` directory, ensure | 27 | Once you have the files and are in the `st` directory, ensure the following |
| 30 | the following packages are installed. | 28 | packages are installed. |
| 31 | 29 | ||
| 32 | ```sh | 30 | ```sh |
| 33 | sudo dnf update && sudo dnf upgrade | 31 | sudo dnf update && sudo dnf upgrade |
| @@ -42,13 +40,12 @@ Before building, ensure that you read the README file. | |||
| 42 | cat README | 40 | cat README |
| 43 | ``` | 41 | ``` |
| 44 | 42 | ||
| 45 | Once you\'ve read the instructions, open the `config.mk` file | 43 | Once you've read the instructions, open the `config.mk` file and ensure it |
| 46 | and ensure it matches your setup. If you\'re not sure, leave the default | 44 | matches your setup. If you're not sure, leave the default options within the |
| 47 | options within the file. | 45 | file. |
| 48 | 46 | ||
| 49 | Finally, you can build `st` with the following command. | 47 | Finally, you can build `st` with the following command. Ensure you run as root |
| 50 | Ensure you run as root (e.g., `sudo`) or else you may not end | 48 | (e.g., `sudo`) or else you may not end up with a usable application file. |
| 51 | up with a usable application file. | ||
| 52 | 49 | ||
| 53 | ```sh | 50 | ```sh |
| 54 | sudo make clean install | 51 | sudo make clean install |
| @@ -56,39 +53,38 @@ sudo make clean install | |||
| 56 | 53 | ||
| 57 | ## Customization (Patches) | 54 | ## Customization (Patches) |
| 58 | 55 | ||
| 59 | Note that customizing `st` requires you to modify the source | 56 | Note that customizing `st` requires you to modify the source files or to |
| 60 | files or to download one of the [available | 57 | download one of the [available patches](https://st.suckless.org/patches/) for |
| 61 | patches](https://st.suckless.org/patches/) for suckless.org. | 58 | suckless.org. |
| 62 | 59 | ||
| 63 | If you\'ve already installed `st` and want to customize or | 60 | If you've already installed `st` and want to customize or install a patch, |
| 64 | install a patch, start by uninstalling the current program. | 61 | start by uninstalling the current program. |
| 65 | 62 | ||
| 66 | ```sh | 63 | ```sh |
| 67 | cd ~/suckless/st | 64 | cd ~/suckless/st |
| 68 | sudo make uninstall | 65 | sudo make uninstall |
| 69 | ``` | 66 | ``` |
| 70 | 67 | ||
| 71 | Next, grab the `<path>.diff` file from the page of the patch | 68 | Next, grab the `<path>.diff` file from the page of the patch you chose. For |
| 72 | you chose. For example, I will be using the | 69 | example, I will be using the |
| 73 | [defaultfontsize](https://st.suckless.org/patches/defaultfontsize/) | 70 | [defaultfontsize](https://st.suckless.org/patches/defaultfontsize/) patch in the |
| 74 | patch in the below example. | 71 | below example. |
| 75 | 72 | ||
| 76 | ```sh | 73 | ```sh |
| 77 | wget https://st.suckless.org/patches/defaultfontsize/st-defaultfontsize-20210225-4ef0cbd.diff | 74 | wget https://st.suckless.org/patches/defaultfontsize/st-defaultfontsize-20210225-4ef0cbd.diff |
| 78 | ``` | 75 | ``` |
| 79 | 76 | ||
| 80 | Once the file is downloaded inside the `st` folder, apply the | 77 | Once the file is downloaded inside the `st` folder, apply the patch and |
| 81 | patch and re-install the program. You may need to install the | 78 | re-install the program. You may need to install the `patch` command if you |
| 82 | `patch` command if you don\'t have it installed already (you | 79 | don't have it installed already (you should have installed it above). |
| 83 | should have installed it above). | ||
| 84 | 80 | ||
| 85 | ```sh | 81 | ```sh |
| 86 | patch -i st-defaultfontsize-20210225-4ef0cbd.diff | 82 | patch -i st-defaultfontsize-20210225-4ef0cbd.diff |
| 87 | sudo make clean install | 83 | sudo make clean install |
| 88 | ``` | 84 | ``` |
| 89 | 85 | ||
| 90 | Once installed, you can use the default font size patch to launch | 86 | Once installed, you can use the default font size patch to launch `st` with any |
| 91 | `st` with any font size you wish: | 87 | font size you wish: |
| 92 | 88 | ||
| 93 | ```sh | 89 | ```sh |
| 94 | st -z 16 | 90 | st -z 16 |
content/blog/2022-12-23-alpine-desktop.md +45 −52
| @@ -5,33 +5,31 @@ description = "" | |||
| 5 | draft = false | 5 | draft = false |
| 6 | +++ | 6 | +++ |
| 7 | 7 | ||
| 8 | # Isn't Alpine Linux for Servers? | ||
| 8 | 9 | ||
| 9 | # Isn\'t Alpine Linux for Servers? | 10 | This is a question I see a lot when people are presented with an example of |
| 11 | Alpine Linux running as a desktop OS. | ||
| 10 | 12 | ||
| 11 | This is a question I see a lot when people are presented with an example | 13 | While Alpine is small, fast, and minimal, that doesn't stop it from functioning |
| 12 | of Alpine Linux running as a desktop OS. | 14 | at a productive level for desktop users. |
| 13 | 15 | ||
| 14 | While Alpine is small, fast, and minimal, that doesn\'t stop it from | 16 | This post is documentation of how I installed and modified Alpine Linux to |
| 15 | functioning at a productive level for desktop users. | 17 | become my daily desktop OS. |
| 16 | |||
| 17 | This post is documentation of how I installed and modified Alpine Linux | ||
| 18 | to become my daily desktop OS. | ||
| 19 | 18 | ||
| 20 | # Installation | 19 | # Installation |
| 21 | 20 | ||
| 22 | Note that I cover the installation of Alpine Linux in my other post, so | 21 | Note that I cover the installation of Alpine Linux in my other post, so I won't |
| 23 | I won\'t repeat it here: [Alpine Linux: My New Server | 22 | repeat it here: [Alpine Linux: My New Server OS](../alpine-linux/). |
| 24 | OS](../alpine-linux/). | ||
| 25 | 23 | ||
| 26 | Basically, get a bootable USB or whatever you prefer with Alpine on it, | 24 | Basically, get a bootable USB or whatever you prefer with Alpine on it, boot the |
| 27 | boot the ISO, and run the setup script. | 25 | ISO, and run the setup script. |
| 28 | 26 | ||
| 29 | ```sh | 27 | ```sh |
| 30 | setup-alpine | 28 | setup-alpine |
| 31 | ``` | 29 | ``` |
| 32 | 30 | ||
| 33 | Once you have gone through all the options and installer finishes | 31 | Once you have gone through all the options and installer finishes without |
| 34 | without errors, reboot. | 32 | errors, reboot. |
| 35 | 33 | ||
| 36 | ```sh | 34 | ```sh |
| 37 | reboot | 35 | reboot |
| @@ -40,9 +38,9 @@ reboot | |||
| 40 | # Initial Setup | 38 | # Initial Setup |
| 41 | 39 | ||
| 42 | Once Alpine is installed and the machine has rebooted, login is as root | 40 | Once Alpine is installed and the machine has rebooted, login is as root |
| 43 | initially or `su` to root once you log in as your user. From | 41 | initially or `su` to root once you log in as your user. From here, you should |
| 44 | here, you should start by updating and upgrading the system in case the | 42 | start by updating and upgrading the system in case the ISO was not fully |
| 45 | ISO was not fully up-to-date. | 43 | up-to-date. |
| 46 | 44 | ||
| 47 | ```sh | 45 | ```sh |
| 48 | # Update and upgrade system | 46 | # Update and upgrade system |
| @@ -52,8 +50,8 @@ apk -U update && apk -U upgrade | |||
| 52 | apk add nano | 50 | apk add nano |
| 53 | ``` | 51 | ``` |
| 54 | 52 | ||
| 55 | You need to uncomment the `community` repository for your | 53 | You need to uncomment the `community` repository for your version of Alpine |
| 56 | version of Alpine Linux. | 54 | Linux. |
| 57 | 55 | ||
| 58 | For v3.17, the `repositories` file should look like this: | 56 | For v3.17, the `repositories` file should look like this: |
| 59 | 57 | ||
| @@ -80,11 +78,11 @@ adduser $USER wheel | |||
| 80 | 78 | ||
| 81 | # Window Manager (Desktop) | 79 | # Window Manager (Desktop) |
| 82 | 80 | ||
| 83 | The [Sway installation guide](https://wiki.alpinelinux.org/wiki/Sway) | 81 | The [Sway installation guide](https://wiki.alpinelinux.org/wiki/Sway) has |
| 84 | has everything you need to get Sway working on Alpine. | 82 | everything you need to get Sway working on Alpine. |
| 85 | 83 | ||
| 86 | However, I\'ll include a brief list of the commands I ran and their | 84 | However, I'll include a brief list of the commands I ran and their purpose for |
| 87 | purpose for posterity here. | 85 | posterity here. |
| 88 | 86 | ||
| 89 | ```sh | 87 | ```sh |
| 90 | # Add eudev and set it up | 88 | # Add eudev and set it up |
| @@ -126,11 +124,10 @@ apk add \ # Install optional dependencies: | |||
| 126 | ``` | 124 | ``` |
| 127 | 125 | ||
| 128 | Once you have the packages installed and set-up, you need to export the | 126 | Once you have the packages installed and set-up, you need to export the |
| 129 | `XDG_RUNTIME_DIR` upon login. To do this, edit your | 127 | `XDG_RUNTIME_DIR` upon login. To do this, edit your `.profile` file. |
| 130 | `.profile` file. | ||
| 131 | 128 | ||
| 132 | If you use another shell, such as `zsh`, you need to edit | 129 | If you use another shell, such as `zsh`, you need to edit that shell's profile |
| 133 | that shell\'s profile (e.g., `~/.zprofile`)! | 130 | (e.g., `~/.zprofile`)! |
| 134 | 131 | ||
| 135 | ```sh | 132 | ```sh |
| 136 | nano ~/.profile | 133 | nano ~/.profile |
| @@ -148,7 +145,7 @@ if test -z "${XDG_RUNTIME_DIR}"; then | |||
| 148 | fi | 145 | fi |
| 149 | ``` | 146 | ``` |
| 150 | 147 | ||
| 151 | Once that\'s complete, you can launch Sway manually. | 148 | Once that's complete, you can launch Sway manually. |
| 152 | 149 | ||
| 153 | ```sh | 150 | ```sh |
| 154 | dbus-run-session -- sway | 151 | dbus-run-session -- sway |
| @@ -156,8 +153,7 @@ dbus-run-session -- sway | |||
| 156 | 153 | ||
| 157 | ## Personal Touches | 154 | ## Personal Touches |
| 158 | 155 | ||
| 159 | I also added the following packages, per my personal preferences and | 156 | I also added the following packages, per my personal preferences and situation. |
| 160 | situation. | ||
| 161 | 157 | ||
| 162 | ```sh | 158 | ```sh |
| 163 | doas apk add brightnessctl \ # Brightness controller | 159 | doas apk add brightnessctl \ # Brightness controller |
| @@ -171,16 +167,16 @@ doas apk add brightnessctl \ # Brightness controller | |||
| 171 | gnupg # GPG key manager | 167 | gnupg # GPG key manager |
| 172 | ``` | 168 | ``` |
| 173 | 169 | ||
| 174 | From here, I use my Syncthing storage to pull all the configuration | 170 | From here, I use my Syncthing storage to pull all the configuration files I |
| 175 | files I stored from prior desktops, such as [my | 171 | stored from prior desktops, such as [my |
| 176 | dotfiles](https://git.sr.ht/~cmc/dotfiles). | 172 | dotfiles](https://git.sr.ht/~cmc/dotfiles). |
| 177 | 173 | ||
| 178 | # Resolving Issues | 174 | # Resolving Issues |
| 179 | 175 | ||
| 180 | ## WiFi Issues | 176 | ## WiFi Issues |
| 181 | 177 | ||
| 182 | I initially tried to set up my Wi-Fi the standard way with | 178 | I initially tried to set up my Wi-Fi the standard way with `iwd`, but it didn't |
| 183 | `iwd`, but it didn\'t work. | 179 | work. |
| 184 | 180 | ||
| 185 | Here is what I initially tried (I did all of this as `root`): | 181 | Here is what I initially tried (I did all of this as `root`): |
| 186 | 182 | ||
| @@ -191,8 +187,7 @@ iwctl station wlan0 connect <SSID> # This will prompt for the password | |||
| 191 | rc-update add iwd boot && rc-update add dbus boot | 187 | rc-update add iwd boot && rc-update add dbus boot |
| 192 | ``` | 188 | ``` |
| 193 | 189 | ||
| 194 | Then, I added the Wi-Fi entry to the bottom of the networking interface | 190 | Then, I added the Wi-Fi entry to the bottom of the networking interface file: |
| 195 | file: | ||
| 196 | 191 | ||
| 197 | ```sh | 192 | ```sh |
| 198 | nano /etc/network/interfaces | 193 | nano /etc/network/interfaces |
| @@ -209,13 +204,11 @@ Finally, restart the networking service: | |||
| 209 | rc-service networking restart | 204 | rc-service networking restart |
| 210 | ``` | 205 | ``` |
| 211 | 206 | ||
| 212 | My Wi-Fi interface would receive an IP address from the router, but it | 207 | My Wi-Fi interface would receive an IP address from the router, but it could not |
| 213 | could not ping anything in the network. To solve the Wi-Fi issues, I | 208 | ping anything in the network. To solve the Wi-Fi issues, I originally upgraded |
| 214 | originally upgraded to Alpine\'s `edge` repositories, which | 209 | to Alpine's `edge` repositories, which was unnecessary. |
| 215 | was unnecessary. | ||
| 216 | 210 | ||
| 217 | Really, the solution was to enable the | 211 | Really, the solution was to enable the `NameResolvingService=resolvconf` in |
| 218 | `NameResolvingService=resolvconf` in | ||
| 219 | `/etc/iwd/main.conf`. | 212 | `/etc/iwd/main.conf`. |
| 220 | 213 | ||
| 221 | ```sh | 214 | ```sh |
| @@ -232,8 +225,8 @@ Once I finished this process, my Wi-Fi is working flawlessly. | |||
| 232 | 225 | ||
| 233 | ## Sound Issues | 226 | ## Sound Issues |
| 234 | 227 | ||
| 235 | Same as with the Wi-Fi, I had no sound and could not control the | 228 | Same as with the Wi-Fi, I had no sound and could not control the mute/unmute or |
| 236 | mute/unmute or volume buttons on my laptop. | 229 | volume buttons on my laptop. |
| 237 | 230 | ||
| 238 | To resolve this, I installed | 231 | To resolve this, I installed |
| 239 | [pipewire](https://wiki.alpinelinux.org/wiki/PipeWire). | 232 | [pipewire](https://wiki.alpinelinux.org/wiki/PipeWire). |
| @@ -247,9 +240,9 @@ addgroup $USER video | |||
| 247 | apk add pipewire wireplumber pipewire-pulse pipewire-jack pipewire-alsa | 240 | apk add pipewire wireplumber pipewire-pulse pipewire-jack pipewire-alsa |
| 248 | ``` | 241 | ``` |
| 249 | 242 | ||
| 250 | Finally, I needed to add `/usr/libexec/pipewire-launcher` to | 243 | Finally, I needed to add `/usr/libexec/pipewire-launcher` to my |
| 251 | my `.config/sway/config` file so that Pipewire would run | 244 | `.config/sway/config` file so that Pipewire would run every time I launched |
| 252 | every time I launched sway. | 245 | sway. |
| 253 | 246 | ||
| 254 | ```sh | 247 | ```sh |
| 255 | nano ~/.config/sway/config | 248 | nano ~/.config/sway/config |
| @@ -266,8 +259,8 @@ bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ to | |||
| 266 | bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle | 259 | bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle |
| 267 | ``` | 260 | ``` |
| 268 | 261 | ||
| 269 | Note that I do not use bluetooth or screen sharing, so I won\'t cover | 262 | Note that I do not use bluetooth or screen sharing, so I won't cover those |
| 270 | those options in this post. | 263 | options in this post. |
| 271 | 264 | ||
| 272 | Other than these issues, I have a working Alpine desktop. No other | 265 | Other than these issues, I have a working Alpine desktop. No other complaints |
| 273 | complaints thus far! | 266 | thus far! |
content/blog/2023-01-03-recent-website-changes.md +47 −51
| @@ -7,80 +7,76 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # The State of This Website | 8 | # The State of This Website |
| 9 | 9 | ||
| 10 | Over the years, this website has changed URLs, styles, content focus, | 10 | Over the years, this website has changed URLs, styles, content focus, and much |
| 11 | and much more. However, it seems that I am never done, as I am yet again | 11 | more. However, it seems that I am never done, as I am yet again changing this |
| 12 | changing this page to fit my current needs and wants. | 12 | page to fit my current needs and wants. |
| 13 | 13 | ||
| 14 | While this site was already minimal (\~12kb), it contained a lot of | 14 | While this site was already minimal (~12kb), it contained a lot of disorganized |
| 15 | disorganized content and some poorly chosen color schemes. | 15 | content and some poorly chosen color schemes. |
| 16 | 16 | ||
| 17 | The recent updates attempt to fix these items while focusing on what I | 17 | The recent updates attempt to fix these items while focusing on what I truly |
| 18 | truly care about here: the content within each page. | 18 | care about here: the content within each page. |
| 19 | 19 | ||
| 20 | # Recent Changes | 20 | # Recent Changes |
| 21 | 21 | ||
| 22 | I\'ve made quite a few changes to the style of this website today, both | 22 | I've made quite a few changes to the style of this website today, both in the |
| 23 | in the CSS and in the HTML. | 23 | CSS and in the HTML. |
| 24 | 24 | ||
| 25 | Here are some of the key takeaways from today\'s changes: | 25 | Here are some of the key takeaways from today's changes: |
| 26 | 26 | ||
| 27 | 1. Reduce the width of the website from `60em` to | 27 | 1. Reduce the width of the website from `60em` to `40em`. |
| 28 | `40em`. | 28 | 2. Remove breadcrumb navigation and replaced with a simple "Return Home" link |
| 29 | 2. Remove breadcrumb navigation and replaced with a simple \"Return | 29 | when visiting anything other than the homepage. |
| 30 | Home\" link when visiting anything other than the homepage. | 30 | 3. Remove syntax highlighting from code blocks. CSS now loads from a single |
| 31 | 3. Remove syntax highlighting from code blocks. CSS now loads from a | 31 | file. |
| 32 | single file. | 32 | 4. Move blog posts on the homepage to the top, pushing tertiary content down. |
| 33 | 4. Move blog posts on the homepage to the top, pushing tertiary content | 33 | 5. Update font-family from `monospace` to `sans-serif` for readability. |
| 34 | down. | ||
| 35 | 5. Update font-family from `monospace` to | ||
| 36 | `sans-serif` for readability. | ||
| 37 | 34 | ||
| 38 | # Future Focus | 35 | # Future Focus |
| 39 | 36 | ||
| 40 | ## Accessibility | 37 | ## Accessibility |
| 41 | 38 | ||
| 42 | My main focus amidst all the changes this past year was accessibility. I | 39 | My main focus amidst all the changes this past year was accessibility. I tried |
| 43 | tried to improve the accessibility of all pages on this site as well as | 40 | to improve the accessibility of all pages on this site as well as I know how. |
| 44 | I know how. For example, I added aria labels to identify different | 41 | For example, I added aria labels to identify different navigation menus in |
| 45 | navigation menus in November. | 42 | November. |
| 46 | 43 | ||
| 47 | I want to continue this in 2023 and learn more about the accessibility | 44 | I want to continue this in 2023 and learn more about the accessibility features |
| 48 | features I can utilize to help those who may need them. | 45 | I can utilize to help those who may need them. |
| 49 | 46 | ||
| 50 | ## Content First | 47 | ## Content First |
| 51 | 48 | ||
| 52 | Beyond accessibility, I am making a concerted effort to bring the | 49 | Beyond accessibility, I am making a concerted effort to bring the content of |
| 53 | content of this site to the forefront and push the tertiary information | 50 | this site to the forefront and push the tertiary information (e.g., About Me, |
| 54 | (e.g., About Me, Services, etc.) down below the content. | 51 | Services, etc.) down below the content. |
| 55 | 52 | ||
| 56 | Further, I want to review and edit previous blog posts for grammar, | 53 | Further, I want to review and edit previous blog posts for grammar, accuracy, |
| 57 | accuracy, dead links, and more. Where necessary, I may even add a blurb | 54 | dead links, and more. Where necessary, I may even add a blurb at the top of old |
| 58 | at the top of old posts that are no longer accurate or helpful. | 55 | posts that are no longer accurate or helpful. |
| 59 | 56 | ||
| 60 | ## Style | 57 | ## Style |
| 61 | 58 | ||
| 62 | As always, I will be searching for ways to reduce distractions and bring | 59 | As always, I will be searching for ways to reduce distractions and bring a |
| 63 | a minimalistic approach to this site. While there are certainly more | 60 | minimalistic approach to this site. While there are certainly more drastic |
| 64 | drastic measures I could take, such as making this a [Shinobi | 61 | measures I could take, such as making this a [Shinobi |
| 65 | Website](https://shinobi.bt.ht) or a [No CSS | 62 | Website](https://shinobi.bt.ht) or a [No CSS Website](https://nocss.club), I |
| 66 | Website](https://nocss.club), I prefer to keep some modern features | 63 | prefer to keep some modern features here. |
| 67 | here. | ||
| 68 | 64 | ||
| 69 | Two ideas have been floating around in my head, but I am not sure how I | 65 | Two ideas have been floating around in my head, but I am not sure how I feel |
| 70 | feel about these approaches yet: | 66 | about these approaches yet: |
| 71 | 67 | ||
| 72 | 1. Going all-in with Emacs org-mode and creating a script to | 68 | 1. Going all-in with Emacs org-mode and creating a script to auto-publish all my |
| 73 | auto-publish all my blog posts from org-mode to plain HTML files and | 69 | blog posts from org-mode to plain HTML files and then letting my CSS style it |
| 74 | then letting my CSS style it after the fact. | 70 | after the fact. |
| 75 | 2. Focus on publishing for Gemini or Gopher and then utilize a | 71 | 2. Focus on publishing for Gemini or Gopher and then utilize a conversion |
| 76 | conversion program to translate the pages to HTML. | 72 | program to translate the pages to HTML. |
| 77 | 73 | ||
| 78 | # Looking Back | 74 | # Looking Back |
| 79 | 75 | ||
| 80 | As I sit here and finalize the changes, as well as this post, I am happy | 76 | As I sit here and finalize the changes, as well as this post, I am happy with |
| 81 | with the current state of this website. It\'s certainly a long way from | 77 | the current state of this website. It's certainly a long way from my first |
| 82 | my first attempts (parallax background images, anyone?) and it\'s good | 78 | attempts (parallax background images, anyone?) and it's good to see the |
| 83 | to see the progress. | 79 | progress. |
| 84 | 80 | ||
| 85 | I can only hope and work hard to ensure that I make more meaningful | 81 | I can only hope and work hard to ensure that I make more meaningful progress by |
| 86 | progress by this time next year. | 82 | this time next year. |
content/blog/2023-01-05-mass-unlike-tumblr-posts.md +32 −39
| @@ -7,27 +7,24 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # The Dilemma | 8 | # The Dilemma |
| 9 | 9 | ||
| 10 | The dilemma I had was pretty simple: I wanted to unlike all the posts I | 10 | The dilemma I had was pretty simple: I wanted to unlike all the posts I have |
| 11 | have liked on Tumblr so that I could follow a new focus on blogs and | 11 | liked on Tumblr so that I could follow a new focus on blogs and start fresh. |
| 12 | start fresh. Otherwise, Tumblr will keep recommending content based on | 12 | Otherwise, Tumblr will keep recommending content based on your previous likes. |
| 13 | your previous likes. | ||
| 14 | 13 | ||
| 15 | # The Solution | 14 | # The Solution |
| 16 | 15 | ||
| 17 | I searched the web for a while and noted that most solutions referenced | 16 | I searched the web for a while and noted that most solutions referenced Tumblr |
| 18 | Tumblr setting and dashboard pages that no longer exist. Additionally, I | 17 | setting and dashboard pages that no longer exist. Additionally, I did not want |
| 19 | did not want to install a third party extension to do this, as some | 18 | to install a third party extension to do this, as some suggested. |
| 20 | suggested. | ||
| 21 | 19 | ||
| 22 | Luckily, I used Javascript for a while a few years ago and figured it | 20 | Luckily, I used Javascript for a while a few years ago and figured it would be |
| 23 | would be easy enough to script a solution, as long as Tumblr had a | 21 | easy enough to script a solution, as long as Tumblr had a system for the unlike |
| 24 | system for the unlike buttons. | 22 | buttons. |
| 25 | 23 | ||
| 26 | ## Identifying Unlike Buttons | 24 | ## Identifying Unlike Buttons |
| 27 | 25 | ||
| 28 | Tumblr\'s unlike buttons are structured as you can see in the following | 26 | Tumblr's unlike buttons are structured as you can see in the following code |
| 29 | code block. All unlike buttons have an `aria-label` with a | 27 | block. All unlike buttons have an `aria-label` with a value of `Unlike`. |
| 30 | value of `Unlike`. | ||
| 31 | 28 | ||
| 32 | ``` html | 29 | ``` html |
| 33 | <button class="TRX6J" aria-label="Unlike"> | 30 | <button class="TRX6J" aria-label="Unlike"> |
| @@ -43,28 +40,26 @@ value of `Unlike`. | |||
| 43 | ## Running a Script to Unlike All Likes | 40 | ## Running a Script to Unlike All Likes |
| 44 | 41 | ||
| 45 | To run this script, you will need to load the [Likes \| | 42 | To run this script, you will need to load the [Likes \| |
| 46 | Tumblr](https://www.tumblr.com/likes) page while logged in to your | 43 | Tumblr](https://www.tumblr.com/likes) page while logged in to your account. |
| 47 | account. | ||
| 48 | 44 | ||
| 49 | Further, be sure to scroll down to the bottom and force Tumblr to load | 45 | Further, be sure to scroll down to the bottom and force Tumblr to load more |
| 50 | more posts so that this script unlikes more posts at a time. | 46 | posts so that this script unlikes more posts at a time. |
| 51 | 47 | ||
| 52 | Once you are logged in and the page is loaded, open the Developer Tools | 48 | Once you are logged in and the page is loaded, open the Developer Tools and be |
| 53 | and be sure you\'re on the \"Console\" tab. It should look something | 49 | sure you're on the "Console" tab. It should look something like this (this is |
| 54 | like this (this is in Firefox, Chromium should be similar): | 50 | in Firefox, Chromium should be similar): |
| 55 | 51 | ||
| 56 |  | 53 | !Tools](https:///img.cleberg.net/blog/20230105-mass-unlike-tumblr-posts/dev_console.png) |
| 58 | 54 | ||
| 59 | All you need to do is paste the following snippet into the dev console. | 55 | All you need to do is paste the following snippet into the dev console. This |
| 60 | This code will collect all unlike buttons (`elements`) and | 56 | code will collect all unlike buttons (`elements`) and then click each button to |
| 61 | then click each button to unlike it. | 57 | unlike it. |
| 62 | 58 | ||
| 63 | Optionally, you can comment-out the line | 59 | Optionally, you can comment-out the line `elements[i].click();` and uncomment |
| 64 | `elements[i].click();` and uncomment the | 60 | the `console.log()` lines to simply print out information without performing any |
| 65 | `console.log()` lines to simply print out information without | 61 | actions. This can be useful to debug issues or confirm that the code below |
| 66 | performing any actions. This can be useful to debug issues or confirm | 62 | isn't doing anything you don't want it to. |
| 67 | that the code below isn\'t doing anything you don\'t want it to. | ||
| 68 | 63 | ||
| 69 | ``` javascript | 64 | ``` javascript |
| 70 | const elements = document.querySelectorAll('[aria-label="Unlike"]'); | 65 | const elements = document.querySelectorAll('[aria-label="Unlike"]'); |
| @@ -78,18 +73,16 @@ for (let i=0; i < elements.length; i++) { | |||
| 78 | 73 | ||
| 79 | # Results | 74 | # Results |
| 80 | 75 | ||
| 81 | The results were quick for my situation, as it unliked \~200 posts | 76 | The results were quick for my situation, as it unliked ~200 posts within 2-3 |
| 82 | within 2-3 seconds. I am not sure how this will perform on larger sets | 77 | seconds. I am not sure how this will perform on larger sets of likes (or if |
| 83 | of likes (or if Tumblr has a limit to unliking posts). | 78 | Tumblr has a limit to unliking posts). |
| 84 | 79 | ||
| 85 | You can see the below screenshot showing that I pasted the snippet into | 80 | You can see the below screenshot showing that I pasted the snippet into the |
| 86 | the console, pressed Enter, and then the posts are automatically | 81 | console, pressed Enter, and then the posts are automatically unliked. |
| 87 | unliked. | ||
| 88 | 82 | ||
| 89 |  | 84 | !Results](https:///img.cleberg.net/blog/20230105-mass-unlike-tumblr-posts/script_results.png) |
| 91 | 85 | ||
| 92 | Thinking about this further, I would bet that this would be fairly | 86 | Thinking about this further, I would bet that this would be fairly simple to |
| 93 | simple to package into a browser add-on so that users could install the | 87 | package into a browser add-on so that users could install the add-on, go to |
| 94 | add-on, go to their Likes page, and click a button to run the script. | 88 | their Likes page, and click a button to run the script. Food for thought. |
| 95 | Food for thought. | ||
content/blog/2023-01-08-fedora-login-manager.md +12 −12
| @@ -5,15 +5,15 @@ description = "" | |||
| 5 | draft = false | 5 | draft = false |
| 6 | +++ | 6 | +++ |
| 7 | 7 | ||
| 8 | # Fedora i3\'s Login Manager | 8 | # Fedora i3's Login Manager |
| 9 | 9 | ||
| 10 | Since I use the i3 spin of Fedora Workstation, I don\'t like to have a | 10 | Since I use the i3 spin of Fedora Workstation, I don't like to have a login |
| 11 | login manager installed by default. As of the current version of Fedora | 11 | manager installed by default. As of the current version of Fedora i3, the |
| 12 | i3, the default login manager is LightDM. | 12 | default login manager is LightDM. |
| 13 | 13 | ||
| 14 | If this is no longer the case, you can search for currently-installed | 14 | If this is no longer the case, you can search for currently-installed packages |
| 15 | packages with the following command and see if you can identify a | 15 | with the following command and see if you can identify a different login |
| 16 | different login manager. | 16 | manager. |
| 17 | 17 | ||
| 18 | ```sh | 18 | ```sh |
| 19 | sudo dnf list installed | 19 | sudo dnf list installed |
| @@ -29,16 +29,16 @@ sudo dnf remove lightdm | |||
| 29 | 29 | ||
| 30 | # Launching i3 Manually | 30 | # Launching i3 Manually |
| 31 | 31 | ||
| 32 | In order to launch i3 manually, you need to set up your X session | 32 | In order to launch i3 manually, you need to set up your X session properly. To |
| 33 | properly. To start, create or edit the `~/.xinitrc` file to | 33 | start, create or edit the `~/.xinitrc` file to include the following at the |
| 34 | include the following at the bottom. | 34 | bottom. |
| 35 | 35 | ||
| 36 | ``` config | 36 | ``` config |
| 37 | exec i3 | 37 | exec i3 |
| 38 | ``` | 38 | ``` |
| 39 | 39 | ||
| 40 | Now, whenever you log in to the TTY, you can launch your desktop with | 40 | Now, whenever you log in to the TTY, you can launch your desktop with the |
| 41 | the following command. | 41 | following command. |
| 42 | 42 | ||
| 43 | ```sh | 43 | ```sh |
| 44 | startx | 44 | startx |
content/blog/2023-01-21-flatpak-symlinks.md +16 −20
| @@ -7,45 +7,41 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Running Flatpak Apps Should Be Faster | 8 | # Running Flatpak Apps Should Be Faster |
| 9 | 9 | ||
| 10 | If you\'re like me and use Flatpak for those pesky apps that cannot run | 10 | If you're like me and use Flatpak for those pesky apps that cannot run on your |
| 11 | on your system for one reason or another, you likely get annoyed with | 11 | system for one reason or another, you likely get annoyed with opening a terminal |
| 12 | opening a terminal and manually running the Flatpak app with the lengthy | 12 | and manually running the Flatpak app with the lengthy `flatpak run ...` command. |
| 13 | `flatpak run ...` command. | ||
| 14 | 13 | ||
| 15 | In the past, I manually created aliases in my `.zshrc` file | 14 | In the past, I manually created aliases in my `.zshrc` file for certain apps. |
| 16 | for certain apps. For example, an alias would look like the example | 15 | For example, an alias would look like the example below. |
| 17 | below. | ||
| 18 | 16 | ||
| 19 | This would allow me to run the command fast within the terminal, but it | 17 | This would allow me to run the command fast within the terminal, but it |
| 20 | wouldn\'t allow me to run it in an application launcher. | 18 | wouldn't allow me to run it in an application launcher. |
| 21 | 19 | ||
| 22 | ```sh | 20 | ```sh |
| 23 | # ~/.zshrc | 21 | # ~/.zshrc |
| 24 | alias librewolf = "flatpak run io.gitlab.librewolf-community" | 22 | alias librewolf = "flatpak run io.gitlab.librewolf-community" |
| 25 | ``` | 23 | ``` |
| 26 | 24 | ||
| 27 | However, I now use a much faster and better method that integrates with | 25 | However, I now use a much faster and better method that integrates with the |
| 28 | the tiling WMs I use and their application launchers - | 26 | tiling WMs I use and their application launchers - `dmenu` and `bemenu`. |
| 29 | `dmenu` and `bemenu`. | ||
| 30 | 27 | ||
| 31 | # Creating Symlinks for Flatpak Apps | 28 | # Creating Symlinks for Flatpak Apps |
| 32 | 29 | ||
| 33 | Let\'s use the example of Librewolf below. I can install the application | 30 | Let's use the example of Librewolf below. I can install the application like |
| 34 | like so: | 31 | so: |
| 35 | 32 | ||
| 36 | ```sh | 33 | ```sh |
| 37 | flatpak install flathub io.gitlab.librewolf-community | 34 | flatpak install flathub io.gitlab.librewolf-community |
| 38 | ``` | 35 | ``` |
| 39 | 36 | ||
| 40 | Once installed, I can create a symlink to link the flatpak app to my new | 37 | Once installed, I can create a symlink to link the flatpak app to my new symlink |
| 41 | symlink in a location commonly included in your PATH. In this case, I | 38 | in a location commonly included in your PATH. In this case, I chose `/usr/bin`. |
| 42 | chose `/usr/bin`. You may need to choose a different location | 39 | You may need to choose a different location if `/usr/bin` isn't in your PATH. |
| 43 | if `/usr/bin` isn\'t in your PATH. | ||
| 44 | 40 | ||
| 45 | ```sh | 41 | ```sh |
| 46 | ln -s /var/lib/flatpak/exports/bin/io.gitlab.librewolf-community /usr/bin/librewolf | 42 | ln -s /var/lib/flatpak/exports/bin/io.gitlab.librewolf-community /usr/bin/librewolf |
| 47 | ``` | 43 | ``` |
| 48 | 44 | ||
| 49 | Once complete, you should be able to launch the app using the command | 45 | Once complete, you should be able to launch the app using the command name you |
| 50 | name you chose above in the symlink (`librewolf`) from a | 46 | chose above in the symlink (`librewolf`) from a terminal or from your |
| 51 | terminal or from your application launcher! | 47 | application launcher! |
content/blog/2023-01-23-random-wireguard.md +26 −28
| @@ -7,18 +7,18 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Mullvad Wireguard | 8 | # Mullvad Wireguard |
| 9 | 9 | ||
| 10 | If you\'re using an OS that does not support one of Mullvad\'s apps, | 10 | If you're using an OS that does not support one of Mullvad's apps, you're |
| 11 | you\'re likely using the Wireguard configuration files instead. | 11 | likely using the Wireguard configuration files instead. |
| 12 | 12 | ||
| 13 | If not, the first step is to visit Mullvad\'s [Wireguard configuration | 13 | If not, the first step is to visit Mullvad's [Wireguard configuration |
| 14 | files](https://mullvad.net/en/account/#/wireguard-config) page and | 14 | files](https://mullvad.net/en/account/#/wireguard-config) page and download a |
| 15 | download a ZIP of the configuration files you want to use. | 15 | ZIP of the configuration files you want to use. |
| 16 | 16 | ||
| 17 | Personally, I downloaded all configuration files across the world and | 17 | Personally, I downloaded all configuration files across the world and chose my |
| 18 | chose my connections using the script below. | 18 | connections using the script below. |
| 19 | 19 | ||
| 20 | Once the files are downloaded, unzip them and move them to your | 20 | Once the files are downloaded, unzip them and move them to your preferred |
| 21 | preferred location: | 21 | location: |
| 22 | 22 | ||
| 23 | ```sh | 23 | ```sh |
| 24 | cd Downloads | 24 | cd Downloads |
| @@ -28,8 +28,8 @@ mkdir ~/mullvad && mv ~/Downloads/*.conf ~/mullvad/ | |||
| 28 | 28 | ||
| 29 | ### Creating a Script to Connect to a Random Host | 29 | ### Creating a Script to Connect to a Random Host |
| 30 | 30 | ||
| 31 | Once you have a folder of Wireguard configuration files from Mullvad, | 31 | Once you have a folder of Wireguard configuration files from Mullvad, you can |
| 32 | you can create a script to randomly connect to any one of the locations. | 32 | create a script to randomly connect to any one of the locations. |
| 33 | 33 | ||
| 34 | Start by creating a shell script - mine is called `vpn.sh`. | 34 | Start by creating a shell script - mine is called `vpn.sh`. |
| 35 | 35 | ||
| @@ -37,10 +37,9 @@ Start by creating a shell script - mine is called `vpn.sh`. | |||
| 37 | nano ~/vpn.sh | 37 | nano ~/vpn.sh |
| 38 | ``` | 38 | ``` |
| 39 | 39 | ||
| 40 | Within this script, you can paste the following info. Note that I | 40 | Within this script, you can paste the following info. Note that I specify `us-*` |
| 41 | specify `us-*` in my script, which means that it will only | 41 | in my script, which means that it will only consider US-based VPN locations. You |
| 42 | consider US-based VPN locations. You can alter this or simply change it | 42 | can alter this or simply change it `*` to consider all locations. |
| 43 | `*` to consider all locations. | ||
| 44 | 43 | ||
| 45 | ```sh | 44 | ```sh |
| 46 | #!/bin/sh | 45 | #!/bin/sh |
| @@ -55,8 +54,8 @@ ls /home/$USER/mullvad/us-** |sort -R |tail -n 1 |while read file; do | |||
| 55 | done | 54 | done |
| 56 | ``` | 55 | ``` |
| 57 | 56 | ||
| 58 | Once you\'ve modified the script to your liking, add executable | 57 | Once you've modified the script to your liking, add executable permissions and |
| 59 | permissions and run the script: | 58 | run the script: |
| 60 | 59 | ||
| 61 | ```sh | 60 | ```sh |
| 62 | chmod +x ~/vpn.sh | 61 | chmod +x ~/vpn.sh |
| @@ -76,21 +75,20 @@ Printing new IP info: | |||
| 76 | You are connected to Mullvad (server country-city-wg-num). Your IP address is 12.345.678.99 | 75 | You are connected to Mullvad (server country-city-wg-num). Your IP address is 12.345.678.99 |
| 77 | ``` | 76 | ``` |
| 78 | 77 | ||
| 79 | That\'s all there is to it. You can see your new location and IP via the | 78 | That's all there is to it. You can see your new location and IP via the |
| 80 | `printf` and `curl` commands included in the | 79 | `printf` and `curl` commands included in the script. |
| 81 | script. | ||
| 82 | 80 | ||
| 83 | You can also go to the [Connection Check \| | 81 | You can also go to the [Connection Check \| |
| 84 | Mullvad](https://mullvad.net/en/check/) page to see if you are fully | 82 | Mullvad](https://mullvad.net/en/check/) page to see if you are fully connected |
| 85 | connected to Mullvad and if any leaks exist. | 83 | to Mullvad and if any leaks exist. |
| 86 | 84 | ||
| 87 |  | 86 | Check](https://img.cleberg.net/blog/20230123-random-mullvad-wireguard/mullvad_check.png) |
| 89 | 87 | ||
| 90 | # Disconnecting from the Wireguard Connection | 88 | # Disconnecting from the Wireguard Connection |
| 91 | 89 | ||
| 92 | If you forget which connection you\'re using, you can execute the | 90 | If you forget which connection you're using, you can execute the following |
| 93 | following command to see where Wireguard is currently connected: | 91 | command to see where Wireguard is currently connected: |
| 94 | 92 | ||
| 95 | ```sh | 93 | ```sh |
| 96 | wg show | 94 | wg show |
| @@ -99,15 +97,15 @@ wg show | |||
| 99 | This command will show you the Wireguard interfaces and should output a | 97 | This command will show you the Wireguard interfaces and should output a |
| 100 | connection like so: `interface: us-lax-wg-104`. | 98 | connection like so: `interface: us-lax-wg-104`. |
| 101 | 99 | ||
| 102 | Once you have this, just disconnect using that files\' full path: | 100 | Once you have this, just disconnect using that files' full path: |
| 103 | 101 | ||
| 104 | ```sh | 102 | ```sh |
| 105 | wg-quick down /home/user/mullvad/us-lax-wg-104.conf | 103 | wg-quick down /home/user/mullvad/us-lax-wg-104.conf |
| 106 | ``` | 104 | ``` |
| 107 | 105 | ||
| 108 | I have a TODO item on figuring out how to easily export an environment | 106 | I have a TODO item on figuring out how to easily export an environment variable |
| 109 | variable that contains the configuration file\'s full name, so that I | 107 | that contains the configuration file's full name, so that I can just execute |
| 110 | can just execute the following: | 108 | the following: |
| 111 | 109 | ||
| 112 | ```sh | 110 | ```sh |
| 113 | # Ideal situation if I can export the $file variable to the environment | 111 | # Ideal situation if I can export the $file variable to the environment |
content/blog/2023-01-28-self-hosting-wger.md +52 −58
| @@ -7,53 +7,52 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Wger: The Self-Hosted Workout Manager | 8 | # Wger: The Self-Hosted Workout Manager |
| 9 | 9 | ||
| 10 | [Wger Workout Manager](https://wger.de) is a fitness tracking tool for | 10 | [Wger Workout Manager](https://wger.de) is a fitness tracking tool for those who |
| 11 | those who enjoy self-hosting their data. You can also register an | 11 | enjoy self-hosting their data. You can also register an account on their main |
| 12 | account on their main website if you\'d prefer to try without | 12 | website if you'd prefer to try without self-hosting. |
| 13 | self-hosting. | ||
| 14 | 13 | ||
| 15 | ## Features | 14 | ## Features |
| 16 | 15 | ||
| 17 | I didn\'t see a full listing of features anywhere, so I compiled this | 16 | I didn't see a full listing of features anywhere, so I compiled this list of my |
| 18 | list of my own after installing wger: | 17 | own after installing wger: |
| 19 | 18 | ||
| 20 | 1. Dashboard | 19 | 1. Dashboard |
| 21 | 20 | ||
| 22 | - Dashboard view of Workout Schedule, Nutrition Plan, Weight | 21 | - Dashboard view of Workout Schedule, Nutrition Plan, Weight Graph, & last |
| 23 | Graph, & last 5 Weight Logs | 22 | 5 Weight Logs |
| 24 | 23 | ||
| 25 | 2. Training | 24 | 2. Training |
| 26 | 25 | ||
| 27 | - Workout Log | 26 | - Workout Log |
| 28 | - Workout Schedule | 27 | - Workout Schedule |
| 29 | - Calendar (shows weight logs and Bad/Neutral/Good days) | 28 | - Calendar (shows weight logs and Bad/Neutral/Good days) |
| 30 | - Gallery (shows images you upload) | 29 | - Gallery (shows images you upload) |
| 31 | - Workout templates | 30 | - Workout templates |
| 32 | - Public templates | 31 | - Public templates |
| 33 | - Exercises | 32 | - Exercises |
| 34 | 33 | ||
| 35 | 3. Nutrition | 34 | 3. Nutrition |
| 36 | 35 | ||
| 37 | - Nutrition plans | 36 | - Nutrition plans |
| 38 | - BMI calculator | 37 | - BMI calculator |
| 39 | - Daily calories calculator | 38 | - Daily calories calculator |
| 40 | - Ingredient overview | 39 | - Ingredient overview |
| 41 | 40 | ||
| 42 | 4. Body Weight | 41 | 4. Body Weight |
| 43 | 42 | ||
| 44 | - Weight overview | 43 | - Weight overview |
| 45 | 44 | ||
| 46 | ## Documentation | 45 | ## Documentation |
| 47 | 46 | ||
| 48 | In order to self-host wger, I opted to use the Docker version of the | 47 | In order to self-host wger, I opted to use the Docker version of the |
| 49 | application. You can read the README within the | 48 | application. You can read the README within the |
| 50 | [wger-project/docker](https://github.com/wger-project/docker) project on | 49 | [wger-project/docker](https://github.com/wger-project/docker) project on GitHub |
| 51 | GitHub for information and installation instructions. | 50 | for information and installation instructions. |
| 52 | 51 | ||
| 53 | ## Installation | 52 | ## Installation |
| 54 | 53 | ||
| 55 | To start the installation, I created a folder for wger and started | 54 | To start the installation, I created a folder for wger and started creating the |
| 56 | creating the three necessary files: | 55 | three necessary files: |
| 57 | 56 | ||
| 58 | ```sh | 57 | ```sh |
| 59 | mkdir ~/wger && mkdir ~/wger/config | 58 | mkdir ~/wger && mkdir ~/wger/config |
| @@ -62,23 +61,20 @@ touch ~/wger/config/prod.env && \ | |||
| 62 | touch ~/wger/config/nginx.conf | 61 | touch ~/wger/config/nginx.conf |
| 63 | ``` | 62 | ``` |
| 64 | 63 | ||
| 65 | Once you have the folders and files created, you will need to copy the | 64 | Once you have the folders and files created, you will need to copy the contents |
| 66 | contents of the `docker-compose.yml`, `prod.env`, | 65 | of the `docker-compose.yml`, `prod.env`, and `nginx.conf` from the GitHub link |
| 67 | and `nginx.conf` from the GitHub link above. | 66 | above. |
| 68 | 67 | ||
| 69 | A few notes to explain the changes I made to the default files: | 68 | A few notes to explain the changes I made to the default files: |
| 70 | 69 | ||
| 71 | - I updated the `ALLOW_REGISTRAION` variable in | 70 | - I updated the `ALLOW_REGISTRAION` variable in `prod.env` to `False` after I |
| 72 | `prod.env` to `False` after I created an | 71 | created an account via my LAN connection, **before** I connected this app to a |
| 73 | account via my LAN connection, **before\*** I connected this app to | 72 | publicly-available domain. |
| 74 | a publicly-available domain. | 73 | - I uncommented and updated `CSRF_TRUSTED_ORIGINS` to be equal to the public |
| 75 | - I uncommented and updated `CSRF_TRUSTED_ORIGINS` to be | 74 | version of this app: `https://wger.example.com`. |
| 76 | equal to the public version of this app: | 75 | - I updated the port within `docker-compose.yml`, within the `nginx` block. The |
| 77 | `https://wger.example.com`. | 76 | port I updated this to will be reflected in my nginx configuration file on the |
| 78 | - I updated the port within `docker-compose.yml`, within | 77 | server (NOT the wger nginx.conf file). |
| 79 | the `nginx` block. The port I updated this to will be | ||
| 80 | reflected in my nginx configuration file on the server (NOT the wger | ||
| 81 | nginx.conf file). | ||
| 82 | 78 | ||
| 83 | ## Deploy | 79 | ## Deploy |
| 84 | 80 | ||
| @@ -89,17 +85,16 @@ container. | |||
| 89 | docker-compose up -d | 85 | docker-compose up -d |
| 90 | ``` | 86 | ``` |
| 91 | 87 | ||
| 92 | You can now visit the website on your LAN by going to | 88 | You can now visit the website on your LAN by going to `localhost:YOUR_PORT` or |
| 93 | `localhost:YOUR_PORT` or by the server\'s IP, if you\'re not | 89 | by the server's IP, if you're not on the same machine that is running the |
| 94 | on the same machine that is running the container. | 90 | container. |
| 95 | 91 | ||
| 96 | If you wish to connect this app to a public domain name, you\'ll need to | 92 | If you wish to connect this app to a public domain name, you'll need to point |
| 97 | point an `A` DNS record from the domain to your server\'s | 93 | an `A` DNS record from the domain to your server's public IP. You'll then need |
| 98 | public IP. You\'ll then need to create a configuration file for | 94 | to create a configuration file for whichever web server or reverse proxy you're |
| 99 | whichever web server or reverse proxy you\'re using. | 95 | using. |
| 100 | 96 | ||
| 101 | Wger\'s README suggests the following reverse proxy configuration for | 97 | Wger's README suggests the following reverse proxy configuration for Nginx: |
| 102 | Nginx: | ||
| 103 | 98 | ||
| 104 | ``` conf | 99 | ``` conf |
| 105 | upstream wger { | 100 | upstream wger { |
| @@ -132,20 +127,19 @@ server { | |||
| 132 | 127 | ||
| 133 | # Thoughts on Wger | 128 | # Thoughts on Wger |
| 134 | 129 | ||
| 135 | I\'m still playing around with the app itself, but it seems to be a | 130 | I'm still playing around with the app itself, but it seems to be a solid |
| 136 | solid all-around workout manager, weight log, and food log. | 131 | all-around workout manager, weight log, and food log. |
| 137 | 132 | ||
| 138 | I like that the weight log graph is fluid and updates quickly. You can | 133 | I like that the weight log graph is fluid and updates quickly. You can also |
| 139 | also import or export data in CSV format if you\'d like to move your | 134 | import or export data in CSV format if you'd like to move your data elsewhere. |
| 140 | data elsewhere. | ||
| 141 | 135 | ||
| 142 | The workout manager is slightly odd, as it requires you to enter sets | 136 | The workout manager is slightly odd, as it requires you to enter sets and reps |
| 143 | and reps for each exercise when you enter it into the plan. Then, when | 137 | for each exercise when you enter it into the plan. Then, when you add a log |
| 144 | you add a log entry for performing a workout, you then add what you | 138 | entry for performing a workout, you then add what you actually performed, in |
| 145 | actually performed, in terms of reps and weight. | 139 | terms of reps and weight. |
| 146 | 140 | ||
| 147 | I haven\'t tried the food log yet and I likely will not, at least for a | 141 | I haven't tried the food log yet and I likely will not, at least for a while. I |
| 148 | while. I have no need for a food log or calorie tracker at the moment. | 142 | have no need for a food log or calorie tracker at the moment. |
| 149 | 143 | ||
| 150 | ## Screenshot Example | 144 | ## Screenshot Example |
| 151 | 145 | ||
content/blog/2023-02-02-exploring-hare.md +65 −76
| @@ -7,87 +7,80 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # A Quick Note | 8 | # A Quick Note |
| 9 | 9 | ||
| 10 | By no means am I a professional developer, so this post will be rather | 10 | By no means am I a professional developer, so this post will be rather short. I |
| 11 | short. I won\'t be going into depth on the specification or anything | 11 | won't be going into depth on the specification or anything that technical. |
| 12 | that technical. | ||
| 13 | 12 | ||
| 14 | Instead, I will simply be talking about how I (a relatively basic | 13 | Instead, I will simply be talking about how I (a relatively basic hobbyist |
| 15 | hobbyist programmer) have been playing with Hare and what intrigues me | 14 | programmer) have been playing with Hare and what intrigues me about the |
| 16 | about the language. | 15 | language. |
| 17 | 16 | ||
| 18 | # Hare | 17 | # Hare |
| 19 | 18 | ||
| 20 | The [Hare](https://harelang.org) programming language is a | 19 | The [Hare](https://harelang.org) programming language is a straightforward |
| 21 | straightforward language that should look familiar if you\'ve ever | 20 | language that should look familiar if you've ever programmed with C, Rust, or |
| 22 | programmed with C, Rust, or other languages that aim to build software | 21 | other languages that aim to build software at the system-level. |
| 23 | at the system-level. | ||
| 24 | 22 | ||
| 25 | The Hare homepage states the following: | 23 | The Hare homepage states the following: |
| 26 | 24 | ||
| 27 | > Hare is a systems programming language designed to be simple, stable, | 25 | > Hare is a systems programming language designed to be simple, stable, and |
| 28 | > and robust. Hare uses a static type system, manual memory management, | 26 | > robust. Hare uses a static type system, manual memory management, and minimal |
| 29 | > and minimal runtime. It is well-suited to writing operating systems, | 27 | > runtime. It is well-suited to writing operating systems, system tools, |
| 30 | > system tools, compilers, networking software, and other low-level, | 28 | > compilers, networking software, and other low-level, high performance tasks. |
| 31 | > high performance tasks. | ||
| 32 | 29 | ||
| 33 | I have found this all to be true while playing with it for the first | 30 | I have found this all to be true while playing with it for the first time today. |
| 34 | time today. In the next few sections, I\'m going to walk through my | 31 | In the next few sections, I'm going to walk through my installation and first |
| 35 | installation and first program. | 32 | program. |
| 36 | 33 | ||
| 37 | ## Installation | 34 | ## Installation |
| 38 | 35 | ||
| 39 | I\'m currently running Alpine Linux on my Thinkpad, so the installation | 36 | I'm currently running Alpine Linux on my Thinkpad, so the installation was |
| 40 | was quite easy as there is a package for Hare in the `apk` | 37 | quite easy as there is a package for Hare in the `apk` repositories. |
| 41 | repositories. | ||
| 42 | 38 | ||
| 43 | ```sh | 39 | ```sh |
| 44 | doas apk add hare hare-doc | 40 | doas apk add hare hare-doc |
| 45 | ``` | 41 | ``` |
| 46 | 42 | ||
| 47 | However, I was able to install Hare from scratch on Fedora Linux a short | 43 | However, I was able to install Hare from scratch on Fedora Linux a short while |
| 48 | while ago, which was also very easy to do. If you need further | 44 | ago, which was also very easy to do. If you need further instructions and Hare |
| 49 | instructions and Hare doesn\'t have a package on your system, take a | 45 | doesn't have a package on your system, take a look at the [Hare |
| 50 | look at the [Hare Installation](https://harelang.org/installation/) | 46 | Installation](https://harelang.org/installation/) page. |
| 51 | page. | ||
| 52 | 47 | ||
| 53 | ## Creating a Test Project | 48 | ## Creating a Test Project |
| 54 | 49 | ||
| 55 | In order to play with the language, I created | 50 | In order to play with the language, I created |
| 56 | [hare-test](https://git.sr.ht/~cmc/hare-projects) and will be putting | 51 | [hare-test](https://git.sr.ht/~cmc/hare-projects) and will be putting any of my |
| 57 | any of my Hare-related adventures in here. | 52 | Hare-related adventures in here. |
| 58 | 53 | ||
| 59 | > **Update:\*** I also created a simple Hare program for creating a file | 54 | > **Update:** I also created a simple Hare program for creating a file from user |
| 60 | > from user input: | 55 | > input: |
| 61 | > [files.ha](https://git.sr.ht/~cmc/hare-projects/tree/main/item/files/files.ha) | 56 | > [files.ha](https://git.sr.ht/~cmc/hare-projects/tree/main/item/files/files.ha) |
| 62 | 57 | ||
| 63 | Luckily, Hare doesn\'t require any complex set-up tools or build | 58 | Luckily, Hare doesn't require any complex set-up tools or build environment. |
| 64 | environment. Once you have Hare installed, you simply need to create a | 59 | Once you have Hare installed, you simply need to create a file ending with `.ha` |
| 65 | file ending with `.ha` and you can run a Hare program. | 60 | and you can run a Hare program. |
| 66 | 61 | ||
| 67 | I created a file called `rgb.ha` in order to test out the | 62 | I created a file called `rgb.ha` in order to test out the random number |
| 68 | random number generation and passing parameters between functions. | 63 | generation and passing parameters between functions. |
| 69 | 64 | ||
| 70 | ```sh | 65 | ```sh |
| 71 | nano rgb.ha | 66 | nano rgb.ha |
| 72 | ``` | 67 | ``` |
| 73 | 68 | ||
| 74 | Within this file, I was able to easily import a few of the [standard | 69 | Within this file, I was able to easily import a few of the [standard library |
| 75 | library modules](https://harelang.org/tutorials/stdlib/): | 70 | modules](https://harelang.org/tutorials/stdlib/): `fmt`, `math::random`, and |
| 76 | `fmt`, `math::random`, and `datetime`. | 71 | `datetime`. |
| 77 | 72 | ||
| 78 | With these modules, I created two functions: | 73 | With these modules, I created two functions: |
| 79 | 74 | ||
| 80 | 1. `main`: This function calls the `generate_rgb` | 75 | 1. `main`: This function calls the `generate_rgb` function and then prints out |
| 81 | function and then prints out the returned values. | 76 | the returned values. |
| 82 | 2. `generate_rgb`: This function uses the current Unix epoch | 77 | 2. `generate_rgb`: This function uses the current Unix epoch time to generate a |
| 83 | time to generate a pseudo-random value and uses this value to create | 78 | pseudo-random value and uses this value to create three more random values |
| 84 | three more random values between 0 and 255. These three numbers | 79 | between 0 and 255. These three numbers represent a color in RGB format. |
| 85 | represent a color in RGB format. | ||
| 86 | 80 | ||
| 87 | > **Note**: Some syntax coloring may look odd, as Zola currently | 81 | > **Note**: Some syntax coloring may look odd, as Zola currently doesn't have a |
| 88 | > doesn\'t have a syntax highlighting theme for Hare. Instead, I\'m | 82 | > syntax highlighting theme for Hare. Instead, I'm using the C theme, which may |
| 89 | > using the C theme, which may not be exactly accurate when coloring the | 83 | > not be exactly accurate when coloring the code below. |
| 90 | > code below. | ||
| 91 | 84 | ||
| 92 | ```c | 85 | ```c |
| 93 | use datetime; | 86 | use datetime; |
| @@ -120,8 +113,7 @@ fn generate_rgb() []u64 = { | |||
| 120 | 113 | ||
| 121 | ## Running a Program | 114 | ## Running a Program |
| 122 | 115 | ||
| 123 | Once you have a Hare file written and ready to run, you simply need to | 116 | Once you have a Hare file written and ready to run, you simply need to run it: |
| 124 | run it: | ||
| 125 | 117 | ||
| 126 | ```sh | 118 | ```sh |
| 127 | hare run file.ha | 119 | hare run file.ha |
| @@ -136,37 +128,34 @@ hare build -o example file.ha | |||
| 136 | 128 | ||
| 137 | ## Initial Thoughts | 129 | ## Initial Thoughts |
| 138 | 130 | ||
| 139 | 1. Documentation Improvements Would Help | 131 | 1. Documentation Improvements Would Help |
| 140 | 132 | ||
| 141 | While I was able to piece everything together eventually, the | 133 | While I was able to piece everything together eventually, the biggest |
| 142 | biggest downfall right now in Hare\'s documentation. For such a new | 134 | downfall right now in Hare's documentation. For such a new project, the |
| 143 | project, the documentation is in a great spot. However, bare | 135 | documentation is in a great spot. However, bare specifications don't help |
| 144 | specifications don\'t help as much as a brief examples section | 136 | as much as a brief examples section would. |
| 145 | would. | ||
| 146 | 137 | ||
| 147 | For example, it took me a while to figure out what the | 138 | For example, it took me a while to figure out what the `u64n` function was |
| 148 | `u64n` function was looking for. I could tell that it | 139 | looking for. I could tell that it took two parameters and the second was my |
| 149 | took two parameters and the second was my max value (255), but | 140 | max value (255), but couldn't figure out what the first value should be. |
| 150 | couldn\'t figure out what the first value should be. Eventually, I | 141 | Eventually, I inspected the `random.ha` file in the [Hare source |
| 151 | inspected the `random.ha` file in the [Hare source | ||
| 152 | code](https://git.sr.ht/~sircmpwn/hare/tree/master/item/math/random/random.ha) | 142 | code](https://git.sr.ht/~sircmpwn/hare/tree/master/item/math/random/random.ha) |
| 153 | and found the test suite that helped me discover that it needed an | 143 | and found the test suite that helped me discover that it needed an `init()` |
| 154 | `init()` value in the form of `&var`. | 144 | value in the form of `&var`. |
| 155 | 145 | ||
| 156 | 2. More Basic Modules | 146 | 2. More Basic Modules |
| 157 | 147 | ||
| 158 | This is another point that comes from Hare being new and awaiting | 148 | This is another point that comes from Hare being new and awaiting more |
| 159 | more contributions, but there are some basic functions that I would | 149 | contributions, but there are some basic functions that I would personally |
| 160 | personally enjoy seeing in Hare, such as one to convert decimal | 150 | enjoy seeing in Hare, such as one to convert decimal (base 10) values to |
| 161 | (base 10) values to hexadecimal (base 16). | 151 | hexadecimal (base 16). |
| 162 | 152 | ||
| 163 | If I\'m feeling comfortable with my math, I may work on the list of | 153 | If I'm feeling comfortable with my math, I may work on the list of |
| 164 | functions I want and see if any can make it into the Hare source | 154 | functions I want and see if any can make it into the Hare source code. |
| 165 | code. | ||
| 166 | 155 | ||
| 167 | 3. Overall Thoughts | 156 | 3. Overall Thoughts |
| 168 | 157 | ||
| 169 | Overall, I actually really enjoy Hare. It\'s not as tedious to get a | 158 | Overall, I actually really enjoy Hare. It's not as tedious to get a project |
| 170 | project up and running as Rust, but it\'s also simpler and more | 159 | up and running as Rust, but it's also simpler and more user-friendly than |
| 171 | user-friendly than learning C. I am going to continue playing with | 160 | learning C. I am going to continue playing with it and see if I can make |
| 172 | it and see if I can make anything of particular value. | 161 | anything of particular value. |
content/blog/2023-05-22-burnout.md +25 −25
| @@ -7,39 +7,39 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # RE: Burnout {#re-burnout-1} | 8 | # RE: Burnout {#re-burnout-1} |
| 9 | 9 | ||
| 10 | I recently read [Drew DeVault\'s post on | 10 | I recently read [Drew DeVault's post on |
| 11 | burnout](https://drewdevault.com/2023/05/01/2023-05-01-Burnout.html) | 11 | burnout](https://drewdevault.com/2023/05/01/2023-05-01-Burnout.html) around the |
| 12 | around the same time I was pulling out of a burnout rut myself earlier | 12 | same time I was pulling out of a burnout rut myself earlier this month. Finally, |
| 13 | this month. Finally, seeing the light at the end of my burnout tunnel | 13 | seeing the light at the end of my burnout tunnel made me want to write my first |
| 14 | made me want to write my first post back on this topic. | 14 | post back on this topic. |
| 15 | 15 | ||
| 16 | # Busy Seasons on Busy Seasons | 16 | # Busy Seasons on Busy Seasons |
| 17 | 17 | ||
| 18 | My career deals with busy seasons, generally driven by client demand. | 18 | My career deals with busy seasons, generally driven by client demand. This last |
| 19 | This last year, I dealt with a harsh busy season from Aug to Oct 2022 to | 19 | year, I dealt with a harsh busy season from Aug to Oct 2022 to issue a few SOC |
| 20 | issue a few SOC reports for the period ending 2022-09-30. Immediately | 20 | reports for the period ending 2022-09-30. Immediately following that, I had to |
| 21 | following that, I had to pivot and found another busy season from Oct to | 21 | pivot and found another busy season from Oct to Jan for financial statement |
| 22 | Jan for financial statement audits ending on 2022-12-31. Then again, | 22 | audits ending on 2022-12-31. Then again, supporting other clients from Jan to |
| 23 | supporting other clients from Jan to Mar 2023, followed by my current | 23 | Mar 2023, followed by my current client workload aiming for SOC reports due on |
| 24 | client workload aiming for SOC reports due on 2023-06-30. | 24 | 2023-06-30. |
| 25 | 25 | ||
| 26 | The result? A busy season that has lasted from August 2022 through | 26 | The result? A busy season that has lasted from August 2022 through today. I will |
| 27 | today. I will likely be rushing throughout the next month or two before | 27 | likely be rushing throughout the next month or two before I have a brief break |
| 28 | I have a brief break and need to focus on the 2023-09-30 SOC reports | 28 | and need to focus on the 2023-09-30 SOC reports again. While auditing and |
| 29 | again. While auditing and consulting always involve a busy season, this | 29 | consulting always involve a busy season, this is the first time I've had one |
| 30 | is the first time I\'ve had one last 9+ months without a break. | 30 | last 9+ months without a break. |
| 31 | 31 | ||
| 32 | While it\'s been tough, I have a handful of breaks pre-planned | 32 | While it's been tough, I have a handful of breaks pre-planned throughout this |
| 33 | throughout this next cycle and should be able to moderate the level of | 33 | next cycle and should be able to moderate the level of commitment required for |
| 34 | commitment required for each client. | 34 | each client. |
| 35 | 35 | ||
| 36 | # Refocusing | 36 | # Refocusing |
| 37 | 37 | ||
| 38 | Outside of work, I finally have time to work on hobbies such as this | 38 | Outside of work, I finally have time to work on hobbies such as this website, |
| 39 | website, programming, athletics, games, etc. | 39 | programming, athletics, games, etc. |
| 40 | 40 | ||
| 41 | You may have noticed my absence if you\'re in the same channels, forums, | 41 | You may have noticed my absence if you're in the same channels, forums, and |
| 42 | and rooms that I am, but I should finally be active again. | 42 | rooms that I am, but I should finally be active again. |
| 43 | 43 | ||
| 44 | I\'m hoping to break an item out of my backlog soon and start working on | 44 | I'm hoping to break an item out of my backlog soon and start working on |
| 45 | building a new project or hack around with a stale one. | 45 | building a new project or hack around with a stale one. |
content/blog/2023-06-08-goaccess-geoip.md +19 −21
| @@ -7,22 +7,21 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Overview | 8 | # Overview |
| 9 | 9 | ||
| 10 | [GoAccess](https://goaccess.io/) is an open source real-time web log | 10 | [GoAccess](https://goaccess.io/) is an open source real-time web log analyzer |
| 11 | analyzer and interactive viewer that runs in a terminal in \*nix systems | 11 | and interactive viewer that runs in a terminal in *nix systems or through your |
| 12 | or through your browser. | 12 | browser. |
| 13 | 13 | ||
| 14 | # Installation | 14 | # Installation |
| 15 | 15 | ||
| 16 | To start, you\'ll need to install GoAccess for your OS. Here\'s an | 16 | To start, you'll need to install GoAccess for your OS. Here's an example for |
| 17 | example for Debian-based distros: | 17 | Debian-based distros: |
| 18 | 18 | ||
| 19 | ```sh | 19 | ```sh |
| 20 | sudo apt install goaccess | 20 | sudo apt install goaccess |
| 21 | ``` | 21 | ``` |
| 22 | 22 | ||
| 23 | Next, find any number of the MaxMind GeoIP database files on GitHub or | 23 | Next, find any number of the MaxMind GeoIP database files on GitHub or another |
| 24 | another file hosting website. We\'re going to use P3TERX\'s version in | 24 | file hosting website. We're going to use P3TERX's version in this example: |
| 25 | this example: | ||
| 26 | 25 | ||
| 27 | ```sh | 26 | ```sh |
| 28 | wget https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-City.mmdb | 27 | wget https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-City.mmdb |
| @@ -32,16 +31,15 @@ Be sure to save this file in an easy to remember location! | |||
| 32 | 31 | ||
| 33 | # Usage | 32 | # Usage |
| 34 | 33 | ||
| 35 | In order to utilize the full capabilities of GoAccess and MMDB, start | 34 | In order to utilize the full capabilities of GoAccess and MMDB, start with the |
| 36 | with the command template below and customize as necessary. This will | 35 | command template below and customize as necessary. This will export an HTML view |
| 37 | export an HTML view of the GoAccess dashboard, showing all relevant | 36 | of the GoAccess dashboard, showing all relevant information related to that |
| 38 | information related to that site\'s access log. You can also omit the | 37 | site's access log. You can also omit the `-o output.html` parameter if you |
| 39 | `-o output.html` parameter if you prefer to view the data | 38 | prefer to view the data within the CLI instead of creating an HTML file. |
| 40 | within the CLI instead of creating an HTML file. | ||
| 41 | 39 | ||
| 42 | With the addition of the GeoIP Database parameter, section | 40 | With the addition of the GeoIP Database parameter, section `16 - Geo Location` |
| 43 | `16 - Geo Location` will be added with the various countries | 41 | will be added with the various countries that are associated with the collected |
| 44 | that are associated with the collected IP addresses. | 42 | IP addresses. |
| 45 | 43 | ||
| 46 | ```sh | 44 | ```sh |
| 47 | zcat /var/log/nginx/example.access.log.*.gz | goaccess \ | 45 | zcat /var/log/nginx/example.access.log.*.gz | goaccess \ |
| @@ -60,11 +58,11 @@ See below for an example of the HTML output: | |||
| 60 |  | 59 | HTML](https://img.cleberg.net/blog/20230608-goaccess/goaccess-dashboard.png) |
| 62 | 60 | ||
| 63 | You can also see the GeoIP card created by the integration of the | 61 | You can also see the GeoIP card created by the integration of the MaxMind |
| 64 | MaxMind database information. | 62 | database information. |
| 65 | 63 | ||
| 66 |  | 65 | GeoIP](https://img.cleberg.net/blog/20230608-goaccess/goaccess-geoip.png) |
| 68 | 66 | ||
| 69 | That\'s all there is to it! Informational data is provided in an | 67 | That's all there is to it! Informational data is provided in an organized |
| 70 | organized fashion with minimal effort. | 68 | fashion with minimal effort. |
content/blog/2023-06-08-self-hosting-baikal.md +47 −51
| @@ -7,27 +7,26 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # What is Baikal? | 8 | # What is Baikal? |
| 9 | 9 | ||
| 10 | [Baikal](https://sabre.io/baikal/) is a lightweight CalDAV + CardDAV | 10 | [Baikal](https://sabre.io/baikal/) is a lightweight CalDAV + CardDAV server that |
| 11 | server that you can self-host on your own machine. While I have tried (& | 11 | you can self-host on your own machine. While I have tried (& failed) to get this |
| 12 | failed) to get this CalDAV + CardDAV server running before, it was quite | 12 | CalDAV + CardDAV server running before, it was quite easy this time. Not really |
| 13 | easy this time. Not really sure what I did differently this time, but | 13 | sure what I did differently this time, but I'm documenting my process here to |
| 14 | I\'m documenting my process here to ensure I don\'t forget. | 14 | ensure I don't forget. |
| 15 | 15 | ||
| 16 | # Installation | 16 | # Installation |
| 17 | 17 | ||
| 18 | First, create a folder on your server and open a | 18 | First, create a folder on your server and open a `docker-compose.yml` file for |
| 19 | `docker-compose.yml` file for editing: | 19 | editing: |
| 20 | 20 | ||
| 21 | ```sh | 21 | ```sh |
| 22 | mkdir baikal && cd baikal | 22 | mkdir baikal && cd baikal |
| 23 | nano docker-compose.yml | 23 | nano docker-compose.yml |
| 24 | ``` | 24 | ``` |
| 25 | 25 | ||
| 26 | Within this file, you\'ll need to paste the information below. You can | 26 | Within this file, you'll need to paste the information below. You can customize |
| 27 | customize the `ports` section to use any port on your server | 27 | the `ports` section to use any port on your server to pass through to port 80 in |
| 28 | to pass through to port 80 in the container. You can also edit the | 28 | the container. You can also edit the `volumes` section to use docker volumes |
| 29 | `volumes` section to use docker volumes instead of local | 29 | instead of local folders. |
| 30 | folders. | ||
| 31 | 30 | ||
| 32 | ``` conf | 31 | ``` conf |
| 33 | version: "2" | 32 | version: "2" |
| @@ -42,8 +41,8 @@ services: | |||
| 42 | - ./data:/var/www/baikal/Specific | 41 | - ./data:/var/www/baikal/Specific |
| 43 | ``` | 42 | ``` |
| 44 | 43 | ||
| 45 | Once finished with editing, save and close the file. Then, launch the | 44 | Once finished with editing, save and close the file. Then, launch the docker |
| 46 | docker container: | 45 | container: |
| 47 | 46 | ||
| 48 | ```sh | 47 | ```sh |
| 49 | sudo docker-compose up -d | 48 | sudo docker-compose up -d |
| @@ -51,42 +50,40 @@ sudo docker-compose up -d | |||
| 51 | 50 | ||
| 52 | # Intial Setup | 51 | # Intial Setup |
| 53 | 52 | ||
| 54 | As long as no issues came up when starting the container, you should be | 53 | As long as no issues came up when starting the container, you should be able to |
| 55 | able to visit the server\'s set-up page at | 54 | visit the server's set-up page at `http://<server_ip>:<port>`. The application |
| 56 | `http://<server_ip>:<port>`. The application will ask you to | 55 | will ask you to create an administrator account and choose the database type for |
| 57 | create an administrator account and choose the database type for your | 56 | your storage. Personally, I opted to use SQLite. |
| 58 | storage. Personally, I opted to use SQLite. | ||
| 59 | 57 | ||
| 60 | Make sure the administrator credentials are adequate to protect against | 58 | Make sure the administrator credentials are adequate to protect against common |
| 61 | common attacks. | 59 | attacks. |
| 62 | 60 | ||
| 63 | # Creating Users | 61 | # Creating Users |
| 64 | 62 | ||
| 65 | Once you\'ve set up the application, you will be greeted by the | 63 | Once you've set up the application, you will be greeted by the Dashboard page, |
| 66 | Dashboard page, which will show the version of the app, status of the | 64 | which will show the version of the app, status of the admin/CalDAV/CardDAV |
| 67 | admin/CalDAV/CardDAV services, and the number of users, calendars, | 65 | services, and the number of users, calendars, events, address books, and |
| 68 | events, address books, and contacts. | 66 | contacts. |
| 69 | 67 | ||
| 70 |  | 69 | Dashboard](https://img.cleberg.net/blog/20230608-baikal/baikal-dashboard.png) |
| 72 | 70 | ||
| 73 | To create a new user, navigate to the `Users and resources` | 71 | To create a new user, navigate to the `Users and resources` page. This process |
| 74 | page. This process is as simple as entering a username, password, and | 72 | is as simple as entering a username, password, and email. |
| 75 | email. | ||
| 76 | 73 | ||
| 77 | Once a user has been created, you can create any number of calendars and | 74 | Once a user has been created, you can create any number of calendars and address |
| 78 | address books for user, as well as inspect their information. | 75 | books for user, as well as inspect their information. |
| 79 | 76 | ||
| 80 | # Setting Up a Public URL | 77 | # Setting Up a Public URL |
| 81 | 78 | ||
| 82 | Once your application is working locally, you can open access remotely | 79 | Once your application is working locally, you can open access remotely via a URL |
| 83 | via a URL by using a reverse-proxy like Nginx. | 80 | by using a reverse-proxy like Nginx. |
| 84 | 81 | ||
| 85 | As a prerequisite, you must own a domain name and set up DNS records to | 82 | As a prerequisite, you must own a domain name and set up DNS records to point a |
| 86 | point a domain name to the server hosting Baikal. | 83 | domain name to the server hosting Baikal. |
| 87 | 84 | ||
| 88 | Start by navigating to your web server\'s configuration directory and | 85 | Start by navigating to your web server's configuration directory and create a |
| 89 | create a new file for this application. | 86 | new file for this application. |
| 90 | 87 | ||
| 91 | ```sh | 88 | ```sh |
| 92 | cd /etc/nginx/sites-available/ | 89 | cd /etc/nginx/sites-available/ |
| @@ -94,7 +91,7 @@ nano dav | |||
| 94 | ``` | 91 | ``` |
| 95 | 92 | ||
| 96 | Within this file, paste in the configuration from below and change | 93 | Within this file, paste in the configuration from below and change |
| 97 | `dav.example.com` to match the URL you\'ll be using. | 94 | `dav.example.com` to match the URL you'll be using. |
| 98 | 95 | ||
| 99 | ``` conf | 96 | ``` conf |
| 100 | server { | 97 | server { |
| @@ -128,33 +125,32 @@ server { | |||
| 128 | } | 125 | } |
| 129 | ``` | 126 | ``` |
| 130 | 127 | ||
| 131 | For Nginx on Ubuntu, you\'ll need to symlink the configuration file to | 128 | For Nginx on Ubuntu, you'll need to symlink the configuration file to the |
| 132 | the `sites-enabled` directory and then restart Nginx. | 129 | `sites-enabled` directory and then restart Nginx. |
| 133 | 130 | ||
| 134 | ```sh | 131 | ```sh |
| 135 | sudo ln -s /etc/nginx/sites-available/dav /etc/nginx/sites-enabled/dav | 132 | sudo ln -s /etc/nginx/sites-available/dav /etc/nginx/sites-enabled/dav |
| 136 | sudo systemctl restart nginx.service | 133 | sudo systemctl restart nginx.service |
| 137 | ``` | 134 | ``` |
| 138 | 135 | ||
| 139 | At this point, the Baikal server should be available over the internet | 136 | At this point, the Baikal server should be available over the internet at the |
| 140 | at the URL configured above! | 137 | URL configured above! |
| 141 | 138 | ||
| 142 | # Configuring Clients | 139 | # Configuring Clients |
| 143 | 140 | ||
| 144 | Lastly, configuring clients and applications is essential to making sure | 141 | Lastly, configuring clients and applications is essential to making sure the DAV |
| 145 | the DAV server is being fully utilized. | 142 | server is being fully utilized. |
| 146 | 143 | ||
| 147 | You can also use the `Users and resources` page to inspect a | 144 | You can also use the `Users and resources` page to inspect a user's personal |
| 148 | user\'s personal link to their calendars and address books by clicking | 145 | link to their calendars and address books by clicking the info (i) button. It |
| 149 | the info (i) button. It will show a URI like | 146 | will show a URI like `/dav.php/calendars/your-user/default/`. |
| 150 | `/dav.php/calendars/your-user/default/`. | ||
| 151 | 147 | ||
| 152 | However, I found that the following URL works for most applications: | 148 | However, I found that the following URL works for most applications: |
| 153 | `/dav.php/principals/your-user/`. | 149 | `/dav.php/principals/your-user/`. |
| 154 | 150 | ||
| 155 | I used the `principals` URL above for Thunderbird (calendar, | 151 | I used the `principals` URL above for Thunderbird (calendar, tasks, and |
| 156 | tasks, and contacts), as well as iOS (calendar, tasks, and contacts) and | 152 | contacts), as well as iOS (calendar, tasks, and contacts) and everything works |
| 157 | everything works flawlessly so far. | 153 | flawlessly so far. |
| 158 | 154 | ||
| 159 | Syncing is quick between the server and clients, and I haven\'t seen any | 155 | Syncing is quick between the server and clients, and I haven't seen any |
| 160 | disruptions in the service or data integrity. | 156 | disruptions in the service or data integrity. |
content/blog/2023-06-18-unifi-ip-blocklist.md +40 −48
| @@ -7,82 +7,74 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Identifying Abusive IPs | 8 | # Identifying Abusive IPs |
| 9 | 9 | ||
| 10 | If you\'re like me and use Unifi network equipment at the edge of the | 10 | If you're like me and use Unifi network equipment at the edge of the network |
| 11 | network you manage, you may know that Unifi is only somewhat decent at | 11 | you manage, you may know that Unifi is only somewhat decent at identifying and |
| 12 | identifying and blocking IPs that represent abusive or threat actors. | 12 | blocking IPs that represent abusive or threat actors. |
| 13 | 13 | ||
| 14 | While Unifi has a [threat | 14 | While Unifi has a [threat |
| 15 | management](https://help.ui.com/hc/en-us/articles/360006893234-UniFi-Gateway-Threat-Management) | 15 | management](https://help.ui.com/hc/en-us/articles/360006893234-UniFi-Gateway-Threat-Management) |
| 16 | tool inside their Network application, it can be lacking in | 16 | tool inside their Network application, it can be lacking in functionality and |
| 17 | functionality and identification. For example, I have my UDM Pro set to | 17 | identification. For example, I have my UDM Pro set to identify and block almost |
| 18 | identify and block almost all categories of threats available within the | 18 | all categories of threats available within the Unifi settings. However, I |
| 19 | Unifi settings. However, I regularly identify abusive actors on my web | 19 | regularly identify abusive actors on my web server via the server logs. |
| 20 | server via the server logs. | ||
| 21 | 20 | ||
| 22 | In addition, I have identified IP addresses and subnets directly within | 21 | In addition, I have identified IP addresses and subnets directly within Unifi's |
| 23 | Unifi\'s logs that the UDM did not block for whatever reason. | 22 | logs that the UDM did not block for whatever reason. |
| 24 | 23 | ||
| 25 | This guide is meant to be another step in the process to manually block | 24 | This guide is meant to be another step in the process to manually block abusive |
| 26 | abusive IP addresses or subnets that you have identified but are not | 25 | IP addresses or subnets that you have identified but are not being automatically |
| 27 | being automatically blocked yet. | 26 | blocked yet. |
| 28 | 27 | ||
| 29 | # Create an IP Group Profile | 28 | # Create an IP Group Profile |
| 30 | 29 | ||
| 31 | To start, login to the Unifi machine\'s web GUI and navigate to the | 30 | To start, login to the Unifi machine's web GUI and navigate to the Network app |
| 32 | Network app \> Settings \> Profiles. | 31 | > Settings > Profiles. |
| 33 | 32 | ||
| 34 | Within this page, choose the `IP Groups` tab and click | 33 | Within this page, choose the `IP Groups` tab and click `Create New`. |
| 35 | `Create New`. | ||
| 36 | 34 | ||
| 37 |  | 36 | Profiles](https://img.cleberg.net/blog/20230618-unifi-ip-blocklist/unifi_profiles.png) |
| 39 | 37 | ||
| 40 | Each IP Group profile can be used as one of three options: | 38 | Each IP Group profile can be used as one of three options: |
| 41 | 39 | ||
| 42 | 1. Port Group | 40 | 1. Port Group |
| 43 | 2. IPv4 Address/Subnet | 41 | 2. IPv4 Address/Subnet |
| 44 | 3. IPv6 Address/Subnet | 42 | 3. IPv6 Address/Subnet |
| 45 | 43 | ||
| 46 | In this example, I\'m creating an IPv4 Address/Subnet group and adding a | 44 | In this example, I'm creating an IPv4 Address/Subnet group and adding a few |
| 47 | few different IP addresses and a subnet. Once you\'ve added all IP | 45 | different IP addresses and a subnet. Once you've added all IP addresses and |
| 48 | addresses and subnets, click the `Apply` button that should | 46 | subnets, click the `Apply` button that should appear at the bottom. |
| 49 | appear at the bottom. | ||
| 50 | 47 | ||
| 51 |  | 49 | IPs](https://img.cleberg.net/blog/20230618-unifi-ip-blocklist/abusive_ips.png) |
| 53 | 50 | ||
| 54 | At this point, the IPv4 Address/Subnet has been created but not yet | 51 | At this point, the IPv4 Address/Subnet has been created but not yet used. |
| 55 | used. | ||
| 56 | 52 | ||
| 57 | # Drop IP Group Profile via the Unifi Firewall | 53 | # Drop IP Group Profile via the Unifi Firewall |
| 58 | 54 | ||
| 59 | To instruct the Unifi machine to block the profile we just created, we | 55 | To instruct the Unifi machine to block the profile we just created, we need to |
| 60 | need to navigate to the Network app \> Settings \> Firewall & Security. | 56 | navigate to the Network app > Settings > Firewall & Security. |
| 61 | 57 | ||
| 62 | Within this screen, find the Firewall Rules table and click | 58 | Within this screen, find the Firewall Rules table and click `Create Entry`. This |
| 63 | `Create Entry`. This entry should contain the following | 59 | entry should contain the following settings: |
| 64 | settings: | ||
| 65 | 60 | ||
| 66 | - Type: `Internet In` | 61 | - Type: `Internet In` |
| 67 | - Description: `<Your Custom Rule>` | 62 | - Description: `<Your Custom Rule>` |
| 68 | - Rule Applied: `Before Predefined Rules` | 63 | - Rule Applied: `Before Predefined Rules` |
| 69 | - Action: `Drop` | 64 | - Action: `Drop` |
| 70 | - Source Type: `Port/IP Group` | 65 | - Source Type: `Port/IP Group` |
| 71 | - IPv4 Address Group: | 66 | - IPv4 Address Group: `<Name of the Group Profile You Created Above>` |
| 72 | `<Name of the Group Profile You Created Above>` | ||
| 73 | 67 | ||
| 74 | Customize the remaining configurations to your liking, and then save and | 68 | Customize the remaining configurations to your liking, and then save and enable |
| 75 | enable the firewall rule. | 69 | the firewall rule. |
| 76 | 70 | ||
| 77 |  | 72 | Rule](https://img.cleberg.net/blog/20230618-unifi-ip-blocklist/firewall_drop_rule.png) |
| 79 | 73 | ||
| 80 | Once enabled, the Unifi machine will be able to drop all incoming | 74 | Once enabled, the Unifi machine will be able to drop all incoming connections |
| 81 | connections from the defined IP addresses and subnets within the created | 75 | from the defined IP addresses and subnets within the created profile. |
| 82 | profile. | ||
| 83 | 76 | ||
| 84 | > As a personal aside to this topic, I\'m looking for a convenient way | 77 | > As a personal aside to this topic, I'm looking for a convenient way to update |
| 85 | > to update the firewall rules or profiles remotely (within the LAN) | 78 | > the firewall rules or profiles remotely (within the LAN) from the web server |
| 86 | > from the web server to accelerate this process. If you have an idea on | 79 | > to accelerate this process. If you have an idea on how to automatically update |
| 87 | > how to automatically update Unifi IP groups or firewall rules, let me | 80 | > Unifi IP groups or firewall rules, let me know! |
| 88 | > know! | ||
content/blog/2023-06-20-audit-review-template.md +57 −62
| @@ -7,75 +7,70 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Overview | 8 | # Overview |
| 9 | 9 | ||
| 10 | This post is a *very* brief overview on the basic process to review | 10 | This post is a *very* brief overview on the basic process to review audit test |
| 11 | audit test results, focusing on work done as part of a financial | 11 | results, focusing on work done as part of a financial statement audit (FSA) or |
| 12 | statement audit (FSA) or service organization controls (SOC) report. | 12 | service organization controls (SOC) report. |
| 13 | 13 | ||
| 14 | While there are numerous different things to review and look for - all | 14 | While there are numerous different things to review and look for - all varying |
| 15 | varying wildly depending on the report, client, and tester - this list | 15 | wildly depending on the report, client, and tester - this list serves as a solid |
| 16 | serves as a solid base foundation for a reviewer. | 16 | base foundation for a reviewer. |
| 17 | 17 | ||
| 18 | I have used this throughout my career as a starting point to my reviews, | 18 | I have used this throughout my career as a starting point to my reviews, and it |
| 19 | and it has worked wonders for creating a consistent and objective | 19 | has worked wonders for creating a consistent and objective template to my |
| 20 | template to my reviews. The goal is to keep this base high-level enough | 20 | reviews. The goal is to keep this base high-level enough to be used on a wide |
| 21 | to be used on a wide variety of engagements, while still ensuring that | 21 | variety of engagements, while still ensuring that all key areas are covered. |
| 22 | all key areas are covered. | ||
| 23 | 22 | ||
| 24 | # Review Template | 23 | # Review Template |
| 25 | 24 | ||
| 26 | 1. [ ] Check all documents for spelling and grammar. | 25 | 1. [ ] Check all documents for spelling and grammar. |
| 27 | 2. [ ] Ensure all acronyms are fully explained upon first use. | 26 | 2. [ ] Ensure all acronyms are fully explained upon first use. |
| 28 | 3. [ ] For all people referenced, use their full names and job titles | 27 | 3. [ ] For all people referenced, use their full names and job titles upon first |
| 29 | upon first use. | 28 | use. |
| 30 | 4. [ ] All supporting documents must cross-reference to the lead sheet | 29 | 4. [ ] All supporting documents must cross-reference to the lead sheet and |
| 31 | and vice-versa. | 30 | vice-versa. |
| 32 | 5. [ ] Verify that the control has been adequately tested: | 31 | 5. [ ] Verify that the control has been adequately tested: |
| 33 | - [ ] **Test of Design**: Did the tester obtain information | 32 | - [ ] **Test of Design**: Did the tester obtain information regarding how |
| 34 | regarding how the control should perform normally and abnormally | 33 | the control should perform normally and abnormally (e.g., emergency |
| 35 | (e.g., emergency scenarios)? | 34 | scenarios)? |
| 36 | - [ ] **Test of Operating Effectiveness**: Did the tester inquire, | 35 | - [ ] **Test of Operating Effectiveness**: Did the tester inquire, observe, |
| 37 | observe, inspect, or re-perform sufficient evidence to support | 36 | inspect, or re-perform sufficient evidence to support their conclusion |
| 38 | their conclusion over the control? Inquiry alone is not | 37 | over the control? Inquiry alone is not adequate! |
| 39 | adequate! | 38 | 6. [ ] For any information used in the control, whether by the control operator |
| 40 | 6. [ ] For any information used in the control, whether by the control | 39 | or by the tester, did the tester appropriately document the source (system or |
| 41 | operator or by the tester, did the tester appropriately document the | 40 | person), extraction method, parameters, and completeness and accuracy (C&A)? |
| 42 | source (system or person), extraction method, parameters, and | 41 | - [ ] For any reports, queries, etc. used in the extraction, did the tester |
| 43 | completeness and accuracy (C&A)? | 42 | include a copy and notate C&A considerations? |
| 44 | - [ ] For any reports, queries, etc. used in the extraction, did | 43 | 7. [ ] Did the tester document the specific criteria that the control is being |
| 45 | the tester include a copy and notate C&A considerations? | 44 | tested against? |
| 46 | 7. [ ] Did the tester document the specific criteria that the control | 45 | 8. [ ] Did the tester notate in the supporting documents where each criterion |
| 47 | is being tested against? | 46 | was satisfied? |
| 48 | 8. [ ] Did the tester notate in the supporting documents where each | 47 | 9. [ ] If testing specific policies or procedures, are the documents adequate? |
| 49 | criterion was satisfied? | 48 | - [ ] e.g., a test to validate that a review of policy XYZ occurs |
| 50 | 9. [ ] If testing specific policies or procedures, are the documents | 49 | periodically should also evaluate the sufficiency of the policy itself, if |
| 51 | adequate? | 50 | meant to cover the risk that such a policy does not exist and is not |
| 52 | - [ ] e.g., a test to validate that a review of policy XYZ occurs | 51 | reviewed. |
| 53 | periodically should also evaluate the sufficiency of the policy | ||
| 54 | itself, if meant to cover the risk that such a policy does not | ||
| 55 | exist and is not reviewed. | ||
| 56 | 10. [ ] Does the test cover the appropriate period under review? | 52 | 10. [ ] Does the test cover the appropriate period under review? |
| 57 | - [ ] If the test is meant to cover only a portion of the audit | 53 | - [ ] If the test is meant to cover only a portion of the audit period, do |
| 58 | period, do other controls exist to mitigate the risks that exist | 54 | other controls exist to mitigate the risks that exist for the remainder of |
| 59 | for the remainder of the period? | 55 | the period? |
| 60 | 11. [ ] For any computer-aided audit tools (CAATs) or other automation | 56 | 11. [ ] For any computer-aided audit tools (CAATs) or other automation |
| 61 | techniques used in the test, is the use of such tools explained and | 57 | techniques used in the test, is the use of such tools explained and |
| 62 | appropriately documented? | 58 | appropriately documented? |
| 63 | 12. [ ] If prior-period documentation exists, are there any missing | 59 | 12. [ ] If prior-period documentation exists, are there any missing pieces of |
| 64 | pieces of evidence that would further enhance the quality of the | 60 | evidence that would further enhance the quality of the test? |
| 61 | 13. [ ] Was any information discovered during the walkthrough or inquiry phase | ||
| 62 | that was not incorporated into the test? | ||
| 63 | 14. [ ] Are there new rules or expectations from your company's internal | ||
| 64 | guidance or your regulatory bodies that would affect the audit approach for | ||
| 65 | this control? | ||
| 66 | 15. [ ] Was an exception, finding, or deficiency identified as a result of this | ||
| 65 | test? | 67 | test? |
| 66 | 13. [ ] Was any information discovered during the walkthrough or inquiry | 68 | - [ ] Was the control deficient in design, operation, or both? |
| 67 | phase that was not incorporated into the test? | 69 | - [ ] What was the root cause of the finding? |
| 68 | 14. [ ] Are there new rules or expectations from your company\'s | 70 | - [ ] Does the finding indicate other findings or potential fraud? |
| 69 | internal guidance or your regulatory bodies that would affect the | 71 | - [ ] What's the severity and scope of the finding? |
| 70 | audit approach for this control? | 72 | - [ ] Do other controls exist as a form of compensation against the |
| 71 | 15. [ ] Was an exception, finding, or deficiency identified as a result | 73 | finding's severity, and do they mitigate the risk within the control |
| 72 | of this test? | 74 | objective? |
| 73 | - [ ] Was the control deficient in design, operation, or both? | 75 | - [ ] Does the finding exist at the end of the period, or was it resolved |
| 74 | - [ ] What was the root cause of the finding? | 76 | within the audit period? |
| 75 | - [ ] Does the finding indicate other findings or potential fraud? | ||
| 76 | - [ ] What\'s the severity and scope of the finding? | ||
| 77 | - [ ] Do other controls exist as a form of compensation against | ||
| 78 | the finding\'s severity, and do they mitigate the risk within | ||
| 79 | the control objective? | ||
| 80 | - [ ] Does the finding exist at the end of the period, or was it | ||
| 81 | resolved within the audit period? | ||
content/blog/2023-06-23-byobu.md +13 −14
| @@ -5,27 +5,26 @@ description = "" | |||
| 5 | draft = false | 5 | draft = false |
| 6 | +++ | 6 | +++ |
| 7 | 7 | ||
| 8 | # Byobu {#byobu-1} | 8 | # Byobu |
| 9 | 9 | ||
| 10 | [byobu](https://www.byobu.org) is a command-line tool that allows you to | 10 | [byobu](https://www.byobu.org) is a command-line tool that allows you to use |
| 11 | use numerous screens within a single terminal emulator instance. More | 11 | numerous screens within a single terminal emulator instance. More specifically, |
| 12 | specifically, it\'s a text based window manager, using either | 12 | it's a text based window manager, using either `screen` or `tmux`. |
| 13 | `screen` or `tmux`. | ||
| 14 | 13 | ||
| 15 | This post is mostly just a self-reference as I explore byobu, so I may | 14 | This post is mostly just a self-reference as I explore byobu, so I may come back |
| 16 | come back later and update this post with more content. | 15 | later and update this post with more content. |
| 17 | 16 | ||
| 18 | ## Screenshot | 17 | ## Screenshot |
| 19 | 18 | ||
| 20 | Take a look below at my current multi-window set-up in byobu while I | 19 | Take a look below at my current multi-window set-up in byobu while I write this |
| 21 | write this blog post: | 20 | blog post: |
| 22 | 21 | ||
| 23 |  | 22 |  |
| 24 | 23 | ||
| 25 | ### Keybindings | 24 | ### Keybindings |
| 26 | 25 | ||
| 27 | You can open the help menu with either of the following commands; they | 26 | You can open the help menu with either of the following commands; they will both |
| 28 | will both open the same manpage: | 27 | open the same manpage: |
| 29 | 28 | ||
| 30 | ```sh | 29 | ```sh |
| 31 | byobu --help | 30 | byobu --help |
| @@ -33,9 +32,9 @@ byobu --help | |||
| 33 | man byobu | 32 | man byobu |
| 34 | ``` | 33 | ``` |
| 35 | 34 | ||
| 36 | While the manpage contains a ton of information about the functionality | 35 | While the manpage contains a ton of information about the functionality of byobu |
| 37 | of byobu (such as status notifications, sessions, and windows), the | 36 | (such as status notifications, sessions, and windows), the first location to |
| 38 | first location to explore should be the keybindings section. | 37 | explore should be the keybindings section. |
| 39 | 38 | ||
| 40 | The keybindings are configured as follows: | 39 | The keybindings are configured as follows: |
| 41 | 40 | ||
content/blog/2023-06-23-self-hosting-convos.md +43 −51
| @@ -7,36 +7,32 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Convos | 8 | # Convos |
| 9 | 9 | ||
| 10 | [Convos](https://convos.chat/) is an always-online web client for IRC. | 10 | [Convos](https://convos.chat/) is an always-online web client for IRC. It has a |
| 11 | It has a few features that made it attractive to me as a self-hosted | 11 | few features that made it attractive to me as a self-hosted option: |
| 12 | option: | 12 | |
| 13 | 13 | - Extremely simple Docker Compose installation method. | |
| 14 | - Extremely simple Docker Compose installation method. | 14 | - Runs in the background and monitors chats even while you're not logged in. |
| 15 | - Runs in the background and monitors chats even while you\'re not | 15 | - Neatly organized sidebar for conversation and client settings. |
| 16 | logged in. | 16 | - Ability to connect to different hosts and create profiles for hosts. |
| 17 | - Neatly organized sidebar for conversation and client settings. | 17 | - By default, registration is closed to the public. You can enable public |
| 18 | - Ability to connect to different hosts and create profiles for hosts. | 18 | registration on the Settings page or generate invitation links on the Users |
| 19 | - By default, registration is closed to the public. You can enable | 19 | page. |
| 20 | public registration on the Settings page or generate invitation | 20 | - Customization of the client theme, organization name and URL, admin email, and |
| 21 | links on the Users page. | 21 | video service. |
| 22 | - Customization of the client theme, organization name and URL, admin | ||
| 23 | email, and video service. | ||
| 24 | 22 | ||
| 25 | # Docker Installation | 23 | # Docker Installation |
| 26 | 24 | ||
| 27 | To install Convos, simply create a directory and a | 25 | To install Convos, simply create a directory and a `docker-compose.yml` file: |
| 28 | `docker-compose.yml` file: | ||
| 29 | 26 | ||
| 30 | ```sh | 27 | ```sh |
| 31 | mkdir ~/convos && cd ~/convos | 28 | mkdir ~/convos && cd ~/convos |
| 32 | nano docker-compose.yml | 29 | nano docker-compose.yml |
| 33 | ``` | 30 | ``` |
| 34 | 31 | ||
| 35 | With the `docker-compose.yml` file open, paste the | 32 | With the `docker-compose.yml` file open, paste the configuration below into the |
| 36 | configuration below into the file. You can customize the host port to be | 33 | file. You can customize the host port to be something unique, such as |
| 37 | something unique, such as `21897:3000`. You can also change | 34 | `21897:3000`. You can also change the `data` folder to be a docker volume |
| 38 | the `data` folder to be a docker volume instead, if you | 35 | instead, if you prefer. |
| 39 | prefer. | ||
| 40 | 36 | ||
| 41 | ``` config | 37 | ``` config |
| 42 | version: '3' | 38 | version: '3' |
| @@ -53,29 +49,27 @@ services: | |||
| 53 | restart: always | 49 | restart: always |
| 54 | ``` | 50 | ``` |
| 55 | 51 | ||
| 56 | Save the `docker-compose.yml` file and bring the container | 52 | Save the `docker-compose.yml` file and bring the container up: |
| 57 | up: | ||
| 58 | 53 | ||
| 59 | ```sh | 54 | ```sh |
| 60 | sudo docker-compose up -d | 55 | sudo docker-compose up -d |
| 61 | ``` | 56 | ``` |
| 62 | 57 | ||
| 63 | At this point, Convos is available at `<server_ip>:3000` but | 58 | At this point, Convos is available at `<server_ip>:3000` but not available to |
| 64 | not available to the public. | 59 | the public. |
| 65 | 60 | ||
| 66 | # Nginx Reverse Proxy | 61 | # Nginx Reverse Proxy |
| 67 | 62 | ||
| 68 | If you\'re using Nginx, you can create a configuration file for the | 63 | If you're using Nginx, you can create a configuration file for the convos |
| 69 | convos application. Start by opening the file: | 64 | application. Start by opening the file: |
| 70 | 65 | ||
| 71 | ```sh | 66 | ```sh |
| 72 | nano /etc/nginx/sites-available/convos | 67 | nano /etc/nginx/sites-available/convos |
| 73 | ``` | 68 | ``` |
| 74 | 69 | ||
| 75 | Within the nginx configuration file, paste the following content and be | 70 | Within the nginx configuration file, paste the following content and be sure to |
| 76 | sure to update `convos.example.com` to match your domain and | 71 | update `convos.example.com` to match your domain and `127.0.0.1:3000` to match |
| 77 | `127.0.0.1:3000` to match the port you opened in the | 72 | the port you opened in the `docker-compose.yml` file. |
| 78 | `docker-compose.yml` file. | ||
| 79 | 73 | ||
| 80 | ``` config | 74 | ``` config |
| 81 | # Host and port where convos is running | 75 | # Host and port where convos is running |
| @@ -117,8 +111,8 @@ server { | |||
| 117 | } | 111 | } |
| 118 | ``` | 112 | ``` |
| 119 | 113 | ||
| 120 | Once the file is saved, link it to the `sites-enabled` | 114 | Once the file is saved, link it to the `sites-enabled` directory and restart |
| 121 | directory and restart Nginx. | 115 | Nginx. |
| 122 | 116 | ||
| 123 | ```sh | 117 | ```sh |
| 124 | sudo ln -s /etc/nginx/sites-available/convos /etc/nginx/sites-enabled/convos | 118 | sudo ln -s /etc/nginx/sites-available/convos /etc/nginx/sites-enabled/convos |
| @@ -127,43 +121,41 @@ sudo systemctl restart nginx.service | |||
| 127 | 121 | ||
| 128 | # Screenshots | 122 | # Screenshots |
| 129 | 123 | ||
| 130 | See the screenshots below for an example of the Convos homepage and an | 124 | See the screenshots below for an example of the Convos homepage and an excerpt |
| 131 | excerpt of the chat screen. | 125 | of the chat screen. |
| 132 | 126 | ||
| 133 | There are numerous themes to choose from; the theme shown in the images | 127 | There are numerous themes to choose from; the theme shown in the images below is |
| 134 | below is Dracula. | 128 | Dracula. |
| 135 | 129 | ||
| 136 |  |
| 137 | Home](https://img.cleberg.net/blog/20230623-convos/convos_home.png) | ||
| 138 | 131 | ||
| 139 |  |
| 140 | Chat](https://img.cleberg.net/blog/20230623-convos/convos_chat.png) | ||
| 141 | 133 | ||
| 142 | # Registering a Nickname | 134 | # Registering a Nickname |
| 143 | 135 | ||
| 144 | Hop into the server channel so that you can message NickServ. In the | 136 | Hop into the server channel so that you can message NickServ. In the case of |
| 145 | case of Convos, the default sever is libera.chat. Simply click the | 137 | Convos, the default sever is libera.chat. Simply click the `libera` conversation |
| 146 | `libera` conversation at the top of the sidebar to open it. | 138 | at the top of the sidebar to open it. Once the chat is open, you can claim a |
| 147 | Once the chat is open, you can claim a nickname by typing: | 139 | nickname by typing: |
| 148 | 140 | ||
| 149 | ``` txt | 141 | ``` txt |
| 150 | /nick <nick> | 142 | /nick <nick> |
| 151 | ``` | 143 | ``` |
| 152 | 144 | ||
| 153 | If the nickname is available, and you\'d like to register the nickname | 145 | If the nickname is available, and you'd like to register the nickname to |
| 154 | to yourself, you\'ll need to type another command: | 146 | yourself, you'll need to type another command: |
| 155 | 147 | ||
| 156 | ``` txt | 148 | ``` txt |
| 157 | /msg NickServ REGISTER | 149 | /msg NickServ REGISTER |
| 158 | <password> <email> | 150 | <password> <email> |
| 159 | ``` | 151 | ``` |
| 160 | 152 | ||
| 161 | On libera.chat, the server will send a confirmation email with a command | 153 | On libera.chat, the server will send a confirmation email with a command that |
| 162 | that you must message in IRC to verify registration of the nickname: | 154 | you must message in IRC to verify registration of the nickname: |
| 163 | 155 | ||
| 164 | ``` txt | 156 | ``` txt |
| 165 | /msg NickServ VERIFY REGISTER <nick> <verification_code> | 157 | /msg NickServ VERIFY REGISTER <nick> <verification_code> |
| 166 | ``` | 158 | ``` |
| 167 | 159 | ||
| 168 | Once entered, the server should confirm registration of the nickname to | 160 | Once entered, the server should confirm registration of the nickname to the |
| 169 | the supplied email with the password specified. | 161 | supplied email with the password specified. |
content/blog/2023-06-28-backblaze-b2.md +66 −74
| @@ -7,82 +7,77 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Overview | 8 | # Overview |
| 9 | 9 | ||
| 10 | Backblaze [B2 Cloud | 10 | Backblaze [B2 Cloud Storage](https://www.backblaze.com/b2/cloud-storage.html) is |
| 11 | Storage](https://www.backblaze.com/b2/cloud-storage.html) is an | 11 | an inexpensive and reliable on-demand cloud storage and backup solution. |
| 12 | inexpensive and reliable on-demand cloud storage and backup solution. | ||
| 13 | 12 | ||
| 14 | The service starts at \$5/TB/month (\$0.005/GB/month) with a download | 13 | The service starts at $5/TB/month ($0.005/GB/month) with a download rate of |
| 15 | rate of \$0.01/GB/month. | 14 | $0.01/GB/month. |
| 16 | 15 | ||
| 17 | However, there are free tiers: | 16 | However, there are free tiers: |
| 18 | 17 | ||
| 19 | - The first 10 GB of storage is free. | 18 | - The first 10 GB of storage is free. |
| 20 | - The first 1 GB of data downloaded each day is free. | 19 | - The first 1 GB of data downloaded each day is free. |
| 21 | - Class A transactions are free. | 20 | - Class A transactions are free. |
| 22 | - The first 2500 Class B transactions each day are free. | 21 | - The first 2500 Class B transactions each day are free. |
| 23 | - The first 2500 Class C transactions each day are free. | 22 | - The first 2500 Class C transactions each day are free. |
| 24 | 23 | ||
| 25 | You can see which API calls fall into categories A, B, or C here: | 24 | You can see which API calls fall into categories A, B, or C here: [Pricing |
| 26 | [Pricing Organized by API | 25 | Organized by API |
| 27 | Calls](https://www.backblaze.com/b2/b2-transactions-price.html). | 26 | Calls](https://www.backblaze.com/b2/b2-transactions-price.html). |
| 28 | 27 | ||
| 29 | For someone like me, who wants an offsite backup of their server\'s | 28 | For someone like me, who wants an offsite backup of their server's `/home/` |
| 30 | `/home/` directory and various other server configs that fall | 29 | directory and various other server configs that fall under 10 GB total, |
| 31 | under 10 GB total, Backblaze is a great solution from a financial | 30 | Backblaze is a great solution from a financial perspective. |
| 32 | perspective. | ||
| 33 | 31 | ||
| 34 | # Create An Account | 32 | # Create An Account |
| 35 | 33 | ||
| 36 | To start with Backblaze, you\'ll need to [create a free | 34 | To start with Backblaze, you'll need to [create a free |
| 37 | account](https://www.backblaze.com/b2/sign-up.html) - no payment method | 35 | account](https://www.backblaze.com/b2/sign-up.html) - no payment method is |
| 38 | is required to sign up. | 36 | required to sign up. |
| 39 | 37 | ||
| 40 | Once you have an account, you can test out the service with their web | 38 | Once you have an account, you can test out the service with their web GUI, their |
| 41 | GUI, their mobile app, or their CLI tool. I\'m going to use the CLI tool | 39 | mobile app, or their CLI tool. I'm going to use the CLI tool below to test a |
| 42 | below to test a file upload and then sync an entire directory to my | 40 | file upload and then sync an entire directory to my Backblaze bucket. |
| 43 | Backblaze bucket. | ||
| 44 | 41 | ||
| 45 | # Create a Bucket | 42 | # Create a Bucket |
| 46 | 43 | ||
| 47 | Before you can start uploading, you need to create a bucket. If you\'re | 44 | Before you can start uploading, you need to create a bucket. If you're familiar |
| 48 | familiar with other object storage services, this will feel familiar. If | 45 | with other object storage services, this will feel familiar. If not, it's |
| 49 | not, it\'s pretty simple to create one. | 46 | pretty simple to create one. |
| 50 | 47 | ||
| 51 | As their webpage says: | 48 | As their webpage says: |
| 52 | 49 | ||
| 53 | > A bucket is a container that holds files that are uploaded into B2 | 50 | > A bucket is a container that holds files that are uploaded into B2 Cloud |
| 54 | > Cloud Storage. The bucket name must be globally unique and must have a | 51 | > Storage. The bucket name must be globally unique and must have a minimum of 6 |
| 55 | > minimum of 6 characters. A limit of 100 buckets may be created per | 52 | > characters. A limit of 100 buckets may be created per account. An unlimited |
| 56 | > account. An unlimited number of files may be uploaded into a bucket. | 53 | > number of files may be uploaded into a bucket. |
| 57 | 54 | ||
| 58 | Once you click the `Create a Bucket` button on their webpage | 55 | Once you click the `Create a Bucket` button on their webpage or mobile app, you |
| 59 | or mobile app, you need to provide the following: | 56 | need to provide the following: |
| 60 | 57 | ||
| 61 | - Bucket Unique Name | 58 | - Bucket Unique Name |
| 62 | - Files in Bucket are: `Private` or `Public` | 59 | - Files in Bucket are: `Private` or `Public` |
| 63 | - Default Encryption: `Disable` or `Enable` | 60 | - Default Encryption: `Disable` or `Enable` |
| 64 | - Object Lock: `Disable` or `Enable` | 61 | - Object Lock: `Disable` or `Enable` |
| 65 | 62 | ||
| 66 | For my bucket, I created a private bucket with encryption enabled and | 63 | For my bucket, I created a private bucket with encryption enabled and object |
| 67 | object lock disabled. | 64 | lock disabled. |
| 68 | 65 | ||
| 69 | Once your bucket is created, you can test the upload/download feature on | 66 | Once your bucket is created, you can test the upload/download feature on their |
| 70 | their web GUI or mobile app! At this point, you have a fully functional | 67 | web GUI or mobile app! At this point, you have a fully functional bucket and |
| 71 | bucket and account. | 68 | account. |
| 72 | 69 | ||
| 73 | # Linux CLI Tool | 70 | # Linux CLI Tool |
| 74 | 71 | ||
| 75 | ## Installation | 72 | ## Installation |
| 76 | 73 | ||
| 77 | To install the `b2` CLI tool, you\'ll need to download it | 74 | To install the `b2` CLI tool, you'll need to download it from the [CLI |
| 78 | from the [CLI | 75 | Tools](https://www.backblaze.com/docs/cloud-storage-command-line-tools) page. I |
| 79 | Tools](https://www.backblaze.com/docs/cloud-storage-command-line-tools) | 76 | recommend copying the URL from the link that says `Linux` and using wget to |
| 80 | page. I recommend copying the URL from the link that says | 77 | download it, as shown below. |
| 81 | `Linux` and using wget to download it, as shown below. | ||
| 82 | 78 | ||
| 83 | Once downloaded, make the file executable and move it to a location on | 79 | Once downloaded, make the file executable and move it to a location on your |
| 84 | your `$PATH`, so that you can execute that command from | 80 | `$PATH`, so that you can execute that command from anywhere on the machine. |
| 85 | anywhere on the machine. | ||
| 86 | 81 | ||
| 87 | ```sh | 82 | ```sh |
| 88 | wget <b2_cli_url> | 83 | wget <b2_cli_url> |
| @@ -93,12 +88,10 @@ mv b2_linux /usr/bin/b2 | |||
| 93 | ## Log In | 88 | ## Log In |
| 94 | 89 | ||
| 95 | The first step after installation is to log in. To do this, execute the | 90 | The first step after installation is to log in. To do this, execute the |
| 96 | following command and provide your `<applicationKeyId>` and | 91 | following command and provide your `<applicationKeyId>` and `<applicationKey>`. |
| 97 | `<applicationKey>`. | ||
| 98 | 92 | ||
| 99 | If you don\'t want to provide these values in the command itself, you | 93 | If you don't want to provide these values in the command itself, you can simply |
| 100 | can simply execute the base command and it will request them in an | 94 | execute the base command and it will request them in an interactive prompt. |
| 101 | interactive prompt. | ||
| 102 | 95 | ||
| 103 | ```sh | 96 | ```sh |
| 104 | # if you want to provide the keys directly: | 97 | # if you want to provide the keys directly: |
| @@ -110,9 +103,9 @@ b2 authorize-account | |||
| 110 | 103 | ||
| 111 | ## Upload a Test File | 104 | ## Upload a Test File |
| 112 | 105 | ||
| 113 | In order to test the functionality of the CLI tool, I\'ll start by | 106 | In order to test the functionality of the CLI tool, I'll start by uploading a |
| 114 | uploading a single test file to the bucket I created above. We can do | 107 | single test file to the bucket I created above. We can do this with the |
| 115 | this with the `upload_file` function. | 108 | `upload_file` function. |
| 116 | 109 | ||
| 117 | The command is issued as follows: | 110 | The command is issued as follows: |
| 118 | 111 | ||
| @@ -126,8 +119,8 @@ In my situation, I executed the following command with my username. | |||
| 126 | b2 upload_file my_unique_bucket /home/<user>/test.md test.md | 119 | b2 upload_file my_unique_bucket /home/<user>/test.md test.md |
| 127 | ``` | 120 | ``` |
| 128 | 121 | ||
| 129 | To confirm that the file was uploaded successfully, list the files in | 122 | To confirm that the file was uploaded successfully, list the files in your |
| 130 | your bucket: | 123 | bucket: |
| 131 | 124 | ||
| 132 | ```sh | 125 | ```sh |
| 133 | b2 ls <bucket_name> | 126 | b2 ls <bucket_name> |
| @@ -139,9 +132,9 @@ test.md | |||
| 139 | 132 | ||
| 140 | ## Sync a Directory | 133 | ## Sync a Directory |
| 141 | 134 | ||
| 142 | If you have numerous files, you can use the `sync` function | 135 | If you have numerous files, you can use the `sync` function to perform |
| 143 | to perform functionality similar to `rsync`, where you can | 136 | functionality similar to `rsync`, where you can check what's in your bucket and |
| 144 | check what\'s in your bucket and sync anything that is new or modified. | 137 | sync anything that is new or modified. |
| 145 | 138 | ||
| 146 | The command is issued as follows: | 139 | The command is issued as follows: |
| 147 | 140 | ||
| @@ -149,8 +142,8 @@ The command is issued as follows: | |||
| 149 | b2 sync <source file location> <B2 bucket destination> | 142 | b2 sync <source file location> <B2 bucket destination> |
| 150 | ``` | 143 | ``` |
| 151 | 144 | ||
| 152 | In my case, I can sync my user\'s entire home directory to my bucket | 145 | In my case, I can sync my user's entire home directory to my bucket without |
| 153 | without specifying any of the files directly: | 146 | specifying any of the files directly: |
| 154 | 147 | ||
| 155 | ```sh | 148 | ```sh |
| 156 | b2 sync /home/<user>/ "b2://<bucketName>/home/<user>" | 149 | b2 sync /home/<user>/ "b2://<bucketName>/home/<user>" |
| @@ -160,22 +153,21 @@ b2 sync /home/<user>/ "b2://<bucketName>/home/<user>" | |||
| 160 | 153 | ||
| 161 | ## Timing of Updates to the Web GUI | 154 | ## Timing of Updates to the Web GUI |
| 162 | 155 | ||
| 163 | When performing actions over a bucket, there is a slight delay in the | 156 | When performing actions over a bucket, there is a slight delay in the web GUI |
| 164 | web GUI when inspecting a bucket or its file. Note that simple actions | 157 | when inspecting a bucket or its file. Note that simple actions such as uploading |
| 165 | such as uploading or deleting files may have a delay of a few minutes up | 158 | or deleting files may have a delay of a few minutes up to 24 hours. In my |
| 166 | to 24 hours. In my experience (\<10 GB and \~20,000 files), any actions | 159 | experience (\<10 GB and ~20,000 files), any actions took only a few minutes to |
| 167 | took only a few minutes to update across clients. | 160 | update across clients. |
| 168 | 161 | ||
| 169 | ## Symlinks | 162 | ## Symlinks |
| 170 | 163 | ||
| 171 | Note that symlinks are resolved by b2, so if you have a link from | 164 | Note that symlinks are resolved by b2, so if you have a link from |
| 172 | `/home/<user>/nas-storage` that symlinks out to a | 165 | `/home/<user>/nas-storage` that symlinks out to a `/mnt/nas-storage` folder that |
| 173 | `/mnt/nas-storage` folder that has 10TB of data, | 166 | has 10TB of data, `b2` will resolve that link and start uploading all 10TB of |
| 174 | `b2` will resolve that link and start uploading all 10TB of | ||
| 175 | data linked within the folder. | 167 | data linked within the folder. |
| 176 | 168 | ||
| 177 | If you\'re not sure if you have any symlinks, a symlink will look like | 169 | If you're not sure if you have any symlinks, a symlink will look like this |
| 178 | this (note the `->` symbol): | 170 | (note the `->` symbol): |
| 179 | 171 | ||
| 180 | ```sh | 172 | ```sh |
| 181 | > ls -lha | 173 | > ls -lha |
content/blog/2023-06-30-self-hosting-voyager.md +24 −28
| @@ -7,12 +7,12 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Installation Guide | 8 | # Installation Guide |
| 9 | 9 | ||
| 10 | [Voyager](https://github.com/aeharding/voyager) is a mobile-first Lemmy | 10 | [Voyager](https://github.com/aeharding/voyager) is a mobile-first Lemmy web |
| 11 | web client, based on iOS design standards. It follows very closely to | 11 | client, based on iOS design standards. It follows very closely to Apollo's |
| 12 | Apollo\'s design. | 12 | design. |
| 13 | 13 | ||
| 14 | This post is a guide showing how I was able to build and launch my own | 14 | This post is a guide showing how I was able to build and launch my own instance |
| 15 | instance of Voyager via Docker Compose. | 15 | of Voyager via Docker Compose. |
| 16 | 16 | ||
| 17 | ## Clone the Repository | 17 | ## Clone the Repository |
| 18 | 18 | ||
| @@ -25,26 +25,24 @@ cd voyager | |||
| 25 | 25 | ||
| 26 | ## Build the Image | 26 | ## Build the Image |
| 27 | 27 | ||
| 28 | With this repository, you can build the image yourself without any | 28 | With this repository, you can build the image yourself without any further |
| 29 | further configuration. When complete, it\'ll give you the image ID for | 29 | configuration. When complete, it'll give you the image ID for you to run. |
| 30 | you to run. | ||
| 31 | 30 | ||
| 32 | ```sh | 31 | ```sh |
| 33 | sudo docker build . | 32 | sudo docker build . |
| 34 | # Successfully built 5f00723cb5be | 33 | # Successfully built 5f00723cb5be |
| 35 | ``` | 34 | ``` |
| 36 | 35 | ||
| 37 | With the image ID above, you can run the container and pass the | 36 | With the image ID above, you can run the container and pass the requested port |
| 38 | requested port `5314` through or use a custom port, if you | 37 | `5314` through or use a custom port, if you wish. |
| 39 | wish. | ||
| 40 | 38 | ||
| 41 | You can also set the `CUSTOM_LEMMY_SERVERS` environment | 39 | You can also set the `CUSTOM_LEMMY_SERVERS` environment variable if you want to |
| 42 | variable if you want to add to the default suggested login servers. This | 40 | add to the default suggested login servers. This must be set with a comma |
| 43 | must be set with a comma separated list of suggested servers. The first | 41 | separated list of suggested servers. The first instance in the list will be the |
| 44 | instance in the list will be the default view for logged-out users. | 42 | default view for logged-out users. |
| 45 | 43 | ||
| 46 | I will be using a `docker-compose.yml` file to run this | 44 | I will be using a `docker-compose.yml` file to run this container, instead of a |
| 47 | container, instead of a `docker run` command. | 45 | `docker run` command. |
| 48 | 46 | ||
| 49 | ```sh | 47 | ```sh |
| 50 | nano docker-compose.yml | 48 | nano docker-compose.yml |
| @@ -67,17 +65,16 @@ sudo docker-compose up -d | |||
| 67 | ``` | 65 | ``` |
| 68 | 66 | ||
| 69 | The web app will now be available at the following address: | 67 | The web app will now be available at the following address: |
| 70 | `<machine_ip>:<custom_port>`. If you are running it on your | 68 | `<machine_ip>:<custom_port>`. If you are running it on your local device, try |
| 71 | local device, try `localhost:<custom_port>`. | 69 | `localhost:<custom_port>`. |
| 72 | 70 | ||
| 73 | ## Reverse Proxy | 71 | ## Reverse Proxy |
| 74 | 72 | ||
| 75 | If you want to visit this app via an external URL or domain name, | 73 | If you want to visit this app via an external URL or domain name, you'll need |
| 76 | you\'ll need to set up a reverse proxy. The example below uses Nginx as | 74 | to set up a reverse proxy. The example below uses Nginx as a reverse proxy. |
| 77 | a reverse proxy. | ||
| 78 | 75 | ||
| 79 | Simply create the configuration file, paste the contents below, save the | 76 | Simply create the configuration file, paste the contents below, save the file, |
| 80 | file, symlink the file, and restart Nginx. | 77 | symlink the file, and restart Nginx. |
| 81 | 78 | ||
| 82 | ```sh | 79 | ```sh |
| 83 | sudo nano /etc/nginx/sites-available/voyager | 80 | sudo nano /etc/nginx/sites-available/voyager |
| @@ -120,8 +117,7 @@ sudo ln sudo ln -s /etc/nginx/sites-available/voyager /etc/nginx/sites-enabled/v | |||
| 120 | sudo systemctl restart nginx.service | 117 | sudo systemctl restart nginx.service |
| 121 | ``` | 118 | ``` |
| 122 | 119 | ||
| 123 | The site will now be available at the `server_name` you | 120 | The site will now be available at the `server_name` you specified above! |
| 124 | specified above! | ||
| 125 | 121 | ||
| 126 | You can visit my instance at | 122 | You can visit my instance at [voyager.cleberg.net](https://voyager.cleberg.net) |
| 127 | [voyager.cleberg.net](https://voyager.cleberg.net) for an example. | 123 | for an example. |
content/blog/2023-07-12-wireguard-lan.md +29 −33
| @@ -7,13 +7,13 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Download Configuration Files from Mullvad | 8 | # Download Configuration Files from Mullvad |
| 9 | 9 | ||
| 10 | To begin, you\'ll need [Wireguard configuration files from | 10 | To begin, you'll need [Wireguard configuration files from |
| 11 | Mullvad](https://mullvad.net/account/wireguard-config). You can choose | 11 | Mullvad](https://mullvad.net/account/wireguard-config). You can choose any of |
| 12 | any of the options as you download them. For example, I enabled the kill | 12 | the options as you download them. For example, I enabled the kill switch, |
| 13 | switch, selected all countries, and selected a few content filters. | 13 | selected all countries, and selected a few content filters. |
| 14 | 14 | ||
| 15 | Once downloaded, unzip the files and move them to the Wireguard folder | 15 | Once downloaded, unzip the files and move them to the Wireguard folder on your |
| 16 | on your system. | 16 | system. |
| 17 | 17 | ||
| 18 | ```sh | 18 | ```sh |
| 19 | cd ~/Downloads | 19 | cd ~/Downloads |
| @@ -40,41 +40,38 @@ AllowedIPs = <redacted> | |||
| 40 | Endpoint = <redacted> | 40 | Endpoint = <redacted> |
| 41 | ``` | 41 | ``` |
| 42 | 42 | ||
| 43 | > Note: If you didn\'t select the kill switch option, you won\'t see the | 43 | > Note: If you didn't select the kill switch option, you won't see the |
| 44 | > `PostUp` and `PreDown` lines. In this case, | 44 | > `PostUp` and `PreDown` lines. In this case, you'll need to modify the script |
| 45 | > you\'ll need to modify the script below to simply append those lines | 45 | > below to simply append those lines to the `[Interface]` block. |
| 46 | > to the `[Interface]` block. | ||
| 47 | 46 | ||
| 48 | # Editing the Configuration Files | 47 | # Editing the Configuration Files |
| 49 | 48 | ||
| 50 | Once you have the files, you\'ll need to edit them and replace the | 49 | Once you have the files, you'll need to edit them and replace the `PostUp` and |
| 51 | `PostUp` and `PreDown` lines to enable LAN access. | 50 | `PreDown` lines to enable LAN access. |
| 52 | 51 | ||
| 53 | I recommend that you do this process as root, since you\'ll need to be | 52 | I recommend that you do this process as root, since you'll need to be able to |
| 54 | able to access files in `/etc/wireguard`, which are generally | 53 | access files in `/etc/wireguard`, which are generally owned by root. You can |
| 55 | owned by root. You can also try using `sudo` or | 54 | also try using `sudo` or `doas`, but I didn't test that scenario so you may |
| 56 | `doas`, but I didn\'t test that scenario so you may need to | 55 | need to adjust, as necessary. |
| 57 | adjust, as necessary. | ||
| 58 | 56 | ||
| 59 | ```sh | 57 | ```sh |
| 60 | su | 58 | su |
| 61 | ``` | 59 | ``` |
| 62 | 60 | ||
| 63 | Create the Python file that we\'ll be using to update the Wireguard | 61 | Create the Python file that we'll be using to update the Wireguard |
| 64 | configuration files. | 62 | configuration files. |
| 65 | 63 | ||
| 66 | ```sh | 64 | ```sh |
| 67 | nano replace.py | 65 | nano replace.py |
| 68 | ``` | 66 | ``` |
| 69 | 67 | ||
| 70 | Within the Python file, copy and paste the logic below. This script will | 68 | Within the Python file, copy and paste the logic below. This script will open a |
| 71 | open a directory, loop through every configuration file within the | 69 | directory, loop through every configuration file within the directory, and |
| 72 | directory, and replace the `PostUp` and `PreDown` | 70 | replace the `PostUp` and `PreDown` lines with the new LAN-enabled iptables |
| 73 | lines with the new LAN-enabled iptables commands. | 71 | commands. |
| 74 | 72 | ||
| 75 | > Note: If your LAN is on a subnet other than | 73 | > Note: If your LAN is on a subnet other than `192.168.1.0/24`, you'll need to |
| 76 | > `192.168.1.0/24`, you\'ll need to update the Python script | 74 | > update the Python script below appropriately. |
| 77 | > below appropriately. | ||
| 78 | 75 | ||
| 79 | ``` python | 76 | ``` python |
| 80 | import os | 77 | import os |
| @@ -97,15 +94,15 @@ for file in os.listdir(dir): | |||
| 97 | print("--- done ---") | 94 | print("--- done ---") |
| 98 | ``` | 95 | ``` |
| 99 | 96 | ||
| 100 | Once you\'re done, save and close the file. You can now run the Python | 97 | Once you're done, save and close the file. You can now run the Python script |
| 101 | script and watch as each file is updated. | 98 | and watch as each file is updated. |
| 102 | 99 | ||
| 103 | ```sh | 100 | ```sh |
| 104 | python3 replace.py | 101 | python3 replace.py |
| 105 | ``` | 102 | ``` |
| 106 | 103 | ||
| 107 | To confirm it worked, you can `cat` one of the configuration | 104 | To confirm it worked, you can `cat` one of the configuration files to inspect |
| 108 | files to inspect the new logic and connect to one to test it out. | 105 | the new logic and connect to one to test it out. |
| 109 | 106 | ||
| 110 | ```sh | 107 | ```sh |
| 111 | cat /etc/wireguard/us-chi-wg-001.conf | 108 | cat /etc/wireguard/us-chi-wg-001.conf |
| @@ -128,16 +125,15 @@ AllowedIPs = <redacted> | |||
| 128 | Endpoint = <redacted> | 125 | Endpoint = <redacted> |
| 129 | ``` | 126 | ``` |
| 130 | 127 | ||
| 131 | If you connect to a Wireguard interface, such as | 128 | If you connect to a Wireguard interface, such as `us-chi-wg-001`, you can test |
| 132 | `us-chi-wg-001`, you can test your SSH functionality and see | 129 | your SSH functionality and see that it works even while on the VPN. |
| 133 | that it works even while on the VPN. | ||
| 134 | 130 | ||
| 135 | ```sh | 131 | ```sh |
| 136 | wg-quick up us-chi-wg-001 | 132 | wg-quick up us-chi-wg-001 |
| 137 | ssh user@lan-host | 133 | ssh user@lan-host |
| 138 | ``` | 134 | ``` |
| 139 | 135 | ||
| 140 | To confirm your VPN connection, you can curl Mullvad\'s connection API: | 136 | To confirm your VPN connection, you can curl Mullvad's connection API: |
| 141 | 137 | ||
| 142 | ```sh | 138 | ```sh |
| 143 | curl https://am.i.mullvad.net/connected | 139 | curl https://am.i.mullvad.net/connected |
content/blog/2023-07-19-plex-transcoder-errors.md +17 −21
| @@ -7,9 +7,8 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Plex Transcoder Error | 8 | # Plex Transcoder Error |
| 9 | 9 | ||
| 10 | Occasionally, you may see an error in your Plex client that references a | 10 | Occasionally, you may see an error in your Plex client that references a failure |
| 11 | failure with the transcoder conversion process. The specific error | 11 | with the transcoder conversion process. The specific error wording is: |
| 12 | wording is: | ||
| 13 | 12 | ||
| 14 | ``` txt | 13 | ``` txt |
| 15 | Conversion failed. The transcoder failed to start up. | 14 | Conversion failed. The transcoder failed to start up. |
| @@ -17,14 +16,13 @@ Conversion failed. The transcoder failed to start up. | |||
| 17 | 16 | ||
| 18 | # Debugging the Cause | 17 | # Debugging the Cause |
| 19 | 18 | ||
| 20 | In order to get a better look at what is causing the error, I\'m going | 19 | In order to get a better look at what is causing the error, I'm going to |
| 21 | to observe the Plex console while the error occurs. To do this, open the | 20 | observe the Plex console while the error occurs. To do this, open the Plex web |
| 22 | Plex web client, go to `Settings` \> `Manage` \> | 21 | client, go to `Settings` > `Manage` > `Console`. Now, try to play the title |
| 23 | `Console`. Now, try to play the title again and watch to see | 22 | again and watch to see which errors occur. |
| 24 | which errors occur. | ||
| 25 | 23 | ||
| 26 | In my case, you can see the errors below are related to a subtitle file | 24 | In my case, you can see the errors below are related to a subtitle file (`.srt`) |
| 27 | (`.srt`) causing the transcoder to crash. | 25 | causing the transcoder to crash. |
| 28 | 26 | ||
| 29 | ``` txt | 27 | ``` txt |
| 30 | Jul 19, 2023 16:49:34.945 [140184571120440] Error — Couldn't find the file to stream: /movies/Movie Title (2021)/Movie Title (2021).srt | 28 | Jul 19, 2023 16:49:34.945 [140184571120440] Error — Couldn't find the file to stream: /movies/Movie Title (2021)/Movie Title (2021).srt |
| @@ -36,17 +34,17 @@ Jul 19, 2023 16:51:23.402 [140184510081848] Info — Library section 1 (Movies) | |||
| 36 | 34 | ||
| 37 | # Solving the Error | 35 | # Solving the Error |
| 38 | 36 | ||
| 39 | In my case, I simply removed the subtitle file because it was not | 37 | In my case, I simply removed the subtitle file because it was not critical to |
| 40 | critical to keep. You may also avoid this by turning off subtitles if | 38 | keep. You may also avoid this by turning off subtitles if you don't want to |
| 41 | you don\'t want to delete the file. | 39 | delete the file. |
| 42 | 40 | ||
| 43 | ```sh | 41 | ```sh |
| 44 | rm -rf "/movies/Movie Title (2021)/Movie Title (2021).srt" | 42 | rm -rf "/movies/Movie Title (2021)/Movie Title (2021).srt" |
| 45 | ``` | 43 | ``` |
| 46 | 44 | ||
| 47 | Once the subtitle is removed from the directory or subtitles are turned | 45 | Once the subtitle is removed from the directory or subtitles are turned off, try |
| 48 | off, try to play the title again. At this point, it should play without | 46 | to play the title again. At this point, it should play without error. If not, |
| 49 | error. If not, reopen or refresh your Plex client and the Plex server: | 47 | reopen or refresh your Plex client and the Plex server: |
| 50 | 48 | ||
| 51 | ```sh | 49 | ```sh |
| 52 | sudo systemctl restart plexmediaserver.service | 50 | sudo systemctl restart plexmediaserver.service |
| @@ -56,10 +54,8 @@ sudo systemctl restart plexmediaserver.service | |||
| 56 | 54 | ||
| 57 | Looking at [a related Plex forum | 55 | Looking at [a related Plex forum |
| 58 | post](https://forums.plex.tv/t/subtitles-crashing-plex-transcoder-samsung-q80-tv-with-or-without-hardware-transcode/741441/2), | 56 | post](https://forums.plex.tv/t/subtitles-crashing-plex-transcoder-samsung-q80-tv-with-or-without-hardware-transcode/741441/2), |
| 59 | it seems that `.srt` subtitles are the core issue here. | 57 | it seems that `.srt` subtitles are the core issue here. However, Plex does not |
| 60 | However, Plex does not seem to have a resolution that fixes these | 58 | seem to have a resolution that fixes these errors. |
| 61 | errors. | ||
| 62 | 59 | ||
| 63 | Unfortunately, I would suggest converting subtitle formats, burning the | 60 | Unfortunately, I would suggest converting subtitle formats, burning the |
| 64 | subtitles into the title, or simply removing subtitles when they cause | 61 | subtitles into the title, or simply removing subtitles when they cause crashes. |
| 65 | crashes. | ||
content/blog/2023-08-18-agile-auditing.md +101 −110
| @@ -8,152 +8,143 @@ draft = false | |||
| 8 | # What is Agile Auditing? | 8 | # What is Agile Auditing? |
| 9 | 9 | ||
| 10 | [Agile](https://en.wikipedia.org/wiki/Agile_software_development), the | 10 | [Agile](https://en.wikipedia.org/wiki/Agile_software_development), the |
| 11 | collaborative philosophy behind many software development methods, has | 11 | collaborative philosophy behind many software development methods, has been |
| 12 | been picking up steam as a beneficial tool to use in the external and | 12 | picking up steam as a beneficial tool to use in the external and internal |
| 13 | internal auditing world. | 13 | auditing world. |
| 14 | 14 | ||
| 15 | This blog post will walk through commonly used terms within Agile, | 15 | This blog post will walk through commonly used terms within Agile, Scrum, and |
| 16 | Scrum, and Kanban in order to translate these terms and roles into | 16 | Kanban in order to translate these terms and roles into audit-specific terms. |
| 17 | audit-specific terms. | ||
| 18 | 17 | ||
| 19 | Whether your team is in charge of a financial statement audit, an | 18 | Whether your team is in charge of a financial statement audit, an attestation |
| 20 | attestation (SOC 1, SOC 2, etc.), or a unique internal audit, the terms | 19 | (SOC 1, SOC 2, etc.), or a unique internal audit, the terms used throughout this |
| 21 | used throughout this post should still apply. | 20 | post should still apply. |
| 22 | 21 | ||
| 23 | # Agile | 22 | # Agile |
| 24 | 23 | ||
| 25 | To start, I\'ll take a look at Agile. | 24 | To start, I'll take a look at Agile. |
| 26 | 25 | ||
| 27 | > The Agile methodology is a project management approach that involves | 26 | > The Agile methodology is a project management approach that involves breaking |
| 28 | > breaking the project into phases and emphasizes continuous | 27 | > the project into phases and emphasizes continuous collaboration and |
| 29 | > collaboration and improvement. Teams follow a cycle of planning, | 28 | > improvement. Teams follow a cycle of planning, executing, and evaluating. |
| 30 | > executing, and evaluating. | ||
| 31 | 29 | ||
| 32 | While this approach may seem familiar to what audit teams have | 30 | While this approach may seem familiar to what audit teams have historically |
| 33 | historically done, an audit team must make distinct changes in their | 31 | done, an audit team must make distinct changes in their mentality and how they |
| 34 | mentality and how they approach and manage a project. | 32 | approach and manage a project. |
| 35 | 33 | ||
| 36 | ## Agile Values | 34 | ## Agile Values |
| 37 | 35 | ||
| 38 | The Agile Manifesto, written in 2001 at a summit in Utah, contain a set | 36 | The Agile Manifesto, written in 2001 at a summit in Utah, contain a set of four |
| 39 | of four main values that comprise the Agile approach: | 37 | main values that comprise the Agile approach: |
| 40 | 38 | ||
| 41 | 1. Individuals and interactions over processes and tools. | 39 | 1. Individuals and interactions over processes and tools. |
| 42 | 2. Working software over comprehensive documentation. | 40 | 2. Working software over comprehensive documentation. |
| 43 | 3. Customer collaboration over contract negotiation. | 41 | 3. Customer collaboration over contract negotiation. |
| 44 | 4. Responding to change over following a plan. | 42 | 4. Responding to change over following a plan. |
| 45 | 43 | ||
| 46 | Beyond the four values, [twelve | 44 | Beyond the four values, [twelve |
| 47 | principles](https://agilemanifesto.org/principles.html) were also | 45 | principles](https://agilemanifesto.org/principles.html) were also written as |
| 48 | written as part of the summit. | 46 | part of the summit. |
| 49 | 47 | ||
| 50 | In order to relate these values to an audit or attestation engagement, | 48 | In order to relate these values to an audit or attestation engagement, we need |
| 51 | we need to shift the focus from software development to the main goal of | 49 | to shift the focus from software development to the main goal of an engagement: |
| 52 | an engagement: completing sufficient audit testing to address to | 50 | completing sufficient audit testing to address to relevant risks over the |
| 53 | relevant risks over the processes and controls at hand. | 51 | processes and controls at hand. |
| 54 | 52 | ||
| 55 | Audit Examples: | 53 | Audit Examples: |
| 56 | 54 | ||
| 57 | - Engagement teams must value the team members, client contacts, and | 55 | - Engagement teams must value the team members, client contacts, and their |
| 58 | their interactions over the historical processes and tools that have | 56 | interactions over the historical processes and tools that have been used. |
| 59 | been used. | 57 | - Engagement teams must value a final report that contains sufficient audit |
| 60 | - Engagement teams must value a final report that contains sufficient | 58 | documentation over excessive documentation or scope creep. |
| 61 | audit documentation over excessive documentation or scope creep. | 59 | - Engagement teams must collaborate with the audit clients as much as feasible |
| 62 | - Engagement teams must collaborate with the audit clients as much as | 60 | to ensure that both sides are constantly updated with current knowledge of the |
| 63 | feasible to ensure that both sides are constantly updated with | 61 | engagement's status and any potential findings, rather than waiting for |
| 64 | current knowledge of the engagement\'s status and any potential | 62 | pre-set meetings or the end of the engagement to communicate. |
| 65 | findings, rather than waiting for pre-set meetings or the end of the | 63 | - Engagement teams must be able to respond to change in an engagement's |
| 66 | engagement to communicate. | 64 | schedule, scope, or environment to ensure that the project is completed in a |
| 67 | - Engagement teams must be able to respond to change in an | 65 | timely manner and that all relevant areas are tested. |
| 68 | engagement\'s schedule, scope, or environment to ensure that the | 66 | - In terms of an audit department's portfolio, they must be able to respond |
| 69 | project is completed in a timely manner and that all relevant areas | 67 | to changes in their company's or client's environment and be able to |
| 70 | are tested. | 68 | dynamically change their audit plan accordingly. |
| 71 | - In terms of an audit department\'s portfolio, they must be able | ||
| 72 | to respond to changes in their company\'s or client\'s | ||
| 73 | environment and be able to dynamically change their audit plan | ||
| 74 | accordingly. | ||
| 75 | 69 | ||
| 76 | # Scrum | 70 | # Scrum |
| 77 | 71 | ||
| 78 | The above section discusses the high-level details of the Agile | 72 | The above section discusses the high-level details of the Agile philosophy and |
| 79 | philosophy and how an audit team can potentially mold that mindset into | 73 | how an audit team can potentially mold that mindset into the audit world, but |
| 80 | the audit world, but how does a team implement these ideas? | 74 | how does a team implement these ideas? |
| 81 | 75 | ||
| 82 | There are many methods that use an Agile mindset, but I prefer | 76 | There are many methods that use an Agile mindset, but I prefer |
| 83 | [Scrum](https://en.wikipedia.org/wiki/Scrum_(software_development)). | 77 | [Scrum](https://en.wikipedia.org/wiki/Scrum_(software_development)). Scrum is a |
| 84 | Scrum is a framework based on Agile that enables a team to work through | 78 | framework based on Agile that enables a team to work through a project through a |
| 85 | a project through a series of roles, ceremonies, artifacts, and values. | 79 | series of roles, ceremonies, artifacts, and values. |
| 86 | 80 | ||
| 87 | Let\'s dive into each of these individually. | 81 | Let's dive into each of these individually. |
| 88 | 82 | ||
| 89 | ## Scrum Team | 83 | ## Scrum Team |
| 90 | 84 | ||
| 91 | A scrum project is only as good as the team running the project. | 85 | A scrum project is only as good as the team running the project. Standard scrum |
| 92 | Standard scrum teams are separated into three distinct areas: | 86 | teams are separated into three distinct areas: |
| 93 | 87 | ||
| 94 | 1. **Product Owner (Client Contact)**: The client contact is the audit | 88 | 1. **Product Owner (Client Contact)**: The client contact is the audit |
| 95 | equivalent of the product owner in Scrum. They are responsible for | 89 | equivalent of the product owner in Scrum. They are responsible for partnering |
| 96 | partnering with the engagement or audit team to ensure progress is | 90 | with the engagement or audit team to ensure progress is being made, |
| 97 | being made, priorities are established, and clear guidance is given | 91 | priorities are established, and clear guidance is given when questions or |
| 98 | when questions or findings arise within each sprint. | 92 | findings arise within each sprint. |
| 99 | 2. **Scrum Master (Engagement Lead)**: The engagement or audit team | 93 | 2. **Scrum Master (Engagement Lead)**: The engagement or audit team lead is |
| 100 | lead is responsible for coaching the team and the client contact on | 94 | responsible for coaching the team and the client contact on the scrum |
| 101 | the scrum process, tracking team progress against plan, scheduling | 95 | process, tracking team progress against plan, scheduling necessary resources, |
| 102 | necessary resources, and helping remove obstacles. | 96 | and helping remove obstacles. |
| 103 | 3. **Scrum Developers (Engagement Members)**: The engagement or audit | 97 | 3. **Scrum Developers (Engagement Members)**: The engagement or audit team is |
| 104 | team is the set of team members responsible for getting the work | 98 | the set of team members responsible for getting the work done. These team |
| 105 | done. These team members will work on each task, report progress, | 99 | members will work on each task, report progress, resolve obstacles, and |
| 106 | resolve obstacles, and collaborate with other team members and the | 100 | collaborate with other team members and the client contact to ensure goals |
| 107 | client contact to ensure goals are being met. | 101 | are being met. |
| 108 | 102 | ||
| 109 | ## Scrum Ceremonies | 103 | ## Scrum Ceremonies |
| 110 | 104 | ||
| 111 | Scrum ceremonies are events that are performed on a regular basis. | 105 | Scrum ceremonies are events that are performed on a regular basis. |
| 112 | 106 | ||
| 113 | 1. **Sprint Planning**: The team works together to plan the upcoming | 107 | 1. **Sprint Planning**: The team works together to plan the upcoming sprint goal |
| 114 | sprint goal and which user stories (tasks) will be added to the | 108 | and which user stories (tasks) will be added to the sprint to achieve that |
| 115 | sprint to achieve that goal. | 109 | goal. |
| 116 | 2. **Sprint**: The time period, typically at least one week and no more | 110 | 2. **Sprint**: The time period, typically at least one week and no more than one |
| 117 | than one month in length, where the team works on the stories and | 111 | month in length, where the team works on the stories and anything in the |
| 118 | anything in the backlog. | 112 | backlog. |
| 119 | 3. **Daily Scrum**: A very short meeting held each day, typically 15 | 113 | 3. **Daily Scrum**: A very short meeting held each day, typically 15 minutes, to |
| 120 | minutes, to quickly emphasize alignment on the sprint goal and plan | 114 | quickly emphasize alignment on the sprint goal and plan the next 24 hours. |
| 121 | the next 24 hours. Each team member may share what they did the day | 115 | Each team member may share what they did the day before, what they'll do |
| 122 | before, what they\'ll do today, and any obstacles to their work. | 116 | today, and any obstacles to their work. |
| 123 | 4. **Sprint Review**: At the end of each sprint, the team will gather | 117 | 4. **Sprint Review**: At the end of each sprint, the team will gather and |
| 124 | and discuss the progress, obstacles, and backlog from the previous | 118 | discuss the progress, obstacles, and backlog from the previous sprint. |
| 125 | sprint. | 119 | 5. **Sprint Retrospective**: More specific than the sprint review, the |
| 126 | 5. **Sprint Retrospective**: More specific than the sprint review, the | 120 | retrospective is meant to discuss what worked and what did not work during |
| 127 | retrospective is meant to discuss what worked and what did not work | 121 | the sprint. This may be processes, tools, people, or even things related to |
| 128 | during the sprint. This may be processes, tools, people, or even | 122 | the Scrum ceremonies. |
| 129 | things related to the Scrum ceremonies. | 123 | |
| 130 | 124 | One additional ceremony that may be applicable is organizing the backlog. This | |
| 131 | One additional ceremony that may be applicable is organizing the | 125 | is typically the responsibility of the engagement leader and is meant to |
| 132 | backlog. This is typically the responsibility of the engagement leader | 126 | prioritize and clarify what needs to be done to complete items in the backlog. |
| 133 | and is meant to prioritize and clarify what needs to be done to complete | ||
| 134 | items in the backlog. | ||
| 135 | 127 | ||
| 136 | ## Artifacts | 128 | ## Artifacts |
| 137 | 129 | ||
| 138 | While artifacts are generally not customizable in the audit world (i.e., | 130 | While artifacts are generally not customizable in the audit world (i.e., each |
| 139 | each control test must include some kind of working paper with evidence | 131 | control test must include some kind of working paper with evidence supporting |
| 140 | supporting the test results), I wanted to include some quick notes on | 132 | the test results), I wanted to include some quick notes on associating scrum |
| 141 | associating scrum artifact terms with an audit. | 133 | artifact terms with an audit. |
| 142 | 134 | ||
| 143 | 1. **Product Backlog**: This is the overall backlog of unfinished audit | 135 | 1. **Product Backlog**: This is the overall backlog of unfinished audit tasks |
| 144 | tasks from all prior sprints. | 136 | from all prior sprints. |
| 145 | 2. **Sprint Backlog**: This is the backlog of unfinished audit tasks | 137 | 2. **Sprint Backlog**: This is the backlog of unfinished audit tasks from one |
| 146 | from one individual sprint. | 138 | individual sprint. |
| 147 | 3. **Increment**: This is the output of each sprint - generally this is | 139 | 3. **Increment**: This is the output of each sprint - generally this is best |
| 148 | best thought of as any documentation prepared during the sprint, | 140 | thought of as any documentation prepared during the sprint, such as risk |
| 149 | such as risk assessments, control working papers, deficiency | 141 | assessments, control working papers, deficiency analysis, etc. |
| 150 | analysis, etc. | ||
| 151 | 142 | ||
| 152 | # Kanban | 143 | # Kanban |
| 153 | 144 | ||
| 154 | Last but not least, Kanban is a methodology that relies on boards to | 145 | Last but not least, Kanban is a methodology that relies on boards to categorize |
| 155 | categorize work into distinct, descriptive categories that allow an | 146 | work into distinct, descriptive categories that allow an agile or scrum team to |
| 156 | agile or scrum team to effectively plan the work of a sprint or project. | 147 | effectively plan the work of a sprint or project. |
| 157 | 148 | ||
| 158 | See Atlassian\'s [Kanban](https://www.atlassian.com/agile/kanban) page | 149 | See Atlassian's [Kanban](https://www.atlassian.com/agile/kanban) page for more |
| 159 | for more information. | 150 | information. |
content/blog/2023-09-15-self-hosting-gitweb.md +11 −14
| @@ -7,14 +7,12 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Overview | 8 | # Overview |
| 9 | 9 | ||
| 10 | [GitWeb](https://git-scm.com/book/en/v2/Git-on-the-Server-GitWeb) is a | 10 | [GitWeb](https://git-scm.com/book/en/v2/Git-on-the-Server-GitWeb) is a simple |
| 11 | simple web-based visualizer for git repositories. By default, GitWeb | 11 | web-based visualizer for git repositories. By default, GitWeb will only run with |
| 12 | will only run with the `lighttpd` or `webrick` web | 12 | the `lighttpd` or `webrick` web servers. |
| 13 | servers. | ||
| 14 | 13 | ||
| 15 | However, this guide will show you how to keep GitWeb running in the | 14 | However, this guide will show you how to keep GitWeb running in the background |
| 16 | background and display information for all repositories in a chosen | 15 | and display information for all repositories in a chosen directory. |
| 17 | directory. | ||
| 18 | 16 | ||
| 19 | See below for the final result: | 17 | See below for the final result: |
| 20 | 18 | ||
| @@ -22,7 +20,7 @@ See below for the final result: | |||
| 22 | 20 | ||
| 23 | # Install Dependencies | 21 | # Install Dependencies |
| 24 | 22 | ||
| 25 | To start, you\'ll need install the following packages: | 23 | To start, you'll need install the following packages: |
| 26 | 24 | ||
| 27 | ```sh | 25 | ```sh |
| 28 | sudo apt install git gitweb fcgiwrap nginx | 26 | sudo apt install git gitweb fcgiwrap nginx |
| @@ -57,21 +55,20 @@ server { | |||
| 57 | } | 55 | } |
| 58 | ``` | 56 | ``` |
| 59 | 57 | ||
| 60 | To make the configuration active, you need to symlink it and then | 58 | To make the configuration active, you need to symlink it and then restart Nginx. |
| 61 | restart Nginx. | ||
| 62 | 59 | ||
| 63 | ```sh | 60 | ```sh |
| 64 | sudo ln -s /etc/nginx/sites-available/git.example.com /etc/nginx/sites-enabled/git.example.com | 61 | sudo ln -s /etc/nginx/sites-available/git.example.com /etc/nginx/sites-enabled/git.example.com |
| 65 | sudo systemctl restart nginx.service | 62 | sudo systemctl restart nginx.service |
| 66 | ``` | 63 | ``` |
| 67 | 64 | ||
| 68 | The GitWeb application should now be available via the URL you set in | 65 | The GitWeb application should now be available via the URL you set in the Nginx |
| 69 | the Nginx configuration above. | 66 | configuration above. |
| 70 | 67 | ||
| 71 | # Customize GitWeb | 68 | # Customize GitWeb |
| 72 | 69 | ||
| 73 | If you need to, you can customize many things about Gitweb by editing | 70 | If you need to, you can customize many things about Gitweb by editing the |
| 74 | the [gitweb.conf](https://git-scm.com/docs/gitweb.conf) file. | 71 | [gitweb.conf](https://git-scm.com/docs/gitweb.conf) file. |
| 75 | 72 | ||
| 76 | ```sh | 73 | ```sh |
| 77 | sudo nano /etc/gitweb.conf | 74 | sudo nano /etc/gitweb.conf |
content/blog/2023-09-19-audit-sql-scripts.md +33 −41
| @@ -7,17 +7,16 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Overview | 8 | # Overview |
| 9 | 9 | ||
| 10 | When you have to scope a database into your engagement, you may be | 10 | When you have to scope a database into your engagement, you may be curious how |
| 11 | curious how to best extract the information from the database. While | 11 | to best extract the information from the database. While there are numerous |
| 12 | there are numerous different methods to extract this type of | 12 | different methods to extract this type of information, I'm going to show an |
| 13 | information, I\'m going to show an example of how to gather all users | 13 | example of how to gather all users and privileges from three main database |
| 14 | and privileges from three main database types: Oracle, Microsoft SQL, | 14 | types: Oracle, Microsoft SQL, and MySQL. |
| 15 | and MySQL. | ||
| 16 | 15 | ||
| 17 | # Oracle | 16 | # Oracle |
| 18 | 17 | ||
| 19 | You can use the following SQL script to see all users and their | 18 | You can use the following SQL script to see all users and their privileges in an |
| 20 | privileges in an Oracle database: | 19 | Oracle database: |
| 21 | 20 | ||
| 22 | ``` sql | 21 | ``` sql |
| 23 | SELECT | 22 | SELECT |
| @@ -37,23 +36,21 @@ WHERE | |||
| 37 | grantee IN (SELECT DISTINCT grantee FROM dba_tab_privs); | 36 | grantee IN (SELECT DISTINCT grantee FROM dba_tab_privs); |
| 38 | ``` | 37 | ``` |
| 39 | 38 | ||
| 40 | This script queries the `dba_sys_privs` and | 39 | This script queries the `dba_sys_privs` and `dba_tab_privs` views to retrieve |
| 41 | `dba_tab_privs` views to retrieve system and table-level | 40 | system and table-level privileges respectively. It then combines the results |
| 42 | privileges respectively. It then combines the results using | 41 | using `UNION ALL` to show all users and their associated privileges. Please note |
| 43 | `UNION ALL` to show all users and their associated | 42 | that this method does not extract information from the `dba_role_privs` table - |
| 44 | privileges. Please note that this method does not extract information | 43 | use the method below for that data. |
| 45 | from the `dba_role_privs` table - use the method below for | ||
| 46 | that data. | ||
| 47 | 44 | ||
| 48 | Please note that you might need appropriate privileges (e.g., DBA | 45 | Please note that you might need appropriate privileges (e.g., DBA privileges) to |
| 49 | privileges) to access these views, and you should exercise caution when | 46 | access these views, and you should exercise caution when querying system tables |
| 50 | querying system tables in a production Oracle database. | 47 | in a production Oracle database. |
| 51 | 48 | ||
| 52 | ## Alternative Oracle Query | 49 | ## Alternative Oracle Query |
| 53 | 50 | ||
| 54 | You can also extract each table\'s information separately and perform | 51 | You can also extract each table's information separately and perform processing |
| 55 | processing outside the database to explore and determine the information | 52 | outside the database to explore and determine the information necessary for the |
| 56 | necessary for the audit: | 53 | audit: |
| 57 | 54 | ||
| 58 | ``` sql | 55 | ``` sql |
| 59 | SELECT ** FROM sys.dba_role_privs; | 56 | SELECT ** FROM sys.dba_role_privs; |
| @@ -64,9 +61,8 @@ SELECT ** FROM sys.dba_users; | |||
| 64 | 61 | ||
| 65 | # Microsoft SQL | 62 | # Microsoft SQL |
| 66 | 63 | ||
| 67 | You can use the following SQL script to see all users and their | 64 | You can use the following SQL script to see all users and their privileges in a |
| 68 | privileges in a Microsoft SQL Server database | 65 | Microsoft SQL Server database ([source](https://stackoverflow.com/a/30040784)): |
| 69 | ([source](https://stackoverflow.com/a/30040784)): | ||
| 70 | 66 | ||
| 71 | ``` sql | 67 | ``` sql |
| 72 | /* | 68 | /* |
| @@ -217,8 +213,8 @@ ORDER BY | |||
| 217 | 213 | ||
| 218 | # MySQL | 214 | # MySQL |
| 219 | 215 | ||
| 220 | You can use the following SQL script to see all users and their | 216 | You can use the following SQL script to see all users and their privileges in a |
| 221 | privileges in a MySQL database: | 217 | MySQL database: |
| 222 | 218 | ||
| 223 | ```sh | 219 | ```sh |
| 224 | mysql -u root -p | 220 | mysql -u root -p |
| @@ -230,26 +226,22 @@ Find all users and hosts with access to the database: | |||
| 230 | SELECT ** FROM information_schema.user_privileges; | 226 | SELECT ** FROM information_schema.user_privileges; |
| 231 | ``` | 227 | ``` |
| 232 | 228 | ||
| 233 | This script retrieves user information and their associated | 229 | This script retrieves user information and their associated database-level |
| 234 | database-level privileges from the | 230 | privileges from the `information_schema.user_privileges` table in MySQL. It |
| 235 | `information_schema.user_privileges` table in MySQL. It lists | 231 | lists various privileges such as SELECT, INSERT, UPDATE, DELETE, CREATE, and |
| 236 | various privileges such as SELECT, INSERT, UPDATE, DELETE, CREATE, and | ||
| 237 | more for each user and database combination. | 232 | more for each user and database combination. |
| 238 | 233 | ||
| 239 | Please note that you may need appropriate privileges (e.g., | 234 | Please note that you may need appropriate privileges (e.g., `SELECT` privileges |
| 240 | `SELECT` privileges on | 235 | on `information_schema.user_privileges`) to access this information in a MySQL |
| 241 | `information_schema.user_privileges`) to access this | 236 | database. Additionally, some privileges like GRANT OPTION, EXECUTE, EVENT, and |
| 242 | information in a MySQL database. Additionally, some privileges like | 237 | TRIGGER may not be relevant for all users and databases. |
| 243 | GRANT OPTION, EXECUTE, EVENT, and TRIGGER may not be relevant for all | ||
| 244 | users and databases. | ||
| 245 | 238 | ||
| 246 | ## Alternative MySQL Query | 239 | ## Alternative MySQL Query |
| 247 | 240 | ||
| 248 | You can also grab individual sets of data from MySQL if you prefer to | 241 | You can also grab individual sets of data from MySQL if you prefer to join them |
| 249 | join them after extraction. I have marked the queries below with | 242 | after extraction. I have marked the queries below with `SELECT ...` and excluded |
| 250 | `SELECT ...` and excluded most `WHERE` clauses for | 243 | most `WHERE` clauses for brevity. You should determine the relevant privileges |
| 251 | brevity. You should determine the relevant privileges in-scope and query | 244 | in-scope and query for those privileges to reduce the length of time to query. |
| 252 | for those privileges to reduce the length of time to query. | ||
| 253 | 245 | ||
| 254 | ``` sql | 246 | ``` sql |
| 255 | -- Global Permissions | 247 | -- Global Permissions |
content/blog/2023-10-04-digital-minimalism.md +65 −73
| @@ -5,103 +5,95 @@ description = "" | |||
| 5 | draft = false | 5 | draft = false |
| 6 | +++ | 6 | +++ |
| 7 | 7 | ||
| 8 | I\'ve written [a note about minimalism](file:///wiki/#digital-garden) | 8 | I've written [a note about minimalism](file:///wiki/#digital-garden) before, |
| 9 | before, but I wanted to dedicate some time to reflect on digital | 9 | but I wanted to dedicate some time to reflect on digital minimalism and how |
| 10 | minimalism and how I\'ve been able to minimize the impact of digital | 10 | I've been able to minimize the impact of digital devices in my life. |
| 11 | devices in my life. | 11 | |
| 12 | 12 | > These changes crept up on us and happened fast, before we had a chance to step | |
| 13 | > These changes crept up on us and happened fast, before we had a chance | 13 | > back and ask what we really wanted out of the rapid advances of the past |
| 14 | > to step back and ask what we really wanted out of the rapid advances | 14 | > decade. We added new technologies to the periphery of our experience for minor |
| 15 | > of the past decade. We added new technologies to the periphery of our | 15 | > reasons, then woke one morning to discover that they had colonized the core of |
| 16 | > experience for minor reasons, then woke one morning to discover that | 16 | > our daily life. We didn't, in other words, sign up for the digital world in |
| 17 | > they had colonized the core of our daily life. We didn\'t, in other | 17 | > which we're currently entrenched; we seem to have stumbled backward into it. |
| 18 | > words, sign up for the digital world in which we\'re currently | ||
| 19 | > entrenched; we seem to have stumbled backward into it. | ||
| 20 | > | 18 | > |
| 21 | > *(Digital Minimalism, 2019)* | 19 | > *(Digital Minimalism, 2019)* |
| 22 | 20 | ||
| 23 | # The Principles of Digital Minimalism | 21 | # The Principles of Digital Minimalism |
| 24 | 22 | ||
| 25 | As noted in Cal Newport\'s book, *Digital Minimalism*, there are three | 23 | As noted in Cal Newport's book, *Digital Minimalism*, there are three main |
| 26 | main principles to digital minimalism that I tend to agree with: | 24 | principles to digital minimalism that I tend to agree with: |
| 27 | 25 | ||
| 28 | 1. Clutter is costly. | 26 | 1. Clutter is costly. |
| 29 | - Digital minimalists recognize that cluttering their time and | 27 | - Digital minimalists recognize that cluttering their time and attention |
| 30 | attention with too many devices, apps, and services creates an | 28 | with too many devices, apps, and services creates an overall negative cost |
| 31 | overall negative cost that can swamp the small benefits that | 29 | that can swamp the small benefits that each individual item provides in |
| 32 | each individual item provides in isolation. | 30 | isolation. |
| 33 | 2. Optimization is important. | 31 | 2. Optimization is important. |
| 34 | - Digital minimalists believe that deciding a particular | 32 | - Digital minimalists believe that deciding a particular technology supports |
| 35 | technology supports something they value is only the first step. | 33 | something they value is only the first step. To truly extract its full |
| 36 | To truly extract its full potential benefit, it\'s necessary to | 34 | potential benefit, it's necessary to think carefully about how they'll |
| 37 | think carefully about how they\'ll use the technology. | 35 | use the technology. |
| 38 | 3. Intentionality is satisfying. | 36 | 3. Intentionality is satisfying. |
| 39 | - Digital minimalists derive significant satisfaction from their | 37 | - Digital minimalists derive significant satisfaction from their general |
| 40 | general commitment to being more intentional about how they | 38 | commitment to being more intentional about how they engage with new |
| 41 | engage with new technologies. This source of satisfaction is | 39 | technologies. This source of satisfaction is independent of the specific |
| 42 | independent of the specific decisions they make and is one of | 40 | decisions they make and is one of the biggest reasons that minimalism |
| 43 | the biggest reasons that minimalism tends to be immensely | 41 | tends to be immensely meaningful to its practitioners. |
| 44 | meaningful to its practitioners. | ||
| 45 | 42 | ||
| 46 | # Taking Action | 43 | # Taking Action |
| 47 | 44 | ||
| 48 | In order to put the logic into practice, I\'ve created a few new habits | 45 | In order to put the logic into practice, I've created a few new habits and |
| 49 | and continued performing old habits that are working well: | 46 | continued performing old habits that are working well: |
| 50 | 47 | ||
| 51 | ## Using Devices With Intention | 48 | ## Using Devices With Intention |
| 52 | 49 | ||
| 53 | - I already rarely use \"social media\", mostly limited to forums such | 50 | - I already rarely use "social media", mostly limited to forums such as Hacker |
| 54 | as Hacker News and Tildes, so I\'ve just tweaked my behavior to stop | 51 | News and Tildes, so I've just tweaked my behavior to stop looking for content |
| 55 | looking for content in those places when I\'m bored. | 52 | in those places when I'm bored. |
| 56 | - Use devices with intention. Each time I pick up a digital device, | 53 | - Use devices with intention. Each time I pick up a digital device, there should |
| 57 | there should be an intention to use the device to improve my current | 54 | be an intention to use the device to improve my current situation. No more |
| 58 | situation. No more endless scrolling or searching for something to | 55 | endless scrolling or searching for something to interest me. |
| 59 | interest me. | ||
| 60 | 56 | ||
| 61 | ## Prevent Distractions | 57 | ## Prevent Distractions |
| 62 | 58 | ||
| 63 | - Disable (most) notifications on all devices. I spent 15-30 minutes | 59 | - Disable (most) notifications on all devices. I spent 15-30 minutes going |
| 64 | going through the notifications on my phone, watch, and computer to | 60 | through the notifications on my phone, watch, and computer to ensure that only |
| 65 | ensure that only a select few apps have the ability to interrupt me: | 61 | a select few apps have the ability to interrupt me: Calendar, Messages, Phone, |
| 66 | Calendar, Messages, Phone, Reminders, & Signal. | 62 | Reminders, & Signal. |
| 67 | - Disable badges for any apps except the ones mentioned in the bullet | 63 | - Disable badges for any apps except the ones mentioned in the bullet above. |
| 68 | above. | 64 | - Set-up focus profiles across devices so that I can enable different modes, |
| 69 | - Set-up focus profiles across devices so that I can enable different | 65 | such as Personal when I only want to see notifications from people I care |
| 70 | modes, such as Personal when I only want to see notifications from | 66 | about or Do Not Disturb, where absolutely nothing can interrupt me. |
| 71 | people I care about or Do Not Disturb, where absolutely nothing can | 67 | - Clean up my home screens. This one was quite easy as I already maintain a |
| 72 | interrupt me. | 68 | minimalist set-up, but I went extreme by limiting my phone to just eight apps |
| 73 | - Clean up my home screens. This one was quite easy as I already | 69 | on the home screen and four in the dock. If I need another app, I'll have to |
| 74 | maintain a minimalist set-up, but I went extreme by limiting my | 70 | search or use the app library. |
| 75 | phone to just eight apps on the home screen and four in the dock. If | 71 | - Remove the work profile from my phone. This was a tough decision as having my |
| 76 | I need another app, I\'ll have to search or use the app library. | 72 | work profile on my device definitely makes my life easier at times, but it |
| 77 | - Remove the work profile from my phone. This was a tough decision as | 73 | also has quite a negative effect when I'm "always online" and can see the |
| 78 | having my work profile on my device definitely makes my life easier | 74 | notifications and team activity 24/7. I believe creating a distinct barrier |
| 79 | at times, but it also has quite a negative effect when I\'m \"always | 75 | between my work and personal devices will be beneficial in the end. |
| 80 | online\" and can see the notifications and team activity 24/7. I | ||
| 81 | believe creating a distinct barrier between my work and personal | ||
| 82 | devices will be beneficial in the end. | ||
| 83 | 76 | ||
| 84 | ## Creating Alternative Activities | 77 | ## Creating Alternative Activities |
| 85 | 78 | ||
| 86 | This is the most difficult piece, as most of my hobbies and interests | 79 | This is the most difficult piece, as most of my hobbies and interests lie in the |
| 87 | lie in the digital world. However, I\'m making a concerted effort to put | 80 | digital world. However, I'm making a concerted effort to put devices down |
| 88 | devices down unless necessary and force myself to perform other | 81 | unless necessary and force myself to perform other activities in the physical |
| 89 | activities in the physical world instead. | 82 | world instead. |
| 90 | 83 | ||
| 91 | I\'ve started with a few basics that are always readily available to me: | 84 | I've started with a few basics that are always readily available to me: |
| 92 | 85 | ||
| 93 | - Do a chore, such as organizing or cleaning. | 86 | - Do a chore, such as organizing or cleaning. |
| 94 | - Read a book, study a piece of art, etc. | 87 | - Read a book, study a piece of art, etc. |
| 95 | - Exercise or get outdoors. | 88 | - Exercise or get outdoors. |
| 96 | - Participate in a hobby, such as photography, birding, disc golf, | 89 | - Participate in a hobby, such as photography, birding, disc golf, etc. |
| 97 | etc. | 90 | - Let yourself be bored and wander into creativity. |
| 98 | - Let yourself be bored and wander into creativity. | ||
| 99 | 91 | ||
| 100 | # Making Progress | 92 | # Making Progress |
| 101 | 93 | ||
| 102 | I\'ll be taking notes as I continue down this journey and hope to see | 94 | I'll be taking notes as I continue down this journey and hope to see positive |
| 103 | positive trends. I\'ve always been a minimalist in the physical world | 95 | trends. I've always been a minimalist in the physical world and it feels |
| 104 | and it feels refreshing to filter out the clutter that has come to | 96 | refreshing to filter out the clutter that has come to dominate my digital life |
| 105 | dominate my digital life over the years. | 97 | over the years. |
| 106 | 98 | ||
| 107 | I\'m excited to see where this journey leads. | 99 | I'm excited to see where this journey leads. |
content/blog/2023-10-11-self-hosting-authelia.md +60 −69
| @@ -7,49 +7,47 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Overview | 8 | # Overview |
| 9 | 9 | ||
| 10 | [Authelia](https://www.authelia.com/) is an open-source authentication | 10 | [Authelia](https://www.authelia.com/) is an open-source authentication service |
| 11 | service that allows you to place a portal between end users on the | 11 | that allows you to place a portal between end users on the internet and |
| 12 | internet and self-hosted services on your server. | 12 | self-hosted services on your server. |
| 13 | 13 | ||
| 14 | You can require one factor (username+password) or two factor | 14 | You can require one factor (username+password) or two factor authentication for |
| 15 | authentication for any such user before allowing them to access a | 15 | any such user before allowing them to access a specific service on your domain. |
| 16 | specific service on your domain. | ||
| 17 | 16 | ||
| 18 | This guide will walk through a standard installation of Authelia for | 17 | This guide will walk through a standard installation of Authelia for |
| 19 | `example.com`, using `auth.example.com` as | 18 | `example.com`, using `auth.example.com` as Authelia's authentication domain and |
| 20 | Authelia\'s authentication domain and `teddit.example.com` as | 19 | `teddit.example.com` as the website we want to protect behind the authentication |
| 21 | the website we want to protect behind the authentication portal. | 20 | portal. |
| 22 | 21 | ||
| 23 | # Prerequisites | 22 | # Prerequisites |
| 24 | 23 | ||
| 25 | This guide assumes you have the following already set-up: | 24 | This guide assumes you have the following already set-up: |
| 26 | 25 | ||
| 27 | - A registered domain with DNS pointing to your server. | 26 | - A registered domain with DNS pointing to your server. |
| 28 | - A subdomain for Authelia (`auth.example.com`) and a | 27 | - A subdomain for Authelia (`auth.example.com`) and a subdomain to protect via |
| 29 | subdomain to protect via Authelia (`app.example.com`). | 28 | Authelia (`app.example.com`). |
| 30 | - A working Nginx web server. | 29 | - A working Nginx web server. |
| 31 | - Docker and docker-compose installed. | 30 | - Docker and docker-compose installed. |
| 32 | 31 | ||
| 33 | # Installation | 32 | # Installation |
| 34 | 33 | ||
| 35 | This guide will walk through each installation step one-by-one, starting | 34 | This guide will walk through each installation step one-by-one, starting with |
| 36 | with the container and finishing by cleaning up external access via an | 35 | the container and finishing by cleaning up external access via an Nginx reverse |
| 37 | Nginx reverse proxy. | 36 | proxy. |
| 38 | 37 | ||
| 39 | ## Docker-Compose | 38 | ## Docker-Compose |
| 40 | 39 | ||
| 41 | To start, create a directory for Authelia and create a | 40 | To start, create a directory for Authelia and create a `docker-compose.yml` |
| 42 | `docker-compose.yml` file. | 41 | file. |
| 43 | 42 | ||
| 44 | ```sh | 43 | ```sh |
| 45 | mkdir ~/authelia | 44 | mkdir ~/authelia |
| 46 | nano ~/authelia/docker-compose.yml | 45 | nano ~/authelia/docker-compose.yml |
| 47 | ``` | 46 | ``` |
| 48 | 47 | ||
| 49 | Within this file, paste the following content. If you prefer a different | 48 | Within this file, paste the following content. If you prefer a different local |
| 50 | local port, modify the port on the left side of the colon on the | 49 | port, modify the port on the left side of the colon on the `9091:9091` line. Be |
| 51 | `9091:9091` line. Be sure to modify the `TZ` | 50 | sure to modify the `TZ` variable to your timezone. |
| 52 | variable to your timezone. | ||
| 53 | 51 | ||
| 54 | ``` yml | 52 | ``` yml |
| 55 | version: '3.3' | 53 | version: '3.3' |
| @@ -72,45 +70,40 @@ Start the container with docker-compose: | |||
| 72 | sudo docker-compose up -d | 70 | sudo docker-compose up -d |
| 73 | ``` | 71 | ``` |
| 74 | 72 | ||
| 75 | After the first start, the container will automatically exit and require | 73 | After the first start, the container will automatically exit and require you to |
| 76 | you to modify the app\'s configuration files before continuing. Read on | 74 | modify the app's configuration files before continuing. Read on to learn more. |
| 77 | to learn more. | ||
| 78 | 75 | ||
| 79 | ## Authelia Configuration | 76 | ## Authelia Configuration |
| 80 | 77 | ||
| 81 | To configure Authelia before we restart the container, we need to open | 78 | To configure Authelia before we restart the container, we need to open the |
| 82 | the `config` directory and modify the files. Start by editing | 79 | `config` directory and modify the files. Start by editing the |
| 83 | the `configuration.yml` file, where all of Authelia\'s | 80 | `configuration.yml` file, where all of Authelia's settings are stored. |
| 84 | settings are stored. | ||
| 85 | 81 | ||
| 86 | My personal preference is to copy the original configuration file to a | 82 | My personal preference is to copy the original configuration file to a backup |
| 87 | backup file and edit a fresh copy. | 83 | file and edit a fresh copy. |
| 88 | 84 | ||
| 89 | ```sh | 85 | ```sh |
| 90 | sudo cp ~/authelia/config/configuration.yml ~/authelia/config/configuration.yml.bk | 86 | sudo cp ~/authelia/config/configuration.yml ~/authelia/config/configuration.yml.bk |
| 91 | sudo nano ~/authelia/config/configuration.yml | 87 | sudo nano ~/authelia/config/configuration.yml |
| 92 | ``` | 88 | ``` |
| 93 | 89 | ||
| 94 | Within the blank `configuration.yml` file, paste the | 90 | Within the blank `configuration.yml` file, paste the following information. You |
| 95 | following information. You will need to make quite a few updates, so be | 91 | will need to make quite a few updates, so be sure to read each line carefully |
| 96 | sure to read each line carefully and modify as necessary. | 92 | and modify as necessary. |
| 97 | 93 | ||
| 98 | The major required changes are: | 94 | The major required changes are: |
| 99 | 95 | ||
| 100 | - Any instances of `example.com` should be replaced by your | 96 | - Any instances of `example.com` should be replaced by your domain. |
| 101 | domain. | 97 | - `jwt_secret` - Use the `pwgen 40 1` command to generate a secret for yourself. |
| 102 | - `jwt_secret` - Use the `pwgen 40 1` command to | 98 | - `access_control` - Set the Authelia domain to bypass here, as well as any |
| 103 | generate a secret for yourself. | 99 | subdomains you want to protect. |
| 104 | - `access_control` - Set the Authelia domain to bypass | 100 | - `session` > `secret` - Use the `pwgen 40 1` command to generate a secret for |
| 105 | here, as well as any subdomains you want to protect. | 101 | yourself. |
| 106 | - `session` \> `secret` - Use the | 102 | - `regulation` - Set the variables here to restrict login attempts and bans. |
| 107 | `pwgen 40 1` command to generate a secret for yourself. | 103 | - `storage` > `encryption_key` - Use the `pwgen 40 1` command to generate a |
| 108 | - `regulation` - Set the variables here to restrict login | 104 | secret for yourself. |
| 109 | attempts and bans. | 105 | - `smtp` - If you have access to an SMTP service, set up the information here to |
| 110 | - `storage` \> `encryption_key` - Use the | 106 | active outgoing emails. |
| 111 | `pwgen 40 1` command to generate a secret for yourself. | ||
| 112 | - `smtp` - If you have access to an SMTP service, set up | ||
| 113 | the information here to active outgoing emails. | ||
| 114 | 107 | ||
| 115 | ``` yml | 108 | ``` yml |
| 116 | # yamllint disable rule:comments-indentation | 109 | # yamllint disable rule:comments-indentation |
| @@ -211,14 +204,13 @@ Next, create the users file for authentication. | |||
| 211 | sudo nano ~/authelia/config/users_database.yml | 204 | sudo nano ~/authelia/config/users_database.yml |
| 212 | ``` | 205 | ``` |
| 213 | 206 | ||
| 214 | Within the file, you will need to create an entry for each user that | 207 | Within the file, you will need to create an entry for each user that needs |
| 215 | needs access to Authelia. The `my_username` entry will be the | 208 | access to Authelia. The `my_username` entry will be the username used on the |
| 216 | username used on the login page. | 209 | login page. |
| 217 | 210 | ||
| 218 | To generate the password, go to [Argon2 Hash | 211 | To generate the password, go to [Argon2 Hash Generator](https://argon2.online), |
| 219 | Generator](https://argon2.online), generate a random salt, and make sure | 212 | generate a random salt, and make sure the rest of the settings match the |
| 220 | the rest of the settings match the `authentication_backend` | 213 | `authentication_backend` section of `configuration.yml` file. |
| 221 | section of `configuration.yml` file. | ||
| 222 | 214 | ||
| 223 | ``` yaml | 215 | ``` yaml |
| 224 | users: | 216 | users: |
| @@ -242,8 +234,8 @@ sudo docker-compose down && sudo docker-compose up -d | |||
| 242 | 234 | ||
| 243 | ## Nginx: Authelia Domain | 235 | ## Nginx: Authelia Domain |
| 244 | 236 | ||
| 245 | Once the container is running and configured, the final step is to | 237 | Once the container is running and configured, the final step is to configure |
| 246 | configure external access to the server via Nginx reverse proxy. | 238 | external access to the server via Nginx reverse proxy. |
| 247 | 239 | ||
| 248 | Start by creating the Authelia domain. | 240 | Start by creating the Authelia domain. |
| 249 | 241 | ||
| @@ -252,9 +244,8 @@ sudo nano /etc/nginx/sites-available/auth | |||
| 252 | ``` | 244 | ``` |
| 253 | 245 | ||
| 254 | Within this file, paste the following information and be sure to update | 246 | Within this file, paste the following information and be sure to update |
| 255 | `example.com` to your domain. Make sure the | 247 | `example.com` to your domain. Make sure the `$upstream_authelia` variable |
| 256 | `$upstream_authelia` variable matches the location of your | 248 | matches the location of your Authelia container. |
| 257 | Authelia container. | ||
| 258 | 249 | ||
| 259 | ``` conf | 250 | ``` conf |
| 260 | server { | 251 | server { |
| @@ -310,8 +301,8 @@ server { | |||
| 310 | } | 301 | } |
| 311 | ``` | 302 | ``` |
| 312 | 303 | ||
| 313 | Next, symlink the file and restart Nginx. If there are errors, be sure | 304 | Next, symlink the file and restart Nginx. If there are errors, be sure to |
| 314 | to resolve those before moving on. | 305 | resolve those before moving on. |
| 315 | 306 | ||
| 316 | ```sh | 307 | ```sh |
| 317 | sudo ln -s /etc/nginx/sites-available/auth /etc/nginx/sites-enabled/auth | 308 | sudo ln -s /etc/nginx/sites-available/auth /etc/nginx/sites-enabled/auth |
| @@ -320,9 +311,9 @@ sudo systemctl restart nginx.service | |||
| 320 | 311 | ||
| 321 | ## Nginx: Protected Domain(s) | 312 | ## Nginx: Protected Domain(s) |
| 322 | 313 | ||
| 323 | Now that Authelia is accessible externally, you need to configure the | 314 | Now that Authelia is accessible externally, you need to configure the domain you |
| 324 | domain you intend to protect with Authelia. In this example, I\'m | 315 | intend to protect with Authelia. In this example, I'm protecting |
| 325 | protecting `teddit.example.com`. | 316 | `teddit.example.com`. |
| 326 | 317 | ||
| 327 | Similar to the process above, paste the content and update the relevant | 318 | Similar to the process above, paste the content and update the relevant |
| 328 | variables. | 319 | variables. |
| @@ -450,9 +441,9 @@ authentication domain and presented with the Authelia login portal. | |||
| 450 |  | 442 | Portal](https://img.cleberg.net/blog/20231010-authelia/authelia_portal.png) |
| 452 | 443 | ||
| 453 | Once you\'ve successfully authenticated, you can visit your | 444 | Once you've successfully authenticated, you can visit your authentication |
| 454 | authentication domain directly and see that you\'re currently | 445 | domain directly and see that you're currently authenticated to any domain |
| 455 | authenticated to any domain protected by Authelia. | 446 | protected by Authelia. |
| 456 | 447 | ||
| 457 |  | 449 | Success](https://img.cleberg.net/blog/20231010-authelia/authelia_success.png) |
content/blog/2023-10-15-alpine-ssh-hardening.md +8 −8
| @@ -8,13 +8,13 @@ draft = false | |||
| 8 | # Overview | 8 | # Overview |
| 9 | 9 | ||
| 10 | This guide follows the standard | 10 | This guide follows the standard |
| 11 | [ssh-audit](https://www.ssh-audit.com/hardening_guides.html) hardening | 11 | [ssh-audit](https://www.ssh-audit.com/hardening_guides.html) hardening guide, |
| 12 | guide, tweaked for Alpine Linux. | 12 | tweaked for Alpine Linux. |
| 13 | 13 | ||
| 14 | # Hardening Guide | 14 | # Hardening Guide |
| 15 | 15 | ||
| 16 | These steps must be performed as root. You can try to use | 16 | These steps must be performed as root. You can try to use `doas` or `sudo`, but |
| 17 | `doas` or `sudo`, but there may be issues. | 17 | there may be issues. |
| 18 | 18 | ||
| 19 | 1. Re-generate the RSA and ED25519 keys | 19 | 1. Re-generate the RSA and ED25519 keys |
| 20 | 20 | ||
| @@ -31,8 +31,8 @@ awk '$5 >= 3071' /etc/ssh/moduli > /etc/ssh/moduli.safe | |||
| 31 | mv /etc/ssh/moduli.safe /etc/ssh/moduli | 31 | mv /etc/ssh/moduli.safe /etc/ssh/moduli |
| 32 | ``` | 32 | ``` |
| 33 | 33 | ||
| 34 | 3. Enable the RSA and ED25519 HostKey directives in the | 34 | 3. Enable the RSA and ED25519 HostKey directives in the /etc/ssh/sshd~config~ |
| 35 | /etc/ssh/sshd~config~ file | 35 | file |
| 36 | 36 | ||
| 37 | ```sh | 37 | ```sh |
| 38 | sed -i 's/^\#HostKey \/etc\/ssh\/ssh_host_\(rsa\|ed25519\)_key$/HostKey \/etc\/ssh\/ssh_host_\1_key/g' /etc/ssh/sshd_config | 38 | sed -i 's/^\#HostKey \/etc\/ssh\/ssh_host_\(rsa\|ed25519\)_key$/HostKey \/etc\/ssh\/ssh_host_\1_key/g' /etc/ssh/sshd_config |
| @@ -65,8 +65,8 @@ pip3 install ssh-audit | |||
| 65 | ssh-audit localhost | 65 | ssh-audit localhost |
| 66 | ``` | 66 | ``` |
| 67 | 67 | ||
| 68 | If everything succeeded, the results will show as all green. If anything | 68 | If everything succeeded, the results will show as all green. If anything is |
| 69 | is yellow, orange, or red, you may need to tweak additional settings. | 69 | yellow, orange, or red, you may need to tweak additional settings. |
| 70 | 70 | ||
| 71 | ``` txt | 71 | ``` txt |
| 72 | #+caption: ssh audit | 72 | #+caption: ssh audit |
content/blog/2023-10-17-self-hosting-anonymousoverflow.md +17 −20
| @@ -8,18 +8,17 @@ draft = false | |||
| 8 | # Overview | 8 | # Overview |
| 9 | 9 | ||
| 10 | I recently launched an instance of AnonymousOverflow at | 10 | I recently launched an instance of AnonymousOverflow at |
| 11 | [ao.cleberg.net](https://ao.cleberg.net) and wanted to write a brief | 11 | [ao.cleberg.net](https://ao.cleberg.net) and wanted to write a brief post on how |
| 12 | post on how easy it is to install with Docker Compose and Nginx. | 12 | easy it is to install with Docker Compose and Nginx. |
| 13 | 13 | ||
| 14 | This guide uses Ubuntu server, Docker Compose, and Nginx as a reverse | 14 | This guide uses Ubuntu server, Docker Compose, and Nginx as a reverse proxy. |
| 15 | proxy. | ||
| 16 | 15 | ||
| 17 | # Installation | 16 | # Installation |
| 18 | 17 | ||
| 19 | ## Docker Compose | 18 | ## Docker Compose |
| 20 | 19 | ||
| 21 | To install AnonymousOverflow, start by creating a directory for the | 20 | To install AnonymousOverflow, start by creating a directory for the application |
| 22 | application and create its `docker-compose.yml` file. | 21 | and create its `docker-compose.yml` file. |
| 23 | 22 | ||
| 24 | ```sh | 23 | ```sh |
| 25 | mkdir ~/anonymousoverflow && cd ~/anonymousoverflow | 24 | mkdir ~/anonymousoverflow && cd ~/anonymousoverflow |
| @@ -27,8 +26,7 @@ nano docker-compose.yml | |||
| 27 | ``` | 26 | ``` |
| 28 | 27 | ||
| 29 | Within this file, paste the following information. Be sure to change the | 28 | Within this file, paste the following information. Be sure to change the |
| 30 | `APP_URL`, `JWT_SIGNING_SECRET`, and | 29 | `APP_URL`, `JWT_SIGNING_SECRET`, and `ports` to match your needs. |
| 31 | `ports` to match your needs. | ||
| 32 | 30 | ||
| 33 | ``` yaml | 31 | ``` yaml |
| 34 | version: '3' | 32 | version: '3' |
| @@ -45,8 +43,8 @@ services: | |||
| 45 | restart: 'always' | 43 | restart: 'always' |
| 46 | ``` | 44 | ``` |
| 47 | 45 | ||
| 48 | Save and exit the file when complete. You can now launch the container | 46 | Save and exit the file when complete. You can now launch the container and |
| 49 | and access it via your local network. | 47 | access it via your local network. |
| 50 | 48 | ||
| 51 | ```sh | 49 | ```sh |
| 52 | sudo docker-compose up -d | 50 | sudo docker-compose up -d |
| @@ -54,19 +52,18 @@ sudo docker-compose up -d | |||
| 54 | 52 | ||
| 55 | ## Nginx Reverse Proxy | 53 | ## Nginx Reverse Proxy |
| 56 | 54 | ||
| 57 | If you want to access this service outside the local network, I | 55 | If you want to access this service outside the local network, I recommend using |
| 58 | recommend using Nginx as a reverse proxy. | 56 | Nginx as a reverse proxy. |
| 59 | 57 | ||
| 60 | Let\'s start by creating a configuration file. | 58 | Let's start by creating a configuration file. |
| 61 | 59 | ||
| 62 | ```sh | 60 | ```sh |
| 63 | sudo nano /etc/nginx/sites-available/ao | 61 | sudo nano /etc/nginx/sites-available/ao |
| 64 | ``` | 62 | ``` |
| 65 | 63 | ||
| 66 | Within this file, paste the following content and repace | 64 | Within this file, paste the following content and repace `ao.example.com` with |
| 67 | `ao.example.com` with your URL. You may need to update the | 65 | your URL. You may need to update the SSL certificate statements if your |
| 68 | SSL certificate statements if your certificates are in a different | 66 | certificates are in a different location. |
| 69 | location. | ||
| 70 | 67 | ||
| 71 | ``` conf | 68 | ``` conf |
| 72 | server { | 69 | server { |
| @@ -122,9 +119,9 @@ server { | |||
| 122 | } | 119 | } |
| 123 | ``` | 120 | ``` |
| 124 | 121 | ||
| 125 | Save and exit the file when complete. On Ubuntu, you will need to | 122 | Save and exit the file when complete. On Ubuntu, you will need to symlink the |
| 126 | symlink the configuration file before it will be recognized by Nginx. | 123 | configuration file before it will be recognized by Nginx. Once complete, simply |
| 127 | Once complete, simply restart the web server. | 124 | restart the web server. |
| 128 | 125 | ||
| 129 | ```sh | 126 | ```sh |
| 130 | sudo ln -s /etc/nginx/sites-available/ao /etc/nginx/sites-enabled/ao | 127 | sudo ln -s /etc/nginx/sites-available/ao /etc/nginx/sites-enabled/ao |
content/blog/2023-11-08-scli.md +54 −65
| @@ -5,49 +5,42 @@ description = "" | |||
| 5 | draft = false | 5 | draft = false |
| 6 | +++ | 6 | +++ |
| 7 | 7 | ||
| 8 | [scli](https://github.com/isamert/scli) is a command-line tool that | 8 | [scli](https://github.com/isamert/scli) is a command-line tool that allows you |
| 9 | allows you to connect to your Signal messenger account. This program | 9 | to connect to your Signal messenger account. This program utilizes a two-pane |
| 10 | utilizes a two-pane display that shows you chats on the left and the | 10 | display that shows you chats on the left and the focused conversation on the |
| 11 | focused conversation on the right. | 11 | right. |
| 12 | 12 | ||
| 13 | This guide will show you how to install `scli` and its | 13 | This guide will show you how to install `scli` and its dependencies on Alpine |
| 14 | dependencies on Alpine Linux, which requires some extra work due to | 14 | Linux, which requires some extra work due to musl. |
| 15 | musl. | ||
| 16 | 15 | ||
| 17 | If you\'re using a non-musl system, you can likely following the | 16 | If you're using a non-musl system, you can likely following the `scli` README |
| 18 | `scli` README and download the packaged binaries for an | 17 | and download the packaged binaries for an easier installation process. |
| 19 | easier installation process. | ||
| 20 | 18 | ||
| 21 | # Dependencies | 19 | # Dependencies |
| 22 | 20 | ||
| 23 | In order to use `scli`, you need a few dependencies: | 21 | In order to use `scli`, you need a few dependencies: |
| 24 | 22 | ||
| 25 | - `openjdk17-jre` - Used as a dependency for the | 23 | - `openjdk17-jre` - Used as a dependency for the `signal-cli` tool. Version may |
| 26 | `signal-cli` tool. Version may vary. | 24 | vary. |
| 27 | - `signal-cli` - Used as the backbone of the | 25 | - `signal-cli` - Used as the backbone of the `scli` tool. |
| 28 | `scli` tool. | 26 | - `findutils` - Replaces the standard Busybox version of `xargs`. |
| 29 | - `findutils` - Replaces the standard Busybox version of | 27 | - `urwid` - A console user interface library for Python. |
| 30 | `xargs`. | 28 | - `urwid-readline` - For GNU emacs-like keybinds on the input line. |
| 31 | - `urwid` - A console user interface library for Python. | 29 | - `qrencode` - Displays a QR code in the terminal to link the device using your |
| 32 | - `urwid-readline` - For GNU emacs-like keybinds on the | 30 | phone. Not necessary if you're only linking on desktop and can copy/paste the |
| 33 | input line. | 31 | connection URL. |
| 34 | - `qrencode` - Displays a QR code in the terminal to link | 32 | |
| 35 | the device using your phone. Not necessary if you\'re only linking | 33 | Let's start by installing the packages available via Alpine's repositories. Be |
| 36 | on desktop and can copy/paste the connection URL. | 34 | sure to install the latest version of `openjdk`. If you run into Java-related |
| 37 | 35 | issues, uninstall `openjdk` and install an older version. | |
| 38 | Let\'s start by installing the packages available via Alpine\'s | ||
| 39 | repositories. Be sure to install the latest version of | ||
| 40 | `openjdk`. If you run into Java-related issues, uninstall | ||
| 41 | `openjdk` and install an older version. | ||
| 42 | 36 | ||
| 43 | ```sh | 37 | ```sh |
| 44 | doas apk add openjdk17-jre findutils qrencode | 38 | doas apk add openjdk17-jre findutils qrencode |
| 45 | ``` | 39 | ``` |
| 46 | 40 | ||
| 47 | Next, let\'s install `signal-cli`. Be sure to export the | 41 | Next, let's install `signal-cli`. Be sure to export the version of `signal-cli` |
| 48 | version of `signal-cli` that you want. I use version | 42 | that you want. I use version `0.12.4` below, but that may be outdated by the |
| 49 | `0.12.4` below, but that may be outdated by the time you\'re | 43 | time you're reading this. |
| 50 | reading this. | ||
| 51 | 44 | ||
| 52 | ```sh | 45 | ```sh |
| 53 | export VERSION="0.12.4" | 46 | export VERSION="0.12.4" |
| @@ -56,8 +49,7 @@ doas tar xf signal-cli-"${VERSION}".tar.gz -C /opt | |||
| 56 | doas ln -sf /opt/signal-cli-${VERSION}"/bin/signal/cli /usr/local/bin | 49 | doas ln -sf /opt/signal-cli-${VERSION}"/bin/signal/cli /usr/local/bin |
| 57 | ``` | 50 | ``` |
| 58 | 51 | ||
| 59 | Finally, install the `urwid` packages using the Python | 52 | Finally, install the `urwid` packages using the Python packaging utility. |
| 60 | packaging utility. | ||
| 61 | 53 | ||
| 62 | ```sh | 54 | ```sh |
| 63 | pip3 install urwid urwid-readline | 55 | pip3 install urwid urwid-readline |
| @@ -65,25 +57,24 @@ pip3 install urwid urwid-readline | |||
| 65 | 57 | ||
| 66 | # Installation | 58 | # Installation |
| 67 | 59 | ||
| 68 | Now that we have all of the dependencies we need, we can install | 60 | Now that we have all of the dependencies we need, we can install `scli`. Start |
| 69 | `scli`. Start by simply cloning the repository. | 61 | by simply cloning the repository. |
| 70 | 62 | ||
| 71 | ```sh | 63 | ```sh |
| 72 | git clone https://github.com/isamert/scli | 64 | git clone https://github.com/isamert/scli |
| 73 | ``` | 65 | ``` |
| 74 | 66 | ||
| 75 | When I cloned this repository on 2023-11-08, I found a bug in the logic | 67 | When I cloned this repository on 2023-11-08, I found a bug in the logic that |
| 76 | that required a fix. You must edit the `scli` file and | 68 | required a fix. You must edit the `scli` file and replace the one instance of |
| 77 | replace the one instance of `RLIMIT_OFILE` with | 69 | `RLIMIT_OFILE` with `RLIMIT_NOFILE`. |
| 78 | `RLIMIT_NOFILE`. | ||
| 79 | 70 | ||
| 80 | ```sh | 71 | ```sh |
| 81 | cd scli | 72 | cd scli |
| 82 | nano scli | 73 | nano scli |
| 83 | ``` | 74 | ``` |
| 84 | 75 | ||
| 85 | Once complete, you can move this program to anywhere on your | 76 | Once complete, you can move this program to anywhere on your `$PATH`. I chose |
| 86 | `$PATH`. I chose the following directory. | 77 | the following directory. |
| 87 | 78 | ||
| 88 | ```sh | 79 | ```sh |
| 89 | doas mv scli /usr/local/bin/scli | 80 | doas mv scli /usr/local/bin/scli |
| @@ -91,43 +82,41 @@ doas mv scli /usr/local/bin/scli | |||
| 91 | 82 | ||
| 92 | # Initial Setup | 83 | # Initial Setup |
| 93 | 84 | ||
| 94 | Now that everything is installed, we can login and configure the client. | 85 | Now that everything is installed, we can login and configure the client. Start |
| 95 | Start by generating a connection link. | 86 | by generating a connection link. |
| 96 | 87 | ||
| 97 | ```sh | 88 | ```sh |
| 98 | signal-cli link -n "YOUR-DEVICE-NICKNAME" | tee >(xargs -L 1 qrencode -t utf8) | 89 | signal-cli link -n "YOUR-DEVICE-NICKNAME" | tee >(xargs -L 1 qrencode -t utf8) |
| 99 | ``` | 90 | ``` |
| 100 | 91 | ||
| 101 | This will generate a connection link and related QR code for you to use | 92 | This will generate a connection link and related QR code for you to use to link |
| 102 | to link the devices together. Once complete, **wait patiently\*** for | 93 | the devices together. Once complete, **wait patiently** for the connection |
| 103 | the connection process to finish. | 94 | process to finish. |
| 104 | 95 | ||
| 105 | Once it completes, it will exit and return you to the prompt. From here, | 96 | Once it completes, it will exit and return you to the prompt. From here, you |
| 106 | you need to perform an initial `receive` command to start | 97 | need to perform an initial `receive` command to start things off. The `USERNAME` |
| 107 | things off. The `USERNAME` variable should be your phone | 98 | variable should be your phone number, such as `+15551237890`. |
| 108 | number, such as `+15551237890`. | ||
| 109 | 99 | ||
| 110 | ```sh | 100 | ```sh |
| 111 | signal-cli -u USERNAME receive | 101 | signal-cli -u USERNAME receive |
| 112 | ``` | 102 | ``` |
| 113 | 103 | ||
| 114 | Also be sure to test the daemon to ensure it works properly. If no | 104 | Also be sure to test the daemon to ensure it works properly. If no errors occur, |
| 115 | errors occur, it\'s working. If you run into errors because you\'re not | 105 | it's working. If you run into errors because you're not running a DBUS |
| 116 | running a DBUS session, see my notes below. | 106 | session, see my notes below. |
| 117 | 107 | ||
| 118 | ```sh | 108 | ```sh |
| 119 | signal-cli -u USERNAME daemon | 109 | signal-cli -u USERNAME daemon |
| 120 | ``` | 110 | ``` |
| 121 | 111 | ||
| 122 | Once the initial reception is complete, you are ready to use | 112 | Once the initial reception is complete, you are ready to use `scli`. |
| 123 | `scli`. | ||
| 124 | 113 | ||
| 125 | This process will differ depending on your desktop environment (DE). If | 114 | This process will differ depending on your desktop environment (DE). If you are |
| 126 | you are running a DE, you likely have a DBUS session running already and | 115 | running a DE, you likely have a DBUS session running already and can simply |
| 127 | can simply launch the program. | 116 | launch the program. |
| 128 | 117 | ||
| 129 | However, if you\'re like me and running your computer straight on the | 118 | However, if you're like me and running your computer straight on the TTY |
| 130 | TTY without a DE, you\'ll need to start a DBUS session for this program. | 119 | without a DE, you'll need to start a DBUS session for this program. |
| 131 | 120 | ||
| 132 | ```sh | 121 | ```sh |
| 133 | # If you're not running a DBUS session yet, you need to start one for scli | 122 | # If you're not running a DBUS session yet, you need to start one for scli |
| @@ -139,9 +128,9 @@ scli | |||
| 139 | 128 | ||
| 140 | # Configuration | 129 | # Configuration |
| 141 | 130 | ||
| 142 | Lastly, there are a number of configuration options that you can pass | 131 | Lastly, there are a number of configuration options that you can pass via the |
| 143 | via the command or in the `~/.config/sclirc` file. See the | 132 | command or in the `~/.config/sclirc` file. See the Github README for more |
| 144 | Github README for more information on configuration options. | 133 | information on configuration options. |
| 145 | 134 | ||
| 146 | ```sh | 135 | ```sh |
| 147 | nano ~/.config/sclirc | 136 | nano ~/.config/sclirc |
| @@ -154,5 +143,5 @@ wrap-at = 80 | |||
| 154 | enable-notifications = true | 143 | enable-notifications = true |
| 155 | ``` | 144 | ``` |
| 156 | 145 | ||
| 157 | That\'s it! Following this guide, I have a functional `scli` | 146 | That's it! Following this guide, I have a functional `scli` program that |
| 158 | program that successfully sends messages to my contacts and myself! | 147 | successfully sends messages to my contacts and myself! |
content/blog/2023-12-03-unifi-nextdns.md +31 −34
| @@ -9,32 +9,31 @@ draft = false | |||
| 9 | 9 | ||
| 10 | I recently installed NextDNS on my Unifi Dream Machine router using the | 10 | I recently installed NextDNS on my Unifi Dream Machine router using the |
| 11 | [UnifiOS](https://github.com/nextdns/nextdns/wiki/UnifiOS) wiki page on | 11 | [UnifiOS](https://github.com/nextdns/nextdns/wiki/UnifiOS) wiki page on |
| 12 | NextDNS\'s GitHub repository. | 12 | NextDNS's GitHub repository. |
| 13 | 13 | ||
| 14 | As a result of this, I wanted to write down the process in case the wiki | 14 | As a result of this, I wanted to write down the process in case the wiki or |
| 15 | or installer ever gets lost. | 15 | installer ever gets lost. |
| 16 | 16 | ||
| 17 | # Wiki | 17 | # Wiki |
| 18 | 18 | ||
| 19 | The following is copied from the wiki page linked above, with one | 19 | The following is copied from the wiki page linked above, with one difference in |
| 20 | difference in the `ssh` command. | 20 | the `ssh` command. |
| 21 | 21 | ||
| 22 | Install instructions for Unifi Dream Machine (UDM) standard and pro | 22 | Install instructions for Unifi Dream Machine (UDM) standard and pro routers. |
| 23 | routers. | ||
| 24 | 23 | ||
| 25 | ## Install | 24 | ## Install |
| 26 | 25 | ||
| 27 | Enable SSH: | 26 | Enable SSH: |
| 28 | 27 | ||
| 29 | - Go to your unifi admin interface and select your device (not the | 28 | - Go to your unifi admin interface and select your device (not the controller |
| 30 | controller settings, but the Dream Machine settings) | 29 | settings, but the Dream Machine settings) |
| 31 | - Click on \"Settings\" at the bottom of the page | 30 | - Click on "Settings" at the bottom of the page |
| 32 | - Go to the \"Advanced\" section on the left pan | 31 | - Go to the "Advanced" section on the left pan |
| 33 | - Enable SSH | 32 | - Enable SSH |
| 34 | - Set a SSH password | 33 | - Set a SSH password |
| 35 | 34 | ||
| 36 | Connect to your router using `ssh root@xxx.xxx.xxx.xxx` with | 35 | Connect to your router using `ssh root@xxx.xxx.xxx.xxx` with the password you |
| 37 | the password you configured. | 36 | configured. |
| 38 | 37 | ||
| 39 | Run the following command and follow the instructions: | 38 | Run the following command and follow the instructions: |
| 40 | 39 | ||
| @@ -42,25 +41,24 @@ Run the following command and follow the instructions: | |||
| 42 | sh -c 'sh -c "$(curl -sL https://nextdns.io/install)"' | 41 | sh -c 'sh -c "$(curl -sL https://nextdns.io/install)"' |
| 43 | ``` | 42 | ``` |
| 44 | 43 | ||
| 45 | Note: Queries from the UDM itself won\'t be routed to NextDNS nor | 44 | Note: Queries from the UDM itself won't be routed to NextDNS nor encrypted due |
| 46 | encrypted due to current system limitation. All traffic from other | 45 | to current system limitation. All traffic from other devices on then network |
| 47 | devices on then network will. | 46 | will. |
| 48 | 47 | ||
| 49 | ## Upgrade | 48 | ## Upgrade |
| 50 | 49 | ||
| 51 | To upgrade to the last version, simply re-run the installer above. If a | 50 | To upgrade to the last version, simply re-run the installer above. If a new |
| 52 | new version is available, the upgrade action will added to the list of | 51 | version is available, the upgrade action will added to the list of possible |
| 53 | possible actions. | 52 | actions. |
| 54 | 53 | ||
| 55 | ## Uninstall | 54 | ## Uninstall |
| 56 | 55 | ||
| 57 | To uninstall, re-run the installer above and select \"Remove\" in the | 56 | To uninstall, re-run the installer above and select "Remove" in the menu. |
| 58 | menu. | ||
| 59 | 57 | ||
| 60 | ## Troubleshooting | 58 | ## Troubleshooting |
| 61 | 59 | ||
| 62 | If the installation fail, please the installer in debug mode and contact | 60 | If the installation fail, please the installer in debug mode and contact us at |
| 63 | us at team@nextdns.io with the transcript of the installation: | 61 | team@nextdns.io with the transcript of the installation: |
| 64 | 62 | ||
| 65 | ```sh | 63 | ```sh |
| 66 | sh -c 'DEBUG=1 sh -c "$(curl -sL https://nextdns.io/install)"' | 64 | sh -c 'DEBUG=1 sh -c "$(curl -sL https://nextdns.io/install)"' |
| @@ -68,15 +66,15 @@ sh -c 'DEBUG=1 sh -c "$(curl -sL https://nextdns.io/install)"' | |||
| 68 | 66 | ||
| 69 | ### Content Filtering Conflict | 67 | ### Content Filtering Conflict |
| 70 | 68 | ||
| 71 | NextDNS CLI and the UDM Content Filtering or the Ad Blocking features | 69 | NextDNS CLI and the UDM Content Filtering or the Ad Blocking features are |
| 72 | are incompatible. If you want to use NextDNS CLI, please make sure they | 70 | incompatible. If you want to use NextDNS CLI, please make sure they are |
| 73 | are disabled. | 71 | disabled. |
| 74 | 72 | ||
| 75 | To disable Content Filtering, go to Settings \> Network, then for each | 73 | To disable Content Filtering, go to Settings > Network, then for each network, |
| 76 | network, set the Content Filtering feature to None | 74 | set the Content Filtering feature to None |
| 77 | 75 | ||
| 78 | To disable Ad Blocking, go to Settings \> Application Firewall. In the | 76 | To disable Ad Blocking, go to Settings > Application Firewall. In the General |
| 79 | General tab, uncheck the Ad Blocking checkbox. | 77 | tab, uncheck the Ad Blocking checkbox. |
| 80 | 78 | ||
| 81 | ### APT Error | 79 | ### APT Error |
| 82 | 80 | ||
| @@ -96,8 +94,7 @@ sed -i -e 's/deb.debian.org/archive.debian.org/g' \ | |||
| 96 | 94 | ||
| 97 | ## install.sh | 95 | ## install.sh |
| 98 | 96 | ||
| 99 | Here are the contents of the `install.sh` file used above, as | 97 | Here are the contents of the `install.sh` file used above, as of 2023-12-03: |
| 100 | of 2023-12-03: | ||
| 101 | 98 | ||
| 102 | ```sh | 99 | ```sh |
| 103 | #!/bin/sh | 100 | #!/bin/sh |
content/blog/2024-01-08-dont-say-hello.md +16 −16
| @@ -5,25 +5,25 @@ description = "" | |||
| 5 | draft = false | 5 | draft = false |
| 6 | +++ | 6 | +++ |
| 7 | 7 | ||
| 8 | I recently came back from a winter break and have started working | 8 | I recently came back from a winter break and have started working again... only |
| 9 | again... only to immediately run into the dilemma of people sending me | 9 | to immediately run into the dilemma of people sending me cliffhanger messages |
| 10 | cliffhanger messages again. | 10 | again. |
| 11 | 11 | ||
| 12 | # No Hello | 12 | # No Hello |
| 13 | 13 | ||
| 14 | A year or two ago, I discovered [no hello](https://nohello.net/en/) and | 14 | A year or two ago, I discovered [no hello](https://nohello.net/en/) and have |
| 15 | have thought about it often since then. I\'ve even sent it to a few | 15 | thought about it often since then. I've even sent it to a few people since then |
| 16 | people since then (who wouldn\'t take offense to it). | 16 | (who wouldn't take offense to it). |
| 17 | 17 | ||
| 18 | I work in a fast-paced environment where efficiency is extremely | 18 | I work in a fast-paced environment where efficiency is extremely valuable. |
| 19 | valuable. Therefore, I have always held a deep displeasure for | 19 | Therefore, I have always held a deep displeasure for conversations where people |
| 20 | conversations where people start with \"Hello\" and then. | 20 | start with "Hello" and then. |
| 21 | 21 | ||
| 22 | I searched back through my work messages and found that I received \~50 | 22 | I searched back through my work messages and found that I received ~50 messages |
| 23 | messages from \~10 people last year from people that contained \"hi\", | 23 | from ~10 people last year from people that contained "hi", "hey", or |
| 24 | \"hey\", or \"hello\" and did not contain any indication of the purpose | 24 | "hello" and did not contain any indication of the purpose of the conversation. |
| 25 | of the conversation. I also noticed that a few of the users were | 25 | I also noticed that a few of the users were responsible for the large majority |
| 26 | responsible for the large majority of the cliffhangers. | 26 | of the cliffhangers. |
| 27 | 27 | ||
| 28 | There\'s no real point to this post, just a desparate request for people | 28 | There's no real point to this post, just a desparate request for people to |
| 29 | to please stop doing this. | 29 | please stop doing this. |
content/blog/2024-01-09-macos-customization.md +60 −71
| @@ -5,42 +5,38 @@ description = "" | |||
| 5 | draft = false | 5 | draft = false |
| 6 | +++ | 6 | +++ |
| 7 | 7 | ||
| 8 | I have been using macOS more than Linux lately, so I wrote this post to | 8 | I have been using macOS more than Linux lately, so I wrote this post to describe |
| 9 | describe some simple options to customize macOS beyond the normal | 9 | some simple options to customize macOS beyond the normal built-in settings menu. |
| 10 | built-in settings menu. | ||
| 11 | 10 | ||
| 12 | While not all-encompassing, the options below should be a good start for | 11 | While not all-encompassing, the options below should be a good start for anyone |
| 13 | anyone looking to dive down the rabbit hole. | 12 | looking to dive down the rabbit hole. |
| 14 | 13 | ||
| 15 | # Basics | 14 | # Basics |
| 16 | 15 | ||
| 17 | ## Package Management | 16 | ## Package Management |
| 18 | 17 | ||
| 19 | To install a lot of software on macOS, you will need | 18 | To install a lot of software on macOS, you will need |
| 20 | [Homebrew](https://brew.sh/). You can use their installation script to | 19 | [Homebrew](https://brew.sh/). You can use their installation script to get |
| 21 | get started. Simply open the `Terminal` application and paste | 20 | started. Simply open the `Terminal` application and paste the following snippet: |
| 22 | the following snippet: | ||
| 23 | 21 | ||
| 24 | ```sh | 22 | ```sh |
| 25 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | 23 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
| 26 | ``` | 24 | ``` |
| 27 | 25 | ||
| 28 | This will allow you to easily install and manage applications and other | 26 | This will allow you to easily install and manage applications and other software |
| 29 | software easily through the `brew` command. | 27 | easily through the `brew` command. |
| 30 | 28 | ||
| 31 | ## Terminal | 29 | ## Terminal |
| 32 | 30 | ||
| 33 | If you\'re serious about customizing your macOS system, I highly | 31 | If you're serious about customizing your macOS system, I highly recommend |
| 34 | recommend installing a terminal emulator that you like and if you\'re | 32 | installing a terminal emulator that you like and if you're not comfortable on |
| 35 | not comfortable on the command line yet, start learning. A lot of | 33 | the command line yet, start learning. A lot of customization options require you |
| 36 | customization options require you to edit hidden files, which is easiest | 34 | to edit hidden files, which is easiest in a terminal. |
| 37 | in a terminal. | ||
| 38 | 35 | ||
| 39 | There are options like iTerm2, Kitty, Alacritty, Hyper, Warp, or the | 36 | There are options like iTerm2, Kitty, Alacritty, Hyper, Warp, or the built-in |
| 40 | built-in Terminal app. | 37 | Terminal app. |
| 41 | 38 | ||
| 42 | I use [iTerm2](https://iterm2.com/), which can be installed with | 39 | I use [iTerm2](https://iterm2.com/), which can be installed with Homebrew: |
| 43 | Homebrew: | ||
| 44 | 40 | ||
| 45 | ```sh | 41 | ```sh |
| 46 | brew install iterm2 | 42 | brew install iterm2 |
| @@ -48,39 +44,37 @@ brew install iterm2 | |||
| 48 | 44 | ||
| 49 |  | 45 |  |
| 50 | 46 | ||
| 51 | To install color schemes, such as the Dracula scheme shown in the | 47 | To install color schemes, such as the Dracula scheme shown in the screenshot |
| 52 | screenshot above, you visit [iTerm | 48 | above, you visit [iTerm Themes](https://iterm2colorschemes.com/) and follow |
| 53 | Themes](https://iterm2colorschemes.com/) and follow their installation | 49 | their installation instructions to install any of the themes. |
| 54 | instructions to install any of the themes. | ||
| 55 | 50 | ||
| 56 | # Desktop | 51 | # Desktop |
| 57 | 52 | ||
| 58 | ## Window Management | 53 | ## Window Management |
| 59 | 54 | ||
| 60 | [yabai](https://github.com/koekeishiya/yabai) is a tiling window manager | 55 | [yabai](https://github.com/koekeishiya/yabai) is a tiling window manager for |
| 61 | for macOS. While other window managers exist, I found that most of them | 56 | macOS. While other window managers exist, I found that most of them struggled to |
| 62 | struggled to create logical layouts and to allow me to easily move | 57 | create logical layouts and to allow me to easily move windows around the screen. |
| 63 | windows around the screen. | ||
| 64 | 58 | ||
| 65 | Some advanced settings for yabai are only available if partially disable | 59 | Some advanced settings for yabai are only available if partially disable System |
| 66 | System Integrity Protection (SIP). However, I chose not to do this and | 60 | Integrity Protection (SIP). However, I chose not to do this and it hasn't |
| 67 | it hasn\'t affected my basic usage of yabai at all. | 61 | affected my basic usage of yabai at all. |
| 68 | 62 | ||
| 69 | Refer to the [yabai | 63 | Refer to the [yabai |
| 70 | wiki](https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(latest-release)) | 64 | wiki](https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(latest-release)) |
| 71 | for installation instructions. You will need to ensure that yabai is | 65 | for installation instructions. You will need to ensure that yabai is allowed to |
| 72 | allowed to access the accessibility and screen recording APIs. | 66 | access the accessibility and screen recording APIs. |
| 73 | 67 | ||
| 74 | You can see a basic three-pane layout atuomatically configured by yabai | 68 | You can see a basic three-pane layout atuomatically configured by yabai for me |
| 75 | for me as I opened the windows below. | 69 | as I opened the windows below. |
| 76 | 70 | ||
| 77 |  | 72 | manager](https://img.cleberg.net/blog/20240109-macos-customization/yabai.png) |
| 79 | 73 | ||
| 80 | ## Keyboard Shortcuts | 74 | ## Keyboard Shortcuts |
| 81 | 75 | ||
| 82 | [skhd](https://github.com/koekeishiya/skhd) is a simple hotkey daemon | 76 | [skhd](https://github.com/koekeishiya/skhd) is a simple hotkey daemon that |
| 83 | that allows you to define hotkeys in a file for usage on your system. | 77 | allows you to define hotkeys in a file for usage on your system. |
| 84 | 78 | ||
| 85 | Installation is simple: | 79 | Installation is simple: |
| 86 | 80 | ||
| @@ -89,11 +83,10 @@ brew install koekeishiya/formulae/skhd | |||
| 89 | skhd --start-service | 83 | skhd --start-service |
| 90 | ``` | 84 | ``` |
| 91 | 85 | ||
| 92 | After installation, be sure to allow `skhd` access to the | 86 | After installation, be sure to allow `skhd` access to the accessibility API in |
| 93 | accessibility API in the macOS privacy settings. | 87 | the macOS privacy settings. |
| 94 | 88 | ||
| 95 | You can configure your hotkeys in the `~/.config/skhd/skhdrc` | 89 | You can configure your hotkeys in the `~/.config/skhd/skhdrc` file: |
| 96 | file: | ||
| 97 | 90 | ||
| 98 | ```sh | 91 | ```sh |
| 99 | nano ~/.config/skhd/skhdrc | 92 | nano ~/.config/skhd/skhdrc |
| @@ -112,14 +105,13 @@ cmd + shift - return : /Applications/LibreWolf.app/Contents/MacOS/librewolf | |||
| 112 | ## Widgets | 105 | ## Widgets |
| 113 | 106 | ||
| 114 | [uebersicht](https://github.com/felixhageloh/uebersicht/) is a handy | 107 | [uebersicht](https://github.com/felixhageloh/uebersicht/) is a handy |
| 115 | desktop-based widget tool with a plethora of community-made widgets | 108 | desktop-based widget tool with a plethora of community-made widgets available in |
| 116 | available in the [widgets | 109 | the [widgets gallery](https://tracesof.net/uebersicht-widgets/). You can also |
| 117 | gallery](https://tracesof.net/uebersicht-widgets/). You can also write | 110 | write your own widgets with this tool. |
| 118 | your own widgets with this tool. | ||
| 119 | 111 | ||
| 120 | To install, simply download the latest release from the [uebersicht | 112 | To install, simply download the latest release from the [uebersicht |
| 121 | website](https://tracesof.net/uebersicht/) and copy it to the | 113 | website](https://tracesof.net/uebersicht/) and copy it to the Applications |
| 122 | Applications folder. | 114 | folder. |
| 123 | 115 | ||
| 124 | See below for an example of the | 116 | See below for an example of the |
| 125 | [Mond](https://tracesof.net/uebersicht-widgets/#Mond) widget in action. | 117 | [Mond](https://tracesof.net/uebersicht-widgets/#Mond) widget in action. |
| @@ -137,22 +129,20 @@ You can browse a discussion where various users shared their | |||
| 137 | for inspiration or to copy their dotfiles. | 129 | for inspiration or to copy their dotfiles. |
| 138 | 130 | ||
| 139 | See below for a quick (& slightly broken) copy of | 131 | See below for a quick (& slightly broken) copy of |
| 140 | [zer0yu\'s](https://github.com/zer0yu/dotfiles) SketchyBar | 132 | [zer0yu's](https://github.com/zer0yu/dotfiles) SketchyBar configuration. |
| 141 | configuration. | ||
| 142 | 133 | ||
| 143 |  | 134 |  |
| 144 | 135 | ||
| 145 | ## Dock | 136 | ## Dock |
| 146 | 137 | ||
| 147 | The easiest way to customize the dock is to install | 138 | The easiest way to customize the dock is to install |
| 148 | [uBar](https://ubarapp.com/), which uses a Windows-like menu bar as the | 139 | [uBar](https://ubarapp.com/), which uses a Windows-like menu bar as the default |
| 149 | default style. | 140 | style. |
| 150 | 141 | ||
| 151 | However, the built-in macOS dock cannot be disabled and can only be set | 142 | However, the built-in macOS dock cannot be disabled and can only be set to |
| 152 | to \"always hidden\". This can be annoying as it will pop out any time | 143 | "always hidden". This can be annoying as it will pop out any time your mouse |
| 153 | your mouse cursor passes closely to the dock edge of the screen. Because | 144 | cursor passes closely to the dock edge of the screen. Because of this, I simply |
| 154 | of this, I simply use the built-in dock instead of customizing it with | 145 | use the built-in dock instead of customizing it with third-party software. |
| 155 | third-party software. | ||
| 156 | 146 | ||
| 157 | Regardless, see below for the default installation style of uBar. | 147 | Regardless, see below for the default installation style of uBar. |
| 158 | 148 | ||
| @@ -160,22 +150,21 @@ Regardless, see below for the default installation style of uBar. | |||
| 160 | 150 | ||
| 161 | ## Application Icons | 151 | ## Application Icons |
| 162 | 152 | ||
| 163 | You can also customize the icon of any application in macOS, which will | 153 | You can also customize the icon of any application in macOS, which will show up |
| 164 | show up in Finder, the Dock, Launchpad, search results, etc. I recommend | 154 | in Finder, the Dock, Launchpad, search results, etc. I recommend using |
| 165 | using [macOSicons](https://macosicons.com/) to download icons you want, | 155 | [macOSicons](https://macosicons.com/) to download icons you want, and then apply |
| 166 | and then apply them by following this process. | 156 | them by following this process. |
| 167 | 157 | ||
| 168 | 1. Open the Finder application. | 158 | 1. Open the Finder application. |
| 169 | 2. Navigate to the `Applications` folder. | 159 | 2. Navigate to the `Applications` folder. |
| 170 | 3. Right-click an application of your choice, and select | 160 | 3. Right-click an application of your choice, and select `Get Info`. |
| 171 | `Get Info`. | 161 | 4. Drag the image you downloaded on top of the application's icon at the top of |
| 172 | 4. Drag the image you downloaded on top of the application\'s icon at | 162 | information window (you will see a green "plus" symbol when you're |
| 173 | the top of information window (you will see a green \"plus\" symbol | 163 | hovering over it). |
| 174 | when you\'re hovering over it). | 164 | 5. Release the new icon on top of the old icon and it will update! |
| 175 | 5. Release the new icon on top of the old icon and it will update! | 165 | |
| 176 | 166 | You can see an example of me dragging a new `signal.icns` file onto my | |
| 177 | You can see an example of me dragging a new `signal.icns` | 167 | Signal.app information window to update it below: |
| 178 | file onto my Signal.app information window to update it below: | ||
| 179 | 168 | ||
| 180 |  | 170 | icons](https://img.cleberg.net/blog/20240109-macos-customization/replace_icon.png) |
content/blog/2024-01-13-local-llm.md +53 −59
| @@ -7,40 +7,38 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # Requirements | 8 | # Requirements |
| 9 | 9 | ||
| 10 | I\'ve recently started playing with large language models (LLMs), mostly | 10 | I've recently started playing with large language models (LLMs), mostly in the |
| 11 | in the popular chatbot form, as part of my job and have decided to see | 11 | popular chatbot form, as part of my job and have decided to see if there's a |
| 12 | if there\'s a consistent and reliable way to interact with these models | 12 | consistent and reliable way to interact with these models on Apple devices |
| 13 | on Apple devices without sacrificing privacy or requiring in-depth | 13 | without sacrificing privacy or requiring in-depth technical setup. |
| 14 | technical setup. | ||
| 15 | 14 | ||
| 16 | My requirements for this test: | 15 | My requirements for this test: |
| 17 | 16 | ||
| 18 | - Open source platform | 17 | - Open source platform |
| 19 | - On-device model files | 18 | - On-device model files |
| 20 | - Minimal required configuration | 19 | - Minimal required configuration |
| 21 | - Preferably pre-built, but a simple build process is acceptable | 20 | - Preferably pre-built, but a simple build process is acceptable |
| 22 | 21 | ||
| 23 | I tested a handful of apps and have summarized my favorite (so far) for | 22 | I tested a handful of apps and have summarized my favorite (so far) for macOS |
| 24 | macOS and iOS below. | 23 | and iOS below. |
| 25 | 24 | ||
| 26 | > TL;DR - Here are the two that met my requirements and I have found the | 25 | > TL;DR - Here are the two that met my requirements and I have found the easiest |
| 27 | > easiest to install and use so far: | 26 | > to install and use so far: |
| 28 | 27 | ||
| 29 | - macOS: [Ollama](https://ollama.ai/) | 28 | - macOS: [Ollama](https://ollama.ai/) |
| 30 | - iOS : [LLM Farm](https://llmfarm.site/) | 29 | - iOS : [LLM Farm](https://llmfarm.site/) |
| 31 | 30 | ||
| 32 | # macOS | 31 | # macOS |
| 33 | 32 | ||
| 34 | [Ollama](https://ollama.ai/) is a simple Go application for macOS and | 33 | [Ollama](https://ollama.ai/) is a simple Go application for macOS and Linux that |
| 35 | Linux that can run various LLMs locally. | 34 | can run various LLMs locally. |
| 36 | 35 | ||
| 37 | For macOS, you can download the pplication on the [Ollama download | 36 | For macOS, you can download the pplication on the [Ollama download |
| 38 | page](https://ollama.ai/download/mac) and install it by unzipping the | 37 | page](https://ollama.ai/download/mac) and install it by unzipping the |
| 39 | `Ollama.app` file and moving it to the | 38 | `Ollama.app` file and moving it to the `Applications` folder. |
| 40 | `Applications` folder. | ||
| 41 | 39 | ||
| 42 | If you prefer the command line, you can run these commands after the | 40 | If you prefer the command line, you can run these commands after the download |
| 43 | download finished: | 41 | finished: |
| 44 | 42 | ||
| 45 | ```sh | 43 | ```sh |
| 46 | cd ~/Downloads && \ | 44 | cd ~/Downloads && \ |
| @@ -48,64 +46,60 @@ unzip Ollama-darwin.zip && \ | |||
| 48 | mv ~/Downloads/Ollama.app /Applications/ | 46 | mv ~/Downloads/Ollama.app /Applications/ |
| 49 | ``` | 47 | ``` |
| 50 | 48 | ||
| 51 | After running the app, the app will ask you to open a terminal and run | 49 | After running the app, the app will ask you to open a terminal and run the |
| 52 | the default `llama2` model, which will open an interactive | 50 | default `llama2` model, which will open an interactive chat session in the |
| 53 | chat session in the terminal. You can startfully using the application | 51 | terminal. You can startfully using the application at this point. |
| 54 | at this point. | ||
| 55 | 52 | ||
| 56 |  | 53 |  |
| 57 | 54 | ||
| 58 | If you don\'t want to use the default `llama2` model, you can | 55 | If you don't want to use the default `llama2` model, you can download and run |
| 59 | download and run additional models found on the | 56 | additional models found on the [Models](https://ollama.ai/library) page. |
| 60 | [Models](https://ollama.ai/library) page. | ||
| 61 | 57 | ||
| 62 | To see the information for the currently-used model, you can run the | 58 | To see the information for the currently-used model, you can run the `/show |
| 63 | `/show info` command in the chat. | 59 | info` command in the chat. |
| 64 | 60 | ||
| 65 |  |
| 66 | Info](https://img.cleberg.net/blog/20240113-local-llm/ollama_info.png) | ||
| 67 | 62 | ||
| 68 | ## Community Integrations | 63 | ## Community Integrations |
| 69 | 64 | ||
| 70 | I highly recommend browsing the [Community | 65 | I highly recommend browsing the [Community |
| 71 | Integrations](https://github.com/jmorganca/ollama#community-integrations) | 66 | Integrations](https://github.com/jmorganca/ollama#community-integrations) |
| 72 | section of the project to see how you would prefer to extend Ollama | 67 | section of the project to see how you would prefer to extend Ollama beyond a |
| 73 | beyond a simple command-line interface. There are options for APIs, | 68 | simple command-line interface. There are options for APIs, browser UIs, advanced |
| 74 | browser UIs, advanced terminal configurations, and more. | 69 | terminal configurations, and more. |
| 75 | 70 | ||
| 76 |  | 72 | SwiftUI](https://img.cleberg.net/blog/20240113-local-llm/ollama-swiftui.png) |
| 78 | 73 | ||
| 79 | # iOS | 74 | # iOS |
| 80 | 75 | ||
| 81 | While there are a handful of decent macOS options, it was quite | 76 | While there are a handful of decent macOS options, it was quite difficult to |
| 82 | difficult to find an iOS app that offered an open source platform | 77 | find an iOS app that offered an open source platform without an extensive |
| 83 | without an extensive configuration and building process. I found LLM | 78 | configuration and building process. I found LLM Farm to be decent enough in |
| 84 | Farm to be decent enough in quality to sit at the top of my list - | 79 | quality to sit at the top of my list - however, it's definitely not user |
| 85 | however, it\'s definitely not user friendly enough for me to consider | 80 | friendly enough for me to consider using it on a daily basis. |
| 86 | using it on a daily basis. | ||
| 87 | 81 | ||
| 88 | [LLM Farm](https://llmfarm.site/) is available on TestFlight, so | 82 | [LLM Farm](https://llmfarm.site/) is available on TestFlight, so there's no |
| 89 | there\'s no manual build process required. However, you can view the | 83 | manual build process required. However, you can view the [LLMFarm |
| 90 | [LLMFarm repository](https://github.com/guinmoon/LLMFarm) if you wish. | 84 | repository](https://github.com/guinmoon/LLMFarm) if you wish. |
| 91 | 85 | ||
| 92 | The caveat is that you will have to manually download the model files | 86 | The caveat is that you will have to manually download the model files from the |
| 93 | from the links in the | 87 | links in the |
| 94 | [models.md](https://github.com/guinmoon/LLMFarm/blob/main/models.md) | 88 | [models.md](https://github.com/guinmoon/LLMFarm/blob/main/models.md) file to |
| 95 | file to your iPhone to use the app - there\'s currently no option in the | 89 | your iPhone to use the app - there's currently no option in the app to reach |
| 96 | app to reach out and grab the latest version of any supported model. | 90 | out and grab the latest version of any supported model. |
| 97 | 91 | ||
| 98 | Once you have a file downloaded, you simply create a new chat and select | 92 | Once you have a file downloaded, you simply create a new chat and select the |
| 99 | the downloaded model file and ensure the inference matches the | 93 | downloaded model file and ensure the inference matches the requirement in the |
| 100 | requirement in the `models.md` file. | 94 | `models.md` file. |
| 101 | 95 | ||
| 102 | See below for a test of the ORCA Mini v3 model: | 96 | See below for a test of the ORCA Mini v3 model: |
| 103 | 97 | ||
| 104 | Chat List Chat | 98 | | Chat List | Chat | |
| 105 | ------------------------------------------------------------------------- ------------------------------------------------------------------- | 99 | |-------------------------------------------------------------------------|-------------------------------------------------------------------| |
| 106 |   | 100 | |  |  | |
| 107 | 101 | ||
| 108 | [Enchanted](https://github.com/AugustDev/enchanted) is also an iOS for | 102 | [Enchanted](https://github.com/AugustDev/enchanted) is also an iOS for private |
| 109 | private AI models, but it requires a public-facing Ollama API, which did | 103 | AI models, but it requires a public-facing Ollama API, which did not meet my |
| 110 | not meet my \"on device requirement.\" Nonetheless, it\'s an interesting | 104 | "on device requirement." Nonetheless, it's an interesting looking app and I |
| 111 | looking app and I will likely set it up to test soon. | 105 | will likely set it up to test soon. |
content/blog/2024-01-26-audit-dashboard.md +96 −107
| @@ -5,9 +5,9 @@ description = "" | |||
| 5 | draft = false | 5 | draft = false |
| 6 | +++ | 6 | +++ |
| 7 | 7 | ||
| 8 | Alteryx and Power BI are powerful tools that can help turn your | 8 | Alteryx and Power BI are powerful tools that can help turn your old-school audit |
| 9 | old-school audit trackers into interactive tools that provide useful | 9 | trackers into interactive tools that provide useful insights and potential |
| 10 | insights and potential action plans. | 10 | action plans. |
| 11 | 11 | ||
| 12 | With these tools, we are going to build the following dashboard: | 12 | With these tools, we are going to build the following dashboard: |
| 13 | 13 | ||
| @@ -18,59 +18,57 @@ With these tools, we are going to build the following dashboard: | |||
| 18 | 18 | ||
| 19 | This project assumes the following: | 19 | This project assumes the following: |
| 20 | 20 | ||
| 21 | - You have access to Alteryx Designer and Power BI Desktop. | 21 | - You have access to Alteryx Designer and Power BI Desktop. |
| 22 | - If you only have Power BI Desktop, you may need to perform some | 22 | - If you only have Power BI Desktop, you may need to perform some analysis |
| 23 | analysis in Power BI instead of Alteryx. | 23 | in Power BI instead of Alteryx. |
| 24 | - Your data is in a format that can be imported into Alteryx and/or | 24 | - Your data is in a format that can be imported into Alteryx and/or Power BI. |
| 25 | Power BI. | 25 | - You have a basic understanding of data types and visualization. |
| 26 | - You have a basic understanding of data types and visualization. | ||
| 27 | 26 | ||
| 28 | # Alteryx: Data Preparation & Analysis | 27 | # Alteryx: Data Preparation & Analysis |
| 29 | 28 | ||
| 30 | ## Import Data | 29 | ## Import Data |
| 31 | 30 | ||
| 32 | With Alteryx, importing data is easy with the use of the | 31 | With Alteryx, importing data is easy with the use of the `Input Data` tool. |
| 33 | `Input Data` tool. Simply drag this tool onto the canvas from | 32 | Simply drag this tool onto the canvas from the `In/Out` tab in the Ribbon to |
| 34 | the `In/Out` tab in the Ribbon to create it as a node. | 33 | create it as a node. |
| 35 | 34 | ||
| 36 | You can choose the File Format manually or simply connect to your | 35 | You can choose the File Format manually or simply connect to your file/database |
| 37 | file/database and let Alteryx determine the format for you. For this | 36 | and let Alteryx determine the format for you. For this example, we will be |
| 38 | example, we will be importing an Excel file and changing the | 37 | importing an Excel file and changing the `Start Data Import on Line` variable to |
| 39 | `Start Data Import on Line` variable to `2`. | 38 | `2`. |
| 40 | 39 | ||
| 41 |  | 41 | Import](https://img.cleberg.net/blog/20240126-audit-dashboard/alteryx_import.png) |
| 43 | 42 | ||
| 44 | ## Transform Data | 43 | ## Transform Data |
| 45 | 44 | ||
| 46 | Next, let\'s replace null data and remove whitespace to clean up our | 45 | Next, let's replace null data and remove whitespace to clean up our data. We |
| 47 | data. We can do this with the `Data Cleansing` tool in the | 46 | can do this with the `Data Cleansing` tool in the `Preparation` tab in the |
| 48 | `Preparation` tab in the Ribbon. | 47 | Ribbon. |
| 49 | 48 | ||
| 50 | Ensure that the following options are enabled: | 49 | Ensure that the following options are enabled: |
| 51 | 50 | ||
| 52 | - Replace Nulls | 51 | - Replace Nulls |
| 53 | - Replace with Blanks (String Fields) | 52 | - Replace with Blanks (String Fields) |
| 54 | - Replace with 0 (Numeric Fields) | 53 | - Replace with 0 (Numeric Fields) |
| 55 | - Remove Unwanted Characters | 54 | - Remove Unwanted Characters |
| 56 | - Leading and Trailing Whitespace | 55 | - Leading and Trailing Whitespace |
| 57 | 56 | ||
| 58 |  | 58 | Cleansing](https://img.cleberg.net/blog/20240126-audit-dashboard/alteryx_cleansing.png) |
| 60 | 59 | ||
| 61 | For our next step, we will transform the date fields from strings to | 60 | For our next step, we will transform the date fields from strings to datetime |
| 62 | datetime format. Add a `Datetime` tool for each field you | 61 | format. Add a `Datetime` tool for each field you want to transform - in the |
| 63 | want to transform - in the example below, I am using the tool twice for | 62 | example below, I am using the tool twice for the "Started On" and "Submitted |
| 64 | the \"Started On\" and \"Submitted On\" fields. | 63 | On" fields. |
| 65 | 64 | ||
| 66 |  | 66 | Transformation](https://img.cleberg.net/blog/20240126-audit-dashboard/alteryx_transformation.png) |
| 68 | 67 | ||
| 69 | Now that the dates are in the correct format, let\'s perform a | 68 | Now that the dates are in the correct format, let's perform a calculation based |
| 70 | calculation based on those fields. Start by adding a `Filter` | 69 | on those fields. Start by adding a `Filter` tool, naming a new Output Column, |
| 71 | tool, naming a new Output Column, and pasting the formula below into it | 70 | and pasting the formula below into it (the two fields used in this formula must |
| 72 | (the two fields used in this formula must match the output of the | 71 | match the output of the `Datetime` tools above): |
| 73 | `Datetime` tools above): | ||
| 74 | 72 | ||
| 75 | ``` txt | 73 | ``` txt |
| 76 | DateTimeDiff([SubmittedOn_Out],[StartedOn_Out], "days") | 74 | DateTimeDiff([SubmittedOn_Out],[StartedOn_Out], "days") |
| @@ -81,8 +79,8 @@ Analysis](https://img.cleberg.net/blog/20240126-audit-dashboard/alteryx_analysis | |||
| 81 | 79 | ||
| 82 | ## Export Data | 80 | ## Export Data |
| 83 | 81 | ||
| 84 | Finalize the process by exporting the transformed data set to a new | 82 | Finalize the process by exporting the transformed data set to a new file, for |
| 85 | file, for use in the following visualization step. | 83 | use in the following visualization step. |
| 86 | 84 | ||
| 87 |  | 86 | Export](https://img.cleberg.net/blog/20240126-audit-dashboard/alteryx_export.png) |
| @@ -91,17 +89,15 @@ Export](https://img.cleberg.net/blog/20240126-audit-dashboard/alteryx_export.png | |||
| 91 | 89 | ||
| 92 | ## Import Data | 90 | ## Import Data |
| 93 | 91 | ||
| 94 | To start, open the Power BI Desktop application. Upon first use, Power | 92 | To start, open the Power BI Desktop application. Upon first use, Power BI will |
| 95 | BI will ask if you want to open an existing dashboard or import new | 93 | ask if you want to open an existing dashboard or import new data. |
| 96 | data. | ||
| 97 | 94 | ||
| 98 | As we are creating our first dashboard, let\'s import our data. In my | 95 | As we are creating our first dashboard, let's import our data. In my example |
| 99 | example below, I\'m importing data from the \"Tracker\" sheet of the | 96 | below, I'm importing data from the "Tracker" sheet of the Excel file I'm |
| 100 | Excel file I\'m using for this project. | 97 | using for this project. |
| 101 | 98 | ||
| 102 | During this process, I also imported the export from the Alteryx | 99 | During this process, I also imported the export from the Alteryx workflow above. |
| 103 | workflow above. Therefore, we have two different files available for use | 100 | Therefore, we have two different files available for use in our dashboard. |
| 104 | in our dashboard. | ||
| 105 | 101 | ||
| 106 |  | 103 | Tracker](https://img.cleberg.net/blog/20240126-audit-dashboard/excel_tracker.png) |
| @@ -111,78 +107,71 @@ Import](https://img.cleberg.net/blog/20240126-audit-dashboard/powerbi_import.png | |||
| 111 | 107 | ||
| 112 | ## Add Visuals | 108 | ## Add Visuals |
| 113 | 109 | ||
| 114 | To create the dashboard below, you will need to follow the list | 110 | To create the dashboard below, you will need to follow the list instructions |
| 115 | instructions below and format as needed: | 111 | below and format as needed: |
| 116 | 112 | ||
| 117 |  | 113 |  |
| 118 |  | 114 |  |
| 119 | 115 | ||
| 120 | Instructions to create the visuals above: | 116 | Instructions to create the visuals above: |
| 121 | 117 | ||
| 122 | - `Text Box`: Explain the name and purpose of the | 118 | - `Text Box`: Explain the name and purpose of the dashboard. You can also add |
| 123 | dashboard. You can also add images and logos at the top of the | 119 | images and logos at the top of the dashboard. |
| 124 | dashboard. | 120 | - `Donut Chart`: Overall status of the project. |
| 125 | - `Donut Chart`: Overall status of the project. | 121 | - `Legend`: Status |
| 126 | - `Legend`: Status | 122 | - `Values`: Count of Status |
| 127 | - `Values`: Count of Status | 123 | - `Stacked Column Chart`: Task count by assignee. |
| 128 | - `Stacked Column Chart`: Task count by assignee. | 124 | - `X-axis`: Preparer |
| 129 | - `X-axis`: Preparer | 125 | - `Y-axis`: Count of Control ID |
| 130 | - `Y-axis`: Count of Control ID | 126 | - `Legend`: Status |
| 131 | - `Legend`: Status | 127 | - `Treemap`: Top N client submitters by average days to submit. |
| 132 | - `Treemap`: Top N client submitters by average days to | 128 | - `Details`: Preparer |
| 133 | submit. | 129 | - `Values`: Sum of Avg~DaysToSubmit~ |
| 134 | - `Details`: Preparer | 130 | - `Line Chart`: Projected vs. actual hours over time. |
| 135 | - `Values`: Sum of Avg~DaysToSubmit~ | 131 | - `Clustered Bar Chart`: Projected vs. actual hours per person. |
| 136 | - `Line Chart`: Projected vs. actual hours over time. | 132 | - `Slicer & Table` - Upcoming due dates. |
| 137 | - `Clustered Bar Chart`: Projected vs. actual hours per | 133 | - `Slicer`: |
| 138 | person. | 134 | - `Values`: Date Due |
| 139 | - `Slicer & Table` - Upcoming due dates. | 135 | - `Table`: |
| 140 | - `Slicer`: | 136 | - `Columns`: Count of Control ID, Date Due, Preparer, Status |
| 141 | - `Values`: Date Due | ||
| 142 | - `Table`: | ||
| 143 | - `Columns`: Count of Control ID, Date Due, | ||
| 144 | Preparer, Status | ||
| 145 | 137 | ||
| 146 | ## Format the Dashboard | 138 | ## Format the Dashboard |
| 147 | 139 | ||
| 148 | You can choose a theme in the View tab of the Ribbon. You can even | 140 | You can choose a theme in the View tab of the Ribbon. You can even browse for |
| 149 | browse for custom JSON files that define themes, such as ones found | 141 | custom JSON files that define themes, such as ones found online or custom ones |
| 150 | online or custom ones created by your organization. | 142 | created by your organization. |
| 151 | 143 | ||
| 152 | For each visual, you can click the `Format` button in the | 144 | For each visual, you can click the `Format` button in the `Visualizations` side |
| 153 | `Visualizations` side pane and explore the options. You can | 145 | pane and explore the options. You can custom options such as: |
| 154 | custom options such as: | 146 | |
| 155 | 147 | - Visual | |
| 156 | - Visual | 148 | - Legend |
| 157 | - Legend | 149 | - Colors |
| 158 | - Colors | 150 | - Data labels |
| 159 | - Data labels | 151 | - Category labels |
| 160 | - Category labels | 152 | - General |
| 161 | - General | 153 | - Properties |
| 162 | - Properties | 154 | - Title |
| 163 | - Title | 155 | - Effects |
| 164 | - Effects | 156 | - Header icons |
| 165 | - Header icons | 157 | - Tooltips |
| 166 | - Tooltips | 158 | - Alt text |
| 167 | - Alt text | 159 | |
| 168 | 160 | You can always look online for inspiration when trying to decide how best to | |
| 169 | You can always look online for inspiration when trying to decide how | 161 | organize and style your dashboard. |
| 170 | best to organize and style your dashboard. | ||
| 171 | 162 | ||
| 172 | # Sharing the Results | 163 | # Sharing the Results |
| 173 | 164 | ||
| 174 | Generally, you have a few different options for sharing your dashboards | 165 | Generally, you have a few different options for sharing your dashboards with |
| 175 | with others: | 166 | others: |
| 176 | 167 | ||
| 177 | 1. Export the dashboard as a PDF in the file menu of Power BI. This | 168 | 1. Export the dashboard as a PDF in the file menu of Power BI. This will export |
| 178 | will export all tabs and visuals as they are set when the export | 169 | all tabs and visuals as they are set when the export button is pressed. You |
| 179 | button is pressed. You will lose all interactivity with this option. | 170 | will lose all interactivity with this option. |
| 180 | 2. Send the full Power BI file to those you wish to share the | 171 | 2. Send the full Power BI file to those you wish to share the dashboard. This |
| 181 | dashboard. This will retain all settings and interactivity. However, | 172 | will retain all settings and interactivity. However, you will also need to |
| 182 | you will also need to send the source files if they need to refresh | 173 | send the source files if they need to refresh the dashboard and you will need |
| 183 | the dashboard and you will need to re-send the files if you make | 174 | to re-send the files if you make updates. |
| 184 | updates. | 175 | 3. Store the dashboard in a synced location, such as a shared drive or Microsoft |
| 185 | 3. Store the dashboard in a synced location, such as a shared drive or | 176 | Teams. Depending on how a user configures their local Windows paths, the data |
| 186 | Microsoft Teams. Depending on how a user configures their local | 177 | source paths may not be compatible for all users with such a setup. |
| 187 | Windows paths, the data source paths may not be compatible for all | ||
| 188 | users with such a setup. | ||
content/blog/2024-01-27-tableau-dashboard.md +48 −51
| @@ -5,12 +5,12 @@ description = "" | |||
| 5 | draft = false | 5 | draft = false |
| 6 | +++ | 6 | +++ |
| 7 | 7 | ||
| 8 | In this project, I am going to show you how to use Tableau Public for | 8 | In this project, I am going to show you how to use Tableau Public for free to |
| 9 | free to create simple dashboards. | 9 | create simple dashboards. |
| 10 | 10 | ||
| 11 | I will be creating simple visuals from an Omaha crime data set and | 11 | I will be creating simple visuals from an Omaha crime data set and combining |
| 12 | combining them to create the dashboard below. You can view this | 12 | them to create the dashboard below. You can view this dashboard interactively |
| 13 | dashboard interactively online here: [Omaha Crime Data (2015 - | 13 | online here: [Omaha Crime Data (2015 - |
| 14 | 2023)](https://public.tableau.com/app/profile/c.c7042/viz/OmahaCrimeData2015-2023/OmahaCrimeData2015-2023#1). | 14 | 2023)](https://public.tableau.com/app/profile/c.c7042/viz/OmahaCrimeData2015-2023/OmahaCrimeData2015-2023#1). |
| 15 | 15 | ||
| 16 |  is a free-to-use web | 85 | [Tableau Public](https://public.tableau.com/) is a free-to-use web application |
| 86 | application that allows you to create visualizations by uploading data | 86 | that allows you to create visualizations by uploading data sources. Note that |
| 87 | sources. Note that there\'s no way to keep the data and visualizations | 87 | there's no way to keep the data and visualizations private, so don't upload |
| 88 | private, so don\'t upload anything private. | 88 | anything private. |
| 89 | 89 | ||
| 90 | After creating an account, you can click the `Create` \> | 90 | After creating an account, you can click the `Create` > `Web Authoring` link to |
| 91 | `Web Authoring` link to create your first visualization. | 91 | create your first visualization. |
| 92 | 92 | ||
| 93 |  | 94 | Button](https://img.cleberg.net/blog/20240127-tableau-dashboard/create_button.png) |
| 95 | 95 | ||
| 96 | ## Upload the Data | 96 | ## Upload the Data |
| 97 | 97 | ||
| 98 | Once you\'ve opened your first project, Tableau will ask you to connect | 98 | Once you've opened your first project, Tableau will ask you to connect to your |
| 99 | to your data. For this project, click the | 99 | data. For this project, click the `Upload from computer` button and select the |
| 100 | `Upload from computer` button and select the CSV file | 100 | CSV file previously combined in the step above. |
| 101 | previously combined in the step above. | ||
| 102 | 101 | ||
| 103 |  | 103 | Data](https://img.cleberg.net/blog/20240127-tableau-dashboard/connect_data.png) |
| 105 | 104 | ||
| 106 | Once connected, you can refresh the preview of the data with the | 105 | Once connected, you can refresh the preview of the data with the `Refresh Data |
| 107 | `Refresh Data Source` button in the toolbar. | 106 | Source` button in the toolbar. |
| 108 | 107 | ||
| 109 |  | 109 | Preview](https://img.cleberg.net/blog/20240127-tableau-dashboard/data_preview.png) |
| 111 | 110 | ||
| 112 | If you need to edit any of the data types, column names, etc., you can | 111 | If you need to edit any of the data types, column names, etc., you can do so |
| 113 | do so now. Once complete, generate an extract so that you can start | 112 | now. Once complete, generate an extract so that you can start creating |
| 114 | creating visualizations. | 113 | visualizations. |
| 115 | 114 | ||
| 116 | ## Create Visualizations | 115 | ## Create Visualizations |
| 117 | 116 | ||
| 118 | To start, create a worksheet in the toolbar at the bottom of the screen. | 117 | To start, create a worksheet in the toolbar at the bottom of the screen. |
| 119 | 118 | ||
| 120 | Within this screen, select a column from the `Data` side bar | 119 | Within this screen, select a column from the `Data` side bar on the left and |
| 121 | on the left and drag it into the `Columns` or | 120 | drag it into the `Columns` or `Rows` area of the canvas. |
| 122 | `Rows` area of the canvas. | ||
| 123 | 121 | ||
| 124 | See below for the map visualization. You can recreate this by adding the | 122 | See below for the map visualization. You can recreate this by adding the |
| 125 | following fields: | 123 | following fields: |
| 126 | 124 | ||
| 127 | - `Columns`: Lon | 125 | - `Columns`: Lon |
| 128 | - `Rows`: Lat | 126 | - `Rows`: Lat |
| 129 | - `Marks`: | 127 | - `Marks`: |
| 130 | - Description | 128 | - Description |
| 131 | - Datetime | 129 | - Datetime |
| 132 | - `Filters`: Datetime | 130 | - `Filters`: Datetime |
| 133 | 131 | ||
| 134 |  | 133 | Editing](https://img.cleberg.net/blog/20240127-tableau-dashboard/worksheet_edit.png) |
| 136 | 134 | ||
| 137 | You can repeat this process for each visualization you want to create. | 135 | You can repeat this process for each visualization you want to create. Explore |
| 138 | Explore your options by dragging data fields to different areas and by | 136 | your options by dragging data fields to different areas and by opening the field |
| 139 | opening the field options to explore what operations can be performed on | 137 | options to explore what operations can be performed on different data types |
| 140 | different data types (e.g., average, count, etc.). | 138 | (e.g., average, count, etc.). |
| 141 | 139 | ||
| 142 | ## Create Dashboard | 140 | ## Create Dashboard |
| 143 | 141 | ||
| 144 | To create a dashboard, click the button on the toolbar at the bottom of | 142 | To create a dashboard, click the button on the toolbar at the bottom of the |
| 145 | the screen. Within the dashboard, drag each sheet from the left side bar | 143 | screen. Within the dashboard, drag each sheet from the left side bar onto the |
| 146 | onto the dashboard canvas. | 144 | dashboard canvas. |
| 147 | 145 | ||
| 148 |  | 147 | Editing](https://img.cleberg.net/blog/20240127-tableau-dashboard/dashboard_edit.png) |
| 150 | 148 | ||
| 151 | ## Formatting | 149 | ## Formatting |
| 152 | 150 | ||
| 153 | You can explore a ton of different formatting options throughout the | 151 | You can explore a ton of different formatting options throughout the worksheets |
| 154 | worksheets and dashboard. Specifically for maps, you can alter the map | 152 | and dashboard. Specifically for maps, you can alter the map layers, background, |
| 155 | layers, background, and visible features through the `Map` | 153 | and visible features through the `Map` menu in the top file menu of the editing |
| 156 | menu in the top file menu of the editing screen. | 154 | screen. |
| 157 | 155 | ||
| 158 | In the finished dashboard below, I opted for a dark mode with a map that | 156 | In the finished dashboard below, I opted for a dark mode with a map that showed |
| 159 | showed county lines and city names. | 157 | county lines and city names. |
| 160 | 158 | ||
| 161 | There\'s a ton of other options available to be used in a dashboard like | 159 | There's a ton of other options available to be used in a dashboard like this, |
| 162 | this, but this project shows a quick preview of what you can do in | 160 | but this project shows a quick preview of what you can do in Tableau Public. |
| 163 | Tableau Public. | ||
| 164 | 161 | ||
| 165 |  | 163 | Dashboard](https://img.cleberg.net/blog/20240127-tableau-dashboard/dashboard.png) |
content/blog/2024-02-06-zfs.md +69 −83
| @@ -8,14 +8,12 @@ draft = false | |||
| 8 | This post details the process I used to create ZFS pools, datasets, and | 8 | This post details the process I used to create ZFS pools, datasets, and |
| 9 | snapshots on Ubuntu Server. | 9 | snapshots on Ubuntu Server. |
| 10 | 10 | ||
| 11 | I found the following pages very helpful while going through this | 11 | I found the following pages very helpful while going through this process: |
| 12 | process: | ||
| 13 | 12 | ||
| 14 | - [Setup a ZFS storage | 13 | - [Setup a ZFS storage |
| 15 | pool](https://ubuntu.com/tutorials/setup-zfs-storage-pool) | 14 | pool](https://ubuntu.com/tutorials/setup-zfs-storage-pool) |
| 16 | - [Kernel/Reference/ZFS](https://wiki.ubuntu.com/Kernel/Reference/ZFS) | 15 | - [Kernel/Reference/ZFS](https://wiki.ubuntu.com/Kernel/Reference/ZFS) |
| 17 | - [ZFS for | 16 | - [ZFS for Dummies](https://blog.victormendonca.com/2020/11/03/zfs-for-dummies/) |
| 18 | Dummies](https://blog.victormendonca.com/2020/11/03/zfs-for-dummies/) | ||
| 19 | 17 | ||
| 20 | # Installation | 18 | # Installation |
| 21 | 19 | ||
| @@ -25,8 +23,7 @@ To start, I installed the ZFS package with the following command: | |||
| 25 | sudo apt install zfsutils-linux | 23 | sudo apt install zfsutils-linux |
| 26 | ``` | 24 | ``` |
| 27 | 25 | ||
| 28 | Once installed, you can check the version to see if it installed | 26 | Once installed, you can check the version to see if it installed correctly. |
| 29 | correctly. | ||
| 30 | 27 | ||
| 31 | ```sh | 28 | ```sh |
| 32 | > zsf --version | 29 | > zsf --version |
| @@ -39,32 +36,32 @@ zfs-kmod-2.1.5-1ubuntu6~22.04.1 | |||
| 39 | 36 | ||
| 40 | Now that ZFS is installed, we can create and configure the pool. | 37 | Now that ZFS is installed, we can create and configure the pool. |
| 41 | 38 | ||
| 42 | You have various options for configuring ZFS pools that all come | 39 | You have various options for configuring ZFS pools that all come different pros |
| 43 | different pros and cons. I suggest visiting the links at the top of this | 40 | and cons. I suggest visiting the links at the top of this post or searching |
| 44 | post or searching online for the best configuration for your use-case. | 41 | online for the best configuration for your use-case. |
| 45 | 42 | ||
| 46 | - Striped VDEVs (Raid0) | 43 | - Striped VDEVs (Raid0) |
| 47 | - Mirrored VDEVs (Raid1) | 44 | - Mirrored VDEVs (Raid1) |
| 48 | - Striped Mirrored VDEVs (Raid10) | 45 | - Striped Mirrored VDEVs (Raid10) |
| 49 | - RAIDz (Raid5) | 46 | - RAIDz (Raid5) |
| 50 | - RAIDz2 (Raidd6) | 47 | - RAIDz2 (Raidd6) |
| 51 | - RAIDz3 | 48 | - RAIDz3 |
| 52 | - Nested RAIDz (Raid50, Raid60) | 49 | - Nested RAIDz (Raid50, Raid60) |
| 53 | 50 | ||
| 54 | I will be using Raid10 in this guide. However, the majority of the steps | 51 | I will be using Raid10 in this guide. However, the majority of the steps are the |
| 55 | are the same regardless of your chosen pool configuration. | 52 | same regardless of your chosen pool configuration. |
| 56 | 53 | ||
| 57 | ## Creating the Pool | 54 | ## Creating the Pool |
| 58 | 55 | ||
| 59 | To start, let\'s list the disks available to use. You can use | 56 | To start, let's list the disks available to use. You can use `fdisk` command to |
| 60 | `fdisk` command to see all available disks. | 57 | see all available disks. |
| 61 | 58 | ||
| 62 | ```sh | 59 | ```sh |
| 63 | sudo fdisk -l | 60 | sudo fdisk -l |
| 64 | ``` | 61 | ``` |
| 65 | 62 | ||
| 66 | Or, if you currently have them mounted, you can use the `df` | 63 | Or, if you currently have them mounted, you can use the `df` command to view |
| 67 | command to view your disks. | 64 | your disks. |
| 68 | 65 | ||
| 69 | ```sh | 66 | ```sh |
| 70 | > sudo df -h | 67 | > sudo df -h |
| @@ -79,24 +76,23 @@ Filesystem Size Used Avail Use% Mounted on | |||
| 79 | /dev/sdf1 7.3T 28K 6.9T 1% /mnt/red-04 | 76 | /dev/sdf1 7.3T 28K 6.9T 1% /mnt/red-04 |
| 80 | ``` | 77 | ``` |
| 81 | 78 | ||
| 82 | If you\'re going to use mounted disks, make sure to umount them before | 79 | If you're going to use mounted disks, make sure to umount them before creating |
| 83 | creating the pool. | 80 | the pool. |
| 84 | 81 | ||
| 85 | ```sh | 82 | ```sh |
| 86 | sudo umount /dev/sda1 | 83 | sudo umount /dev/sda1 |
| 87 | sudo umount /dev/sdb1 | 84 | sudo umount /dev/sdb1 |
| 88 | ``` | 85 | ``` |
| 89 | 86 | ||
| 90 | Now that I\'ve identified the disks I want to use and have them | 87 | Now that I've identified the disks I want to use and have them unmounted, |
| 91 | unmounted, let\'s create the pool. For this example, I will call it | 88 | let's create the pool. For this example, I will call it `tank`. |
| 92 | `tank`. | ||
| 93 | 89 | ||
| 94 | ```sh | 90 | ```sh |
| 95 | sudo zpool create -f -m /mnt/pool tank mirror /dev/sda /dev/sdb | 91 | sudo zpool create -f -m /mnt/pool tank mirror /dev/sda /dev/sdb |
| 96 | ``` | 92 | ``` |
| 97 | 93 | ||
| 98 | See below for the results of the new ZFS pool named `tank`, | 94 | See below for the results of the new ZFS pool named `tank`, with a vdev |
| 99 | with a vdev automatically named `mirror-0`. | 95 | automatically named `mirror-0`. |
| 100 | 96 | ||
| 101 | ```sh | 97 | ```sh |
| 102 | > zfs list | 98 | > zfs list |
| @@ -121,8 +117,8 @@ config: | |||
| 121 | errors: No known data errors | 117 | errors: No known data errors |
| 122 | ``` | 118 | ``` |
| 123 | 119 | ||
| 124 | We can also look at the mounted filesystem to see where the pool is | 120 | We can also look at the mounted filesystem to see where the pool is mounted and |
| 125 | mounted and some quick stats. | 121 | some quick stats. |
| 126 | 122 | ||
| 127 | ```sh | 123 | ```sh |
| 128 | > df -h | 124 | > df -h |
| @@ -134,28 +130,25 @@ tank 7.2T 128K 7.2T 1% /tank | |||
| 134 | 130 | ||
| 135 | ## Expanding the Pool | 131 | ## Expanding the Pool |
| 136 | 132 | ||
| 137 | If you want to expand this pool, you will need to add a new VDEV to the | 133 | If you want to expand this pool, you will need to add a new VDEV to the pool. |
| 138 | pool. Since I am using 2 disks per VDEV, I will need to add a new 2-disk | 134 | Since I am using 2 disks per VDEV, I will need to add a new 2-disk VDEV to the |
| 139 | VDEV to the existing `tank` pool. | 135 | existing `tank` pool. |
| 140 | 136 | ||
| 141 | ```sh | 137 | ```sh |
| 142 | sudo zpool add tank mirror /dev/sdX /dev/sdY | 138 | sudo zpool add tank mirror /dev/sdX /dev/sdY |
| 143 | ``` | 139 | ``` |
| 144 | 140 | ||
| 145 | If you\'re adding disks of different sizes, you\'ll need to use the | 141 | If you're adding disks of different sizes, you'll need to use the `-f` flag. |
| 146 | `-f` flag. Keep in mind that the max size will be limited to | 142 | Keep in mind that the max size will be limited to the smallest disk added. |
| 147 | the smallest disk added. | ||
| 148 | 143 | ||
| 149 | ```sh | 144 | ```sh |
| 150 | sudo zpool add -f tank mirror /dev/sdX /dev/sdY | 145 | sudo zpool add -f tank mirror /dev/sdX /dev/sdY |
| 151 | ``` | 146 | ``` |
| 152 | 147 | ||
| 153 | I added two 8TB hard drives and this process took around 10 seconds to | 148 | I added two 8TB hard drives and this process took around 10 seconds to complete. |
| 154 | complete. | ||
| 155 | 149 | ||
| 156 | When viewing the pool again, you can see that the pool has now doubled | 150 | When viewing the pool again, you can see that the pool has now doubled in size. |
| 157 | in size. We have 14.3 TB useable space and the same space used for | 151 | We have 14.3 TB useable space and the same space used for mirroring. |
| 158 | mirroring. | ||
| 159 | 152 | ||
| 160 | ```sh | 153 | ```sh |
| 161 | > zfs list | 154 | > zfs list |
| @@ -168,8 +161,8 @@ tank/media 96K 14.3T 96K /tank/media | |||
| 168 | 161 | ||
| 169 | ### Converting Disks | 162 | ### Converting Disks |
| 170 | 163 | ||
| 171 | Some disks, such as NTFS-formatted drives, will need to be partitioned | 164 | Some disks, such as NTFS-formatted drives, will need to be partitioned and |
| 172 | and formatted prior to being added to the pool. | 165 | formatted prior to being added to the pool. |
| 173 | 166 | ||
| 174 | Start by identifying the disks you want to format and add to the pool. | 167 | Start by identifying the disks you want to format and add to the pool. |
| 175 | 168 | ||
| @@ -177,18 +170,16 @@ Start by identifying the disks you want to format and add to the pool. | |||
| 177 | sudo fdisk -l | grep /dev | 170 | sudo fdisk -l | grep /dev |
| 178 | ``` | 171 | ``` |
| 179 | 172 | ||
| 180 | I am going to format my `/dev/sdc` and `/dev/sdd` | 173 | I am going to format my `/dev/sdc` and `/dev/sdd` disks with the `fdisk` |
| 181 | disks with the `fdisk` command. | 174 | command. |
| 182 | 175 | ||
| 183 | See below for instructions on how to use `fdisk`. Here\'s | 176 | See below for instructions on how to use `fdisk`. Here's what I did to create |
| 184 | what I did to create basic Linux formatted disks: | 177 | basic Linux formatted disks: |
| 185 | 178 | ||
| 186 | - `g` : Create GPT partition table | 179 | - `g` : Create GPT partition table |
| 187 | - `n` : Create a new partition, hit Enter for all default | 180 | - `n` : Create a new partition, hit Enter for all default options |
| 188 | options | 181 | - `t` : Change partition type to `20` for `Linux filesystem` |
| 189 | - `t` : Change partition type to `20` for | 182 | - `w` : Write the changes to disk and exit |
| 190 | `Linux filesystem` | ||
| 191 | - `w` : Write the changes to disk and exit | ||
| 192 | 183 | ||
| 193 | I repeated this process for both disks. | 184 | I repeated this process for both disks. |
| 194 | 185 | ||
| @@ -247,9 +238,9 @@ sudo zpool add tank mirror /dev/sdc /dev/sdd | |||
| 247 | ``` | 238 | ``` |
| 248 | 239 | ||
| 249 | When we list the pool again, we can see that our size is now updated to | 240 | When we list the pool again, we can see that our size is now updated to |
| 250 | approximately 22TB. This represents my hard drives totalling 45.6TB when | 241 | approximately 22TB. This represents my hard drives totalling 45.6TB when shown |
| 251 | shown with `fdisk -l`, with a Raid10 configuration using 22TB | 242 | with `fdisk -l`, with a Raid10 configuration using 22TB for mirroring and 22TB |
| 252 | for mirroring and 22TB of useable space. | 243 | of useable space. |
| 253 | 244 | ||
| 254 | ```sh | 245 | ```sh |
| 255 | > zfs list | 246 | > zfs list |
| @@ -263,24 +254,22 @@ tank/media 145GT 21.7T 96K /tank/media | |||
| 263 | ## Creating Datasets | 254 | ## Creating Datasets |
| 264 | 255 | ||
| 265 | According to [ZFS | 256 | According to [ZFS |
| 266 | Terminology](https://docs.oracle.com/cd/E18752_01/html/819-5461/ftyue.html), | 257 | Terminology](https://docs.oracle.com/cd/E18752_01/html/819-5461/ftyue.html), a |
| 267 | a `dataset` can refer to "clones, file systems, snapshots, | 258 | `dataset` can refer to "clones, file systems, snapshots, and volumes. |
| 268 | and volumes. | ||
| 269 | 259 | ||
| 270 | For this guide, I will use the `dataset` term to refer to | 260 | For this guide, I will use the `dataset` term to refer to file systems created |
| 271 | file systems created under a pool. | 261 | under a pool. |
| 272 | 262 | ||
| 273 | Within my `tank` pool, I am going to create some datasets to | 263 | Within my `tank` pool, I am going to create some datasets to help organize my |
| 274 | help organize my files. This will give me location to store data rather | 264 | files. This will give me location to store data rather than simply dumping |
| 275 | than simply dumping everything at the `/tank/` location. | 265 | everything at the `/tank/` location. |
| 276 | 266 | ||
| 277 | ```sh | 267 | ```sh |
| 278 | sudo zfs create tank/cloud | 268 | sudo zfs create tank/cloud |
| 279 | sudo zfs create tank/media | 269 | sudo zfs create tank/media |
| 280 | ``` | 270 | ``` |
| 281 | 271 | ||
| 282 | Once created, you can see these datasets in the output of your pool | 272 | Once created, you can see these datasets in the output of your pool list: |
| 283 | list: | ||
| 284 | 273 | ||
| 285 | ```sh | 274 | ```sh |
| 286 | > zfs list | 275 | > zfs list |
| @@ -292,9 +281,9 @@ tank/media 96K 7.14T 96K /tank/media | |||
| 292 | 281 | ||
| 293 | ## Creating Snapshots | 282 | ## Creating Snapshots |
| 294 | 283 | ||
| 295 | Next, let\'s create our first snapshot. We can do this by calling the | 284 | Next, let's create our first snapshot. We can do this by calling the `snapshot` |
| 296 | `snapshot` command and give it an output name. I will be | 285 | command and give it an output name. I will be throwing the current date and time |
| 297 | throwing the current date and time into my example. | 286 | into my example. |
| 298 | 287 | ||
| 299 | ```sh | 288 | ```sh |
| 300 | sudo zfs snapshot tank@$(date '+%Y-%m-%d_%H-%M') | 289 | sudo zfs snapshot tank@$(date '+%Y-%m-%d_%H-%M') |
| @@ -325,13 +314,10 @@ no datasets available | |||
| 325 | 314 | ||
| 326 | # My Thoughts on ZFS So Far | 315 | # My Thoughts on ZFS So Far |
| 327 | 316 | ||
| 328 | - I sacrificed 25TB to be able to mirror my data, but I feel more | 317 | - I sacrificed 25TB to be able to mirror my data, but I feel more comfortable |
| 329 | comfortable with the potential to save my data by quickly replacing | 318 | with the potential to save my data by quickly replacing a disk if I need to. |
| 330 | a disk if I need to. | 319 | - The set-up was surprisingly easy and fast. |
| 331 | - The set-up was surprisingly easy and fast. | 320 | - Disk I/O is fast as well. I was worried that the data transfer speeds would be |
| 332 | - Disk I/O is fast as well. I was worried that the data transfer | 321 | slower due to the RAID configuration. |
| 333 | speeds would be slower due to the RAID configuration. | 322 | - Media streaming and transcoding has seen no noticeable drop in performance. |
| 334 | - Media streaming and transcoding has seen no noticeable drop in | 323 | - My only limitation really is the number of HDD bays in my server HDD cage. |
| 335 | performance. | ||
| 336 | - My only limitation really is the number of HDD bays in my server HDD | ||
| 337 | cage. | ||
content/blog/2024-02-13-ubuntu-emergency-mode.md +23 −26
| @@ -7,12 +7,12 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # The Problem | 8 | # The Problem |
| 9 | 9 | ||
| 10 | I recently [migrated my hard drives to a ZFS pool](../zfs/) and found | 10 | I recently [migrated my hard drives to a ZFS pool](../zfs/) and found myself |
| 11 | myself stuck in Ubuntu\'s emergency mode after the first reboot I | 11 | stuck in Ubuntu's emergency mode after the first reboot I performed after |
| 12 | performed after creating the ZFS pool. | 12 | creating the ZFS pool. |
| 13 | 13 | ||
| 14 | My server was stuck in the boot process and showed the following error | 14 | My server was stuck in the boot process and showed the following error on the |
| 15 | on the screen: | 15 | screen: |
| 16 | 16 | ||
| 17 | ``` txt | 17 | ``` txt |
| 18 | You are in emergency mode. | 18 | You are in emergency mode. |
| @@ -21,34 +21,33 @@ After logging in, type "journalctl -xb" to view system logs, | |||
| 21 | or ^D to try again to boot into default mode". | 21 | or ^D to try again to boot into default mode". |
| 22 | ``` | 22 | ``` |
| 23 | 23 | ||
| 24 | After rebooting the server and watching the logs scroll on a monitor, I | 24 | After rebooting the server and watching the logs scroll on a monitor, I noticed |
| 25 | noticed the root cause was related to a very long search for certain | 25 | the root cause was related to a very long search for certain drives. I kept |
| 26 | drives. I kept seeing errors like this: | 26 | seeing errors like this: |
| 27 | 27 | ||
| 28 | ``` txt | 28 | ``` txt |
| 29 | [ TIME ] Timed out waiting of device dev-disk-by/[disk-uuid] | 29 | [ TIME ] Timed out waiting of device dev-disk-by/[disk-uuid] |
| 30 | ``` | 30 | ``` |
| 31 | 31 | ||
| 32 | I realized that I had not removed the `/etc/fstab` references | 32 | I realized that I had not removed the `/etc/fstab` references that asked Ubuntu |
| 33 | that asked Ubuntu to mount two disks on boot, but I had recently changed | 33 | to mount two disks on boot, but I had recently changed those disks to be part of |
| 34 | those disks to be part of my ZFS pool instead. Therefore, Ubuntu was | 34 | my ZFS pool instead. Therefore, Ubuntu was trying to identify and mount a disk |
| 35 | trying to identify and mount a disk that was not available. | 35 | that was not available. |
| 36 | 36 | ||
| 37 | Now that we have an idea of the issue, let\'s move to solution. | 37 | Now that we have an idea of the issue, let's move to solution. |
| 38 | 38 | ||
| 39 | # The Solution | 39 | # The Solution |
| 40 | 40 | ||
| 41 | In order to fix the issue, I waited until I was allowed to type the root | 41 | In order to fix the issue, I waited until I was allowed to type the root user's |
| 42 | user\'s password, and then I executed the following command: | 42 | password, and then I executed the following command: |
| 43 | 43 | ||
| 44 | ```sh | 44 | ```sh |
| 45 | nano /etc/fstab | 45 | nano /etc/fstab |
| 46 | ``` | 46 | ``` |
| 47 | 47 | ||
| 48 | Within the `fstab` file, I needed to comment/remove the | 48 | Within the `fstab` file, I needed to comment/remove the following lines at the |
| 49 | following lines at the bottom of the file. You can comment-out a line by | 49 | bottom of the file. You can comment-out a line by prepending a `#` symbol at the |
| 50 | prepending a `#` symbol at the beginning of the line. You can | 50 | beginning of the line. You can also delete the line entirely. |
| 51 | also delete the line entirely. | ||
| 52 | 51 | ||
| 53 | ``` conf | 52 | ``` conf |
| 54 | # What it looked like when running into the issue: | 53 | # What it looked like when running into the issue: |
| @@ -60,16 +59,14 @@ UUID=E69867E59867B32B /mnt/white-02 ntfs-3g uid=1000,gid=1000 0 0 | |||
| 60 | # UUID=E69867E59867B32B /mnt/white-02 ntfs-3g uid=1000,gid=1000 0 0 | 59 | # UUID=E69867E59867B32B /mnt/white-02 ntfs-3g uid=1000,gid=1000 0 0 |
| 61 | ``` | 60 | ``` |
| 62 | 61 | ||
| 63 | Once removing the lines above from the `/etc/fstab` file, | 62 | Once removing the lines above from the `/etc/fstab` file, save and exit the file |
| 64 | save and exit the file by hitting the `Ctrl` + `x` | 63 | by hitting the `Ctrl` + `x` key combo. |
| 65 | key combo. | ||
| 66 | 64 | ||
| 67 | You can now hit `Ctrl` + `D` to continue, or | 65 | You can now hit `Ctrl` + `D` to continue, or reboot: |
| 68 | reboot: | ||
| 69 | 66 | ||
| 70 | ```sh | 67 | ```sh |
| 71 | systemctl reboot | 68 | systemctl reboot |
| 72 | ``` | 69 | ``` |
| 73 | 70 | ||
| 74 | Once rebooted, I was able to watch the machine boot properly and launch | 71 | Once rebooted, I was able to watch the machine boot properly and launch to the |
| 75 | to the TTY login screen without errors! | 72 | TTY login screen without errors! |
content/blog/2024-02-21-self-hosting-otter-wiki.md +27 −31
| @@ -7,33 +7,32 @@ draft = false | |||
| 7 | 7 | ||
| 8 | # An Otter Wiki | 8 | # An Otter Wiki |
| 9 | 9 | ||
| 10 | [An Otter Wiki](https://otterwiki.com/) is an easy to use wiki software | 10 | [An Otter Wiki](https://otterwiki.com/) is an easy to use wiki software that |
| 11 | that takes almost no effort to set up and maintain. | 11 | takes almost no effort to set up and maintain. |
| 12 | 12 | ||
| 13 | # Installation | 13 | # Installation |
| 14 | 14 | ||
| 15 | To install An Otter Wiki, I\'m going to use Docker Compose to create the | 15 | To install An Otter Wiki, I'm going to use Docker Compose to create the |
| 16 | container and then use Nginx as a reverse proxy to allow external access | 16 | container and then use Nginx as a reverse proxy to allow external access via a |
| 17 | via a subdomain I own. | 17 | subdomain I own. |
| 18 | 18 | ||
| 19 | ## Docker Compose | 19 | ## Docker Compose |
| 20 | 20 | ||
| 21 | Start by creating a directory for the container\'s files. | 21 | Start by creating a directory for the container's files. |
| 22 | 22 | ||
| 23 | ```sh | 23 | ```sh |
| 24 | mkdir ~/otterwiki | 24 | mkdir ~/otterwiki |
| 25 | ``` | 25 | ``` |
| 26 | 26 | ||
| 27 | Next, create the `docker-compose.yml` file to define the | 27 | Next, create the `docker-compose.yml` file to define the container's |
| 28 | container\'s parameters. | 28 | parameters. |
| 29 | 29 | ||
| 30 | ```sh | 30 | ```sh |
| 31 | nano ~/otterwiki/docker-compose.yml | 31 | nano ~/otterwiki/docker-compose.yml |
| 32 | ``` | 32 | ``` |
| 33 | 33 | ||
| 34 | Within the file, paste the following content. You can read the | 34 | Within the file, paste the following content. You can read the project's |
| 35 | project\'s documentation if you want to further override or customize | 35 | documentation if you want to further override or customize the container. |
| 36 | the container. | ||
| 37 | 36 | ||
| 38 | ``` conf | 37 | ``` conf |
| 39 | version: '3' | 38 | version: '3' |
| @@ -56,23 +55,22 @@ cd ~/otterwiki | |||
| 56 | sudo docker-compose up -d | 55 | sudo docker-compose up -d |
| 57 | ``` | 56 | ``` |
| 58 | 57 | ||
| 59 | The container is now available at `localhost:8337`. Next, we | 58 | The container is now available at `localhost:8337`. Next, we will use Nginx to |
| 60 | will use Nginx to serve this app externally. | 59 | serve this app externally. |
| 61 | 60 | ||
| 62 | ## Nginx | 61 | ## Nginx |
| 63 | 62 | ||
| 64 | To access the app externally, let\'s set up a reverse proxy. I\'ll start | 63 | To access the app externally, let's set up a reverse proxy. I'll start by |
| 65 | by creating the Nginx configuration file for my wiki. | 64 | creating the Nginx configuration file for my wiki. |
| 66 | 65 | ||
| 67 | ```sh | 66 | ```sh |
| 68 | sudo nano /etc/nginx/sites-available/wiki | 67 | sudo nano /etc/nginx/sites-available/wiki |
| 69 | ``` | 68 | ``` |
| 70 | 69 | ||
| 71 | Within the file, I have saved the following content. This assumes you | 70 | Within the file, I have saved the following content. This assumes you already |
| 72 | already have a TLS/SSL cert to use with this subdomain. If not, simply | 71 | have a TLS/SSL cert to use with this subdomain. If not, simply remove the |
| 73 | remove the `ssl_*` variables, remove the `80` | 72 | `ssl_*` variables, remove the `80` server block, and change the `443` server |
| 74 | server block, and change the `443` server block to | 73 | block to `80` to serve the app without SSL. |
| 75 | `80` to serve the app without SSL. | ||
| 76 | 74 | ||
| 77 | ``` conf | 75 | ``` conf |
| 78 | server { | 76 | server { |
| @@ -110,15 +108,14 @@ server { | |||
| 110 | } | 108 | } |
| 111 | ``` | 109 | ``` |
| 112 | 110 | ||
| 113 | Save and close the configuration file. On Nginx, we need to symlink the | 111 | Save and close the configuration file. On Nginx, we need to symlink the file to |
| 114 | file to enable it. | 112 | enable it. |
| 115 | 113 | ||
| 116 | ```sh | 114 | ```sh |
| 117 | sudo ln -s /etc/nginx/sites-available/wiki /etc/nginx/sites-enabled/wiki | 115 | sudo ln -s /etc/nginx/sites-available/wiki /etc/nginx/sites-enabled/wiki |
| 118 | ``` | 116 | ``` |
| 119 | 117 | ||
| 120 | Once enabled, restart the Nginx server to start serving the app | 118 | Once enabled, restart the Nginx server to start serving the app externally. |
| 121 | externally. | ||
| 122 | 119 | ||
| 123 | ```sh | 120 | ```sh |
| 124 | sudo systemctl restart nginx.service | 121 | sudo systemctl restart nginx.service |
| @@ -126,18 +123,17 @@ sudo systemctl restart nginx.service | |||
| 126 | 123 | ||
| 127 | # Screenshots | 124 | # Screenshots |
| 128 | 125 | ||
| 129 | In the screenshot below, you can see the initial launch screen for An | 126 | In the screenshot below, you can see the initial launch screen for An Otter |
| 130 | Otter Wiki. Start by creating your admin account and configure the app | 127 | Wiki. Start by creating your admin account and configure the app as necessary. |
| 131 | as necessary. | ||
| 132 | 128 | ||
| 133 |  | 130 | Screen](https://img.cleberg.net/blog/20240221-otterwiki/otterwiki.png) |
| 135 | 131 | ||
| 136 | You can also see the default editing screen for creating and editing | 132 | You can also see the default editing screen for creating and editing pages. |
| 137 | pages. It\'s as easy as typing Markdown and hitting the save button. | 133 | It's as easy as typing Markdown and hitting the save button. |
| 138 | 134 | ||
| 139 |  | 136 | Screen](https://img.cleberg.net/blog/20240221-otterwiki/otterwiki-edit.png) |
| 141 | 137 | ||
| 142 | Overall, I like An Otter Wiki and will be looking forward to seeing how | 138 | Overall, I like An Otter Wiki and will be looking forward to seeing how much use |
| 143 | much use I get out of it going forward. | 139 | I get out of it going forward. |
content/blog/2024-03-13-doom-emacs.md +134 −153
| @@ -7,12 +7,11 @@ draft = false | |||
| 7 | 7 | ||
| 8 | ## Screenshots | 8 | ## Screenshots |
| 9 | 9 | ||
| 10 | These screenshots are showing a project opened with projectile, a | 10 | These screenshots are showing a project opened with projectile, a treemacs side |
| 11 | treemacs side pane open with the project contents, multiple buffers | 11 | pane open with the project contents, multiple buffers tiled next to each other, |
| 12 | tiled next to each other, and the help pane open at the bottomm. | 12 | and the help pane open at the bottomm. |
| 13 | 13 | ||
| 14 | The themes are `doom-homage-white` and | 14 | The themes are `doom-homage-white` and `doom-homage-black`. |
| 15 | `doom-homage-black`. | ||
| 16 | 15 | ||
| 17 |  | 17 | Mode](https://img.cleberg.net/blog/20240314-doom-emacs/light.png) |
| @@ -24,42 +23,38 @@ Mode](https://img.cleberg.net/blog/20240314-doom-emacs/dark.png) | |||
| 24 | 23 | ||
| 25 | I have been switching back and forth between | 24 | I have been switching back and forth between |
| 26 | [markdown](https://en.wikipedia.org/wiki/Markdown) and | 25 | [markdown](https://en.wikipedia.org/wiki/Markdown) and |
| 27 | [org-mode](https://en.wikipedia.org/wiki/Org-mode) recently for my | 26 | [org-mode](https://en.wikipedia.org/wiki/Org-mode) recently for my personal note |
| 28 | personal note taking, wiki, and even this blog. As a result, I have been | 27 | taking, wiki, and even this blog. As a result, I have been stumbling further |
| 29 | stumbling further into the world of Emacs and found myself at a point | 28 | into the world of Emacs and found myself at a point where I now prefer to do |
| 30 | where I now prefer to do most of my basic editing within Emacs. | 29 | most of my basic editing within Emacs. |
| 31 | 30 | ||
| 32 | I\'ll leave the markdown vs. org-mode debate for another post, but I | 31 | I'll leave the markdown vs. org-mode debate for another post, but I love |
| 33 | love org-mode\'s extensibility and interactive nature within Emacs, but | 32 | org-mode's extensibility and interactive nature within Emacs, but it becomes |
| 34 | it becomes very unwieldy in any other client implementation of | 33 | very unwieldy in any other client implementation of org-mode - especially on |
| 35 | org-mode - especially on iOS. On the flip side, markdown is limited in | 34 | iOS. On the flip side, markdown is limited in functionality and fractured into |
| 36 | functionality and fractured into different standards, but it\'s simple | 35 | different standards, but it's simple and popular enough that there are a |
| 37 | and popular enough that there are a plethora of great clients to choose | 36 | plethora of great clients to choose from that will get the job done. |
| 38 | from that will get the job done. | 37 | |
| 39 | 38 | For now, I want to focus on how I have been using Emacs and some of the things | |
| 40 | For now, I want to focus on how I have been using Emacs and some of the | 39 | that would have helped me learn it faster had I known where to start. |
| 41 | things that would have helped me learn it faster had I known where to | ||
| 42 | start. | ||
| 43 | 40 | ||
| 44 | ### Installation | 41 | ### Installation |
| 45 | 42 | ||
| 46 | This post focuses on [Doom | 43 | This post focuses on [Doom Emacs](https://github.com/doomemacs/doomemacs), which |
| 47 | Emacs](https://github.com/doomemacs/doomemacs), which is an Emacs | 44 | is an Emacs framework that provides an alternative experience to the vanilla |
| 48 | framework that provides an alternative experience to the vanilla [GNU | 45 | [GNU Emacs](https://www.gnu.org/software/emacs/). |
| 49 | Emacs](https://www.gnu.org/software/emacs/). | ||
| 50 | 46 | ||
| 51 | The [Getting Start | 47 | The [Getting Start |
| 52 | Guide](https://github.com/doomemacs/doomemacs/blob/master/docs/getting_started.org) | 48 | Guide](https://github.com/doomemacs/doomemacs/blob/master/docs/getting_started.org) |
| 53 | has an extremely detailed walkthrough of installation for all systems, | 49 | has an extremely detailed walkthrough of installation for all systems, so please |
| 54 | so please refer to that guide for up-to-date instructions. | 50 | refer to that guide for up-to-date instructions. |
| 55 | 51 | ||
| 56 | I chose to install on macOS, using the Homebrew option with the | 52 | I chose to install on macOS, using the Homebrew option with the |
| 57 | `railwaycat/emacsmacport` version of Emacs. | 53 | `railwaycat/emacsmacport` version of Emacs. |
| 58 | 54 | ||
| 59 | Once the program is installed, you can run the program by typing | 55 | Once the program is installed, you can run the program by typing `emacs` in a |
| 60 | `emacs` in a terminal. If you installed a version of Emacs | 56 | terminal. If you installed a version of Emacs that supports both a GUI and TUI, |
| 61 | that supports both a GUI and TUI, you will have to run | 57 | you will have to run `emacs -nw` to get the TUI instead of the default GUI. |
| 62 | `emacs -nw` to get the TUI instead of the default GUI. | ||
| 63 | 58 | ||
| 64 | ### Configuration | 59 | ### Configuration |
| 65 | 60 | ||
| @@ -68,13 +63,13 @@ Once installed, you can configure Doom by editing the files within the | |||
| 68 | 63 | ||
| 69 | 1. `config.el` - Personal configuration file | 64 | 1. `config.el` - Personal configuration file |
| 70 | 2. `custom.el` - Custom set variables | 65 | 2. `custom.el` - Custom set variables |
| 71 | 3. `init.el` - Doom modules and load order, must run | 66 | 3. `init.el` - Doom modules and load order, must run `doom sync` after |
| 72 | `doom sync` after modifying | 67 | modifying |
| 73 | 4. `packages.el` - Declare packages to install in this file, | 68 | 4. `packages.el` - Declare packages to install in this file, then run `doom |
| 74 | then run `doom sync` to install | 69 | sync` to install |
| 75 | 70 | ||
| 76 | I only needed a few customizations for my configuration, so I\'ll list | 71 | I only needed a few customizations for my configuration, so I'll list them |
| 77 | them below. | 72 | below. |
| 78 | 73 | ||
| 79 | ```lisp | 74 | ```lisp |
| 80 | ;; ~/.doom.d/config.el | 75 | ;; ~/.doom.d/config.el |
| @@ -148,140 +143,127 @@ them below. | |||
| 148 | (default +bindings +smartparens)) | 143 | (default +bindings +smartparens)) |
| 149 | ``` | 144 | ``` |
| 150 | 145 | ||
| 151 | If you\'re editing these files within Doom directly, remember to run | 146 | If you're editing these files within Doom directly, remember to run `SPC h r r` |
| 152 | `SPC h r r` to reload the configuration. Also remember to run | 147 | to reload the configuration. Also remember to run `doom sync` for any changes to |
| 153 | `doom sync` for any changes to the `init.el` or | 148 | the `init.el` or `packages.el` files. |
| 154 | `packages.el` files. | ||
| 155 | 149 | ||
| 156 | ## Basic Functionality | 150 | ## Basic Functionality |
| 157 | 151 | ||
| 158 | I kept a cheat sheet note open at first with all of the basic functions | 152 | I kept a cheat sheet note open at first with all of the basic functions typed |
| 159 | typed out, copied as I went through the tutorial. After a little while, | 153 | out, copied as I went through the tutorial. After a little while, I no longer |
| 160 | I no longer needed it. I highly recommend writing down the most | 154 | needed it. I highly recommend writing down the most applicable shortcuts for |
| 161 | applicable shortcuts for your preferred functionality and refer back to | 155 | your preferred functionality and refer back to it until you've memorized it. |
| 162 | it until you\'ve memorized it. | 156 | |
| 163 | 157 | Memorizing the shortcuts will differ based on the type of Emacs framework being | |
| 164 | Memorizing the shortcuts will differ based on the type of Emacs | 158 | used. Personally, migrating from vanilla Emacs to Doom Emacs simplified |
| 165 | framework being used. Personally, migrating from vanilla Emacs to Doom | 159 | everything by a large factor and instantly enabled me to start working on my |
| 166 | Emacs simplified everything by a large factor and instantly enabled me | 160 | projects, eliminating most of the hurdles I was running into. The vanilla emacs |
| 167 | to start working on my projects, eliminating most of the hurdles I was | 161 | hotkeys became obnoxious and I actually stopped using Emacs entirely for about a |
| 168 | running into. The vanilla emacs hotkeys became obnoxious and I actually | 162 | month before trying Doom. |
| 169 | stopped using Emacs entirely for about a month before trying Doom. | 163 | |
| 170 | 164 | For me, the first logical step is to interact with the local filesystem. To do | |
| 171 | For me, the first logical step is to interact with the local filesystem. | 165 | this, I needed to know how to open directories, open files, save files, discard |
| 172 | To do this, I needed to know how to open directories, open files, save | 166 | changes, close files, and switch between open files. Here are some example |
| 173 | files, discard changes, close files, and switch between open files. Here | 167 | shortcuts I've written down in order to accomplish file-based actions. |
| 174 | are some example shortcuts I\'ve written down in order to accomplish | 168 | |
| 175 | file-based actions. | 169 | | Doom Hotkey | Emacs Hotkey | Description | |
| 176 | 170 | |-----------------|--------------|----------------------------------------| | |
| 177 | Doom Hotkey Emacs Hotkey Description | 171 | | `SPC :` | `C-x` | Run functions | |
| 178 | ---------------------------- --------------------------- ---------------------------------------- | 172 | | `SPC f f` | `C-x f` | Open file in buffer | |
| 179 | `SPC :` `C-x` Run functions | 173 | | `SPC f d` | `C-x d` | Open directory with `dired` | |
| 180 | `SPC f f` `C-x f` Open file in buffer | 174 | | `i` | `C-x C-q` | Edit current buffer (insert mode) | |
| 181 | `SPC f d` `C-x d` Open directory with `dired` | 175 | | `q` | `C-x C-q` | Quit out of insert mode | |
| 182 | `i` `C-x C-q` Edit current buffer (insert mode) | 176 | | `SPC f s` | `C-x s` | Save current buffer | |
| 183 | `q` `C-x C-q` Quit out of insert mode | 177 | | `SPC b k` | `C-x k` | Kill current buffer | |
| 184 | `SPC f s` `C-x s` Save current buffer | 178 | | `SPC w h/j/k/l` | `C-x o`[^1] | Move left/down/up/right to next buffer | |
| 185 | `SPC b k` `C-x k` Kill current buffer | 179 | |
| 186 | `SPC w h/j/k/l` `C-x o`\[^1^\] Move left/down/up/right to next buffer | 180 | [^1]: Doom's evil-window functionality is a bit different from GNU Emacs, but |
| 187 | 181 | you can always switch to the "other" buffer with `C-x o` or `C-x b` to get a | |
| 188 | \[^1^\] Doom\'s evil-window functionality is a bit different from GNU | 182 | list of buffers to select. |
| 189 | Emacs, but you can always switch to the \"other\" buffer with | 183 | |
| 190 | `C-x o` or `C-x b` to get a list of buffers to | 184 | In general, when in Doom, you can press `SPC` and wait a second for the help |
| 191 | select. | 185 | pane to appear with all available hotkey options. For example, you can press |
| 192 | 186 | `SPC`, wait for the help pane, and then select a key such as `g` to enter the | |
| 193 | In general, when in Doom, you can press `SPC` and wait a | 187 | git help pane and explore further command options. |
| 194 | second for the help pane to appear with all available hotkey options. | ||
| 195 | For example, you can press `SPC`, wait for the help pane, and | ||
| 196 | then select a key such as `g` to enter the git help pane and | ||
| 197 | explore further command options. | ||
| 198 | 188 | ||
| 199 | ## Editing | 189 | ## Editing |
| 200 | 190 | ||
| 201 | Next in my process is to dive into editing for any languages I\'m | 191 | Next in my process is to dive into editing for any languages I'm currently |
| 202 | currently using. In this post, I will just cover Markdown and Org-Mode | 192 | using. In this post, I will just cover Markdown and Org-Mode but I have also |
| 203 | but I have also been slowly adoping some Python and general web dev | 193 | been slowly adoping some Python and general web dev tools as well. |
| 204 | tools as well. | ||
| 205 | 194 | ||
| 206 | ### Markdown | 195 | ### Markdown |
| 207 | 196 | ||
| 208 |  | 198 | Preview](https://img.cleberg.net/blog/20240314-doom-emacs/markdown.png) |
| 210 | 199 | ||
| 211 | Markdown is fairly simple as the syntax is limited, so just make sure | 200 | Markdown is fairly simple as the syntax is limited, so just make sure the |
| 212 | the `~/.doom.d/init.el` includes the `markdown` | 201 | `~/.doom.d/init.el` includes the `markdown` declaration in the `:lang` section. |
| 213 | declaration in the `:lang` section. | ||
| 214 | 202 | ||
| 215 | This package includes the following hotkey menus. The insert and toggle | 203 | This package includes the following hotkey menus. The insert and toggle menu |
| 216 | menu expands further, allowing you to insert various markdown elements | 204 | expands further, allowing you to insert various markdown elements and toggle |
| 217 | and toggle things like link hiding. | 205 | things like link hiding. |
| 218 | 206 | ||
| 219 | Doom Hotkey Function | 207 | | Doom Hotkey | Function | |
| 220 | ----------------------------------------- -------------------------- | 208 | |------------------------------|--------------------------| |
| 221 | `SPC m '` markdown-edit-code-block | 209 | | `SPC m '` | markdown-edit-code-block | |
| 222 | `SPC m e` markdown-export | 210 | | `SPC m e` | markdown-export | |
| 223 | `SPC m i` +insert | 211 | | `SPC m i` | +insert | |
| 224 | `SPC m o` markdown-open | 212 | | `SPC m o` | markdown-open | |
| 225 | `SPC m p` markdown-preview | 213 | | `SPC m p` | markdown-preview | |
| 226 | `SPC m t` +toggle | 214 | | `SPC m t` | +toggle | |
| 227 | `SPC : markdown-table-align` markdown-table-align | 215 | | `SPC : markdown-table-align` | markdown-table-align | |
| 228 | 216 | ||
| 229 | ### Org-Mode | 217 | ### Org-Mode |
| 230 | 218 | ||
| 231 |  |
| 232 | Preview](https://img.cleberg.net/blog/20240314-doom-emacs/org.png) | 220 | |
| 233 | 221 | Similar to the markdown section above, ensure that the `~/.doom.d/init.el` | |
| 234 | Similar to the markdown section above, ensure that the | 222 | includes the `org` declaration in the `:lang` section. |
| 235 | `~/.doom.d/init.el` includes the `org` declaration | 223 | |
| 236 | in the `:lang` section. | 224 | There are a few hot keys, but a quick search with `SPC : org` shows that there |
| 237 | 225 | are 865 possible org-related functions you can run. I won't possibly be able to | |
| 238 | There are a few hot keys, but a quick search with `SPC : org` | 226 | list them all, so I will simply cover a few of the basic commands I use myself. |
| 239 | shows that there are 865 possible org-related functions you can run. I | 227 | |
| 240 | won\'t possibly be able to list them all, so I will simply cover a few | 228 | | Doom Hotkey | Function | |
| 241 | of the basic commands I use myself. | 229 | |----------------|---------------------------------------| |
| 242 | 230 | | `SPC m t` | org-todo | | |
| 243 | Doom Hotkey Function | 231 | | `SPC n t` | org-todo-list | |
| 244 | --------------------------- --------------------------------------- | 232 | | `SPC o A` | org-agenda | |
| 245 | `SPC m t` org-todo | 233 | | `SPC X` | org-capture | |
| 246 | `SPC n t` org-todo-list | 234 | | `SPC m p p` | org-priority | |
| 247 | `SPC o A` org-agenda | 235 | | `SPC m d s` | org-schedule | |
| 248 | `SPC X` org-capture | 236 | | `TAB` | org-cycle | |
| 249 | `SPC m p p` org-priority | 237 | | `SHIFT TAB` | Collapse/open all headings in buffer | |
| 250 | `SPC m d s` org-schedule | 238 | | `M-q` | Format/wrap current section | |
| 251 | `TAB` org-cycle | 239 | | `M-Left/Right` | Demote/promote current heading | |
| 252 | `SHIFT TAB` Collapse/open all headings in buffer | 240 | | `M-Down/Up` | Shift current heading section down/up | |
| 253 | `M-q` Format/wrap current section | ||
| 254 | `M-Left/Right` Demote/promote current heading | ||
| 255 | `M-Down/Up` Shift current heading section down/up | ||
| 256 | 241 | ||
| 257 | 1. Org-Publish | 242 | 1. Org-Publish |
| 258 | 243 | ||
| 259 | Org includes a [publishing management | 244 | Org includes a [publishing management |
| 260 | system](https://orgmode.org/manual/Publishing.html) by default that | 245 | system](https://orgmode.org/manual/Publishing.html) by default that allows |
| 261 | allows you to export org files to Org, iCalendar, HTML, LaTex, | 246 | you to export org files to Org, iCalendar, HTML, LaTex, Markdown, ODT, and |
| 262 | Markdown, ODT, and Plain Text. Most of these can be exported into | 247 | Plain Text. Most of these can be exported into another buffer and opened, or |
| 263 | another buffer and opened, or simply to an external file. | 248 | simply to an external file. |
| 264 | 249 | ||
| 265 | While inside an org file, simply run `SPC m e` or | 250 | While inside an org file, simply run `SPC m e` or `M-x org-export-dispatch` |
| 266 | `M-x org-export-dispatch` to open the export menu. This | 251 | to open the export menu. This menu will show all options and ask you to |
| 267 | menu will show all options and ask you to select an option. If you | 252 | select an option. If you want to export to HTML, simply press `h` and then |
| 268 | want to export to HTML, simply press `h` and then | 253 | `H` (As HTML buffer), `h` (As HTML file), or `o` (As HTML file and open). |
| 269 | `H` (As HTML buffer), `h` (As HTML file), or | ||
| 270 | `o` (As HTML file and open). | ||
| 271 | 254 | ||
| 272 | 2. Projects | 255 | 2. Projects |
| 273 | 256 | ||
| 274 | Some publishing options are easier with a defined project in Emacs. | 257 | Some publishing options are easier with a defined project in Emacs. To |
| 275 | To create a project within Emacs, I use two methods: | 258 | create a project within Emacs, I use two methods: |
| 276 | 259 | ||
| 277 | 1. Add the project via the projectile command `SPC p a`. | 260 | 1. Add the project via the projectile command `SPC p a`. Does not always |
| 278 | Does not always work for me. | 261 | work for me. |
| 279 | 2. Add an empty `.projectile` file in the project root. | 262 | 2. Add an empty `.projectile` file in the project root. |
| 280 | 263 | ||
| 281 | Once a project has been created, you can create custom publishing | 264 | Once a project has been created, you can create custom publishing actions |
| 282 | actions within your `~/.doom.d/config.el` file. For | 265 | within your `~/.doom.d/config.el` file. For example, here's a test project |
| 283 | example, here\'s a test project I created to try and convert this | 266 | I created to try and convert this blog to org-mode recently. |
| 284 | blog to org-mode recently. | ||
| 285 | 267 | ||
| 286 | ```lisp | 268 | ```lisp |
| 287 | ;; org-publish | 269 | ;; org-publish |
| @@ -352,11 +334,10 @@ of the basic commands I use myself. | |||
| 352 | 334 | ||
| 353 | ## General Thoughts | 335 | ## General Thoughts |
| 354 | 336 | ||
| 355 | I have enjoyed Doom Emacs (far more than GNU Emacs) and will likely | 337 | I have enjoyed Doom Emacs (far more than GNU Emacs) and will likely continue to |
| 356 | continue to use it as my main editor for the time being. Org-Mode is | 338 | use it as my main editor for the time being. Org-Mode is certainly the largest |
| 357 | certainly the largest factor here, as I far prefer it over Markdown due | 339 | factor here, as I far prefer it over Markdown due to its inherent features and |
| 358 | to its inherent features and detailed markup options. However, working | 340 | detailed markup options. However, working with org-mode on iOS has been a pain |
| 359 | with org-mode on iOS has been a pain and I will have to see if there\'s | 341 | and I will have to see if there's an easier way to resolve those issues or if |
| 360 | an easier way to resolve those issues or if going back to separate | 342 | going back to separate Markdown, Reminders, and Calendar apps is easier to work |
| 361 | Markdown, Reminders, and Calendar apps is easier to work with than an | 343 | with than an all-in-one org solution. |
| 362 | all-in-one org solution. | ||
content/blog/2024-03-15-self-hosting-ddns-updater.md +51 −63
| @@ -8,25 +8,22 @@ draft = false | |||
| 8 |  | 9 | View](https://img.cleberg.net/blog/20240315-ddns-updater/ddns.png) |
| 10 | 10 | ||
| 11 | [DDNS Updater](https://github.com/qdm12/ddns-updater) is a program to | 11 | [DDNS Updater](https://github.com/qdm12/ddns-updater) is a program to keep DNS A |
| 12 | keep DNS A and/or AAAA records updated for multiple DNS providers. | 12 | and/or AAAA records updated for multiple DNS providers. |
| 13 | 13 | ||
| 14 | If you\'ve read any of my other posts, you\'ll notice that I have been | 14 | If you've read any of my other posts, you'll notice that I have been searching |
| 15 | searching for and using a few different DDNS updating solutions for | 15 | for and using a few different DDNS updating solutions for years. You'll also |
| 16 | years. You\'ll also notice that I love any projects that offer a Docker | 16 | notice that I love any projects that offer a Docker Compose solution. |
| 17 | Compose solution. | ||
| 18 | 17 | ||
| 19 | Luckily, DDNS Upater fits both of these preferences. | 18 | Luckily, DDNS Upater fits both of these preferences. |
| 20 | 19 | ||
| 21 | ## Installation | 20 | ## Installation |
| 22 | 21 | ||
| 23 | To get started, always make sure to review the project\'s | 22 | To get started, always make sure to review the project's |
| 24 | [README](https://github.com/qdm12/ddns-updater/blob/master/README.md). | 23 | [README](https://github.com/qdm12/ddns-updater/blob/master/README.md). I'll be |
| 25 | I\'ll be documenting my steps below, but they may have changed by the | 24 | documenting my steps below, but they may have changed by the time you read this. |
| 26 | time you read this. | ||
| 27 | 25 | ||
| 28 | The first step is to set up the directories and files required for the | 26 | The first step is to set up the directories and files required for the project. |
| 29 | project. | ||
| 30 | 27 | ||
| 31 | ```sh | 28 | ```sh |
| 32 | mkdir ~/ddns-updater | 29 | mkdir ~/ddns-updater |
| @@ -36,46 +33,38 @@ touch ~/ddns-updater/data/config.json | |||
| 36 | 33 | ||
| 37 | ### Configuration | 34 | ### Configuration |
| 38 | 35 | ||
| 39 | The main configuration you need to update is the | 36 | The main configuration you need to update is the `data/config.json` file. There |
| 40 | `data/config.json` file. There is a large list of supported | 37 | is a large list of supported providers in the README, but I'm going to use |
| 41 | providers in the README, but I\'m going to use Cloudflare in this | 38 | Cloudflare in this example. |
| 42 | example. | ||
| 43 | 39 | ||
| 44 | ```sh | 40 | ```sh |
| 45 | nano ~/ddns-updater/data/config.json | 41 | nano ~/ddns-updater/data/config.json |
| 46 | ``` | 42 | ``` |
| 47 | 43 | ||
| 48 | When setting up the configuration for Cloudflare, you\'ll need the | 44 | When setting up the configuration for Cloudflare, you'll need the following: |
| 49 | following: | 45 | |
| 50 | 46 | - Required Parameters | |
| 51 | - Required Parameters | 47 | - `"zone_identifier"` is the Zone ID of your site from the domain overview |
| 52 | - `"zone_identifier"` is the Zone ID of your site from | 48 | page |
| 53 | the domain overview page | 49 | - `"host"` is your host and can be `"@"`, a subdomain or the wildcard `"*"`. |
| 54 | - `"host"` is your host and can be `"@"`, a | 50 | See [this issue comment for |
| 55 | subdomain or the wildcard `"*"`. See [this issue | 51 | context](https://github.com/qdm12/ddns-updater/issues/243#issuecomment-928313949). |
| 56 | comment for | 52 | - `"ttl"` integer value for record TTL in seconds (specify 1 for automatic) |
| 57 | context](https://github.com/qdm12/ddns-updater/issues/243#issuecomment-928313949). | 53 | - One of the following ([how to find API |
| 58 | - `"ttl"` integer value for record TTL in seconds | 54 | keys](https://developers.cloudflare.com/fundamentals/api/get-started/)): |
| 59 | (specify 1 for automatic) | 55 | - Email `"email"` and Global API Key `"key"` |
| 60 | - One of the following ([how to find API | 56 | - User service key `"user_service_key"` |
| 61 | keys](https://developers.cloudflare.com/fundamentals/api/get-started/)): | 57 | - API Token `"token"`, configured with DNS edit permissions for your DNS |
| 62 | - Email `"email"` and Global API Key | 58 | name's zone |
| 63 | `"key"` | 59 | - Optional Parameters |
| 64 | - User service key `"user_service_key"` | 60 | - `"proxied"` can be set to `true` to use the proxy services of Cloudflare |
| 65 | - API Token `"token"`, configured with DNS edit | 61 | - `"ip_version"` can be `ipv4` (A records), or `ipv6` (AAAA records) or |
| 66 | permissions for your DNS name\'s zone | 62 | `ipv4 or ipv6` (update one of the two, depending on the public ip |
| 67 | - Optional Parameters | 63 | found). It defaults to `ipv4 or ipv6`. |
| 68 | - `"proxied"` can be set to `true` to use | 64 | - `"ipv6_suffix"` is the IPv6 interface identifier suffix to use. It can be |
| 69 | the proxy services of Cloudflare | 65 | for example `0:0:0:0:72ad:8fbb:a54e:bedd/64`. If left empty, it defaults |
| 70 | - `"ip_version"` can be `ipv4` (A records), | 66 | to no suffix and the raw public IPv6 address obtained is used in the |
| 71 | or `ipv6` (AAAA records) or | 67 | record updating. |
| 72 | `ipv4 or ipv6` (update one of the two, depending on | ||
| 73 | the public ip found). It defaults to `ipv4 or ipv6`. | ||
| 74 | - `"ipv6_suffix"` is the IPv6 interface identifier | ||
| 75 | suffix to use. It can be for example | ||
| 76 | `0:0:0:0:72ad:8fbb:a54e:bedd/64`. If left empty, it | ||
| 77 | defaults to no suffix and the raw public IPv6 address obtained | ||
| 78 | is used in the record updating. | ||
| 79 | 68 | ||
| 80 | ``` conf | 69 | ``` conf |
| 81 | { | 70 | { |
| @@ -95,8 +84,8 @@ following: | |||
| 95 | } | 84 | } |
| 96 | ``` | 85 | ``` |
| 97 | 86 | ||
| 98 | Once you have configured the provider of your choice, correct the file | 87 | Once you have configured the provider of your choice, correct the file and |
| 99 | and directory permissions and ownership. | 88 | directory permissions and ownership. |
| 100 | 89 | ||
| 101 | ```sh | 90 | ```sh |
| 102 | cd ~/ddns_updater | 91 | cd ~/ddns_updater |
| @@ -110,8 +99,8 @@ chmod 400 data/config.json | |||
| 110 | 99 | ||
| 111 | ### Docker Compose | 100 | ### Docker Compose |
| 112 | 101 | ||
| 113 | After creating the project structure, let\'s create the | 102 | After creating the project structure, let's create the `docker-compose.yml` |
| 114 | `docker-compose.yml` file. | 103 | file. |
| 115 | 104 | ||
| 116 | ```sh | 105 | ```sh |
| 117 | nano ~/ddns_-pdater/docker-compose.yml | 106 | nano ~/ddns_-pdater/docker-compose.yml |
| @@ -155,22 +144,22 @@ services: | |||
| 155 | restart: always | 144 | restart: always |
| 156 | ``` | 145 | ``` |
| 157 | 146 | ||
| 158 | After configuring your preferences in the | 147 | After configuring your preferences in the `docker-compose.yml`, launch the |
| 159 | `docker-compose.yml`, launch the container. | 148 | container. |
| 160 | 149 | ||
| 161 | ```sh | 150 | ```sh |
| 162 | cd ~/ddns-updater | 151 | cd ~/ddns-updater |
| 163 | sudo docker-compose up -d | 152 | sudo docker-compose up -d |
| 164 | ``` | 153 | ``` |
| 165 | 154 | ||
| 166 | If you\'ve launched this on your local machine, you can launch | 155 | If you've launched this on your local machine, you can launch `localhost:8097` |
| 167 | `localhost:8097` in your browser to see the results. | 156 | in your browser to see the results. |
| 168 | 157 | ||
| 169 | ### Nginx Reverse Proxy | 158 | ### Nginx Reverse Proxy |
| 170 | 159 | ||
| 171 | If you launched this service on a server, other machine, or just want to | 160 | If you launched this service on a server, other machine, or just want to access |
| 172 | access it remotely via a domain name, you can use Nginx as a reverse | 161 | it remotely via a domain name, you can use Nginx as a reverse proxy to expose |
| 173 | proxy to expose the service publicly. | 162 | the service publicly. |
| 174 | 163 | ||
| 175 | Start by creating the Nginx configuration file. | 164 | Start by creating the Nginx configuration file. |
| 176 | 165 | ||
| @@ -178,7 +167,7 @@ Start by creating the Nginx configuration file. | |||
| 178 | sudo nano /etc/nginx/sites-available/ddns | 167 | sudo nano /etc/nginx/sites-available/ddns |
| 179 | ``` | 168 | ``` |
| 180 | 169 | ||
| 181 | Here\'s a basic example that should work properly. | 170 | Here's a basic example that should work properly. |
| 182 | 171 | ||
| 183 | ``` conf | 172 | ``` conf |
| 184 | server { | 173 | server { |
| @@ -198,8 +187,8 @@ server { | |||
| 198 | } | 187 | } |
| 199 | ``` | 188 | ``` |
| 200 | 189 | ||
| 201 | Here\'s a full example that uses my Authelia authentication service to | 190 | Here's a full example that uses my Authelia authentication service to require |
| 202 | require authentication before someone can access the web page. | 191 | authentication before someone can access the web page. |
| 203 | 192 | ||
| 204 | ``` conf | 193 | ``` conf |
| 205 | server { | 194 | server { |
| @@ -317,5 +306,4 @@ sudo ln -s /etc/nginx/sites-available/ddns /etc/nginx/sites-enabled/ddns | |||
| 317 | sudo systemctl restart nginx.service | 306 | sudo systemctl restart nginx.service |
| 318 | ``` | 307 | ``` |
| 319 | 308 | ||
| 320 | Your ddns-updater service will now be available via | 309 | Your ddns-updater service will now be available via `ddns.example.com`! |
| 321 | `ddns.example.com`! | ||
content/blog/2024-03-29-org-blog.md +60 −72
| @@ -5,49 +5,45 @@ description = "" | |||
| 5 | draft = false | 5 | draft = false |
| 6 | +++ | 6 | +++ |
| 7 | 7 | ||
| 8 | First and foremost, apologies to those who subscribe via RSS as I know | 8 | First and foremost, apologies to those who subscribe via RSS as I know that my |
| 9 | that my feed duplicated itself when I moved this blog over to org-mode | 9 | feed duplicated itself when I moved this blog over to org-mode last night. |
| 10 | last night. | ||
| 11 | 10 | ||
| 12 | This post focuses specifically on the configuration and tools I use to | 11 | This post focuses specifically on the configuration and tools I use to blog from |
| 13 | blog from Emacs with Org-Mode and does not focus on Emacs or Org-Mode | 12 | Emacs with Org-Mode and does not focus on Emacs or Org-Mode themselves. Refer to |
| 14 | themselves. Refer to the post I wrote about [Doom Emacs & | 13 | the post I wrote about [Doom Emacs & |
| 15 | Org-Mode](file:///blog/doom-emacs-org-mode.html) for more information | 14 | Org-Mode](file:///blog/doom-emacs-org-mode.html) for more information about my |
| 16 | about my base Emacs configuration. | 15 | base Emacs configuration. |
| 17 | 16 | ||
| 18 | # Weblorg | 17 | # Weblorg |
| 19 | 18 | ||
| 20 | The first step in blogging with Org-Mode is to choose a method to | 19 | The first step in blogging with Org-Mode is to choose a method to convert the |
| 21 | convert the source files to HTML and publish them. The Worg site | 20 | source files to HTML and publish them. The Worg site maintains a nice list of |
| 22 | maintains a nice list of [Blogs and Wikis with | 21 | [Blogs and Wikis with Org](https://orgmode.org/worg/org-blog-wiki.html), but the |
| 23 | Org](https://orgmode.org/worg/org-blog-wiki.html), but the tools are | 22 | tools are inevitably different and opinionated, so you'll need to find what |
| 24 | inevitably different and opinionated, so you\'ll need to find what works | 23 | works for you. |
| 25 | for you. | 24 | |
| 26 | 25 | I tried using Jekyll, Hugo, ox-hugo, Nikola, Blorg, org-static-blog, and the | |
| 27 | I tried using Jekyll, Hugo, ox-hugo, Nikola, Blorg, org-static-blog, and | 26 | native org-publish functions before finally settling on Weblorg. For one reason |
| 28 | the native org-publish functions before finally settling on Weblorg. For | 27 | or another, the other solutions were a drastic step down from my previous |
| 29 | one reason or another, the other solutions were a drastic step down from | 28 | workflow that used [Zola](https://www.getzola.org/) with Markdown content. |
| 30 | my previous workflow that used [Zola](https://www.getzola.org/) with | 29 | |
| 31 | Markdown content. | 30 | [Weblorg](https://github.com/emacs-love/weblorg) is a static site generator for |
| 32 | 31 | [org-mode](https://orgmode.org/), built for use within | |
| 33 | [Weblorg](https://github.com/emacs-love/weblorg) is a static site | 32 | [Emacs](https://www.gnu.org/software/emacs/). Since it's written in Emacs Lisp, |
| 34 | generator for [org-mode](https://orgmode.org/), built for use within | 33 | there's no need to install other languages or frameworks to get started. More |
| 35 | [Emacs](https://www.gnu.org/software/emacs/). Since it\'s written in | 34 | than that, you can write in any editor you please and simply invoke the Emacs |
| 36 | Emacs Lisp, there\'s no need to install other languages or frameworks to | 35 | build process with the `--script` parameter instead of requiring you to blog |
| 37 | get started. More than that, you can write in any editor you please and | 36 | inside Emacs. |
| 38 | simply invoke the Emacs build process with the `--script` | ||
| 39 | parameter instead of requiring you to blog inside Emacs. | ||
| 40 | 37 | ||
| 41 | ## Installation | 38 | ## Installation |
| 42 | 39 | ||
| 43 | The [Getting Started](https://emacs.love/weblorg/doc/index.html) page | 40 | The [Getting Started](https://emacs.love/weblorg/doc/index.html) page details |
| 44 | details broad installation requirements. I am using Doom Emacs on macOS, | 41 | broad installation requirements. I am using Doom Emacs on macOS, which requires |
| 45 | which requires you to add the package to the | 42 | you to add the package to the `~/.doom.d/packages.el` file and configure the |
| 46 | `~/.doom.d/packages.el` file and configure the | ||
| 47 | `publish.el` file slightly differently. | 43 | `publish.el` file slightly differently. |
| 48 | 44 | ||
| 49 | To start, add the `htmlize` and `weblorg` packages | 45 | To start, add the `htmlize` and `weblorg` packages to Doom, sync the changes, |
| 50 | to Doom, sync the changes, and reload. | 46 | and reload. |
| 51 | 47 | ||
| 52 | ```sh | 48 | ```sh |
| 53 | nano ~/.doom.d/packages.el | 49 | nano ~/.doom.d/packages.el |
| @@ -62,23 +58,20 @@ nano ~/.doom.d/packages.el | |||
| 62 | doom sync | 58 | doom sync |
| 63 | ``` | 59 | ``` |
| 64 | 60 | ||
| 65 | Either re-open Emacs or hit `SPC h r r` to reload the | 61 | Either re-open Emacs or hit `SPC h r r` to reload the changes. |
| 66 | changes. | ||
| 67 | 62 | ||
| 68 | ## Configuration | 63 | ## Configuration |
| 69 | 64 | ||
| 70 | Now that I\'ve installed weblorg, I need to configure the project. I\'ll | 65 | Now that I've installed weblorg, I need to configure the project. I'll start |
| 71 | start by navigating to my site\'s source code and creating a | 66 | by navigating to my site's source code and creating a `publish.el` file. |
| 72 | `publish.el` file. | ||
| 73 | 67 | ||
| 74 | ```sh | 68 | ```sh |
| 75 | cd ~/Source/cleberg.net && nano publish.el | 69 | cd ~/Source/cleberg.net && nano publish.el |
| 76 | ``` | 70 | ``` |
| 77 | 71 | ||
| 78 | Since I\'m using Doom, Emacs will not automatically load the packages I | 72 | Since I'm using Doom, Emacs will not automatically load the packages I need |
| 79 | need later in the build process. To compensate, my | 73 | later in the build process. To compensate, my `publish.el` file needs to |
| 80 | `publish.el` file needs to explicitly tell Emacs where Doom | 74 | explicitly tell Emacs where Doom stores the `htmlize`, `weblorg`, and |
| 81 | stores the `htmlize`, `weblorg`, and | ||
| 82 | `templatel` packages. | 75 | `templatel` packages. |
| 83 | 76 | ||
| 84 | ```lisp | 77 | ```lisp |
| @@ -189,12 +182,10 @@ stores the `htmlize`, `weblorg`, and | |||
| 189 | ## Structure | 182 | ## Structure |
| 190 | 183 | ||
| 191 | The project structure for weblorg is highly customizable and the main | 184 | The project structure for weblorg is highly customizable and the main |
| 192 | restriction is that the `publish.el` file must point to the | 185 | restriction is that the `publish.el` file must point to the correct paths. |
| 193 | correct paths. | ||
| 194 | 186 | ||
| 195 | For my blog, I prefer to keep the blog content out of the top-level | 187 | For my blog, I prefer to keep the blog content out of the top-level directory. |
| 196 | directory. This results in the following structure (shortened for | 188 | This results in the following structure (shortened for brevity): |
| 197 | brevity): | ||
| 198 | 189 | ||
| 199 | ``` txt | 190 | ``` txt |
| 200 | .build/ | 191 | .build/ |
| @@ -222,17 +213,17 @@ build.sh | |||
| 222 | publish.el | 213 | publish.el |
| 223 | ``` | 214 | ``` |
| 224 | 215 | ||
| 225 | This is simply my preferred structure and you can alter it to fit your | 216 | This is simply my preferred structure and you can alter it to fit your needs. |
| 226 | needs. The key here really is that you can customize at will, as long as | 217 | The key here really is that you can customize at will, as long as the |
| 227 | the `publish.el` file matches. | 218 | `publish.el` file matches. |
| 228 | 219 | ||
| 229 | ## Build & Deploy | 220 | ## Build & Deploy |
| 230 | 221 | ||
| 231 | Once you\'re content with the status of the project, you\'re ready to | 222 | Once you're content with the status of the project, you're ready to build and |
| 232 | build and deploy the blog. | 223 | deploy the blog. |
| 233 | 224 | ||
| 234 | My process utilizes a `build.sh` script that combines the | 225 | My process utilizes a `build.sh` script that combines the steps I take every |
| 235 | steps I take every time. | 226 | time. |
| 236 | 227 | ||
| 237 | ```sh | 228 | ```sh |
| 238 | touch build.sh && chmod +x build.sh && nano build.sh | 229 | touch build.sh && chmod +x build.sh && nano build.sh |
| @@ -240,14 +231,12 @@ touch build.sh && chmod +x build.sh && nano build.sh | |||
| 240 | 231 | ||
| 241 | Within this script, I do the following: | 232 | Within this script, I do the following: |
| 242 | 233 | ||
| 243 | 1. Remove any files within the `.build` directory that I use | 234 | 1. Remove any files within the `.build` directory that I use to store published |
| 244 | to store published files. | 235 | files. |
| 245 | 2. Set the environment variable to `prod` to ensure the | 236 | 2. Set the environment variable to `prod` to ensure the `base_url` matches my |
| 246 | `base_url` matches my configuration in | 237 | configuration in `publish.el`. |
| 247 | `publish.el`. | 238 | 3. Build the site with Emacs & `publish.el`. |
| 248 | 3. Build the site with Emacs & `publish.el`. | 239 | 4. Use `scp` to copy files to my site's public directory on my server. |
| 249 | 4. Use `scp` to copy files to my site\'s public directory on | ||
| 250 | my server. | ||
| 251 | 240 | ||
| 252 | ```sh | 241 | ```sh |
| 253 | rm -rf .build/* && \ | 242 | rm -rf .build/* && \ |
| @@ -259,13 +248,12 @@ scp -r .build/* ubuntu:/var/www/cleberg.net/ | |||
| 259 | 248 | ||
| 260 | My only current complaints are: | 249 | My only current complaints are: |
| 261 | 250 | ||
| 262 | 1. Errors messages are not helpful. It takes work to determine what the | 251 | 1. Errors messages are not helpful. It takes work to determine what the error is |
| 263 | error is and where it\'s coming from. I generally have to sit and | 252 | and where it's coming from. I generally have to sit and watch the build |
| 264 | watch the build process to see the file that weblorg pubslishes | 253 | process to see the file that weblorg pubslishes right before the error |
| 265 | right before the error occurred. | 254 | occurred. |
| 266 | 2. The build process re-builds every single file on each run, which | 255 | 2. The build process re-builds every single file on each run, which takes a long |
| 267 | takes a long time for a blog of my size. See below for the last time | 256 | time for a blog of my size. See below for the last time I measured. |
| 268 | I measured. | ||
| 269 | 257 | ||
| 270 | ```sh | 258 | ```sh |
| 271 | > time ./build.sh | 259 | > time ./build.sh |
| @@ -273,5 +261,5 @@ My only current complaints are: | |||
| 273 | ./build.sh 35.46s user 0.59s system 85% cpu 41.965 total | 261 | ./build.sh 35.46s user 0.59s system 85% cpu 41.965 total |
| 274 | ``` | 262 | ``` |
| 275 | 263 | ||
| 276 | Overall, I have thoroughly enjoyed using weblog and will continue to use | 264 | Overall, I have thoroughly enjoyed using weblog and will continue to use it |
| 277 | it going forward until I find something better. | 265 | going forward until I find something better. |
content/blog/2024-04-06-convert-onenote-to-markdown.md +46 −54
| @@ -5,25 +5,23 @@ description = "" | |||
| 5 | draft = false | 5 | draft = false |
| 6 | +++ | 6 | +++ |
| 7 | 7 | ||
| 8 | If you\'re looking to convert your OneNote content to another format, | 8 | If you're looking to convert your OneNote content to another format, such as |
| 9 | such as Markdown or Org-Mode, you\'re in luck. I use a solution that | 9 | Markdown or Org-Mode, you're in luck. I use a solution that doesn't require |
| 10 | doesn\'t require other programs, such as Evernote or Notion. Personally, | 10 | other programs, such as Evernote or Notion. Personally, I used this solution on |
| 11 | I used this solution on a managed corporate laptop that doesn\'t allow | 11 | a managed corporate laptop that doesn't allow installation of other programs |
| 12 | installation of other programs like these. | 12 | like these. |
| 13 | 13 | ||
| 14 | This solution uses OneNote and Pandoc on Windows 10. | 14 | This solution uses OneNote and Pandoc on Windows 10. |
| 15 | 15 | ||
| 16 | # Export OneNote Content to Word | 16 | # Export OneNote Content to Word |
| 17 | 17 | ||
| 18 | To start, export any pages or tabs from OneNote to the Word format | 18 | To start, export any pages or tabs from OneNote to the Word format (`.docx`): |
| 19 | (`.docx`): | ||
| 20 | 19 | ||
| 21 | 1. Open OneNote desktop. | 20 | 1. Open OneNote desktop. |
| 22 | 2. Select `File` and then `Export`. | 21 | 2. Select `File` and then `Export`. |
| 23 | 3. Select the scope of content to export, such as `Tab` or | 22 | 3. Select the scope of content to export, such as `Tab` or `Page`. |
| 24 | `Page`. | 23 | 4. Name and save the file in an easy to remember location. I recommend your |
| 25 | 4. Name and save the file in an easy to remember location. I recommend | 24 | Downloads or Desktop folder. |
| 26 | your Downloads or Desktop folder. | ||
| 27 | 25 | ||
| 28 | See below for a visual walkthrough of the export process. | 26 | See below for a visual walkthrough of the export process. |
| 29 | 27 | ||
| @@ -39,46 +37,42 @@ Document](https://img.cleberg.net/blog/20240406-convert-onenote-to-markdown/word | |||
| 39 | # Download Pandoc | 37 | # Download Pandoc |
| 40 | 38 | ||
| 41 | Start by downloading Pandoc from their [GitHub | 39 | Start by downloading Pandoc from their [GitHub |
| 42 | releases](https://github.com/jgm/pandoc/releases) page. I cannot install | 40 | releases](https://github.com/jgm/pandoc/releases) page. I cannot install `.msi` |
| 43 | `.msi` files on my corporate laptop, so I downloaded the | 41 | files on my corporate laptop, so I downloaded the |
| 44 | `pandoc-3.1.12.3-windows-x86_64.zip` file, which contains a | 42 | `pandoc-3.1.12.3-windows-x86_64.zip` file, which contains a simple `.exe` file |
| 45 | simple `.exe` file that you do not need to install - you will | 43 | that you do not need to install - you will simply run it from the command line |
| 46 | simply run it from the command line below. | 44 | below. |
| 47 | 45 | ||
| 48 | Once downloaded, unzip the archive and move the `pandoc.exe` | 46 | Once downloaded, unzip the archive and move the `pandoc.exe` file to the same |
| 49 | file to the same folder where your Word documents were saved above. If | 47 | folder where your Word documents were saved above. If you prefer, you can move |
| 50 | you prefer, you can move this file to an easier location, such as | 48 | this file to an easier location, such as `C:\Users\youruser\Downloads`. |
| 51 | `C:\Users\youruser\Downloads`. | ||
| 52 | 49 | ||
| 53 | # Convert Word to Markdown | 50 | # Convert Word to Markdown |
| 54 | 51 | ||
| 55 | In this example, I will be converting the Word documents to Markdown, | 52 | In this example, I will be converting the Word documents to Markdown, but Pandoc |
| 56 | but Pandoc supports [a ton of different formats for | 53 | supports [a ton of different formats for |
| 57 | conversion](https://github.com/jgm/pandoc?tab=readme-ov-file#the-universal-markup-converter). | 54 | conversion](https://github.com/jgm/pandoc?tab=readme-ov-file#the-universal-markup-converter). |
| 58 | Choose the format you prefer and then modify the following commands as | 55 | Choose the format you prefer and then modify the following commands as needed. |
| 59 | needed. | ||
| 60 | 56 | ||
| 61 | To perform the conversion, open the Command Prompt. If you can\'t find | 57 | To perform the conversion, open the Command Prompt. If you can't find it, open |
| 62 | it, open the start menu and search for it. | 58 | the start menu and search for it. |
| 63 | 59 | ||
| 64 | Within the command prompt, navigate to the directory where you stored | 60 | Within the command prompt, navigate to the directory where you stored the |
| 65 | the `pandoc.exe` file and the Word documents. | 61 | `pandoc.exe` file and the Word documents. |
| 66 | 62 | ||
| 67 | ```ps1 | 63 | ```ps1 |
| 68 | cd "C:\Users\yourusername\Downloads" | 64 | cd "C:\Users\yourusername\Downloads" |
| 69 | ``` | 65 | ``` |
| 70 | 66 | ||
| 71 | You can verify that you\'re in the correct directory with the | 67 | You can verify that you're in the correct directory with the `dir` command. |
| 72 | `dir` command. | ||
| 73 | 68 | ||
| 74 | ```ps1 | 69 | ```ps1 |
| 75 | dir | 70 | dir |
| 76 | ``` | 71 | ``` |
| 77 | 72 | ||
| 78 | Once you have verified that you have the command prompt open in the | 73 | Once you have verified that you have the command prompt open in the correct |
| 79 | correct directory with the `pandoc.exe` and the Word | 74 | directory with the `pandoc.exe` and the Word documents, you can run the |
| 80 | documents, you can run the following loop to convert all Word documents | 75 | following loop to convert all Word documents to Markdown. |
| 81 | to Markdown. | ||
| 82 | 76 | ||
| 83 | ```ps1 | 77 | ```ps1 |
| 84 | for %f in (*.docx) do (pandoc.exe --extract-media=. --wrap=preserve "%f" -o "%f.md") | 78 | for %f in (*.docx) do (pandoc.exe --extract-media=. --wrap=preserve "%f" -o "%f.md") |
| @@ -86,29 +80,27 @@ for %f in (*.docx) do (pandoc.exe --extract-media=. --wrap=preserve "%f" -o "%f. | |||
| 86 | 80 | ||
| 87 | This loop will perform the following actions: | 81 | This loop will perform the following actions: |
| 88 | 82 | ||
| 89 | 1. Find all documents matching the pattern `*.docx`, which | 83 | 1. Find all documents matching the pattern `*.docx`, which means all Word |
| 90 | means all Word documents ending with that file extension. | 84 | documents ending with that file extension. |
| 91 | 2. Iterate through all files found in step 1. | 85 | 2. Iterate through all files found in step 1. |
| 92 | 3. For each file, perform the pandoc command. | 86 | 3. For each file, perform the pandoc command. |
| 93 | 4. Within the pandoc command, `--extract-media` saves all | 87 | 4. Within the pandoc command, `--extract-media` saves all media found in the |
| 94 | media found in the files to the current folder, with pandoc | 88 | files to the current folder, with pandoc automatically creating a `media` |
| 95 | automatically creating a `media` subfolder to hold all | 89 | subfolder to hold all images. |
| 96 | images. | 90 | 5. Within the pandoc command, `--wrap=preserve` will attempt to prseerve the |
| 97 | 5. Within the pandoc command, `--wrap=preserve` will attempt | 91 | wrapping from the source document. |
| 98 | to prseerve the wrapping from the source document. | 92 | 6. Within the pandoc command, the final step is to specify the output path with |
| 99 | 6. Within the pandoc command, the final step is to specify the output | 93 | `-o`. This option adds the `.md` file extension to recognize the output files |
| 100 | path with `-o`. This option adds the `.md` | 94 | as Markdown files. |
| 101 | file extension to recognize the output files as Markdown files. | ||
| 102 | 95 | ||
| 103 |  | 97 | Conversion](https://img.cleberg.net/blog/20240406-convert-onenote-to-markdown/command.png) |
| 105 | 98 | ||
| 106 | If you want to export to another format, simply specify the | 99 | If you want to export to another format, simply specify the `-f=`/`--from=` and |
| 107 | `-f=`/`--from=` and `-t=`/`--to=` options. | 100 | `-t=`/`--to=` options. |
| 108 | 101 | ||
| 109 | For example, you can convert the Word document to org-mode. You can also | 102 | For example, you can convert the Word document to org-mode. You can also convert |
| 110 | convert to one format and subsequently convert to other formats as | 103 | to one format and subsequently convert to other formats as needed. |
| 111 | needed. | ||
| 112 | 104 | ||
| 113 | ```ps1 | 105 | ```ps1 |
| 114 | pandoc.exe -f docx -t org file.docx | 106 | pandoc.exe -f docx -t org file.docx |
content/blog/2024-04-08-docker-local-web-server.md +49 −58
| @@ -5,56 +5,52 @@ description = "" | |||
| 5 | draft = false | 5 | draft = false |
| 6 | +++ | 6 | +++ |
| 7 | 7 | ||
| 8 | When developing websites locally, I often use a simple Python web server | 8 | When developing websites locally, I often use a simple Python web server to |
| 9 | to observe the changes. | 9 | observe the changes. |
| 10 | 10 | ||
| 11 | ```sh | 11 | ```sh |
| 12 | python3 -m http.server | 12 | python3 -m http.server |
| 13 | ``` | 13 | ``` |
| 14 | 14 | ||
| 15 | However, this approach has its limitations. For example, this approach | 15 | However, this approach has its limitations. For example, this approach does not |
| 16 | does not enable logging or access controls. You also need to customize | 16 | enable logging or access controls. You also need to customize `SimpleHTTPServer` |
| 17 | `SimpleHTTPServer` if you have advanced needs from your web | 17 | if you have advanced needs from your web server. |
| 18 | server. | ||
| 19 | 18 | ||
| 20 | So, I went to find an alternative that is almost as easy and far more | 19 | So, I went to find an alternative that is almost as easy and far more extensible |
| 21 | extensible and found Docker Desktop to be a suitable replacement. | 20 | and found Docker Desktop to be a suitable replacement. |
| 22 | 21 | ||
| 23 | # Docker Desktop | 22 | # Docker Desktop |
| 24 | 23 | ||
| 25 | ## Installation | 24 | ## Installation |
| 26 | 25 | ||
| 27 | [Docker Desktop](https://www.docker.com/products/docker-desktop/) is a | 26 | [Docker Desktop](https://www.docker.com/products/docker-desktop/) is a desktop |
| 28 | desktop GUI for the phenomenal Docker container software. This allows | 27 | GUI for the phenomenal Docker container software. This allows you to manage |
| 29 | you to manage containers, images, volumes, environments, and extensions | 28 | containers, images, volumes, environments, and extensions via an easy-to-use |
| 30 | via an easy-to-use GUI. | 29 | GUI. |
| 31 | 30 | ||
| 32 | To install, open the link above and click the `Download` | 31 | To install, open the link above and click the `Download` button for your |
| 33 | button for your platform. I\'m going through this process on an M2 | 32 | platform. I'm going through this process on an M2 Macbook, so I downloaded the |
| 34 | Macbook, so I downloaded the Mac - Apple Chip version. | 33 | Mac - Apple Chip version. |
| 35 | 34 | ||
| 36 | Open the installer and follow the installation process until the | 35 | Open the installer and follow the installation process until the application |
| 37 | application finishes the installation process. | 36 | finishes the installation process. |
| 38 | 37 | ||
| 39 |  | 39 | macOS](https://img.cleberg.net/blog/20240408-docker-local-web-server/docker-desktop.png) |
| 41 | 40 | ||
| 42 | ## Creating an Nginx Container | 41 | ## Creating an Nginx Container |
| 43 | 42 | ||
| 44 | I prefer to use the command line to create containers, so the following | 43 | I prefer to use the command line to create containers, so the following commands |
| 45 | commands will be input via the terminal. | 44 | will be input via the terminal. |
| 46 | 45 | ||
| 47 | The following command will create a container, using the | 46 | The following command will create a container, using the `nginx` image: |
| 48 | `nginx` image: | ||
| 49 | 47 | ||
| 50 | 1. `-d`: Run this container as a daemon (detach) | 48 | 1. `-d`: Run this container as a daemon (detach) |
| 51 | 2. `-p`: Allocate a port in the format | 49 | 2. `-p`: Allocate a port in the format `<external>:<internal>` |
| 52 | `<external>:<internal>` | 50 | 3. `-i`: Keep STDIN open even if not attached |
| 53 | 3. `-i`: Keep STDIN open even if not attached | 51 | 4. `-t`: Allocate a pseudo-TTY |
| 54 | 4. `-t`: Allocate a pseudo-TTY | 52 | 5. `-p`: Allocate a port in the format `<external>:<internal>` |
| 55 | 5. `-p`: Allocate a port in the format | 53 | 6. `--rm`: Remove the container once it's done running |
| 56 | `<external>:<internal>` | ||
| 57 | 6. `--rm`: Remove the container once it\'s done running | ||
| 58 | 54 | ||
| 59 | ```sh | 55 | ```sh |
| 60 | docker run -it --rm -d -p 8000:80 --name web nginx | 56 | docker run -it --rm -d -p 8000:80 --name web nginx |
| @@ -67,27 +63,26 @@ Container](https://img.cleberg.net/blog/20240408-docker-local-web-server/default | |||
| 67 | 63 | ||
| 68 | ## Customizing the Nginx Container | 64 | ## Customizing the Nginx Container |
| 69 | 65 | ||
| 70 | Now that I have a container running the Nginx web server, I need to link | 66 | Now that I have a container running the Nginx web server, I need to link some |
| 71 | some volumes so that I can modify the site configuration and provide the | 67 | volumes so that I can modify the site configuration and provide the web files to |
| 72 | web files to serve. | 68 | serve. |
| 73 | 69 | ||
| 74 | Let\'s start with the new command, which adds two volumes: | 70 | Let's start with the new command, which adds two volumes: |
| 75 | 71 | ||
| 76 | 1. `<your_content>:/usr/share/nginx/html`: This is the | 72 | 1. `<your_content>:/usr/share/nginx/html`: This is the directory where you will |
| 77 | directory where you will provide the web pages for the server to | 73 | provide the web pages for the server to serve. |
| 78 | serve. | 74 | 2. `<your_config>:/etc/nginx/conf.d/default.conf`: This is the Nginx |
| 79 | 2. `<your_config>:/etc/nginx/conf.d/default.conf`: This is | 75 | configuration file for your site. |
| 80 | the Nginx configuration file for your site. | ||
| 81 | 76 | ||
| 82 | To see the updates, you can delete the previous container in the GUI or | 77 | To see the updates, you can delete the previous container in the GUI or run |
| 83 | run `docker stop web` to stop the container. Once stopped, | 78 | `docker stop web` to stop the container. Once stopped, you can run the new |
| 84 | you can run the new `docker run` command below. | 79 | `docker run` command below. |
| 85 | 80 | ||
| 86 | ```sh | 81 | ```sh |
| 87 | docker run -it -d -p 8000:80 --name web -v ~/Source/cleberg.net/.build:/usr/share/nginx/html -v ~/Source/cleberg.net/nginx-config.conf:/etc/nginx/conf.d/default.conf nginx | 82 | docker run -it -d -p 8000:80 --name web -v ~/Source/cleberg.net/.build:/usr/share/nginx/html -v ~/Source/cleberg.net/nginx-config.conf:/etc/nginx/conf.d/default.conf nginx |
| 88 | ``` | 83 | ``` |
| 89 | 84 | ||
| 90 | Here\'s an example of my development configuration file. | 85 | Here's an example of my development configuration file. |
| 91 | 86 | ||
| 92 | ``` conf | 87 | ``` conf |
| 93 | # nginx-config.conf | 88 | # nginx-config.conf |
| @@ -114,19 +109,16 @@ server { | |||
| 114 | 109 | ||
| 115 | # Customizing Deployment Actions | 110 | # Customizing Deployment Actions |
| 116 | 111 | ||
| 117 | I am currently blogging with [weblorg](https://emacs.love/weblorg/), | 112 | I am currently blogging with [weblorg](https://emacs.love/weblorg/), which uses |
| 118 | which uses a custom `publish.el` file to build the static | 113 | a custom `publish.el` file to build the static site. Within this file, I have |
| 119 | site. Within this file, I have configured my deployment process to check | 114 | configured my deployment process to check for the `ENV` variable in thesh and if |
| 120 | for the `ENV` variable in thesh and if it\'s set to | 115 | it's set to `prod`, the script will set the base URLs to `https://cleberg.net`. |
| 121 | `prod`, the script will set the base URLs to | 116 | If not, it sets the base URLs to `localhost:8000` (which matches the port used |
| 122 | `https://cleberg.net`. If not, it sets the base URLs to | 117 | in the container above). |
| 123 | `localhost:8000` (which matches the port used in the | ||
| 124 | container above). | ||
| 125 | 118 | ||
| 126 | Therefore, I have modified my `build.sh` script to build with | 119 | Therefore, I have modified my `build.sh` script to build with `localhost` URLs |
| 127 | `localhost` URLs if `ENV` is not set to | 120 | if `ENV` is not set to `prod`. It also prevents the build process from sending |
| 128 | `prod`. It also prevents the build process from sending the | 121 | the built files to the production web server. |
| 129 | built files to the production web server. | ||
| 130 | 122 | ||
| 131 | ```sh | 123 | ```sh |
| 132 | #!/bin/bash | 124 | #!/bin/bash |
| @@ -143,7 +135,6 @@ else | |||
| 143 | fi | 135 | fi |
| 144 | ``` | 136 | ``` |
| 145 | 137 | ||
| 146 | You can modify the container in numerous ways and this approach allows | 138 | You can modify the container in numerous ways and this approach allows you to |
| 147 | you to create complex scenarios for your web development purposes. I | 139 | create complex scenarios for your web development purposes. I highly recommend |
| 148 | highly recommend switching over to a container-based approach for | 140 | switching over to a container-based approach for simple, local web development. |
| 149 | simple, local web development. | ||
content/blog/2024-04-18-mu4e.md +45 −54
| @@ -6,19 +6,18 @@ draft = false | |||
| 6 | +++ | 6 | +++ |
| 7 | 7 | ||
| 8 | This post was heavily inspired by [Email setup in Emacs with Mu4e on | 8 | This post was heavily inspired by [Email setup in Emacs with Mu4e on |
| 9 | macOS](https://macowners.club/posts/email-emacs-mu4e-macos/), but with | 9 | macOS](https://macowners.club/posts/email-emacs-mu4e-macos/), but with my own |
| 10 | my own tweaks for a single-account configuration and some Doom-specific | 10 | tweaks for a single-account configuration and some Doom-specific configurations. |
| 11 | configurations. | ||
| 12 | 11 | ||
| 13 | # Overview | 12 | # Overview |
| 14 | 13 | ||
| 15 | [Mu4e](https://github.com/emacsmirror/mu4e) is an Emacs-based email | 14 | [Mu4e](https://github.com/emacsmirror/mu4e) is an Emacs-based email client based |
| 16 | client based on [mu](https://www.djcbsoftware.nl/code/mu/), an indexer | 15 | on [mu](https://www.djcbsoftware.nl/code/mu/), an indexer that stores email in |
| 17 | that stores email in the Maildir format. | 16 | the Maildir format. |
| 18 | 17 | ||
| 19 | This blog post covers the installation of Mu4e in Doom Emacs on macOS. | 18 | This blog post covers the installation of Mu4e in Doom Emacs on macOS. This |
| 20 | This guide should be very similar to GNU Emacs and Linux-based systems, | 19 | guide should be very similar to GNU Emacs and Linux-based systems, with a few |
| 21 | with a few tweaks required in the various configuration files. | 20 | tweaks required in the various configuration files. |
| 22 | 21 | ||
| 23 | # Installation | 22 | # Installation |
| 24 | 23 | ||
| @@ -36,33 +35,32 @@ mkdir ~/.maildir/certificates # used to store system root certificates | |||
| 36 | 35 | ||
| 37 | ### Store Email Account Passwords in macOS Keychain | 36 | ### Store Email Account Passwords in macOS Keychain |
| 38 | 37 | ||
| 39 | Next, I will be using the macOS Keychain to store my email account | 38 | Next, I will be using the macOS Keychain to store my email account passwords |
| 40 | passwords using the command below. | 39 | using the command below. |
| 41 | 40 | ||
| 42 | ```sh | 41 | ```sh |
| 43 | security add-generic-password -s mu4e-example -a you@example.com -w | 42 | security add-generic-password -s mu4e-example -a you@example.com -w |
| 44 | ``` | 43 | ``` |
| 45 | 44 | ||
| 46 | This will prompt you to input your password twice to confirm. Keep the | 45 | This will prompt you to input your password twice to confirm. Keep the |
| 47 | `mu4e-example` name in mind, as you will need to reference it | 46 | `mu4e-example` name in mind, as you will need to reference it later in the IMAP |
| 48 | later in the IMAP and SMTP configuration files. | 47 | and SMTP configuration files. |
| 49 | 48 | ||
| 50 | ### Store Root Certificates | 49 | ### Store Root Certificates |
| 51 | 50 | ||
| 52 | In order to use IMAP and SMTP, we need to provide certificates to the | 51 | In order to use IMAP and SMTP, we need to provide certificates to the local |
| 53 | local services. We will use the macOS defaults for this. | 52 | services. We will use the macOS defaults for this. |
| 54 | 53 | ||
| 55 | 1. Open `Keychain Access.app`. | 54 | 1. Open `Keychain Access.app`. |
| 56 | 2. Select `System Roots` in the sidebar. | 55 | 2. Select `System Roots` in the sidebar. |
| 57 | 3. Select all items with `CMD + a`. | 56 | 3. Select all items with `CMD + a`. |
| 58 | 4. Export selected items with `SHIFT + CMD + a` to the file | 57 | 4. Export selected items with `SHIFT + CMD + a` to the file |
| 59 | `~/.maildir/certificates/root-certificates.pem`. | 58 | `~/.maildir/certificates/root-certificates.pem`. |
| 60 | 59 | ||
| 61 | ### Install Dependencies | 60 | ### Install Dependencies |
| 62 | 61 | ||
| 63 | Install `mbsync` (via `isync`) to fetch emails via | 62 | Install `mbsync` (via `isync`) to fetch emails via IMAP, `mu` to index emails, |
| 64 | IMAP, `mu` to index emails, and `msmtp` to send | 63 | and `msmtp` to send emails via SMTP. |
| 65 | emails via SMTP. | ||
| 66 | 64 | ||
| 67 | ```sh | 65 | ```sh |
| 68 | brew install mu isync msmtp | 66 | brew install mu isync msmtp |
| @@ -76,9 +74,8 @@ Within Doom Emacs, we can install Mu4e by enabling the package. | |||
| 76 | nano ~/.doom.d/init.el | 74 | nano ~/.doom.d/init.el |
| 77 | ``` | 75 | ``` |
| 78 | 76 | ||
| 79 | In this file, uncomment the `mu4e` line within the | 77 | In this file, uncomment the `mu4e` line within the `:email` section. You can |
| 80 | `:email` section. You can also enable the `+org` | 78 | also enable the `+org` and `+gmail` options if you prefer. |
| 81 | and `+gmail` options if you prefer. | ||
| 82 | 79 | ||
| 83 | ```lisp | 80 | ```lisp |
| 84 | (doom! :input | 81 | (doom! :input |
| @@ -92,9 +89,9 @@ and `+gmail` options if you prefer. | |||
| 92 | 89 | ||
| 93 | # Configuration | 90 | # Configuration |
| 94 | 91 | ||
| 95 | As an overall suggestion, I create the following configuration files in | 92 | As an overall suggestion, I create the following configuration files in the |
| 96 | the `~/.maildir` directory and using symlinks to their proper | 93 | `~/.maildir` directory and using symlinks to their proper locations so that I |
| 97 | locations so that I can backup and restore these files easily. | 94 | can backup and restore these files easily. |
| 98 | 95 | ||
| 99 | ```sh | 96 | ```sh |
| 100 | touch ~/.maildir/.mbsyncrc && \ | 97 | touch ~/.maildir/.mbsyncrc && \ |
| @@ -103,14 +100,13 @@ ln -s /Users/username/.maildir/.mbsyncrc /Users/username/.mbsyncrc && \ | |||
| 103 | ln -s /Users/username/.maildir/.msmtprc /Users/username/.msmtprc | 100 | ln -s /Users/username/.maildir/.msmtprc /Users/username/.msmtprc |
| 104 | ``` | 101 | ``` |
| 105 | 102 | ||
| 106 | You can also create these files in your home directory and skip the | 103 | You can also create these files in your home directory and skip the symlinking |
| 107 | symlinking process above. | 104 | process above. |
| 108 | 105 | ||
| 109 | ## IMAP | 106 | ## IMAP |
| 110 | 107 | ||
| 111 | Next, let\'s configure `mbsync` in the file created above. | 108 | Next, let's configure `mbsync` in the file created above. Paste the following |
| 112 | Paste the following information and customize it to match your mail | 109 | information and customize it to match your mail provider's information. |
| 113 | provider\'s information. | ||
| 114 | 110 | ||
| 115 | ```sh | 111 | ```sh |
| 116 | nano ~/.maildir/.mbsyncrc | 112 | nano ~/.maildir/.mbsyncrc |
| @@ -146,9 +142,8 @@ SyncState * | |||
| 146 | 142 | ||
| 147 | ## SMTP | 143 | ## SMTP |
| 148 | 144 | ||
| 149 | Next, let\'s configured `msmtprc` in the file created above. | 145 | Next, let's configured `msmtprc` in the file created above. Paste the following |
| 150 | Paste the following information and customize it to match your mail | 146 | information and customize it to match your mail provider's information. |
| 151 | provider\'s information. | ||
| 152 | 147 | ||
| 153 | ```sh | 148 | ```sh |
| 154 | nano ~/.maildir/.msmtprc | 149 | nano ~/.maildir/.msmtprc |
| @@ -180,8 +175,8 @@ account default : startmail | |||
| 180 | 175 | ||
| 181 | ## Doom Emacs | 176 | ## Doom Emacs |
| 182 | 177 | ||
| 183 | Finally, we need to configure Doom Emacs to use the proper packages and | 178 | Finally, we need to configure Doom Emacs to use the proper packages and set some |
| 184 | set some variables and functions. | 179 | variables and functions. |
| 185 | 180 | ||
| 186 | ```sh | 181 | ```sh |
| 187 | nano ~/.doom.d/config.el | 182 | nano ~/.doom.d/config.el |
| @@ -279,14 +274,12 @@ Be sure to sync Doom to update the current configurations. | |||
| 279 | doom sync | 274 | doom sync |
| 280 | ``` | 275 | ``` |
| 281 | 276 | ||
| 282 | If you have Doom open, execute `SPC h r r` to reload the new | 277 | If you have Doom open, execute `SPC h r r` to reload the new configurations. |
| 283 | configurations. | ||
| 284 | 278 | ||
| 285 | # Initial Sync | 279 | # Initial Sync |
| 286 | 280 | ||
| 287 | Once you have configured all of the relevant files, you can perform an | 281 | Once you have configured all of the relevant files, you can perform an initial |
| 288 | initial sync. Note that you can perform syncing within Mu4e itself afer | 282 | sync. Note that you can perform syncing within Mu4e itself afer this. |
| 289 | this. | ||
| 290 | 283 | ||
| 291 | ```sh | 284 | ```sh |
| 292 | mbsync -aV | 285 | mbsync -aV |
| @@ -303,21 +296,19 @@ The emails will now to be ready to use! | |||
| 303 | 296 | ||
| 304 | # Screenshots | 297 | # Screenshots |
| 305 | 298 | ||
| 306 | You can now launch Doom and open Mu4e with `SPC o m`. You can | 299 | You can now launch Doom and open Mu4e with `SPC o m`. You can also explore the |
| 307 | also explore the Mu4e options with `SPC : mu4e`. | 300 | Mu4e options with `SPC : mu4e`. |
| 308 | 301 | ||
| 309 | The home page shows various options and metdata about the account | 302 | The home page shows various options and metdata about the account you've |
| 310 | you\'ve opened. | 303 | opened. |
| 311 | 304 | ||
| 312 |  | 305 |  |
| 313 | 306 | ||
| 314 | When composing an email, you can see the metadata fields at the top and | 307 | When composing an email, you can see the metadata fields at the top and compose |
| 315 | compose the message below the indicator line. | 308 | the message below the indicator line. |
| 316 | 309 | ||
| 317 |  |
| 318 | Screen](https://img.cleberg.net/blog/20240418-mu4e/draft.png) | ||
| 319 | 311 | ||
| 320 | When in a folder, you can view emails in a pane and perform actions as | 312 | When in a folder, you can view emails in a pane and perform actions as needed. |
| 321 | needed. | ||
| 322 | 313 | ||
| 323 |  | 314 |  |
content/services.md +2 −2
| @@ -8,9 +8,9 @@ draft = false | |||
| 8 | - [FileArchive](https://files.cleberg.net/) - An interesting file archive | 8 | - [FileArchive](https://files.cleberg.net/) - An interesting file archive |
| 9 | - [FlashPaper](https://paste.cleberg.net/) - One-time encrypted password/secret sharing | 9 | - [FlashPaper](https://paste.cleberg.net/) - One-time encrypted password/secret sharing |
| 10 | - [GotHub](https://gh.cleberg.net/) - An alternative front-end for GitHub | 10 | - [GotHub](https://gh.cleberg.net/) - An alternative front-end for GitHub |
| 11 | - [ifconfig.php](https://ip.cleberg.net/) - A \"whatsmyip\" tool | 11 | - [ifconfig.php](https://ip.cleberg.net/) - A "whatsmyip" tool |
| 12 | - [Invidious](https://invidious.cleberg.net/) - A YouTube proxy | 12 | - [Invidious](https://invidious.cleberg.net/) - A YouTube proxy |
| 13 | - [Office](https://office.cleberg.net/) - The world\'s smallest office suite | 13 | - [Office](https://office.cleberg.net/) - The world's smallest office suite |
| 14 | - [Org-Live](https://org.cleberg.net/) - A basic org-mode editor for the web I built | 14 | - [Org-Live](https://org.cleberg.net/) - A basic org-mode editor for the web I built |
| 15 | - [SearXNG](https://search.cleberg.net/) - A privacy-respecting, open metasearch engine | 15 | - [SearXNG](https://search.cleberg.net/) - A privacy-respecting, open metasearch engine |
| 16 | 16 | ||
content/wiki/blogroll.md +1 −1
| @@ -27,7 +27,7 @@ A list of various plaintext websites and lists. | |||
| 27 | 27 | ||
| 28 | ## Webrings | 28 | ## Webrings |
| 29 | 29 | ||
| 30 | Instead of listing my personal favorites, I\'m just going to drop a link to [brisay's webring list](https://brisray.com/web/webring-list.htm), which contains 237 webrings for a total of 7078 websites, as of 2024-03-15. | 30 | Instead of listing my personal favorites, I'm just going to drop a link to [brisay's webring list](https://brisray.com/web/webring-list.htm), which contains 237 webrings for a total of 7078 websites, as of 2024-03-15. |
| 31 | 31 | ||
| 32 | ## Everything Else | 32 | ## Everything Else |
| 33 | 33 | ||
content/wiki/hardware.md +1 −1
| @@ -47,7 +47,7 @@ and quiet as my top priorities. | |||
| 47 | 47 | ||
| 48 | ### IoT | 48 | ### IoT |
| 49 | 49 | ||
| 50 | A collection of mainly smart lights, sensors, and smart appliances. My first preference is to disable all networking for new smart devices or simply not connect internet in the first place (e.g. I never enable internet on my smart TVs). If the smart device requires LAN access, I will connect the device to my guest-restricted IoT network. As a last resort, I will set-up the internet but monitor the DNS lookups via NextDNS and forcibly block any domains I do not want the device to be using. If the device is egregious or shady, I\'ll just sell it and either replace it or live without it. | 50 | A collection of mainly smart lights, sensors, and smart appliances. My first preference is to disable all networking for new smart devices or simply not connect internet in the first place (e.g. I never enable internet on my smart TVs). If the smart device requires LAN access, I will connect the device to my guest-restricted IoT network. As a last resort, I will set-up the internet but monitor the DNS lookups via NextDNS and forcibly block any domains I do not want the device to be using. If the device is egregious or shady, I'll just sell it and either replace it or live without it. |
| 51 | 51 | ||
| 52 | - Other Appliances (washer, dryer, humidifier, fans, etc.) | 52 | - Other Appliances (washer, dryer, humidifier, fans, etc.) |
| 53 | - [Roomba i7+](https://about.irobot.com/sitecore/content/north-america/irobot-us/home/roomba/i7-series) | 53 | - [Roomba i7+](https://about.irobot.com/sitecore/content/north-america/irobot-us/home/roomba/i7-series) |
content/wiki/ios.md +12 −12
| @@ -51,19 +51,19 @@ Here's the baseline I start with: | |||
| 51 | - Disable: | 51 | - Disable: |
| 52 | - Analytics & Improvements | 52 | - Analytics & Improvements |
| 53 | - Apple Advertising | 53 | - Apple Advertising |
| 54 | - Apple ID \> Sign-In & Security \> Two-Factor Authentication | 54 | - Apple ID > Sign-In & Security > Two-Factor Authentication |
| 55 | - Location Services \> System Services \> Product Improvement | 55 | - Location Services > System Services > Product Improvement |
| 56 | - Tracking \> Allow Apps to Request to Track | 56 | - Tracking > Allow Apps to Request to Track |
| 57 | - Safari \> Advanced \> Privacy Preserving Ad Measurement | 57 | - Safari > Advanced > Privacy Preserving Ad Measurement |
| 58 | - Enable: | 58 | - Enable: |
| 59 | - Apple ID \> iCloud \> Advanced Data Protection | 59 | - Apple ID > iCloud > Advanced Data Protection |
| 60 | - Apple ID \> Personal Information \> Communication Preferences | 60 | - Apple ID > Personal Information > Communication Preferences |
| 61 | - App Privacy Report | 61 | - App Privacy Report |
| 62 | - Location Services only for Camera, Find My, UDisc, & WiFiman | 62 | - Location Services only for Camera, Find My, UDisc, & WiFiman |
| 63 | (`While Using`) | 63 | (`While Using`) |
| 64 | - Safari \> Prevent Cross-Site Tracking | 64 | - Safari > Prevent Cross-Site Tracking |
| 65 | - Safari \> Hide IP Address | 65 | - Safari > Hide IP Address |
| 66 | - Safari \> Advanced \> Advanced Tracking and Fingerprinting | 66 | - Safari > Advanced > Advanced Tracking and Fingerprinting |
| 67 | Protection | 67 | Protection |
| 68 | 68 | ||
| 69 | ## Native Apps | 69 | ## Native Apps |
| @@ -92,7 +92,7 @@ Here's the baseline I start with: | |||
| 92 | 92 | ||
| 93 | ### Music | 93 | ### Music |
| 94 | 94 | ||
| 95 | - [Apple Music](https://apps.apple.com/us/app/apple-music/id1108187390) (`*`) - Apple\'s native music streaming app | 95 | - [Apple Music](https://apps.apple.com/us/app/apple-music/id1108187390) (`*`) - Apple's native music streaming app |
| 96 | - [Plexamp](https://apps.apple.com/us/app/plexamp/id1500797510) (`*`) - Top-notch music app for your Plex Media Server, with a neural network that provides excellent radio/shuffle suggestions | 96 | - [Plexamp](https://apps.apple.com/us/app/plexamp/id1500797510) (`*`) - Top-notch music app for your Plex Media Server, with a neural network that provides excellent radio/shuffle suggestions |
| 97 | 97 | ||
| 98 | ### News | 98 | ### News |
| @@ -109,7 +109,7 @@ Here's the baseline I start with: | |||
| 109 | - [beorg](https://apps.apple.com/us/app/beorg-to-do-list-agenda/id1238649962) - An org-mode editor, outline, and scheduler with paid extensions | 109 | - [beorg](https://apps.apple.com/us/app/beorg-to-do-list-agenda/id1238649962) - An org-mode editor, outline, and scheduler with paid extensions |
| 110 | - [Bitwarden](https://apps.apple.com/us/app/bitwarden-password-manager/id1137397744) (`*`) - An open source password manager | 110 | - [Bitwarden](https://apps.apple.com/us/app/bitwarden-password-manager/id1137397744) (`*`) - An open source password manager |
| 111 | - [Cryptomator](https://apps.apple.com/us/app/cryptomator/id1560822163) - A cross-platform encryption program | 111 | - [Cryptomator](https://apps.apple.com/us/app/cryptomator/id1560822163) - A cross-platform encryption program |
| 112 | - [Obsidian](https://apps.apple.com/us/app/obsidian-connected-notes/id1557175442) (`*`) - A nice Markdown-based editor based on a \"vault\" structure. Offers a paid sync solution and community extensions | 112 | - [Obsidian](https://apps.apple.com/us/app/obsidian-connected-notes/id1557175442) (`*`) - A nice Markdown-based editor based on a "vault" structure. Offers a paid sync solution and community extensions |
| 113 | - [Strongbox](https://apps.apple.com/us/app/strongbox-password-manager/id897283731) - Keepass password manager for iOS & macOS | 113 | - [Strongbox](https://apps.apple.com/us/app/strongbox-password-manager/id897283731) - Keepass password manager for iOS & macOS |
| 114 | - [UniFi Network](https://apps.apple.com/us/app/unifi/id1057750338) - View and manage most UniFi Network settings | 114 | - [UniFi Network](https://apps.apple.com/us/app/unifi/id1057750338) - View and manage most UniFi Network settings |
| 115 | 115 | ||
| @@ -130,7 +130,7 @@ Here's the baseline I start with: | |||
| 130 | 130 | ||
| 131 | ### Sports | 131 | ### Sports |
| 132 | 132 | ||
| 133 | - [Apple Sports](https://apps.apple.com/us/app/apple-sports/id6446788829) - Apple\'s new sports app - lacks notifications and live events | 133 | - [Apple Sports](https://apps.apple.com/us/app/apple-sports/id6446788829) - Apple's new sports app - lacks notifications and live events |
| 134 | - [UDisc](https://apps.apple.com/us/app/udisc-disc-golf/id1072228953) - Disc golf course maps, score cards, and more | 134 | - [UDisc](https://apps.apple.com/us/app/udisc-disc-golf/id1072228953) - Disc golf course maps, score cards, and more |
| 135 | 135 | ||
| 136 | ### Utilities | 136 | ### Utilities |
content/wiki/macos.md +2 −2
| @@ -92,7 +92,7 @@ echo "yabai configuration loaded.." | |||
| 92 | 92 | ||
| 93 | ### Communications | 93 | ### Communications |
| 94 | 94 | ||
| 95 | - [Element](https://element.io/) (`*`) - Matrix\'s default GUI client | 95 | - [Element](https://element.io/) (`*`) - Matrix's default GUI client |
| 96 | - [gomuks](https://github.com/tulir/gomuks) - A terminal based Matrix client | 96 | - [gomuks](https://github.com/tulir/gomuks) - A terminal based Matrix client |
| 97 | - [Thunderbird](https://www.thunderbird.net/) (`*`) - An open source email client by Mozilla | 97 | - [Thunderbird](https://www.thunderbird.net/) (`*`) - An open source email client by Mozilla |
| 98 | - [Signal](https://signal.org/) (`*`) - A simple, powerful, and secure messenger | 98 | - [Signal](https://signal.org/) (`*`) - A simple, powerful, and secure messenger |
| @@ -103,7 +103,7 @@ echo "yabai configuration loaded.." | |||
| 103 | - [open-webui](https://github.com/open-webui/open-webui) - User-friendly WebUI for LLMs | 103 | - [open-webui](https://github.com/open-webui/open-webui) - User-friendly WebUI for LLMs |
| 104 | - [iTerm2](https://iterm2.com/) (`*`) - The best terminal for macOS, hands down | 104 | - [iTerm2](https://iterm2.com/) (`*`) - The best terminal for macOS, hands down |
| 105 | - [Podman Desktop](https://podman-desktop.io/) (`*`) - Open source tool for containers and Kubernetes | 105 | - [Podman Desktop](https://podman-desktop.io/) (`*`) - Open source tool for containers and Kubernetes |
| 106 | - [Xcode](https://developer.apple.com/xcode/) - Apple\'s IDE | 106 | - [Xcode](https://developer.apple.com/xcode/) - Apple's IDE |
| 107 | - [zsh](https://en.wikipedia.org/wiki/Z_shell) (`*`) - My shell preference due to its plugin and theme community | 107 | - [zsh](https://en.wikipedia.org/wiki/Z_shell) (`*`) - My shell preference due to its plugin and theme community |
| 108 | - [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) - Fish-like autosuggestions for zsh | 108 | - [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) - Fish-like autosuggestions for zsh |
| 109 | - [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) - Fish shell like syntax highlighting for Zsh | 109 | - [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) - Fish shell like syntax highlighting for Zsh |