Cool things I learned recently.....tools, tips & tricks...please add your own

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Message
Author
User avatar
oops
Posts: 2049
Joined: Tue Apr 10, 2018 5:07 pm

Re: Cool things I learned recently.....tools, tips & tricks...please add your own

#11 Post by oops »

To find files and folders not belonging to the user or the group of the user:

Code: Select all

find $HOME ! -user $USER -type f

find $HOME ! -group $USER -type f
( correction after with: sudo chown user:user /Myfolder/Myfile ... chown -R --> for recursive behavior))
Pour les nouveaux utilisateurs: Alt+F1 pour le manuel, ou FAQS, MX MANUEL, et Conseils MX Conseils Debian - Info. système “quick-system-info-mx” (QSI) ... Ici: System: MX-19-23_x64 & antiX23_x32 runit

User avatar
oops
Posts: 2049
Joined: Tue Apr 10, 2018 5:07 pm

Re: Cool things I learned recently.....tools, tips & tricks...please add your own

#12 Post by oops »

# To show the module changes, for example: from kernel 6.1.78 too 6.1.96, for my PC:

Code: Select all

diff="https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1"

echo "" ; date ; cat /proc/cmdline ; inxi -SCxxx ; echo "" ; wget -q -O - wget -q -O - $diff.96 $diff.95 $diff.94 $diff.93 $diff.92 $diff.91 $diff.90 $diff.89 $diff.88 $diff.87 $diff.86 $diff.85 $diff.84 $diff.83 $diff.82 $diff.81 $diff.80 $diff.79  | grep -A2 'Date:' | grep -v 'Date:\|^$\|^--' | grep -we $(echo "$(echo $(cat /proc/modules | cut -d\  -f1) | sed 's/\ /\ -we\ /g')") | sort
Pour les nouveaux utilisateurs: Alt+F1 pour le manuel, ou FAQS, MX MANUEL, et Conseils MX Conseils Debian - Info. système “quick-system-info-mx” (QSI) ... Ici: System: MX-19-23_x64 & antiX23_x32 runit

BitterTruth
Posts: 736
Joined: Tue Sep 22, 2020 7:36 pm

Re: Cool things I learned recently.....tools, tips & tricks...please add your own

#13 Post by BitterTruth »

Quick terminal calendar:

Code: Select all

 ~$ cal
     July 2024        
Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6  
 7  8  9 10 11 12 13  
14 15 16 17 18 19 20  
21 22 23 24 25 26 27  
28 29 30 31    


For a full year:

Code: Select all

~$ cal 2024
                            2024
      January               February               March          
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6               1  2  3                  1  2  
 7  8  9 10 11 12 13   4  5  6  7  8  9 10   3  4  5  6  7  8  9  
14 15 16 17 18 19 20  11 12 13 14 15 16 17  10 11 12 13 14 15 16  
21 22 23 24 25 26 27  18 19 20 21 22 23 24  17 18 19 20 21 22 23  
28 29 30 31           25 26 27 28 29        24 25 26 27 28 29 30  
                                            31                    

       April                  May                   June          
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6            1  2  3  4                     1  
 7  8  9 10 11 12 13   5  6  7  8  9 10 11   2  3  4  5  6  7  8  
14 15 16 17 18 19 20  12 13 14 15 16 17 18   9 10 11 12 13 14 15  
21 22 23 24 25 26 27  19 20 21 22 23 24 25  16 17 18 19 20 21 22  
28 29 30              26 27 28 29 30 31     23 24 25 26 27 28 29  
                                            30                    

        July                 August              September        
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6               1  2  3   1  2  3  4  5  6  7  
 7  8  9 10 11 12 13   4  5  6  7  8  9 10   8  9 10 11 12 13 14  
14 15 16 17 18 19 20  11 12 13 14 15 16 17  15 16 17 18 19 20 21  
21 22 23 24 25 26 27  18 19 20 21 22 23 24  22 23 24 25 26 27 28  
28 29 30 31           25 26 27 28 29 30 31  29 30                 
                                                                  

      October               November              December        
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  
       1  2  3  4  5                  1  2   1  2  3  4  5  6  7  
 6  7  8  9 10 11 12   3  4  5  6  7  8  9   8  9 10 11 12 13 14  
13 14 15 16 17 18 19  10 11 12 13 14 15 16  15 16 17 18 19 20 21  
20 21 22 23 24 25 26  17 18 19 20 21 22 23  22 23 24 25 26 27 28  
27 28 29 30 31        24 25 26 27 28 29 30  29 30 31              
                                                              

User avatar
LinuxSpring1
Posts: 274
Joined: Sun May 05, 2024 8:57 am

Re: Cool things I learned recently.....tools, tips & tricks...please add your own

#14 Post by LinuxSpring1 »

Kwrite, part of the KDE Plasma application suite, can open all the log and text files which have been compressed using GZip or BZip2. So for example if you have configured the logrotate to compress the log files then those compressed log files can be directly opened up, without the need to use Ark/bzip2/gzip to decompress them.

Just open KWrite, navigate to File > Open.
In the location/path enter the directory where the compressed log file is located
Select the compressed file and click on open

Caveats
  • This will not work with log files or text files that have been compressed with zip or rar or 7z file format
  • If you have a archive file that has multiple files inside the archive then this will not work.

User avatar
davidy
Posts: 818
Joined: Sat Jul 03, 2021 1:59 pm

Re: Cool things I learned recently.....tools, tips & tricks...please add your own

#15 Post by davidy »

By accident I found that clonezilla will make a bootable image of your hibernating pc. The only real trick other than going from hibernation and booting directly into clonezilla is to make sure your backup location is at the root of the drive and whatever you do, let it finish. You can pull the flash drive out once you hear the horns with the 'ps' flag (playsound) option. Also, once you've made the backup and you reboot out of hibernation you will have to boot again to see the backup folder you made. Strange but true.
Sys76 LemurPro-mx-23.4, EliteMinis HM90-mx-21.3, Deskmini UM350-phoenixLite win10, Qnap 12tb nas, Protectli FW4C-opnsense(=゜ω゜)

zero privacy = zero security . All MX'd Up
UAP = up above people

User avatar
siamhie
Global Moderator
Posts: 3835
Joined: Fri Aug 20, 2021 5:45 pm

Re: Cool things I learned recently.....tools, tips & tricks...please add your own

#16 Post by siamhie »

BitterTruth wrote: Mon Jul 15, 2024 3:23 pm Quick terminal calendar:

@BitterTruth I've switched to using ncal. It highlights the day you're on.

Code: Select all

-b      Use oldstyle format for ncal output.

Code: Select all

-w      Print the number of the week below each week column.
*the highlighted day doesn't show in the forum code tags
ncal.png
ncal-2024.png
You do not have the required permissions to view the files attached to this post.
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

User avatar
siamhie
Global Moderator
Posts: 3835
Joined: Fri Aug 20, 2021 5:45 pm

Re: Cool things I learned recently.....tools, tips & tricks...please add your own

#17 Post by siamhie »

Speaking of calendars. Here's a couple I have picked up along the way for conky.

Code: Select all

conky.config = {
alignment = 'top_right',
    background = false,
    border_width = 1,
    cpu_avg_samples = 1,
    default_color = 'white',
    default_outline_color = 'white',
    default_shade_color = 'white',
    double_buffer = true,
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    extra_newline = false,
    font = 'mono uralic:bold:size=10',
gap_x = 0,
gap_y = 0,
    maximum_width = 225,
    net_avg_samples = 2,
    no_buffers = true,
    out_to_console = false,
    out_to_ncurses = false,
    out_to_stderr = false,
    out_to_x = true,
    own_window = true,
    own_window_class = 'Conky',
own_window_argb_visual = true,
own_window_argb_value = 0,
own_window_colour = '000000',
own_window_transparent = true,
    own_window_type = 'desktop',
    show_graph_range = false,
    show_graph_scale = false,
    stippled_borders = 0,
    update_interval = 0.5,
    uppercase = false,
    use_spacer = 'left',
    use_xft = true,
	own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
}


conky.text = [[
${execpi 60 DJS=`date +%_d`; cal | sed s/"\(^\|[^0-9]\)$DJS"'\b'/'\1${color #FFFF00}'"$DJS"'${color}'/}
${voffset -30}
]];

Image

Code: Select all

conky.config = {
alignment = 'top_middle',
    background = false,
    border_width = 1,
    cpu_avg_samples = 1,
    default_color = 'white',
    default_outline_color = 'white',
    default_shade_color = 'white',
    double_buffer = true,
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    extra_newline = false,
    font = 'dejavu serif:size=12',
gap_x = -30,
gap_y = 50,
    maximum_width = 1280,
    net_avg_samples = 2,
    no_buffers = true,
    out_to_console = false,
    out_to_ncurses = false,
    out_to_stderr = false,
    out_to_x = true,
    own_window = true,
    own_window_class = 'Conky',
own_window_argb_visual = true,
own_window_argb_value = 0,
own_window_colour = '000000',
own_window_transparent = true,
    own_window_type = 'desktop',
    show_graph_range = false,
    show_graph_scale = false,
    stippled_borders = 0,
    update_interval = 0.5,
    uppercase = false,
    use_spacer = 'left',
    use_xft = true,
	own_window_hints = 'sticky',
}


conky.text = [[
$color${execpi 36000 /home/siamhie/.conky/R8/horical.sh}${color}
${voffset 1}${goto 260}${color}${hr 1} ${voffset 10}${goto 260}${color}${hr 1}
${color 00ffff}${voffset -70}${goto 46}${font rock salt:bold:size=14}${time %A}${font rock salt:bold:size=14}${goto 175} ${color 5BED1B}${voffset 0}${time %d}$color
${color 00ffff}${voffset -15}${font rock salt:bold:size=14}${goto 46}${time %b}${font rock salt:bold:size=14}${goto 175}${color}${voffset 0}${time %Y}$color${voffset -120}

]];

the accompanied horical.sh script.

Code: Select all

#!/bin/bash
# a script to display a horizontal calendar on conky (hence the name horical :D)
# if you need to ask something, contact me via email nhianho@gmail.com
TODAY=`date +%d`
TOPLINE=" "
OVER=" "
REST=" "
# -------- This part is to find out the number of days in a month to display-----------#
a=`date +%-Y`
e1=`expr $a % 400`
e2=`expr $a % 100`
e3=`expr $a % 4`
if [ $e1 == 0 ]
  then c=1
  elif [ $e2 == 0 ]
  then c=0
  elif [ $e3 == 0 ] 
  then c=1
  else c=0
fi
p=`date +%-m`
# if the current year is not a leap one, c = 0
if [ $c == 0 ] 
  then
	if [ $p == 2 ]
	then b=28 # this is the number of days in Febuary 
	elif [ $p == 11 ] || [ $p == 4 ] || [ $p == 6 ] ||  [ $p == 9 ]
	then b=30
	else b=31
	fi
  else
	if [ $p == 2 ]
	then b=29 # the number of days in Febuary in a leap year
	elif [ $p == 11 ] || [ $p == 4 ] || [ $p == 6 ] ||  [ $p == 9 ]
	then b=30
	else b=31
	fi
fi
#--------------------- The bottom line which displays the days of month ----------#
i=1
if [ $TODAY -ne 1 ]
then
    while [ $i -lt $TODAY ]; do
        if [ $i -lt 10 ]
        then
            OVER="$OVER 0$i"
        else
            OVER="$OVER $i"
        fi
        i=$[$i+1]
    done
fi
i=$[$i+1]
if [ $TODAY -ne $b ]
then
    while [ $i -ne $[$b] ]; do
        if [ $i -lt 10 ]
        then
            REST="$REST 0$i"
        else
            REST="$REST $i"
        fi
        i=$[$i+1]
    done
    REST="$REST $b"
fi
#------------- the top line which displays the abbreviated weekday names-------#
k=`date +%u`
j=`date +%e`
f=`expr $j % 7`
if [ $k -lt $f ]
then 
	y=$[$k+8-$f]
else
	y=$[$k-$f+1]
fi
while [ $b -gt 0 ]; do
    case "$y" in
    1) TOPLINE="$TOPLINE Mo";;
    2) TOPLINE="$TOPLINE Tu";;
    3) TOPLINE="$TOPLINE We";;
    4) TOPLINE="$TOPLINE Th";;
    5) TOPLINE="$TOPLINE Fr";;
    6) TOPLINE="$TOPLINE Sa";;
    7) TOPLINE="$TOPLINE Su";;
    esac
    b=$[$b-1]
    y=$[$y+1]
    if [ $y -eq 8 ]
    then
        y=1
    fi
done
echo '${goto 270}''${font mono:Bold:size=10}'$TOPLINE | sed 's/Su/${color red}Su${color}/g' | sed 's/Sa/${color red}Sa${color}/g'
echo '${goto 270}''${font mono:bold:size=10}''${color C28C3A}'$OVER '${color 5BED1B}'$TODAY'${color}'$REST

Image
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

User avatar
m_pav
Developer
Posts: 1911
Joined: Sun Aug 06, 2006 3:02 pm

Re: Cool things I learned recently.....tools, tips & tricks...please add your own

#18 Post by m_pav »

rokytnji.1 wrote: Mon Jul 15, 2024 8:33 am Old but new app. It comes with some preinstalled themes. My screenshot shows app with theme disabled.
+1, much improved overall, but the themes make the results pages almost unreadable so I too disabled the themes. The information under various sections is very nicely presented now and the benchmark tests make more sense overall. My Ryzen 5 5600G, which is slighted against the Ryzen 5 5600X got better results in all tests, so it must have a rather aged database to start with.

My addition to the list would have to be the Live Remaster tools for those who might want to update a fully featured Live USB made with our LUM without having to download a snapshot and creating another, though I do not recommend it be done with slow USB drives, always use a faster unit that can achieve a minimum sustained 65+ MBPS write speed, or a USB-SSD.

Combine the above with the MX Live USB Maker and after mounting an updated L-USB, you can make a clone of it as a secondary backup, and use a different sized flash drive. In the attached image, I am cloning a 128GB USB-SSD to a 256GB Ultra-fast regular USB Flash drive that will hold a sustained write speed of 120MBPS.
Note: in steps 8, 9 & 10, I am allocating 10% of the drive space (~25GB) for the Live USB and the remaining space for cross-platform storage.

Image
Mike P

Regd Linux User #472293
(Daily) Lenovo T560, i7-6600U, 16GB, 2.0TB SSD, MX_ahs
(ManCave) AMD Ryzen 5 5600G, 32G, 8TB mixed, MX_ahs
(Spare)2017 Macbook Air 7,2, 8GB, 256GB SSD, MX_ahs

User avatar
LinuxSpring1
Posts: 274
Joined: Sun May 05, 2024 8:57 am

Re: Cool things I learned recently.....tools, tips & tricks...please add your own

#19 Post by LinuxSpring1 »

siamhie wrote: Fri Aug 30, 2024 8:41 am Speaking of calendars. Here's a couple I have picked up along the way for conky.

...
...

Code: Select all

conky.config = {
alignment = 'top_middle',
    background = false,
    border_width = 1,
    cpu_avg_samples = 1,
    default_color = 'white',
    default_outline_color = 'white',
    default_shade_color = 'white',
    double_buffer = true,
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    extra_newline = false,
    font = 'dejavu serif:size=12',
gap_x = -30,
gap_y = 50,
    maximum_width = 1280,
    net_avg_samples = 2,
    no_buffers = true,
    out_to_console = false,
    out_to_ncurses = false,
    out_to_stderr = false,
    out_to_x = true,
    own_window = true,
    own_window_class = 'Conky',
own_window_argb_visual = true,
own_window_argb_value = 0,
own_window_colour = '000000',
own_window_transparent = true,
    own_window_type = 'desktop',
    show_graph_range = false,
    show_graph_scale = false,
    stippled_borders = 0,
    update_interval = 0.5,
    uppercase = false,
    use_spacer = 'left',
    use_xft = true,
	own_window_hints = 'sticky',
}


conky.text = [[
$color${execpi 36000 /home/siamhie/.conky/R8/horical.sh}${color}
${voffset 1}${goto 260}${color}${hr 1} ${voffset 10}${goto 260}${color}${hr 1}
${color 00ffff}${voffset -70}${goto 46}${font rock salt:bold:size=14}${time %A}${font rock salt:bold:size=14}${goto 175} ${color 5BED1B}${voffset 0}${time %d}$color
${color 00ffff}${voffset -15}${font rock salt:bold:size=14}${goto 46}${time %b}${font rock salt:bold:size=14}${goto 175}${color}${voffset 0}${time %Y}$color${voffset -120}

]];

the accompanied horical.sh script.

Code: Select all

#!/bin/bash
# a script to display a horizontal calendar on conky (hence the name horical :D)
# if you need to ask something, contact me via email nhianho@gmail.com
TODAY=`date +%d`
TOPLINE=" "
OVER=" "
REST=" "
# -------- This part is to find out the number of days in a month to display-----------#
a=`date +%-Y`
e1=`expr $a % 400`
e2=`expr $a % 100`
e3=`expr $a % 4`
if [ $e1 == 0 ]
  then c=1
  elif [ $e2 == 0 ]
  then c=0
  elif [ $e3 == 0 ] 
  then c=1
  else c=0
fi
p=`date +%-m`
# if the current year is not a leap one, c = 0
if [ $c == 0 ] 
  then
	if [ $p == 2 ]
	then b=28 # this is the number of days in Febuary 
	elif [ $p == 11 ] || [ $p == 4 ] || [ $p == 6 ] ||  [ $p == 9 ]
	then b=30
	else b=31
	fi
  else
	if [ $p == 2 ]
	then b=29 # the number of days in Febuary in a leap year
	elif [ $p == 11 ] || [ $p == 4 ] || [ $p == 6 ] ||  [ $p == 9 ]
	then b=30
	else b=31
	fi
fi
#--------------------- The bottom line which displays the days of month ----------#
i=1
if [ $TODAY -ne 1 ]
then
    while [ $i -lt $TODAY ]; do
        if [ $i -lt 10 ]
        then
            OVER="$OVER 0$i"
        else
            OVER="$OVER $i"
        fi
        i=$[$i+1]
    done
fi
i=$[$i+1]
if [ $TODAY -ne $b ]
then
    while [ $i -ne $[$b] ]; do
        if [ $i -lt 10 ]
        then
            REST="$REST 0$i"
        else
            REST="$REST $i"
        fi
        i=$[$i+1]
    done
    REST="$REST $b"
fi
#------------- the top line which displays the abbreviated weekday names-------#
k=`date +%u`
j=`date +%e`
f=`expr $j % 7`
if [ $k -lt $f ]
then 
	y=$[$k+8-$f]
else
	y=$[$k-$f+1]
fi
while [ $b -gt 0 ]; do
    case "$y" in
    1) TOPLINE="$TOPLINE Mo";;
    2) TOPLINE="$TOPLINE Tu";;
    3) TOPLINE="$TOPLINE We";;
    4) TOPLINE="$TOPLINE Th";;
    5) TOPLINE="$TOPLINE Fr";;
    6) TOPLINE="$TOPLINE Sa";;
    7) TOPLINE="$TOPLINE Su";;
    esac
    b=$[$b-1]
    y=$[$y+1]
    if [ $y -eq 8 ]
    then
        y=1
    fi
done
echo '${goto 270}''${font mono:Bold:size=10}'$TOPLINE | sed 's/Su/${color red}Su${color}/g' | sed 's/Sa/${color red}Sa${color}/g'
echo '${goto 270}''${font mono:bold:size=10}''${color C28C3A}'$OVER '${color 5BED1B}'$TODAY'${color}'$REST

Image
The horizontal calendar looks awesome. Need this on my desktop too. A few questions though.
  • In the conky script the value of maximum_width = 1280 is given. I am assuming that this is for screens with resolution of 1280X780 and not for screens with resolution of 1920X1280. Is that correct?
  • In the conky script the value of update_interval is 0.5. Considering that this needs to be updated only once every day, can it be changed to a higher value?
This is a great conky script. Will defintely incorporate it. Thanks @siamhie .

User avatar
siamhie
Global Moderator
Posts: 3835
Joined: Fri Aug 20, 2021 5:45 pm

Re: Cool things I learned recently.....tools, tips & tricks...please add your own

#20 Post by siamhie »

LinuxSpring1 wrote: Mon Sep 02, 2024 12:33 am
The horizontal calendar looks awesome. Need this on my desktop too. A few questions though.

[*] In the conky script the value of maximum_width = 1280 is given. I am assuming that this is for screens with resolution of 1280X780 and not for screens with resolution of 1920X1280. Is that correct?

Maximum width of window in pixels for the conky. http://ifxgroup.net/conky.htm#maximum_width

I've turned on borders to give you an idea of where everything lines up.
border.png
[*] In the conky script the value of update_interval is 0.5. Considering that this needs to be updated only once every day, can it be changed to a higher value?
Update interval in seconds. Fractions of a second are allowed using a decimal point. http://ifxgroup.net/conky.htm#update_interval

This one you can remove as there is nothing being updated for 24 hours.
You do not have the required permissions to view the files attached to this post.
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

Post Reply

Return to “Tips & Tricks by users (not for help)”