Linux |
These notes are my personal online notebook of useful commands and "how-to's". You are welcome to make use of them if you find them helpful. They obviously don't come with any warranty! Click on one of the category tags above for the notes in any category. |
|||
Newer versions of Kubuntu are missing the advanced mouse options which let you debounce the mouse sudo apt install xserver-xorg-input-evdev sudo mkdir -p /etc/X11/xorg.conf.d Then edit and append: Section "InputClass" Identifier "evdev-mouse" MatchIsPointer "yes" Driver "evdev" EndSection You may have to reboot at this point xinput --list # find the id of the mouse (e.g. |
|||
If the system has been corrupted, and there is no grub menu, then boot from a live CD, open a terminal and do this: sudo fdisk -l # find the root filesystem sudo mount /dev/sda2 /mnt #whatever your root filesystem is D1=dev D2=dev/pts D3=proc D4=sys sudo mount --bind /$D1 /mnt/$D1 && sudo mount --bind /$D2 /mnt/$D2 && sudo mount --bind /$D3 /mnt/$D3 && sudo mount --bind /$D4 /mnt/$D4 sudo chroot /mnt # You are now back in the main hard drive cd /etc/default cp grub grub.orig vi grub # change timeout from 0 to 10 # change STYLE from hidden to menu # remove # from Ter |
|||
tar -cvjSf filename.tar.bz2 foldername |
|||
To securely wipe a hard drive of all data, do: apt install wipe shred -vfz -n 2 /dev/sdb
An alternative “light” way of doing this is to simply copy random bytes D=sdb fdisk -l /dev/$D # make sure we have the right device dd if=/dev/urandom of=/dev/$D bs=4096 status=progress
pgrep -l '^dd$' # gives the pid: nnnn DD watch -n 60 kill |
|||
See user manual here: www.gnu.org/…escue_manual.html
Example script:
# first pass to copy the good sectors and make a log file of the bad ddrescue -n /dev/sdc /dev/sdb logfile # second pass keeps retrying the bad sectors ddrescue -dr3 /dev/sdc /dev/sdb logfile # have a look at what we have and do some validation fdisk /dev/sdb e2fsck -v -f /dev/sdb1 e2fsck -v -f /dev/sdb2 # It might be necessary to manually copy partition |
|||
iptables -L INPUT --line-numbers -v
iptables -A INPUT -s 58.245.23.126/24 -j DROP
iptables -D INPUT 3
pre-up iptables-restore < firewall.txt Making changes persistent in CentOS 5iptables rules are stored in memory. |
|||
Undeleting a file is not easy in Linux. |
|||
Make sure userid’s and groupid’s match between the systems
Set up the server
|
|||
using smartmontools documentation, try: smartctl -d sat,16 -i /dev/sdc # find if enabled smartctl -d sat,16 -a /dev/sdc # display all info more documentation: |
|||
