This page requires CSS support to be viewed properly.

My great blog

Warning: my filter is non-existent, you may get offended.

For an indexed view, check this page

This also works on RSS

The Christmas season

[linkstandalone]

It's here... The fucking holidays are in one week and everyone got their hats on. All cities in my country have set up their gigantic Christmas trees and all the songs are getting blasted.

I understand it now (which is why I'm joining this garbage tradition, but I never understood joining it a month prior, like in the end of November. But whatever, I don't care.

I positioned myself away from development for the past few weeks and especially from working on this website, I feel like this site's really reached its peak and I can't really change much significant before fucking it up.

Which is kinda sad for me as the changes for the site for such an important (at least for me) season are minimal.

Boomer joke explained
Sun, 16 Dec 2018 04:51:35 +0200

Cool tools, pt. 4 - Removing gapps

[linkstandalone]

Sometimes a man just needs to install Google apps and to remove them afterwards. For example maybe to download something from the play store or to try something out.

After you did your... whatever, you may be staggered to learn that there is no official way to uninstall gapps.

The recommended way is to wipe and reinstall everything, well, not all of us have the time to do that. So, a solution - forcefully uninstall gapps.

Things needed for this -

CWM is dead anyway, there is no real reason to use it.

Step 1

Wipe /system, just go to Wipe -> Advanced wipe -> [x] System -> Wipe

Step 2

Open up the terminal, go to Advanced -> Terminal, and type these

# cd /data
# find ./ | grep google | xargs rm -rf

(keep in mind # means that it's ran as root, not a comment.)

Step 3

Flash your ROM, just make sure that it's the same - dirty flashing different ROMs ends badly most of the time.

Step 4

Clear cache/dalvik and reboot!


There, gapps is now gone. It's a hack, but it works. And it works better than reflashing as this actually deletes gapps, while reinstalling a ROM would just not recognize the already existing gapps.

Not really a tool, but I wish I had known this before I needlessly wiped a few installs.

Sat, 27 Oct 2018 03:11:34 +0300

Updates - GitLab, f00f.xyz and a PSP

[linkstandalone]

Over the few days I have made a few changes to the site, I'll break them all down briefly.

Changed the domain

Now the primary domain is f00f.xyz, x-t.github.io now just redirects to this domain.

GitLab

I now host a mirror of this site on GitLab.

I also set up GitLab pages on f00f.gitlab.io

It relaxes its HTTPS a bit, which makes it possible to view on troublesome devices, such as this PSP

This site on a PSP

This site on a PSP

Sun, 07 Oct 2018 03:55:45 +0300

Cool tools, pt. 3

[linkstandalone]

This has definitely been done before (won't check), but I decided to hack another one.

Wanna show what song you're listening to in cmus as a status for pidgin/purple and conky? Well, if you are one of the three people, this thing is for you.

First, the script that shows the current track in a %SONG% - %ARTIST% format. (Referred to as CmusCurrent)

#!/bin/bash
cmus-remote -Q | awk '/tag title / { $1=""; $2=""; print } /tag artist / { $1=""; $2=""; print }' | tac | sed ':a;N;$!ba;s/\n/ /g; s/^\ \ //; s/\ \ \ /\ -\ /'

Next, the script that sets the status/outputs the song (Referred to as PurpleCmus)

#!/bin/bash
if [[ `cmus-remote -Q | grep status` == "status playing" ]]; then 
purple-remote "setstatus?status=available&message=`CmusCurrent`"
CmusCurrent
fi

And lastly, the line in your conky.conf

${execi 2 /%PATH_TO%/PurpleCmus}

That's about it. Now you can shove in your music taste to anyone that has you added as a buddy on pidgin.

Fri, 21 Sep 2018 22:20:09 +0300

Updated license, source code

[linkstandalone]

Just because it was now convenient to do so, and my source code got a lot cleaner, I made my site's source code public.

It's hosted on GitHub, check it out here.

I also switched to the GPLv3, replacing the previous BSD-2-Clause license.

Although you probably shouldn't contribute, you can look at the source code.

And maybe repurpose the build system if you want, I don't know. It's just open, that's all.

Tue, 18 Sep 2018 20:05:14 +0300

Cool tools, pt. 2

[linkstandalone]

This one is useful when you want to copy some source code to an HTML page (like these series) and you want to do it from a shell.

#!/bin/bash
cat $1 | sed 's/\&/\&amp\;/g; s/</\&lt\;/g; s/>/\&gt\;/g; s/\\/\&bsol\;/g'

Fri, 14 Sep 2018 21:25:49 +0300

New website, why and how

[linkstandalone]

Replacing the entire infrastructure of a website isn't an usual thing to do.

I thought that I'd make a blog post explaining why this new website was made and how it works.

Maybe anyone reading this could get some inspiration to do something similar? Don't know, either way this post is really just to test the blogging capabilities of this new infrastructure.

Better than a "this is a test" post, so let's start.

Why?

Money.

Seriously, that's it. Hosting shit is not free and I don't have any money to spend on this project. So I had to come up with a solution that would replace my current infrastructure with something free.

My first idea was neocities, but I also knew that GitHub pages existed, so I went for the latter because neocities' editor is complete garbage.

However, a problem, my entire infrastructure is written with PHP. And these services only allow static website hosting. I needed to be little clever about it.

So, let's move on to the

How?

The ways that my website depended on PHP were these:

  1. Using
    <php? include(); ?>
    statements
  2. My analytics system was written entirely with PHP

For analytics, I could just remove them. Sad, but what can you do.

For the former, I decided to not just scrap the idea of handy one-line include statements and make my own system for using them.

It's written in awk and it's some high level web engineering shit.

For an example, take this template page

<!DOCTYPE html>
<html>
<head>
    <title>template</title>
    <!-- HEAD -->
</head>
<body>
    <!-- NOSCRIPT -->
    <!-- CONTACT -->
    <!-- NAVBAR -->

    <div class="c">
        Content
    </div>
    <!-- COPYRIGHT -->
</body>
</html>

This is a similar system that lb, the blog system I use here, uses. Instead of appending text, this solution just replaces the template parts with text.

To make a page that works though, you need to compile it. I use an awk script that looks like this:

function ReadFile(file)
{
    x = ""
    while ((getline y < file) > 0) {
        x = x FS y FS "\n"
    }
    return x
}

BEGIN {
    r_head = ReadFile("../resources/stdhead.html")
}

{
gsub(/<!-- HEAD -->/, r_head)
print
}

You run it from the shell with

awk -f script.awk file_to_compile.html > compiled_file.html

This will replace the HEAD token with whatever is in resources/stdhead.html. Making it work exactly the same as

<?php include("../resources/stdhead.html"); ?>

It works, I get to run away from the burning dumpster that PHP is and the hosting is free. Pretty neat.

Fri, 14 Sep 2018 20:39:51 +0300

Cool tools, pt. 1

[linkstandalone]

Sometimes I just make tools to make my doodly-doos around the computer a little easier.

Since I think these are too small to have their own git repository or something, I thought I'd share these in my blog.

However many I'll write/release, they'll be "licensed" under CC0. Practically public domain, and if your state/country doesn't have public domain - it'll still act like it.

The first in the series is a small thing I made to learn awk. It counts your music by formats.

FLAC sound molesters can flex their RAID arrays with this.

Here's the source code:

#!/bin/bash

find ./ | awk '

BEGIN {
    AllMusic=0
    Flacs=0
    MPThrees=0
    MFourAs=0
    WAVs=0
}

/flac$/ {
    AllMusic++
    Flacs++
}

/mp3$/ {
    AllMusic++
    MPThrees++
}

/m4a$/ {
    AllMusic++
    MFourAs++
}

/wav$/ {
    AllMusic++
    WAVs++
}

END {
    print "Total music:", AllMusic
    print "FLACs:", Flacs
    print "MP3s:", MPThrees
    print "M4As:", MFourAs
    print "WAVs:", WAVs
}
'

Of course there are some issues with this, like not supporting every music format in existance. But you can easily edit it, if you would like to do that.

If you're wondering what my music collection looks like, well...

~/Music> CountMusic
Total music: 560
FLACs: 367
MP3s: 138
M4As: 54
WAVs: 1
~/Music> 

I'll leave it there.

Mon, 27 Aug 2018 23:56:41 +0300

So I have a blog now

[linkstandalone]

Yeah, I set up a blog.

No particular reason, I just thought that I'd have one.

This runs on lb, a tool made by all-mighty Luke Smith. Tumblr can lick my left nut.

I'm not a blog guy by any means, so expect absolutely no new blog posts.

Maybe they will be memes at best, either way, it's fun setting up shit like this, which is why I do it, even though I may end up never using it.

Mon, 27 Aug 2018 23:20:15 +0300