Page 4 of 5

Re: Tips and Tricks

Posted: Tue May 23, 2017 10:47 am
by eemaestro
asinoro, what did I forget to do ? Am I using the wrong syntax ?

Code: Select all

$ ls -Fdltr strong*
-rwxr-xr-x 1 george 100 198 May 23 10:40 strongpw*
$cat strongpw
strongpw () {
echo -n "Enter secret:"
read -r
echo '' # line break
echo -n "$ REPLY: $ 1" | sha256sum | perl -ne "s / ([0-9a-f] {2}) / print chr hex \ $ 1 / gie" | base64 | tr + / Ea | cut -b 1-20
$ strongpw(google.com)
bash: syntax error near unexpected token `google.com'

Re: Tips and Tricks

Posted: Tue May 23, 2017 10:58 am
by asinoro
eemaestro wrote:asinoro, what did I forget to do ? Am I using the wrong syntax ?

Code: Select all

$ ls -Fdltr strong*
-rwxr-xr-x 1 george 100 198 May 23 10:40 strongpw*
$cat strongpw
strongpw () {
echo -n "Enter secret:"
read -r
echo '' # line break
echo -n "$ REPLY: $ 1" | sha256sum | perl -ne "s / ([0-9a-f] {2}) / print chr hex \ $ 1 / gie" | base64 | tr + / Ea | cut -b 1-20
$ strongpw(google.com)
bash: syntax error near unexpected token `google.com'
The correct way:
strongpw google.com

or having different result:
strongpw google

Re: Tips and Tricks

Posted: Tue Jun 20, 2017 9:53 am
by asinoro
Reboot keyboard combination

As Windows user you know that the combination of the keys ctrl+alt+delete restarts the computer.
To have the same result you have to go:
Settings > Keyboard > Applications Shortcut > and you find the xflock4 command where it is to lock the screen > Edit > and change to a key combination ctrl+alt+L > OK > where you will have a visual verification.
Now you can add your reboot command: Add > Command > xfce4-session-logout –reboot > OK > you press ctrl+alt+delete > where you will have a visual verification.
You are ready!

Re: Tips and Tricks

Posted: Tue Jun 20, 2017 4:35 pm
by penguin
Making Screen shoots of your screen and save it automatically somewhere ....

I use this :

Code: Select all

#!/bin/bash
scrot /home/user/Screenshots/$(date +%F_%T:%3N).png
As you see scrot package (terminal screenshot utility) needs to be installed in your system.By default as I know it is installed.
Write above lines in an editor and save it as : as_you_wish.sh ( I use crshoot.sh). Make it executable.
Save this file somewhere .Let's say in the directory Scripts that you have created under /home/user/Scripts/
Now go to: Whicker Meny >Settings>Keyboard>Application Shortcut and click Add+. For the Command give the pathname of file including name; lets say /home/user/Scripts/crshoot.sh
As Command Shortcut press PrtScr. Done!
Now each time you press PrtScr a screenshot will be saved under : /home/user/Screenshots/ named by the exacts time when you clicked PtrScr button.

Instead of png you can use jxfce4-screenshooterxfcepg or bmp.

Meanwhile you can reserve Shift+PtrScr (in the same way : Whisker>Menu>Settings>Keyboard>Applications ) for xfce4-screenshooter :happy:

Re: Tips and Tricks

Posted: Tue Jun 20, 2017 4:41 pm
by penguin
The follow command in the terminal :

Code: Select all

dpkg --list >~/packages_till_$(date +%F_%T:%3N)
will save in a file log of all packages installed in your system till the moment you asked for this log. The file is save under directory ./user/.

Log looked something like this :

Re: Tips and Tricks

Posted: Tue Jun 20, 2017 4:49 pm
by penguin
Cleaning of your terminal history

After trying :

Code: Select all

history - c
or something else I found in the follow website :

Code: Select all

https://unix.stackexchange.com/questions/203290/how-do-i-clear-the-terminal-history
that writing down in terminal

Code: Select all

cat /dev/null > ~/.bash_history && history -c && exit
Can do very well this job :happy:

Re: Tips and Tricks

Posted: Tue Jun 20, 2017 4:50 pm
by penguin
Cleaning up of your system:
I use as follow :

Code: Select all

rm -v -f ~/.cache/thumbnails/*/*.png ~/.thumbnails/*/*.png && rm -v -f ~/.cache/thumbnails/*/*/*.png ~/.thumbnails/*/*/*.png  &&
sudo apt-get update && sudo apt-get autoclean && sudo apt-get clean && sudo apt-get autoremove && sudo updatedb

Re: Tips and Tricks

Posted: Tue Jun 20, 2017 4:51 pm
by penguin
Cleaning of your tmp history:

Code: Select all

for i in /tmp/* ; do rm -r "$i" ; done
found somewhere in the Arch forum.

and :happy:

Code: Select all

e4defrag /
to defrag your / in a ext4 file system :happy: . Some times also linux have bennefits from defrag.Pay attention!Use defrag only if your system is installed in a HDD. Do not use this command if your system is installed in a SSD. Mx Linux has activated fsrim-mx timer that run fstrim utility frequently as maintenance for triming of SSD.
I do not remember very well .The originally fstrim-mx timer (that activates fstrim service) is under /etc/cron.daily/ or /etc/cron.weekly/ ?
You can check for this.Much better to be under /etc/cron.weekly/. One trim per week is enough for SSD.

It is a very interested discussion there

Code: Select all

https://forum.manjaro.org/t/fstab-okay-for-ssd/894/6
.

Re: Tips and Tricks

Posted: Thu Jun 22, 2017 2:40 pm
by asinoro
After suspend resume no mouse cursor

I experience in the past this issue with Mint and MX 15 and after the recent upgrade to 16.1. I solved it by trying to kill the mouse activity where in monitor-task manager is as kpsmoused.
Because some things are difficult to remember and no visual contact to see first you use Superuser key and type task to start the task manager to monitor your system.
After Ctrl+F and type mouse and find the PID of kpsmoused.
Then Ctrl+Alt+T to start the terminal.
And then the command,
sudo kill PID where PID is the number of kpsmoused.

I hope it will help this trick if you experience this annoying situation.

Re: Tips and Tricks

Posted: Fri Jul 14, 2017 3:25 am
by asinoro
Fix MX EFI Grub after install of Mint 18.2

Not all the Linux OS have the politeness to let choose the user to keep its Grub version.
After installing Mint 18.2 it install its own version of grub but I want my own of MX 16.1 with the Kingfisher image.
How to reinstall your MX EFI Grub:

Code: Select all

sudo su

Code: Select all

blkid
Mount your efi partition where sdaX or sdbX according blkid.

Code: Select all

mount /dev/sdaX /boot/efi
Install grub on hard drive sda or sdb or whatever is your drive in the example is the normal sda.

Code: Select all

grub-install /dev/sda

Code: Select all

update-grub
You are ready you have again install your MX grub.