Eadwine's Tips and Tricks: The List

Topics relating to MX Docs and MX Videos
Locked
Message
Author
User avatar
Eadwine Rose
Administrator
Posts: 11954
Joined: Wed Jul 12, 2006 2:10 am

Eadwine's Tips and Tricks: The List

#1 Post by Eadwine Rose »

A list of things that I used to keep on my website, years ago. They have evolved into one large document that I use to install my system in the fastest way possible.

Little knickknacks that might be outdated have been tossed, others were kept. Things might already have made their way into MX.
Also: there might always be a better way, this is the way that -I- do (or did) it.

I just learned that so many back in the day loved that list post in question, so... here is to 2019 and a new life to.. THE LIST!

Note that wherever is referred to a folder called "eadwine" you need to replace this with your username.

Not EVERYTHING is in here of course, it is just my personal list of commands and such that work(ed) on MY system. Needless to say: YMMV ;)


And for everything goes: you break it, you get to keep the pieces, so use these things at your own risk!



Check the burned DVD md5sum

right click the file, compute md5sum
check the downloaded file, open a terminal and type
md5sum filename.iso
Be sure to replace filename with the actual filename.

Find the exact size in bytes of the downloaded iso. Put DVD in the dvd-reader drive, open a terminal and type:

dd if=/dev/sr0 | head --bytes=size | md5sum

Replace size with that actual size



Using a usb stick to install

You can check the md5sum of the USB drive by booting from it, then selecting F4 checkmd5

Alternative:
browse to /media/LiveUSB/antiX open a terminal there and enter
cat *.md5 | md5sum -c

When things are wrong the output looks something like this:
cat *.md5 | md5sum -c
initrd.gz: OK
linuxfs: FAILED
vmlinuz: OK
md5sum: WARNING: 1 computed checksum did NOT match




Remap mouse buttons

First install xbindkeys and xautomation
After installing xbindkeys, you'll need to generate a configuration file. The easiest way to do this is by running:
xbindkeys --defaults > /home/eadwine/.xbindkeysrc

Now we need to check the numbers for those two buttons.

Open a terminal and enter:
xev

A new window will pop up, move the mouse in there and press the buttons. An output will appear in the terminal. As you can see in my case they are numbered 8 and 9:

ButtonPress event, serial 37, synthetic NO, window 0x7e00001,
root 0x290, subw 0x0, time 9863287, (174,13), root:(1045,448),
state 0x0, button 9, same_screen YES

ButtonRelease event, serial 37, synthetic NO, window 0x7e00001,
root 0x290, subw 0x0, time 9863423, (174,13), root:(1045,448),
state 0x0, button 9, same_screen YES

ButtonPress event, serial 37, synthetic NO, window 0x7e00001,
root 0x290, subw 0x0, time 9864137, (174,13), root:(1045,448),
state 0x0, button 8, same_screen YES

ButtonRelease event, serial 37, synthetic NO, window 0x7e00001,
root 0x290, subw 0x0, time 9864241, (174,13), root:(1045,448),
state 0x0, button 8, same_screen YES

Now open the hidden .xbindkeysrc in your /home/username folder and add the following:

#lower button
"xte 'keydown Page_Up'"
b:8

#lower button release
"xte 'keyup Page_Up'"
b:8 + release

#upper button
"xte 'keydown Page_Down'"
b:9

#upper button release
"xte 'keyup Page_Down'"
b:9 + release

Yes that seems backwards but the top button is easier to reach for me and I need the page down to be under that one ;)

Also the keydown keyup bits ensure that when you press the page down button it will go down once, and when you hold the button it will continue to generate page downs until you release it.

Save the file, and then we need to kill all running xbindkeys:
killall xbindkeys

And restart xbindkeys with your just adjusted configuration file:
xbindkeys -f ~/.xbindkeysrc

No need to restart the computer, the effect is immediate.




Disk manager

Menu – disk manager
If you haven't done so yet, mount partitions you want automounted at login using thunar
Put a checkmark on them in disk manager

On some machines for unknown reasons, DM uses: ntfs (unknown driver) for ntfs partitions, which is read-only. To change to read/write, take the following steps:
1 Highlight the partition
2 Click the Edit button at the bottom
3 Change the Driver to: ntfs-3g (Read-write driver)
4 Save



Mouse acceleration

check if acceleration is working. Select the correct pointer device first!

If not, in the terminal, enter:
sudo ln -s /usr/share/X11/xorg.conf.d/10-evdev.conf /etc/X11/xorg.conf.d/10-evdev.conf
then reboot



Assigning hotkeys

Assigning hotkeys to set the sound for my tvcard
Find your settings manager in the menu and under hardware click keyboard.
Move to the application shortcuts tab.
In the bottom click add.
In the command field enter: amixer -c 0 set Line toggle
Click OK
Now click the key combo you want to use and voila, the new line appears in the overview.
Assign as well:
amixer -c 0 set Line 1%-
amixer -c 0 set Line 1%+

Plextor drives
eject /dev/sr0 (open drive)
eject -t /dev/sr0 (close drive)


When I close tvtime my pulseaudio gets muted. First find out which sink corresponds to the audio output you'd like to control. To list available sinks:
pactl list sinks short

Suppose sink 0 is to be used
To raise the volume:
sh -c "pactl set-sink-mute 0 false ; pactl set-sink-volume 0 +5%"

To lower the volume:
sh -c "pactl set-sink-mute 0 false ; pactl set-sink-volume 0 -5%"

To mute/unmute the pulseaudio volume:
pactl set-sink-mute 0 toggle




Testing if sound works from terminal

speaker-test -c2 -twav -l1




Adding special keys

This makes é and ô and such easy to type with by pressing and holding the left win key

As root go to /etc/default/keyboard, in the line XKBOPTIONS= add
compose:lwin,
in MX17 line now looks like
XKBOPTIONS="compose:lwin,grp:alt_shift_toggle,terminate:ctrl_alt_bksp,grp_led:scroll"
source: http://duncanlock.net/blog/2013/05/03/h ... -rebooting



Kodi stuff

When you get this error upon starting kodi (or other programs):
Xlib: extension "GLX" missing on display ":0.0".
reinstall your video driver (sgfxi)

When Kodi is popping turn off one of these or both:
Enable expert settings
Gear icon - player settings - videos - under playback
1) adjust display refresh rate
2) sync playback to display



Screen tearing fix Nvidia

Make a backup of /etc/X11/xorg.conf
Open /etc/X11/xorg.conf and add the following line in the screen section before the subsections start:
Option "metamodes" "nvidia-auto-select +0+0 { ForceCompositionPipeline = On }"
If you already have a line with “metamodes” in there, then be sure to add just the { ForceCompositionPipeline = On } line of code between the quotation marks at the very end.

Alternatively:

Open terminal
su to root
nvidia-settings
x server display configuration
advanced…
check force composition pipeline
apply
save to x configuration file, merge


I have to remove the xorg.conf file or my system will lock up, so as root enter:
rm /etc/X11/xorg.conf

Since removal of xorg.conf now forces you to force the pipeline at every boot/login, what also seems to work is to add this line:

nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"

to the session startup. Add under application autostart and just give it a name, for instance ScreenTearingFix

reboot and see if you have a working screen



Making hddtemp and syslog show in Conky

Open the terminal, su to root and type: dpkg-reconfigure hddtemp and install hddtemp to run as root

Thunar root mode go to to the /var/log/syslog, right click and change the permissions so that others can read as well.



Locales

As su enter: dpkg-reconfigure locales
uncheck all non en_ and nl_ locales, choose en_us utf 8 as default



System speaker

Disable system beep on logout:
go to /etc/modprobe.d/pc-speaker.conf, and enter following line at bottom: blacklist pcspkr




Long filenames on desktop

Copy .gtkrx-2.0 from Widgets folder to /eadwine folder to get long filenames on desktop and set the permissions so others can read as well

Content of this file:

style "xfdesktop-icon-view" {
XfdesktopIconView::ellipsize-icon-labels = 0
}
widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view"




Orage clock config

right click properties
Line 1: %H:%M:%S font sans size 12
Line 2: %A, %d %B %Y font sans size 8
Tooltip: Week number %V





Set default browser and cursor theme

after setting them in the settings
Open terminal, su to root, and enter
update-alternatives --config x-cursor-theme
and enter the number of the theme you want

update-alternatives --config x-www-browser
and enter the browser you want




VLC

Location vlc settings and all (you can backup this folder and paste it in in a new install):
/home/eadwine/.config/vlc/

To make sure you don't have to resize the window every time, go into preferences, select all, interface, main interfaces, qt, uncheck resize interface to the native video size.

You can open the "VIDEO_TS" subfolder on the mounted DVD with VLC, by drag'n'drop the VIDEO_TS folder into the VLC window. VLC will play the folder in the same way as a DVD.

If you enable "Advanced Controls" in VLC under the View menu, one of them is a big red "Record" button, which will record whatever you're watching to a file. It works really well as a way to make clips of a video, too.




Killing stuck programs

Sometimes a closed program will not restart when you click the icon. It might have some process left running preventing you to do so.
If so, open a terminal and enter:
killall -9 programname




Chrome

When tab muting isn’t working, go here:
disable chrome://flags/#sound-content-setting
this changes mute site to mute tab

enable chrome://flags/#enable-history-entry-requires-user-gesture
to avoid having to click back repeatedly on some sites

When you get the error in syslog:
ERROR:browser_dm_token_storage_linux.cc(93)] Error: /etc/machine-id contains 0 characters (32 were expected)
Open a terminal as root and enter:
ln -s /var/lib/dbus/machine-id /etc/machine-id



Keyring issues

Close all programs like Chrome etc
Clear/remove all existing keyrings

rm ~/.local/share/keyrings/*

Logout and login
Don't start Chrome
Open Password and Keys from the Menu

and you'll find an unlocked login-keyring as indicated by the unlocked symbol

Keyring password should be your user password




LibreOffice

Set everything to the way you like, A4 and all that
File - Templates - Save As Template - Set as default
View – Rulers
To get rid of / typing italics: open a new document - Tools - Autocorrect - Autocorrect options



Autoremovable packages

To check if it is safe to remove the packages in the autoremovable header, right click on the package - select Properties - Dependencies tab... use the drop-down menu to check Dependants etc.



Patch an iso with a delta file

xdelta3 -d -s fromfile patchname.delta tofile



Restart the panel

xfce4-panel -r



Set the time

as root:
ntpdate -u pool.ntp.org



Extracting .001 .002 etc files

go into the folder, right click and open a terminal
If the files are named filename.mkv.001 etc then enter this command:
cat filename.mkv* > filename.mkv



Desmurfing youtube

For videos with reversed colors in youtube, using the editor of your choice, add a file called mms.cfg and insert the following line:
EnableLinuxHWVideoDecode = 1

Put this file in /etc/adobe/
if not there, create adobe folder
Restart your browser



Increasing the volume of your avi file

ffmpeg -i myvideo.avi -vcodec copy -acodec libmp3lame -ab 128k -vol 1000 myvideo_louder.avi

to test this add: -t 30
this does the first 30 seconds so you can check the results

Alternative with avconv:

avconv -i myvideo.avi -vcodec copy -acodec libmp3lame -ab 128k -af volume=volume=1.5 myvideo_louder.avi

t -30 doesn't work here so just break off the conversion process to check




Converting flv to avi

mencoder -oac copy -ovc lavc -o video.avi video.flv




Split file into parts

mkvmerge -o outputprefix.mkv --split 1G origfile.mp4
adjust 1G according to size of pieces you want, outputprefix likely is a .mkv file

or

use MKVtoolnix GUI
left tab merge, tab input, right click in top field, add file
tab output
under “splitting” select split mode size or time
click “start muxing”



Converting mp4 to mp3

You can then run the command faad to convert to wav format and then lame to convert to mp3 format:
$ faad -o abc.wav abc.m4a
$ lame -h -b 192 abc.wav abc.mp3

The -h option of lame requests the production of higher quality output (taking more time to do so) and the -b option results in a bitrate of 192kbps for the resulting mp3



commands for versions
inxi -c0 -S | sed s/^.*Desktop:.// | sed s/Distro.*//
xfwm4 -V
cat /etc/antix-version



SDcard some data may be corrupt message

Upon inserting an sdcard the message:
“not properly unmounted and some data may be corrupt” error
To fix this, unmount the card, then as root run:
fsck -a -r /dev/sdd1
This will clean up the card and get rid of the error




When a file doesn't want to delete, not even as root and it is set read only

In this example it is ldlinux.sys:
Open a terminal where the file is, su to root and enter:
lsattr ldlinux.sys
The output looks like this:
----i--------e-- ldlinux.sys, the i shows it
To remove this file enter:
chattr -i ldlinux.sys
and then enter:
rm ldlinux.sys



Volume louder on an mp3

lame --scale 3 originalfile.mp3 outputfile.mp3
scale 3, 3 can be a different number



Double volume on mkv

ffmpeg -i vid.mkv -vol 512 -vcodec copy output.mkv
not tested though!



Manually delete menu item that you added (not a clue if this still works!)

Any edits to the menu items are saved to ~/.local/shared/applications/ folder which take precedence over the /usr/share/application/ items when the Xfce menu gets built, so if for some reason you mess up a menu item you can always go to ~/.local/shared/applications/ and delete the new entry (this can be done in app by clicking "Restore original item". If you want to be perfectly safe in you test back up ~/.local/shared/applications folder and then you can restore it if something goes wrong).



Do I have hyperthreading?

As root enter:
dmidecode -t processor | grep -E '(Core Count|Thread Count)'

Say the output is:

Core Count: 2
Thread Count: 4
Thread count is double the core count, then I have hyperthreading enabled.



What is the speed of my ethernet card?

Open a terminal and enter: ethtool eth0
Look for the line that looks like this: Speed: 1000Mb/s



Inspect hardware through terminal

dmidecode –type xx
where xx is a number 0-39

0 BIOS
1 System
2 Base Board
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply



The following fixes the BADSIG error in a three step process

1. Remove the directory and subdir holding lists and partial lists that are incompatible with the true keys
2. Recreate the directory structure deleted in step 1
3. Repopulate the directory structure created in step 2 with correct versions of lists deleted in step 1

As root:
rm -r /var/lib/apt/lists
mkdir -p /var/lib/apt/lists/partial
apt-get update



Forgotten the root password

If you still know your user password you can enter in terminal
sudo passwd root
Which should ask for user password then new root password
MX-23.2_x64 July 31 2023 * 6.1.0-20-amd64 ext4 Xfce 4.18.1 * 8core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 525.147.05 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 860EVO * Samsung S24D330 & P2250 * HP Envy 5030

Locked

Return to “Documentation and videos”