Linux - get rid of all NVIDIA drivers from pc

You can see which NVIDIA packages are installed on your pc, typing
  • dpkg -l | grep -i nvidia
and you can take note of the right package's name to uninstall.

It's not always recommended but you can use this command to remove it all in one shot:
  • sudo apt-get autoremove nvidia*

Linux - Mint doesn't wake up after screen is locked and blank

Be careful, this is only a work around.


This feature is a part of usbcore which is compiled in the kernel.

From https://unix.stackexchange.com/a/175035.


  • Edit
    • /etc/default/grub 
  • Change 
    • GRUB_CMDLINE_LINUX_DEFAULT 
  • Add this option at the end
    • usbcore.autosuspend=-1
  • That's the result 
    • GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.autosuspend=-1" 
  • Save the file and update grub
    • sudo update-grub 
  • Reboot

    Now, if you check the autosuspend value with 

    • cat /sys/module/usbcore/parameters/autosuspend
    it should display -1.

Linux - set display resolution via terminal

xrandr --output VGA-0 --mode 1024x768 --pos 1680x0 --rotate normal --output LVDS --mode 1680x1050 --pos 0x0 --rotate normal --output S-video --off --output DV

Linux - work on PDF files via terminal

To reduce a huge PDF 
    gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -sOutputFile=reductedNewFile.pdf hugeOldFile.pdf

To convert to grey scale
 
    convert -colorspace GRAY color.pdf gray.pdfconvert -colorspace GRAY-density 400 -quality 100 color.pdf gray.pdf     convert -colorspace GRAY-density 200 -quality 100 color.pdf gray.pdf     
    convert -colorspace GRAY-density 100 -quality 100 color.pdf gray.pdf

To concatenate jpg in one pdf

     convert *.jpg pictures.pdf    convert -quality 100 -sharpen 0x1.0 *.JPG pdfFile.pdf

To concatenate pdfs in one pdf

     pdftk pdf1.pdf pdf2.pdf pdfN.pdf output newconcatenated.pdf

To split pages
     pdftk myoldfile.pdf cat 1 2 4 5 output mynewfile.pdf

To rotate the first PDF page to 90 degrees clockwise
 
    pdftk in.pdf cat 1east 2-end output out.pdf

Rotate an entire PDF document to 180 degrees
 
    pdftk in.pdf cat 1-endsouth output out.pdf

Linux - to enable a RSync server

1. Enable the rsync (RSYNC_ENABLE=true) in target server (Debian)

nano /etc/default/rsync
change the RSYNC_ENABLE=false to RSYNC_ENABLE=true

2. Create the file /etc/rsyncd.conf

nano /etc/rsyncd.conf
append the following text, then save

pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsync.log

[rsync]
path = /rsync [path to the destination directory]
uid = root
gid = root
read only = no
list = yes
auth users = root
secrets file = /etc/rsyncd.secrets

3. Create the rsync share

mkdir /rsync [path to the destination directory]
Create the /etc/rsyncd.secrets
nano /etc/rsyncd.secrets
- append root:password, which is in the form username:password
Limit access to file owner
- chmod 600 /etc/rsyncd.secrets

4. Restart rsync

/etc/init.d/rsync restart

Linux - need for a disk's checking

Requisite: after the boot, press [ESC] to enter in Grub

Grub doesn't have a specific command to check the disk, but automatically the disk will be checked at the next startup if you exit with the embedded reboot command.


  • press [ESC] early at the boot
  • wait for the Grub menu
  • press [c] for the console
  • type reboot and press [enter]
  • wait for the normal reboot of the machine, that will take a little longer because of the the drive's check