Terminal
sudo chmod 777 .cache -R
This blog was intended for personal use only. I'm very happy if you manage to find some kind of inspiration, but I am not responsible for any damage you can cause by following my tips.
Windows - Uninstall SOPHOS End Point without the unlock password
Enable the Administrator user (if it's not already enabled).
Reboot your Windows system into Safe Mode.
Login as Administrator
Run services.msc
Search for the Sophos Anti-Virus service and click on it with the right mouse button.
From the context menu, select Properties and then deactivate the service.
Run regedit.
Go to the following location in the registry editor: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sophos MCS Agent and set REG_DWORD Start value to 0x00000004
Then, go to the following location:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sophos Endpoint Defense\TamperProtection\Config set the REG_DWORD values SAVEnabled and SEDEnabled both to 0.
Finally, go to the following location:
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Sophos\SAVService\TamperProtection and set the REG_DWORD value to 0.
Reboot the system in normal mode.
Try the uninstall process, it will be need another reboot.
Reboot your Windows system into Safe Mode.
Login as Administrator
Run services.msc
Search for the Sophos Anti-Virus service and click on it with the right mouse button.
From the context menu, select Properties and then deactivate the service.
Run regedit.
Go to the following location in the registry editor: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sophos MCS Agent and set REG_DWORD Start value to 0x00000004
Then, go to the following location:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sophos Endpoint Defense\TamperProtection\Config set the REG_DWORD values SAVEnabled and SEDEnabled both to 0.
Finally, go to the following location:
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Sophos\SAVService\TamperProtection and set the REG_DWORD value to 0.
Reboot the system in normal mode.
Try the uninstall process, it will be need another reboot.
Linux Mint 19 - Looping of login screen
Problem:
After the login, the screen gets black, and then you get the login screen again.
My solution:
Press [ctrl][alt][F3] to jump to a terminal
Login with your credentials
Digit ls -lha and take note of permission of .Xautority
Note that the permission is like this:
-rw------- 1 root root 53 Jul 02 20:19 .Xauthority
Digit chown myuser:myuser .Xauthority (where myuser is your user name)
Now the permission is changed like the following:
-rw------- 1 myuser myuser 53 Jul 02 20:19 .Xauthority
Press [ctrl][alt][F7] to jump to the graphical login screen
Try to login.
After the login, the screen gets black, and then you get the login screen again.
My solution:
Press [ctrl][alt][F3] to jump to a terminal
Login with your credentials
Digit ls -lha and take note of permission of .Xautority
Note that the permission is like this:
-rw------- 1 root root 53 Jul 02 20:19 .Xauthority
Digit chown myuser:myuser .Xauthority (where myuser is your user name)
Now the permission is changed like the following:
-rw------- 1 myuser myuser 53 Jul 02 20:19 .Xauthority
Press [ctrl][alt][F7] to jump to the graphical login screen
Try to login.
Synology - Setting a personal VPN with the NAS
Prerequisite: If you do not have a static IP, enable and set the DDNS on the SYNOLOGY NAS.
name VPN
protocol UPD
local IP address [the IP of the NAS, it's better to give him a static internal IP]
local port 1194
(or range 1194-1194)
WAN IP address ANY
WAN port 1194
(or range 1194-1194)
Run OpenVPN GUI as administrator.
Get VPNConfig.ovpn from the zip archive, edit it:
replace YOUR_SERVER_IP with the public IP of NAS or the hostname registered in the DDNS service of your NAS Synology
add those lines:
auth-user-pass auth.txt
route 0.0.0.0 0.0.0.0 vpn_gateway 500
Put it in C:\Program Files\OpenVPN\config
Ever in C:\Program Files\OpenVPN\config create a file named auth.txt
Edit it adding two lines: in the first one the user name created in Synology and in the second one its password.
At log on,
start C:\Program Files\OpenVPN\bin\openvpn-gui.exe
with those parameters --connect VPNConfig.ovpn
SETTING THE SYNOLOGY
- Install the package [VPN Server] in the Synology NAS.
- In my opinion (and for my needs) it's better to create only one VPN user and give the permision to fruition the VPN enviroment only to him. It's better that the password is very complex.
- Run it. In the left, from the group [Set up VPN Server], select [OpenVPN].
- Put a tick in [Enable OpenVPN server].
- Change the range of the Dinamic IP, if needed.
- Take note of the port "1194" and the protocol "UPD": it will be needed for setting the port forwarding in the Firewall.
- Click on [Export configuration] to have a zip archive content the certificate [ca.crt] and the configurations [VPNConfig.ovpn]
SETTING THE FIREWALL
Setting the firewall that's connected to the NAS, creating a rule with this parameter:name VPN
protocol UPD
local IP address [the IP of the NAS, it's better to give him a static internal IP]
local port 1194
(or range 1194-1194)
WAN IP address ANY
WAN port 1194
(or range 1194-1194)
SETTING OPENVPN IN WINDOWS
From here, download OpenVPN and install it on the PC.Run OpenVPN GUI as administrator.
Get VPNConfig.ovpn from the zip archive, edit it:
replace YOUR_SERVER_IP with the public IP of NAS or the hostname registered in the DDNS service of your NAS Synology
add those lines:
auth-user-pass auth.txt
route 0.0.0.0 0.0.0.0 vpn_gateway 500
Put it in C:\Program Files\OpenVPN\config
Ever in C:\Program Files\OpenVPN\config create a file named auth.txt
Edit it adding two lines: in the first one the user name created in Synology and in the second one its password.
CREATE AN AUTOMATIC TASK IN WINDOWS
Create a task in Task Scheduler with these rules:At log on,
start C:\Program Files\OpenVPN\bin\openvpn-gui.exe
with those parameters --connect VPNConfig.ovpn
Linux - share DVD-ROM through the LAN
Prerequisite: Samba has to be installed and I suppose that the hostname of your PC is MyPC.
Create a directory in /media
sudo mkdir /media/DVD
Modify /etc/fstab by adding this line:
/dev/sr0 /media/DVD iso9660 defaults,noauto,ro,user,uid=1000,gid=1000 0 0
(one line)
Add (or check if it is already there) those lines in /etc/samba/smb.conf
[DVD-ROM]
path = /media/DVD
browseable = yes
read only = yes
guest ok = yes
locking = no
preexec = /bin/mount /media/DVD
postexec = /bin/umount /media/DVD
writable = no
Reread /etc/fstab
sudo mount -a
(ignore the errors that appears: it attempts to mount some already mounted devices)
Restart Samba
sudo service smbd restart
Put a DVD/CD into the drive and check the share:
in MAC
Finder > Go > Connect to Server...
type: smb://MyPC and press enter
Select Guest as user name
in Windows
Open the File Explorer
type \\MyPC and press enter
Create a directory in /media
sudo mkdir /media/DVD
Modify /etc/fstab by adding this line:
/dev/sr0 /media/DVD iso9660 defaults,noauto,ro,user,uid=1000,gid=1000 0 0
(one line)
Add (or check if it is already there) those lines in /etc/samba/smb.conf
[DVD-ROM]
path = /media/DVD
browseable = yes
read only = yes
guest ok = yes
locking = no
preexec = /bin/mount /media/DVD
postexec = /bin/umount /media/DVD
writable = no
Reread /etc/fstab
sudo mount -a
(ignore the errors that appears: it attempts to mount some already mounted devices)
Restart Samba
sudo service smbd restart
Put a DVD/CD into the drive and check the share:
in MAC
Finder > Go > Connect to Server...
type: smb://MyPC and press enter
Select Guest as user name
in Windows
Open the File Explorer
type \\MyPC and press enter
Windows - W10 delete Grub settings
Scenario: You have installed W10 beside Linux (Ubuntu or Ubuntu based) but after this job, Grub disappear and you are not longer able to select the S.O. at the boot.
- Start with W10
- Open a DOS prompt with administrator privilege
- execute this command:
- bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi
- Restart your computer with a live Ubuntu distribution
- Open a terminal (Ctrl Alt T)
- Regenerate Grub with this command:
- sudo update-grub
Linux - analize space used by installed packages
With this command you can get a list of installed packages, order by size:
- dpkg-query --show --showformat='${Package;-50}\t${Installed-Size}\n' | sort -k 2 -n | grep -v deinstall | awk '{printf "%.3f MB \t %s\n", $2/(1024), $1}'
Linux - get rid of all NVIDIA drivers from pc
You can see which NVIDIA packages are installed on your pc, typing
It's not always recommended but you can use this command to remove it all in one shot:
- dpkg -l | grep -i nvidia
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.
Now, if you check the autosuspend value with
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
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
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
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
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
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
- 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.
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
VirtualBox - compact or enlarge the VDI
Requisite: Windows 7 virtualized on Linux machine
To compact a VDI:
Windows side:Download here the SDelete command. You need it because the normal deletion process removes only the index of the file deleted but doesn't zeroes the space occuped.
Uncompress the archive and extract sdelete.exe
From a Command Prompt: "SDelete -z c:"
(This will take a long time)
Linux side:
From a terminal (Ctrl-Alt-T)
cd [path_of_vdi]
/usr/bin/VBoxManage modifyvdi [disk_name.vdi] --compact
(This will take a long time too)
To enlarge a VDI:
Linux side:cd [path_of_vdi]
VBoxManage modifyhd [disk_name.vdi] --resize [size_in_MB]
(example: for 40 GB, 40960 MB)
Clementine - error: "GStreamer encountered a general stream error"
Symptom
On Linux, Clementine refuses to play any songs, giving the error in the title.Problem
Misconfiguration issue.
My solution
First attempt:
delete ~/.config/Clementine/Clementine.conf
Second attempt:
delete the whole directory ~/.config/Clementine
In both solutions, you have to reconfigure Clementine when restarted, and with the second solution, Clementine has to rebuild the DB.
Windows 7 - doesn't print via Samba
Symptom
Windows 7 refuse to print to a Samba shared printer, connected via Linux computerProblem
Windows didn't trust the print server's self-signed SSL certificate.
My solution
- Use Firefox to navigate to https://[servername]:631
- It refuses. Trust the connection
- Now Firefox can open the CUPS Admin webpage, so the SSL exception is working
- Make note of the name of the printer to be installed
- Go to Start Menu/Devices and printers
- Click "Add a printer" / "add a network, wireless, or Bluetooth printer"
- Click "The printer that I want isn't listed
- Click the RadioButton next to "Select a shared printer by name"
- Enter, in the text box, http://[serverName or lan address]:631/printers/[printer name] (printer name must be the exact name listed on the CUPS admin webpage)
- Click next, and the printer should be ready to print
Subscribe to:
Posts (Atom)