Categories
blogging code diy slackware

Check Slackware Changelog using conky

Yesterday I was wondering what’s the best way to update Slackware, and I decided to keep a local mirror of the current branch on my nas, I can mount the directory using the NFS protocol when I need it and the nas can go check for updates and fetch them during the night while I sleep and the network is idle.

The real problem is that I used to rely on Conky to check for updates to the current tree by issuing a slackpkg check-updates, but having slackpkg use my local mirror, it will always say that there are no updates, because the mirror is always updated. So I decided to bypass the mirror for the sole purpose of checking the changelog, and I came up with this script:

#!/bin/bash
 CL="https://sunsite.icm.edu.pl/pub/Linux/slackware/slackware64-current/ChangeLog.txt"
 LOCAL_CL="/var/lib/slackpkg/ChangeLog.txt"
 TMP="/tmp"
 TMPCL="${TMP}/ChangeLog.txt"
 if [[ -f ${TMPCL} ]]; then
     rm $TMPCL
 fi
     wget -q -P ${TMP} ${CL}
     if [ "$?" != 0 ]; then
         echo "Error checking updates…Wait until next try."
     fi
 NCL=$(head -n 1 ${TMPCL})
 LCL=$(head -n 1 ${LOCAL_CL})
 if [[ ${NCL} != ${LCL} ]];then
     echo "Updated packages available!"
 else
     echo "No news is good news!"
 fi

Now I just download the Changelog.txt file from a trusted mirror, using head I check for changes in the first line between the latest file stored by slackpkg and the one I downloaded and if I find a difference I output a line to conky.

This script is made to be run by Conky and usually I have it run once every 12 hours if my pc is on for that long.
I hope someone find it useful 😉

See you on the next one.

Categories
diy linux

new home server ideas

I’m thinking about building a new home server, so I picked some parts I think might work well for what I need to do. Here’s the list for future reference:

PCPartPicker Part List: https://it.pcpartpicker.com/list/Kj3MZf

  • CPU: AMD Ryzen 3 3200G 3.6 GHz Quad-Core Processor
  • CPU Cooler: Cooler Master MasterLiquid ML240L RGB 66.7 CFM Liquid CPU Cooler
  • Thermal Compound: Thermal Grizzly Kryonaut 1g 1 g Thermal Paste
  • Motherboard: Gigabyte B450 AORUS M Micro ATX AM4 Motherboard
  • Memory: Corsair Vengeance LPX 16 GB (2 x 8 GB) DDR4-3200 Memory
  • Case: Antec VSK10 MicroATX Mid Tower Case
  • Power Supply: EVGA BT 450 W 80+ Bronze Certified ATX Power Supply
  • Case Fan: 2x be quiet! Pure Wings 2 140 PWM 61.2 CFM 140 mm Fan

Total around €445.00 on amazon as suggested by PCPartPicker.

What do you guys think?

Categories
blogging diy

Calendario rifiuti Vigasio (VR)

Mi sono trasferito ad inizio Agosto a Vigasio (VR) e ho creato un calendario pubblico su google calendar per il conferimento dei rifiuti. Ogni comune dovrebbe averne uno.

Questo è il link per il calendario: Conferimento Rifiuti Vigasio (VR).
Questo è il link per scaricare il calendario in formato iCal.

Ho inserito le date dei rifiuti solo a partire dal 1 Agosto fino a fine anno, quindi non ci sono le date passate in quanto inutili.

Spero che possa tornare utile a qualcuno, io ho impostato i promemoria il giorno prima alle ore 20.00, in questo modo spero di ricordare di portare giù la spazzatura.

Have a good life.

Categories
diy linux slackware

baking programs

Compiling programs always feels like you’re baking a cake, you look for it, check the dependancies and then run the slackbuild, leave your computer to go grab a drink and when you come back you see an error, checking for it you notice you’ve forgotten a dependency, it’s like you put your cake in the oven, starts cooking and after a while you go “oh shit, I forgot to add sugar to the dough“.

I’ve been compiling a couple programs in the past few days and I’ve ended up patching them a lot, to compile audacity I had to go around and add 6 patches before the script managed to compile correctly, and today with qpdfview it was the same, still dependancy errors but in the end I made it work and let me tell you, when you come back to your PC and the script has ended and it says the program is installed it’s almost like you could smell it, your freshly baked cake waiting for you to enjoy it…

Categories
network

enabling cast to chromecast in latest chromium builds

I’ve tried for some time to get casting to work after Google stopped the cast extension because it is now builtin inside chrome/chromium, so I looked around and found out how to enable casting to chromecast devices from inside chromium browser. To do so, simply paste this line in a browser tab:

chrome://flags/#load-media-router-component-extension

In my case the media router component was set to “default”, so I disabled the media router component, after doing so chromium will ask you to relaunch the browser, after it has loaded again enable the component again and relaunch the browser one more time. Now try casting and it should work, simple as that!!

Categories
code diy WordPress

new plugin – WordPress.org stats for plugin developers

dnxwporg banner
danixland wporg stats plugin

I’m back at writing plugins, this time I wanted a simple way of displaying all the plugins I developed on my website, so I decided to dive in the WordPress.org API documentation to understand how could I do to get a list of all the plugins I have, hosted on the Plugins directory for WordPress.

Categories
code diy linux

GIT – how to setup your own server

Hello everyone,

I recently decided to move all my code under GIT, I’ve used it before and I’ve used also SVN, but I find GIT to be more straightforward in some aspects.

In order to use git I needed a place online where to store my projects, and I thought that github could be a good place, but the fact that you have to pay to keep a project private just didn’t sound right in my opinion. Of course github is there to make money (specially now that M$ bought it), but I prefer to have a simpler setup and be able to do things my way as much as possible.

So I started planning what I wanted my git server to have. Here’s a list:

  • Security – I decided to make it work only under ssh, that way only someone who has the key can clone or access the repository. I also added an unprivileged git user that has only access to very few commands, so even if somebody manages to access through ssh he’ll find himrself with only very few options available.
  • Notifications – my server already tells me a lot of what happens, so I wanted my git service to do the same. I implemented a mail service that notifies me every time a new repository is added or everytime there’s a push to a repository.
  • Automation – I wanted to have less steps possible between creation of the project and deployment to production. Now in two steps I can create a repository and clone it to my local computer, and when I’m done I just need to push my modifications and the code is deployed automatically.
  • Visibility – I haven’t yet decided if I want my code to be visible, so I haven’t even started thinking about this possibility.
Categories
diy linux

lock screen with xscreensaver

Just a quick tip in case you’re not using a major desktop environment like KDE. I’m using LXQT at the moment and as a screensaver it uses xscreensaver. It has no default shortcut to lock the screen, so I looked around a little bit and I found this command:

xscreensaver-command -lock

which will fire up the screensaver locking the screen.

to set it up just open the lxqt settings and add a new global shortcut (mine is Win + L) and save. That’s it, now everytime you need to lock your screen just hit the shortcut and voilà..

Categories
code diy

playing with colors

Today I decided I wanted to have a little “old school” fun, so instead of working on some WordPress theme/plugin, I went for the “lemme write some php from scratch” approach.

I was having a look at some color palettes for **I’m not gonna tell ya**, and it was quite hard for me to mix them together in my mind and decide which color goes where and how to use it, so after thinking about it for a while, I decided I’d narrow my options to 6 colors per palette, and in order to better visualize them, I wrote a small php page to help me.

It’s actually very simple, there’s a large preview where you can modify each color on the fly, and then you can send them to a fake page preview. that’s it.

I put it on github, just in case you want to give it a look.

Let me know what you think about it. Cheers 😉

Categories
blogging code diy WordPress

New WordPress plugin: danixland contact form

I even made a cool looking banner for the plugin’s page on WP.org

And here we are. Another WordPress plugin is coming to life.

This time I was looking for a simple contact form to use on a customer website, and after a little testing I decided it would have been much more interesting to build one myself so, after just a couple of weeks, my contact form is ready to hit the Plugin Directory on WordPress.org.

It’s actually waiting for review but if everything goes well it should be out in the wild in the next few hours.