Depending on the headphones you are going to use, you must configure them according to the images below:
lsblk
# fdisk -l
lspci -v | less
$ sudo hdparm -r0 /dev/sdX
BIOS: $ sudo dmidecode -t 0
Motherboard: $ sudo dmidecode -t 2
Processor: $ sudo dmidecode -t 4
RAM: $ sudo dmidecode -t 17
Max RAM allowed: $ sudo dmidecode -t 16
More info at https://www.linuxtechi.com/dmidecode-command-examples-linux/
Insert pendrive in USB port
Check what is the USB pendrive device/partition: sudo fdisk -l or lsblk
Unmount the device/partition: umount /dev/sdc1 (in my case, sdc1 is the USB pendrive device partition)
Create bootable pendrive: sudo dd bs=4M if=my_iso_image.iso of=/dev/sdc status=progress oflag=sync
In step 4, you must navigate where the iso image is before issuing the command.
sudo dd if=/dev/sdb5 of=/media/cheo/TOSHIBA_HDD/Lubuntu_backup.img oflag=append conv=notrunc,sync,noerror status=progress
The command above does the following:
Create an image file of the sdb5 partition and copy it into an external usb hard drive (TOSHIBA_HDD)
You can name the backup image file as you please. I chose Lubuntu_backup, but you can name it as you wish. However, BE SURE to use the file extension .img
oflag=append conv=notrunc copy the file in the hard drive without using the whole hard drive (otherwise the whole hard drive will be wiped out and all the original data in the hard drive will be lost)
conv=sync,noerror prevents the operation to halt if an error occurs
status=progress shows the progress of the operation
Note that if the partition is 50GB, but the data in the partition is only 20GB, the whole 50GB of the partition will be backed up
sudo dd if=/media/cheo/TOSHIBA_HDD/Lubuntu_backup.img of=/dev/sdb5
If not already installed, install os-prober
Run: sudo grub-mkconfig -o /boot/grub/grub.cfg or update-grub
More info: https://wiki.archlinux.org/index.php/GRUB
Edit /etc/default/grub and make intended changes
Then run:
$ sudo grub-mkconfig -o /boot/grub/grub.cfg
$ chmod +x mybashscript.sh
Add an alias to the bash script
$ gedit ~/.bashrc
alias <new name>='/home/<full path to script>/mybashscript.sh'
Apply the changes in the system
$ source ~/.bashrc
Download the latest Partde Magic ISO image from the download page
Plug in your USB stick and wait 5 seconds to allow enough time for the system to detect it
Unmount the USB stick if auto-mount is enabled or if it was already mounted
Run dd if=/path/to/partedmagic.iso of=/dev/sdx in a shell where sdx is the USB stick
Download the latest SystemRescueCd ISO image from the download page
sudo mkdir -p /mnt/iso
sudo mount -o loop,exec Downloads/systemrescuecd-x86-5.2.2.iso /mnt/iso
Plug in your USB stick and wait 5 seconds to allow enough time for the system to detect it
Unmount the USB stick if auto-mount is enabled or if it was already mounted
cd /mnt/iso
sudo bash ./usb_inst.sh
In the dialog that opens*, navigate the correct USB device with the up and down arrow keys, press space bar to select it and press enter
cd
sudo umount /mnt/iso
*If you are not using xterm-256color, the dialog won't open and the terminal will throw: Error opening terminal: xterm-256color
fdisk
parted
gdisk
cfdisk
ddrescue
testdisk
df -h
du -hc *
du -shc /usr/*
Compress: tar -zcvf mydir.tar.gz mydir
Decompress: tar -zxvf mydir.tar.gz
find / -type f
How to count the number of all directories and files
find / -type f | wc -l
How to find specific text in files in current directory and child directories
grep -d recurse "text"
How to find all files with specific text
grep -rnw '/path/to/somewhere/' -e 'pattern'
https://askubuntu.com/questions/607656/how-to-copy-directories-and-files-from-a-corrupted-harddrive
ddrescue is a tool designed for cloning and recovering data. It copies data from one file or block device (hard disc, cdrom, etc) to another, trying to rescue the good parts first in case of read errors, to maximize the recovered data.
To clone a faulty or dying drive, run ddrescue twice. First round, copy every block without read error and log the errors to rescue.log.
# ddrescue -f -n /dev/sdX /dev/sdY rescue.log
Second round, copy only the bad blocks and try 3 times to read from the source before giving up.
# ddrescue -d -f -r3 /dev/sdX /dev/sdY rescue.log
Now you can check the file system for corruption and mount the new drive.
# fsck -f /dev/sdY
bash-completion
bc (CLI calculator)
galculator (GTK+ scientific calculator)
xfce4-screenshooter (screenshot utility)
gnome-screenshot (screenshot utility)
ristretto (image viewer utility)
transmission-gtk (torrent client)
leafpad (text editor)
nethogs (CLI network processes monitor)
vifm (vi type file manager)
obs (screencasting software)
screenkey (key press screencasting)
sensors (CLI temperature monitoring)
darktable (raw photo editing)
rawtherapee (raw photo editing)
nodejs
gatsby-cli
textlive-full, texmaker, latex2html, pandoc
for gatsby: sudo chown -R $USER:$(id -gn $USER) /home/cheo/.config
blender, gimp, krita, inkscape, darktable, kdenlive, shotcut, openshot, obs-studio, simplescreenrecorder, audacity, vlc, ffmpeg
freecad, librecad, openscad
Launch CMD
diskpart
list disk
select Disk 2 *
clean
create partition primary
*On step 4, choose the correct disk number for your pen drive
Sometimes, when plugging a hard drive or usb drive, Windows does not assign a letter and the drive is not shown in the Explorer. This is how to fix it:
Launch 'Computer Management' -> Storage - Disk Management
Look for the drive without a letter -> Right click -> 'Change drive letter and path' -> Add -> Assign the following drive letter
1. Download Windows 10 from here. Then follow these commands:
2. Insert USB pendrive (in this example in /dev/sdd
3. Issue these commands:
$ sudo add-apt-repository ppa:nilarimogard/webupd8
$ sudo apt update
$ sudo apt install woeusb
$ sudo woeusb --target-filesystem NTFS --device Downloads/Win10_1809Oct_English_x64.iso /dev/sdd
Compress: tar -czf example.tar.gz -C /var/www/example.com/public_html .
Decompress: tar -xzf example.tar.gz -C wordpress
How to export database:
$ mysqldump -u wpuser -p example --single-transaction --quick --lock-tables=false > example-dump.sql
wp_importer
database_name-dump.sql
mydomain.tar.gz
Create empty database:
$ sudo mariadb -u root -p
MariaDB> CREATE DATABASE example;
MariaDB> EXIT
Add database to MariaDB:
$ mariadb -u wpuser -p example < example-dump.sql
Execute bash script:
$ sudo ./wp_importer
Restart LEMP:
$ sudo systemctl restart nginx php-fpm mariadb
You can login now to Wordpress dashboard by navigating to: http://example.com/wp-admin
Connect to remote machine:
$ ssh user@remote_machine_ip
Note: if the remote machine you used to ssh has been deleted and a new system has been installed in the same remote machine with the same user and IP address, issue this command:
ssh-keygen -f "/home/cheo/.ssh/known_hosts" -R "192.168.1.43"
Generate a Key Pair:
$ ssh-keygen
Copy the Public Key to remote machine:
$ ssh-copy-id
How to copy a file from local to remote (from local shell):
scp file_name user@remote_machine_ip:/home/remoteuser/
How to copy a file from remote to local (from local shell):
scp user@remote_machine_ip:file_name /home/localuser/
$ sudo apt install texlive-full texmaker
Note that texlive-full installs all packages available for texlive (~5GB). You may want to install just texlive-base and only some other packages that you will use.
Add linkable table of content:
\usepackage{hyperref}
Add Japanese text support:
\usepackage{CJKutf8}
\begin{document}
\begin{CJK}{UTF8}{min}
日本語
\end{CJK}
\end{document}
Add Yen currency character:
\def\yen\\{{\setbox0=\hbox{Y}Y\kern-.97\wd0\vbox{\hrule height.1ex
width.98\wd0\kern.33ex\hrule height.1ex width.98\wd0\kern.45ex}}}
\begin{document}
The cost is 108\yen\\
\end{document}
Auto generate table of contents:
Add the line \tableofcontents between \begin{document} and \newpage
Each section must be preceded by \newpage:
For the new changes to take affect, you must comment and uncomment \tableofcontents:
%\tableofcontents
Run
\tableofcontents
Run
The configuration file is /boot/grub/grub.cfg, but you shouldn't edit it directly. This file is generated by grub v2's update-grub(8), based on:
The script snippets in /etc/grub.d/
The configuration file /etc/default/grub
To configure GRUB "v2", you should do any or both of these:
edit /etc/default/grub, then run update-grub
modifying the snippets in /etc/grub.d/
Also check the GRUB2 page for more detailed configuration instructions, ideas and suggestions.