Sunday, December 5, 2021

Alert notification on Ubuntu Linux about certain task after given time duration

This happens always with me. I boil milk regularly and it always got boiled over. The problem is I cannot stand 10 mins while watching it, not even with phone. Generally I leave the place immediately and start finishing my pending work on the laptop. I tell myself, I am going to check after 5 min but I get occupied in the work and many times I remember when I get burning smell. Not only it is wastage of milk but also the expensive LPG.

Now I have found the solution only because I start working on my Ubuntu laptop after burning the stove, if I would be busy with my phone, this solution would not work and I would have to find some alarm or similar feature.

I run an alert command which opens a GUI pop-up box. The challenge here was, when I first implemented the command, it opens the pop-up but in the same terminal window where command is running. Of course I was working in some other window so I would never know about the pop-up. Now this solution opens the pop-up over any window and I am able to know about my task.

I had to install a package named wmctrl

sudo apt install wmctrl

Now I run the command

sleep 480; (sleep 1 && wmctrl -F -a "top" -b add,above) &(zenity --info --title="top" --text="Watch the Milk")

If I want alert pop up after 8 min. 480 is in seconds . If I need alert after 5 min I use command.

sleep 300; (sleep 1 && wmctrl -F -a "top" -b add,above) &(zenity --info --title="top" --text="My Alert Message")

It opens the pop up with message over any window and it reminds me about the task.



Wednesday, November 10, 2021

Jenkins - No Plugin available for Execute Shell script on remote host

You were using this plugin in some previous versions of Jenkins but you are not getting ssh plugin after upgrade in the newer versions.

This plugin is very useful if you want to run the script on remote host.

This is the solution for you.

Download hpi file

https://plugins.jenkins.io/ssh/#releases

and import it using

Manage Jenkins > Manage Plugins > Advanced > Upload

 

Restart Jenkins, the option will be there in the Build Environment and Build.



mysql not inserting int greater than 2147483647

Solution :

Your column type might be int or similar. Use bigint as column type.

You will not face the issue.