Blog posts

rss Back

My adventures with PHP

Posted on: Tue, 01 Sep 2020 14:06:10 -0000

You may have noticed that on my website I added 2 new things: a paste service and file hosting. Those two were made in PHP. But slendi, you may ask, how did you even manage to use the hellish language that is PHP? Well, it is not as complicated as people say. To be honest, is even better than ejs! Give it a try, you won't die as some say...

I first learnt PHP from a website a few years ago just to forget everything. Now I watched a whole 1 hour video explaining the basics of it.

Sure, I might have had some issues with it the first time setting it up but everything from there is really easy to do i.e program in it.

Every blog post of mine finishes with a conclusion so, I think you should learn PHP if you are interested in making basic applications and for making websites.

The awesome new mail client, aerc

Posted on: Mon, 24 Aug 2020 19:24:13 -0000

A few days ago I was looking for a new mail client, and aerc popped up.

Aerc is a free, open-source mail client that lets you do multiple things: Apply diffs from mails, run a terminal, use vim keybindings and more.

From the time of writing this, it has been in the works for 3 years and the results show. I encourage you try it, I personally fell in love with it and I think so will you. But with that said, there are still a few problems with it. One of those is that you cannot use J and K to switch folders while it's still loading the folder and you cannot use stuff like the command mode while editing or viewing a mail. Besides those 2 problems, I think it's pretty solid.

It comes with man pages if you need any help, is very configurable. If you wanna try it out, it's available here. I highly suggest you try and contrbute code if you have the time and share it with others!

Image previews in ranger using ueberzug

Posted on: Sun, 26 Jul 2020 16:04:20 -0000

We all like our image previews in our file managers since we know what to pick.

Ranger is a file manager for the terminal and one cool feature of it is that it has image previews, however, they are not enabled by default. So slendi, you may ask, how do you enable image previews in ranger? It is actually quite easy to do! In this post I will tell you what you need to do to enable them!

Ok, let's start by installing ueberzug. On arch-based distros you should be able to use the AUR to install it, for example, with pikaur, you do: "pikaur -S python-ueberzug" but you can also use pip to install it: sudo pip install ueberzug.

With ueberzug installed, now you need to open the rc config file for ranger, which should be at .config/ranger/rc.conf. Search for "set preview_images false" and replace false with true. After that, search for "set preview_images_method w3m" and replace w3m with ueberzug. That's all! Now you can go an image and you will see the preview pop up on the right!

Playing YouTube videos outside of YouTube

Posted on: Sun, 26 Jul 2020 16:04:13 -0000

MPV has a really nice feature where it can stream video data directly from YouTube. What did I do? I decided to make a script to play YouTube videos for me.

Doing this is simple enough: mpv "<YouTube link>". However, you can also specify a resolution using --ytdl-format: "bestvideo[ext=mp4][height<=?<res>]+bestaudio[ext=mp4]" where <res> is the desired resolution. This is a lot to type, so I implemented dmenu and some choices for resolutions: 1080, 720 and 480.

This was just a simple tip from me for you to not use the laggy browser version. I found this really useful for watching videos on older hardware. Combine it with newsboat and you have a really good alternative to browsing YouTube!