PiSquared Blog | Index | Tags | About me

PiSquared Blog

Blog about geeky stuff, computers, physics and life.


Tag hacks

Auto adapting signal to day-night scheme

Tags: English, hacks
Created on Mon, 02 Apr 2018

So I wanted to automatically change the day/night theme of my brand new Signal desktop app. The way that it is manually done is through the File -> Preferences... menu. Now that's not convinient for programatic person like me. Let's investigate!

.config folder

My first stab is looking into the mostly standard ~/.config folder in Linux for Signal if one actually exists. It turns out it does. Let's see. It even has a ~/.config/Signal/config.json file. Unfortunately, that file doesn't contain the settings for the theme, just window positions.

grep -ring in the folder for any of android or theme just returns the logfile that Signal is writing to.

... ./logs/log.log.1:{..."theme-setting changed to android-dark",...} ...

No luck.

Another stab is at /opt/Signal directory. Again - no luck. And the app is a binary ELF executable $ file signal-desktop signal-desktop: ELF 64-bit LSB executable,...

strace-ing

My next attempt

...more

This blog is now written in Markdown and synced with OwnCloud

Tags: English, technology, hacks
Created on Sat, 30 Jun 2018

This has been an idea that has been brewing in my mind for a while - create a simple blog that I can write from anywhere, using standard Markdown syntax. Here's the repo of the project.

The blog itself is a Flask webapp with sqlite database that has a BlogPost table. The trick is that the table is acutally synced with flat files in a folder. Each file is a blog post entry. The folder itself is synced by owncloud client which is running as a daemon (currently behind a tmux but will do it as a systemd service soon).

The key of the syncer is in the flatfile_syncer.py file. The sync is currently one-directional - when a file is created/updated/deleted, a blog post is created/updated/deleted. As an admin, you can CUD blog posts from the web interface but these are currently not synced to the file system.

So whenever I start writing a (non-hidden) file in that fol

...more

Build a memory graph in linux terminal

Tags: English, technology, hacks
Created on Wed, 11 Jul 2018

I was searching for a terminal based graph of usage of memory but I couldn't find one, so I built it using simple bash and python.

First create a directory called mem and enter it with cd mem

Then run the daemon part of the monitor:

while true; do free -m | head -2 | tail -1 | awk '{print $3}' > `date +'%Y-%m-%dT%H:%M:%S%z'`; sleep 1; done

To actually build the graph, use this:

watch -n1 'for f in `ls -r | head -30`; do num=`cat $f`; python -c "print(\"{} {}\".format(\"$f: $num\", \".\" * ($num/10)))"; done'

And the result is something like this:

``` 2018-07-11T11:26:36+0000: 330 ................................. 2018-07-11T11:26:35+0000: 316 ............................... 2018-07-11T11:26:34+0000: 285 ............................ 2018-07-11T11:26:33+0000: 236 ....................... 2018-07-11T11:26:32+0000: 235 ....................... 2018-07-11T11:26:31+0000: 236 ....................... 2018-07-11T11:26:30+0000: 236 ..............

...more

Here's how I got my music from Google Music (as of March 2018)

Tags: English, technology, hacks
Created on Sat, 31 Mar 2018

At some point I uploaded all my music on Google Music - they provided 20,000 songs upload for free. Then of course, they started pushing their paid service - fair enought. I tried the trial several times, I paid subscriptions several times over the years, but I never enjoyed the suggestions it was giving me and somehow the music I wanted, wasn't there. So eventually I always just went to YouTube to listen to music.

But now that I am trying to detach a little bit from the cloud and get my data back I wanted to try to download my music from Google Music.

Google Checkout

My first attempt was the assumption that I can get my music as a part of the standard Google Get Back My Data or whatever. It was fairly easy to get there - MyAccount from my profile image, then Takeout then click

...more

Getting back control of my digital life one bit at a time

Tags: English, technology, hacks, personal
Created on Thu, 29 Mar 2018

I have permanently deleted my Facebook account this week after the latest "scandals" around the "social" network. Of course I knew on some level what is happening with my data but I think it finally hit home. I've always hated Facebook, ever since I first made my account (post about it in Bulgarian) - and that hasn't changed for the 8 years that I used the service, it only got worse I think. It was not so much about the data that I have shared, it has been more about the mindset that it installed in me and in people around me. Being zombies, constantly scrolling useless content by people you barely know or not even know with pages you liked at some point, with no easy way to get out of it, a network hitting all weak spots in human psychology. So the latest revelations of which we were all well aware (in the hacker/techie community at least) got to me and crossed a threshold

...more

Online security

Tags: English, technology, hacks
Created on Wed, 20 Oct 2021

Last week I wrote about a hypothetical Facebook messenger and Whatsapp breach which would give the world access to everyone's chats - including yours, your friends', your parents, everyone you know or don't - indexable, searchable by everyone. A truly privacy is over type of situation. I argued that this is what people really cared about - a personal hit, not bombs and terrorists or some unknown John in a three-letter agency reading your chats. Someone you know - or everyone you know - reading your personal communications with other people.

Scale it down

Alright, maybe leaking all of Facebook's chat would require literal trucks and months of unmonitored leakage due to the sheer amount of data. Text is not so big - the whole of English Wikipedia is merely [20 GB](https://en.wikipedia.org/wiki/Wikipedia:Size_of_Wikip

...more