Initial commit

This commit is contained in:
bufferstack 2024-12-25 02:14:10 -05:00
commit 383f8bc667
91 changed files with 9972 additions and 0 deletions

View file

@ -0,0 +1,39 @@
---
pubDatetime: 2024-10-18
title: Back Again
description: "Life is uncertain, but one thing remains constant- my need to keep my brain engaged."
featured: false
---
> This is going to be a brief post; I have not gathered my thoughts on my current career situation, however that will come.
## What's Up?
Well, I've given up on pivoting to cybersecurity. I have also given up on IT/DevOps as a career. I will be talking about this
more in another post somewhere else which I'll link to, but it is what it is for me.
This means I have more time to build software when I get a chance and for fun and for my next endeavour which means
this blog is my main one for software dev for the foreseeable future.
I am glad to consolidate things and pare things down to just this blog and my next endeavour [Tiff Labs](https://tifflabs.org).
## What is Tiff Labs?
First, I've quit trying to have a career in tech proper. It's just not going to happen for someone my age during a recession
like this. I don't have a degree and am fully self-taught. This is a big strike against me returning to the workforce in tech and
if I can't do that, I will do my own thing. I have income from other sources to be able to do this so I am not too concerned about
making ends meet for now.
Tiff Labs is an umbrella of things- a YouTube channel, a blog, a smart home resource, and a homelab resource. I can make money from that once I get more content up and posted[^1].
I will also be doing more DIY repairing of devices and DIY building of things in general. I enjoy working with my hands more than working with code. I love both, don't get me wrong. However working with my hands gives me immense joy I don't find while writing software.
## What this blog will be
It will be a place for me to talk about the software I build for my other projects and hopefully a small business at some point. That's it.
Here is a project I'd like to build in Go:
<blockquote class="reddit-embed-bq" data-embed-height="364"><a href="https://www.reddit.com/r/golang/comments/1e6cwgi/comment/lds2v63/">Comment</a><br> by<a href="https://www.reddit.com/user/TheBrownViking20/">u/TheBrownViking20</a> from discussion<a href="https://www.reddit.com/r/golang/comments/1e6cwgi/what_is_the_most_interesting_golang_cli_app_youve/"></a><br> in<a href="https://www.reddit.com/r/golang/">golang</a></blockquote><script async="" src="https://embed.reddit.com/widgets.js" charset="UTF-8"></script>
[^1]: I know that affiliate links are frowned upon but other than ads which I don't want to run, this will have to do for now.

View file

@ -0,0 +1,7 @@
---
title: Designing projects
pubDatetime: 2024-12-24
description: Listless and needing focus, I found the perfect repo to build my skills.
featured: true
draft: true
---

View file

@ -0,0 +1,10 @@
---
pubDatetime: 2024-04-01
title: Go Project Structure for gURL
description: Helpful Go tip.
featured: true
---
Over the past week I've been working on changing the structure of gURL.
One of my old CodeNewbie friends on LinkedIn gave me a template to start from on GitHub called [Standard Go Project Layout](https://github.com/golang-standards/project-layout). I intend to use this as a guide.

View file

@ -0,0 +1,80 @@
---
pubDatetime: 2024-03-24
title: "gURL: A cURL Wrapper Written in Go"
description: Moving on from frontend to something new.
featured: true
---
Briefly: I am writing a CLI tool that fetches info from GitHub's REST API as a wrapper around cURL.
Why?
Just to keep my finger on the pulse of software development and to practice my programming skills because believe it or not, being able to code as a cybersecurity professional is extremely useful, even though it isn't _technically necessary_.
I'm currently wading though documentation on Go modules and Go standard library packages, as well as reading other code examples to see how I want to structure my application.
First, I found a [repo that](https://github.com/wick3dr0se/github-api-curl/tree/master) uses shell scripts to wrap around the GitHub API. This gave me the idea for splitting up my tool into different directories.
Then, I fiddled around with [Google's GitHub Go library](https://github.com/google/go-github/tree/master) to see how they used Go to build the library.
## Fits and Starts
My first inkling was to crib this code from the Google repo:
```go
var defaultBaseURL = "https://github.com/"
// Client is a GitHub scraping client.
type Client struct {
*http.Client
// base URL for github.com pages. Exposed primarily for testing. Also
// used for saving and restoring cookies on the Client.
baseURL *url.URL
}
```
I wasn't exactly sure what I was looking at; I have a `baseURL` variable that is assigned the GitHub url. I've imported the `net/http` package, as it would have been in this example. We have a `Client` type that is also a `struct` which I have forgetten what they are exactly, as it has been a while since I've read the C++ docs, which also has a `struct` but I think that `struct` in this instance has the `type` keyword to denote that it is a `class` or something.
In any case, I was trying to figure out how to use string interpolation in the URL parameters like you would in JavaScript template strings:
```js
// Octokit.js
// https://github.com/octokit/core.js#readme
const octokit = new Octokit({
auth: "YOUR-TOKEN",
});
// the request method contains template strings which is
// JavaScript's way of doing string interpolation
await octokit.request("GET /repos/{owner}/{repo}", {
owner: "OWNER",
repo: "REPO",
headers: {
"X-GitHub-Api-Version": "2022-11-28",
},
});
```
How does that work in Go?
At first I was thinking of using `Stripln()` to do string interpolation but as a [StackOverflow user said](https://stackoverflow.com/a/71181938/3800146), to put that junk in a query parameter would be messy and unsafe. The user suggested the op use the `net/http` library which solves all the issues I'd face trying to make `GET` requests to GitHub's REST API.
The example given:
```go
params := url.Values{
"page[size]": []string{"100"},
"page[" + key + "]": []string{"1"},
}
u := &url.URL{
Scheme: "https",
Host: "url.com",
Path: "/path",
RawQuery: params.Encode(),
}
req, err := http.NewRequest("GET", u.String(), nil)
```
This should do it for now.

15
src/content/blog/hello.md Normal file
View file

@ -0,0 +1,15 @@
---
pubDatetime: 2024-03-17
title: "Hello, y'all"
description: Introductions.
---
This is a learning and accountability blog.
This is my first post. It will be updated as time permits.
One of the things frustrating me lately is when I was just starting out, I blogged about literally everything; the industry was new to me and everyone was excited, I was excited at the possibility of pulling myself out of extreme poverty. I was younger, bright-eyed, without any cynicism.
Fast forward 10 years and a lot has changed. I won't get into the gory details but y'all know. Tech is not what it used to be, I've grown to despise most JavaScript anything, and I'm an industry vet who is disillusioned by the state of the industry and the world in general. That kind of pessimism weighs on me daily, so much so I don't write about anything I learn. It sucks.
So this is my blog post I'm sending you, I hope you read it. (Bonus points is you get that reference).

View file

@ -0,0 +1,26 @@
---
pubDatetime: 2024-04-23
title: This Week's Update
description: Brief note.
featured: true
---
Things I have been up to while off LinkedIn:
- Working on my [home lab](http://homelab.tifflabs.org) by setting up k3s for High Availabilty servers for critical services in the lab
- Learning more about VMs, [Nginx](https://notes.0x8c.org/home-lab/nginx-configs/), and Reverse Proxies
- Learning about [Certbot](https://certbot.eff.org/)
- Failing to set up [TWO "beginner-friendly"](https://github.com/tobychui/zoraxy) [reverse proxy managers](https://nginxproxymanager.com/) and realizing that [learning how to use the CLI more](https://lemmy.brendan.ie/comment/223126) is the best course of action
- Learning how to [reconfigure Proxmox IP addresses](https://gist.github.com/twhite96/2ed4c6f3d50ed0009947c69e7bded6ca), failing to keep the cluster, and wiping three nodes clean
- Deciding that I'd keep one node out of the cluster for having one less entrypoint to my network[^1]
- Setting up InfluxDB for use of monitoring my Proxmox cluster and separate node in Grafana
- Learning Linux commands such as `fstab`, `lsblk`, and that you can pretty much do everything you need system wide (rebooting, etc), by prefixing `systemctl` to those commands
- Creating my own Docker image and container to fix a bug in a repo I want to use but want it to install dependencies and "just work", as they say
- Installing a self-hosted Git client/website
- Learning that `ini` files are basically the same as `toml` files
- Researching how to use WebSockets in Python or Go to understand how someone could use that to exploit a website/machine by keeping the socket alive and using the website/machine as a C2 server
- Working on creating my own C2 server
I've been at it nonstop these past two weeks, but I am having serious fun.
[^1]: I have too many VMs and LXCs now or I'd change the IP to help with this as well.