+ Required meta data for active posts

* Moving drafted never posted stuff to an unused folder
This commit is contained in:
shockrah
2021-08-14 18:05:10 -07:00
parent ef568b9eb1
commit 9e40ea463c
27 changed files with 119 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
---
title: "Carry On PC - How I crammed a full ATX board into a mATX Case"
date: January 10, 2018
date: 2018-01-10
draft: false
---

View File

@@ -1,6 +1,6 @@
---
title: "Bash is weird sometimes"
date: July 22, 2018
date: 2018-07-22
draft: false
---

View File

@@ -1,109 +0,0 @@
---
title: "How this site came to be"
date: July 22, 2018
draft: false
---
# How this site came to be
## Tech
The """"tech-stack"""" for this site is [pandoc](https://pandoc.org/) and a single shell script.
Ok, technically there's also the issue about python but really you don't need to use it since the site pages build anyways.
Yea so here's the shell(bash) script.
I'm going to remove any bashisms soon enough but am very lazy so this is the best I got for ya.
```
#!/bin/bash
rootDir='./site/'
targetDir='post/'
post() {
echo Building: $1
tmp=".swap"
full=".fullswap"
base=`basename $1`
# First build the content of the site
pandoc $1 > $tmp
# Title, images and tables get added/fixed here
sed "s/{TITLE}/<title>${base%.*}<\/title>/g" ./templates/post-header.html > $full
cat $tmp ./templates/post-footer.html >> $full
sed -i 's/<img/<img class="pure-img"/g;s/<table>/<table class="pure-table">/g' $full
# Move things to proper directory and cleanup
mv $full "$rootDir/$targetDir/${base%.*}.html"
rm -f $tmp
}
build_all() {
mkdir -p $rootDir/post/ $rootDir/fonts/ $rootDir/media/img/
cp style.css "$rootDir"
cp prebuild/post/style.css "$rootDir/post/"
cp fonts/* $rootDir/fonts/
cp img/ $rootDir/media/img/ -r
mv $rootDir/media/img/favicon.png $rootDir/
# Try to get xargs to deal with this ugliness
for r in prebuild/*md;do
post $r
done
for p in prebuild/post/*md;do
post $p
done
}
_help() {
echo 'Options:
-h show this prompt
-p [postDirectory/*] (takes a list of paths to build from)
-r build root pages
-s copy stylesheets
-l run live server'
}
server() {
cd $rootDir
echo 'Address: 0.0.0.0:8080'
python -m SimpleHTTPServer 8080
}
if [ -z $1 ]
then
_help
exit 0
fi
while getopts ":aslrhp:" opt;do
case "$opt" in
a)
build_all;;
s)
cp style.css "$rootDir"
cp prebuild/post/style.css "$rootDir/$targetDir"
exit 0
;;
r)
# Fix targetDir so that it points to the root of the site output
targetDir=''
post './prebuild/about.md'
post './prebuild/links.md'
post './prebuild/index.md'
exit 0
;;
p)
for file in ${@:2};do
post $file
done
;;
h)
_help;;
l)
server;;
esac
done
```
## Story

View File

@@ -1,24 +0,0 @@
---
title: "Delivering whole OS's in Gitlab's CI/CD"
date: "Unknown"
draft: true
---
# Delivering whole OS's in Gitlab's CI/CD
## Way easier than you may think
Lately I've been trying to learn about deploying things in remote pipelines continuously so I've taken to using Gitlab's own provided CI pipelines to... well _do stuff_.
After some bumps in the road I've learned a few things:
## Setting up docker images isn't that hard
Maybe it's because I'm not doing _complex things_ or maybe because I've dealt with some awful problems on Debian before but setting up Debian images really aren't hard to setup.
The best part is that unlike real full installations they're super easy to just nuke and start fresh over again(assuming you get to that point).
Usually however I just tweak the Docker script, re-run and done.
> Where's the image bro
Here you go: [dank docker image](https://hub.docker.com/repository/docker/shockrah/osdev-build)
To save you a click, its a docker image which I use to provide ISO's of my [handwritten operating system](https://gitlab.com/shockrah/jankos).
It's nice because now I can easily provide bootable files for people to test the code I've written without having to compile any code!

View File

@@ -1,6 +1,6 @@
---
title: "Using Gitlab CI For VPS and Neocites Deployment"
date: "February 08, 2021"
date: 2021-02-08
draft: false
---

View File

@@ -1,42 +0,0 @@
# Drive Recovery
I've gone through too many hard drives and solid state drives to count and they've piled up over the years. So let's find out which ones are actually dead, and which ones I can recover.
For each of these tests I use a combination of the following tools to diagnose what's wrong with the drives.
Not the data or the file systems but the physical drives because if the hardware is good then I should be able to install whatever file system I want and move on.
_Everything here is done on Debian as the tooling is super easy to get a hold of_.
```
badblocks
Check for bad blocks on the drives
smartctl
Grab SMART data off the drives
mount
If a filesystem is found I can pull stuff off the drive once mounted
Most drives don't have anything though
```
## Kingston SSD
First mounting drive to see what its about `mount` tells me the filesystem is unclean
It still mounted but all I found was this:
![](/media/img/drives/dir.png)
It should be noted that this drive has gone through multiple partition schemes.
Its also gone from [Windows] to [Grub, Windows, Linux] back to [Windows, Linux] and then back again at some point.
With `sudo badblocks -v /dev/sdc1 > bads.txt` no errors were found so I moved on from there.
Finally I used `smartctl` which can be found in the Debian buster repositories in the `smartmontools` package.
Luckily my drive was found in the tool's database so it was able to read back useful data from the drive.
One `smartctl -A /dev/sdc` later and I found out that the drive was basically functioning normally, nothing was out of the ordinary.
If you have a Kingston SSD and don't know what the data means then [look at this](https://media.kingston.com/support/downloads/MKP_306_SMART_attribute.pdf).
At this point I just reformatted the drive and moved on to the next drive: a Western Digital Blue 1TB Drive.
## Western Digital Blue 1TB
This drive is somewhat new as my old WD Blue was giving me issues when booting into Windows, and for some reason contained another old Grub installation

View File

@@ -1,6 +1,6 @@
---
title: "DWM > i3"
date: August 18, 2019
date: 2019-08-18
draft: false
---

View File

@@ -1,30 +0,0 @@
# Economical Eats
## A dense packing of information those in recently found hard times
It's official: your _broke and need help, but food is expensive and you're starving, what do you do?_ Let me show you.
## Precursor
* These tips are general purpose and can be changed to fit your needs
* The target audience is anyone who hasn't been _broke_
* These tips are to arm you with the knowledge to survive in modern circumstances
## Good Wholesome Tips
## Ugly Tips
## Blackpill
> These are absolute last resort and if you find yourself here either you fucked up or still have a chance to fix something else
> Nearly all of the following tips are demonstrably awful for you in some way
## More resources
Here's a bunch of links
## Afterthoughts
todo

View File

@@ -1,3 +1,9 @@
---
title: "Making Ice Cream at Home"
date: 2020-07-24
draft: false
---
# Making Ice Cream at Home
**NOTE**: While I don't use an ice cream maker, I do suggest a hand mixer but this can be done with as little as a fork/spoon to mix things(doing that sucks though).

View File

@@ -1,3 +1,9 @@
---
title: "Lewdlad: The Little Chronjob that could"
date: 2021-07-25
draft: false
---
# Lewdlad: the little Chronjob that could
## What is "Lewdlad"

View File

@@ -1,41 +0,0 @@
# title
So for the past week or so I've been deliberating progress over an e-sports related project of mine: [scuffed-league](https://gitlab.com/shockrah/scuffed-league).
The whole idea here is that I like tournaments I still believe that proper long-running leagues are the preferable choice for keeping spectators and competitors around for long periods of time.
## The plan for building
Let's go through the process of building from start to current.
1. I wanted to replicate the experience of using sites like cevo or esea from my own competitive history but, _those have had years to build and mature_.
Something which to be honest never really struck until I had built a few bare pages. I say bare because quite frankly, every page I made had nearly no content to show for. It was also unlikely that I was going to be able to fill them with content for a long time.
Issue: cevo/esea/faceit all support multiple leagues, with multiple divisions in multiple games with multiple tournaments and prizes, news, drama, editors, etc.
There was no way I could fill all these things like a full team of content creators could.
Solution: Start with one game, _Diabotical_ with one league with one division, and a second game mode.
This meant that I could make a ~~meme~~one-page webapp thing.
As the name implies its literally one page which makes it really easy to fill the page with content.
At my scale the amount of content I have to serve up is so small that things shouldn't feel cluttered but will still feel like there's a lot going on.
2. I have some data to store and some of it is really strange do I go with SQL, Redis, Firebase, what?
Some data fits really easily into a table: like user data. Every user can be part of 1 team-league 1 duel-league and then has some basic info about them username/password.
Jam that into a table and its easy to query, update, and remove users.
Even the team data isn't too bad: `captain|member2|member3|teamname|?`. The only issue is the match data.
The problem is how we store match history.
3. I have to store match history for each team and it has to relate to other teams as entries could be related to one another.
If that prompt makes it seem like each team requires a structure to hold previous matches then you would be right.
If I had gone with this question to answer it I would have ended up with a really weird system where I would have to cross reference things in multiple databases and then worry about huge latency.
Reframing the question to "_What data does 1 match really have_".
To actually get to this point however I had to go through a few iterations of holding match data.
![Scratch work showing my progress](/media/images/scuffed_matches_progress.png)

View File

@@ -1,3 +1,8 @@
---
title: "High Spec Logging on Low Spec Hardware"
date: 2021-03-15
draft: false
---
# High Spec Logging on Low Spec Hardware
Being a server admin with a ramen noodle budget my servers aren't super fancy

View File

@@ -1,3 +1,8 @@
---
title: Mapping in Reflex
date: 2018-06-18
draft: false
---
# Mapping Again
[Link to the map I discuss here](https://steamcommunity.com/sharedfiles/filedetails/?id=1329660201)

View File

@@ -1,3 +1,9 @@
---
title: "Markdown Transpiler Thingy"
date: 2020-07-21
draft: false
---
# Markdown to HTML
A while back I made [gensite](https://gitlab.com/shockrah/site-generator) a static site generator that was built with pandoc users in mind.

View File

@@ -1,3 +1,8 @@
---
title: "Setting up OBS - for people with better stuff to do"
date: 2021-03-19
draft: false
---
# Setting up OBS - for people with better stuff to do
This is going to be a very casual post so don't expect huge a

View File

@@ -1,8 +1,14 @@
---
title: "This time for real"
date: 2018-06-18
draft: false
---
# All done setting up
Finally after some struggling with various git clients and learning to use some new tools the source code for this website is finally up and hosted on Gitlab.
> [Link to website source code](https://gitlab.com/AlejandroS/shockrah-city)\
> [Link to website source code](https://gitlab.com/shockrah/shockrah-city)\
> *tbf i stiill need to work on the bash script to auto build stuff*
## Now what?

View File

@@ -1,3 +1,8 @@
---
title: "Website Contruction Philosophy"
date: 2018-06-01
draft: false
---
# No Non-free JS here
To explain succintly, I don't like Javascript, especially considering how much power it has on a user's browser.

View File

@@ -1,60 +0,0 @@
# DWM and POP!\_OS
## tl;dr
Make a `/usr/share/xsessions/dwm.desktop` file with contents listed below and a /comfy/ script.
## Doing the thing tho
1. We need a `/usr/share/xsession/dwm.desktop` file. Mine looks like this:
```
[Desktop Entry]
Name=DWM
Comment=This session logs in to DWM
Exec=/home/shockrah/Rice/dwm-launcher.sh
Type=Application
```
Nothing to crazy its basically a `toml` config with an executable as the entry point of the DE.
For reference here's the official Pop OS config:
```
[Desktop Entry]
Name=Pop
Comment=This session logs you into Pop
Exec=env GNOME_SHELL_SESSION_MODE=pop /usr/bin/gnome-session --systemd --session=pop
TryExec=/usr/bin/gnome-shell
Type=Application
DesktopNames=pop:GNOME
X-GDM-SessionRegisters=true
X-Ubuntu-Gettext-Domain=gnome-session-3.0
```
This time there's more fluff but you can ignore it for the most part(I think).
2. Now let's look at that script I have have [/home/shockrah/Rice/dwm-launcher.sh]:
```sh
#!/bin/sh
# This script is used to mimic an xinitrc to some degree
set -x
eval `ssh-agent`
compton --backend glx --xrender-sync --xrender-sync-fence -b
bright 50 DWM# custom brightness script
feh --randomize --bg-fill ~/Pictures/Papes/* &
statline &
exec dwm
```
Nothing crazy right? Yeap that's it really to setup DWM with any changes you might have easily with Pop OS.
In case you're wondering here's what my setup currently looks like:
![Background Images I found on /wg/](/media/img/desktop/dwm-pop.png)

View File

@@ -1,3 +1,9 @@
---
title: First Foray into Big Projects
date: 2018-06-25
draft: false
---
# Quake Champions Academy Back from the Dead
Finally after nearly a year I've started working on my Quake Chamions Academy project again but this time I have some specific goals in mind besides just, run lots of community events.

View File

@@ -1,102 +0,0 @@
# Building overhaul
Apart from the switch to a more _night friendly_ site style-sheet I've also now switch to a new build system for my not-a-blog.
Full script at the bottom. [Repo link](https://gitlab.com/shockrah/site-generator).
The nice thing about this new script? Way more features, more _unixy_ so it ends up being really straight forward to use, oh and it has a nice name now **gensite**. The only major dependency it has is `pandoc` but I'm slowly going to phase that out for another script which accomplishes the same thing so far; it just can't do tables yet.
Anyway I've been messing about with more shell scripting things as I've been _ded_ for nearly 3 weeks on account of a really epic eye infection which has left me needing glasses.
```
#!/bin/bash
# Uses pandoc to turn markdown into html for my personal blog
mirror=.mirror/
assert_arg() {
[ -z $1 ] && echo No argument provided && exit 1
}
mirror_scaffold() {
# Setup mirror directory so that we can later truck through building new posts and pages
mkdir -p $mirror/
cp -r media/ $mirror/media/
cp partials/style.css $mirror/
}
fix_tables_imgs_pure() {
sed -i "s/{TITLE}/<title>$(basename --suffix=.html 1)<\/title>/g" "$1"
sed -i 's/<img/<img class="pure-img"/g' "$1"
sed -i 's/<table>/<table class="pure-table">/g' "$1"
}
create_post() {
fname=$(basename --suffix=.md $1).html
mkdir -p $mirror/post/
pandoc $1 | cat partials/header.html - partials/footer.html \
> $mirror/post/$fname
fix_tables_imgs_pure $mirror/post/$fname
}
build_root_page() {
fname=$(basename --suffix=.md $1).html
mkdir -p $mirror/
if [ ${1: -5} = ".html" ];then
cat partials/header.html $1 partials/footer.html > $mirror/$fname
else
pandoc $1 | cat partials/header.html - partials/footer.html \
> $mirror/$fname
fi
fix_tables_imgs_pure $mirror/$fname
}
refresh_root_src() {
cp root/* $mirror
}
copy_media() {
mkdir -p $mirror/media/
cp root/style.css $mirror/
cp -r media/ $mirror/
}
new_project() {
mkdir -p "$1"
cd "$1"
mkdir -p media/fonts/ media/img/
mkdir partials/ posts/ pages/ root/
touch partials/header.html partials/footer.html
echo Project \""$1"\" created.
}
_help_prompt() {
cat <<EOF
Options:
new project_path: Create a new project folder
P|page file.path: Build the root level page
p|post file.path: Build that one post into the site mirror folder's posts directory
r|root file.path: Build that root page, these live like /index.html /about.html etc.
R|roots: Copy over the new/updated root resources
m|media: Copy over the media folder contents
s|scaffold: Build mirror directory
server: Run python live server
EOF
}
[ -z $1 ] && _help_prompt && exit 0
opt=`echo $1 | tr -d '-'`
case $opt in
new) assert_arg $2;new_project $2;;
P|page) assert_arg $2; build_root_page $2;;
p|post) assert_arg $2;create_post $2;;
r|root) assert_arg $2;build_root_page $2;;
R|roots) refresh_root_src;;
m|media) copy_media;;
s|scaffold) mirror_scaffold;;
server) cd $mirror && python -m SimpleHTTPServer 8080;;
*) _help_prompt;;
esac
```

View File

@@ -1,3 +1,9 @@
---
title: "Qutebrowser is /comfy/"
date: 2018-07-18
draft: false
---
# A Taste of QuteBrowser
I finally sat down and started fully using [Qutebrowser](https://www.qutebrowser.org/) and to be honest, it's great.

View File

@@ -1,3 +1,9 @@
---
title: "Rewrites and this site"
date: 2019-05-02
draft: false
---
# Rewrites
## For the sake of rewriting things

View File

@@ -1,3 +1,9 @@
---
title: "A Quick Bhop Route Showcase"
date: 2019-10-01
draft: false
---
# Neat Route
_Short post that I've been wanting to make about a run I'm working on_

View File

@@ -1,3 +1,8 @@
---
title: Segmented Routes
date: 2019-10-02
draft: false
---
# Segmenting & Optimizing Realistic Routes
Finally after a few weeks of practicing I took some time to segment the route that I've been working on for _bhop_bochadick_.

View File

@@ -1,3 +1,8 @@
---
title: Wot in tarnation happened to the style
date: 2018-09-21
draft: false
---
# Wew lad new colors
It's been about a minute since I've done anything with this site but I figured what better time to randomly post things then now.

View File

@@ -1,22 +0,0 @@
# Syncthing and Remote File Management
> What is [syncthing](https://syncthing.net/)?
It's a free and open source project that basically keeps your files synchronized across multiple devices.
It woks like so(in my setup):
```
Listen Server => Gets folders and things shared with it
PC => usually uploads stuff to the listen server
Phone => usually just pulls down updates from the listen server
```
I personally use Syncthing to keep my ever growing music library and Book/Papers collection up to date on my phone and PC.
> Can you cut out the middle man by removing that server?
Yes but I'm lazy and this give me the option of running syncthing on my laptop and pull down changes from anywhere without much hassle.
> Where do yo host this listen server?
For hosting I use [IONOS](https://www.ionos.com/) since VPS's only cost 2 USD a month. Currently it's running Debian 10 Buster.

View File

@@ -1,24 +0,0 @@
# Trains are Weird
## y does cali succ at train
I've come to the conclusion that California has no idea how to do public transportation.
Trains for instance get some of the __F A T T E S T__ delays imaginable.
Not unlike any other system of transportation like planes or buses, but with trains there's the added bonus that it can stop, and do nothing, mid travel.
Most countries seemed to have figured out that putting trains on street level means car traffic slows down, and trains have to slow down too.
Here in Cali though, we don't use train tunnels in cities.
_Before you say something about earthquakes, that's not actually the reason why_.
The actual reason, we just suck at public transport.
The absolute state of the freeways here is also pretty hilarious; instead of building better freeway routes we just add more lanes which compounds traffic problems.
## still neat tho
Not even gonna lie, it's kinda fun being on the train; _when you're actually moving_.
Mostly because people that go on trains lose their minds about being locked in a rolly tin can in the woods really quick.
That means after about an hour and in people start wandering around and dropping the maddest _truth bombs_ and _conspiracy theories_ I've ever seen.
Sick shit to witness and journal about but after delays, __literally every trip__ I've decided that I'm just going to spend a tiny bit more and take the plane to get around Cali.
_Shoutout to the guy that crashed into the train ahead of me in the middle of rush hour traffic.
That s1ck 2 hour delay was litty._