Win10 and Samba Netshares Visibility…Again

Mint is not seeing the shares on a recently updated Win 10 PC and vice versa by clicking Network on either Linux or Win10.

check SMB1 turned on in W10 – search "Turn On..", untick CIFS Removal

This turns on CIFS V1 after reboot

PS C:\Windows\system32> Get-SmbServerConfiguration | Select EnableSMB1Protocol


PS C:\Windows\system32> Get-SmbServerConfiguration | Select EnableSMB2Protocol


Get-WindowsOptionalFeature –Online –FeatureName SMB1Protocol

FeatureName      : SMB1Protocol
DisplayName      : SMB 1.0/CIFS File Sharing Support
Description      : Support for the SMB 1.0/CIFS file sharing protocol, and the Computer Browser protocol.
RestartRequired  : Possible
State            : Enabled
CustomProperties :
ServerComponent\Description : Support for the SMB 1.0/CIFS file sharing protocol, and the Computer
Browser protocol.
ServerComponent\DisplayName : SMB 1.0/CIFS File Sharing Support
ServerComponent\Id : 487
ServerComponent\Type : Feature
ServerComponent\UniqueName : FS-SMB1
ServerComponent\Deploys\Update\Name : SMB1Protocol

PS C:\Windows\system32> Set-SmbServerConfiguration -EnableSMB1Protocol $true

Are you sure you want to perform this action?
Performing operation 'Modify' on Target 'SMB Server Configuration'.

PS C:\Windows\system32> Get-Item HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters | ForEach-Object {Get-ItemProperty $_.pspath}

EnableAuthenticateUserSharing : 0
NullSessionPipes : {}
ServiceDll : C:\Windows\system32\srvsvc.dll
ServiceDllUnloadOnStop : 1
autodisconnect : 15
enableforcedlogoff : 1
enablesecuritysignature : 0
requiresecuritysignature : 0
restrictnullsessaccess : 1
SMB1 : 1
Guid : {155, 14, 196, 255…}
SMB2 : 0
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Service
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Service
PSChildName : Parameters
PSProvider : Microsoft.PowerShell.Core\Registry

Set-SmbServerConfiguration -EnableAuthenticateUserSharing $true

Are you sure you want to perform this action?
Performing operation 'Modify' on Target 'SMB Server Configuration'.
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): A

PS C:\Windows\system32> Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB1 -Type DWORD -Value 1 -Force

It is then possible to CIFS mount the Win10 drive using:

stevee@6530b ~ $ smbclient -L \\
WARNING: The "syslog" option is deprecated
Enter stevee's password:
Domain=[PRO6550B] OS=[Windows 10 Pro 18363] Server=[Windows 10 Pro 6.3]

Sharename Type Comment
——— —- ——-
ADMIN$ Disk Remote Admin
C$ Disk Default share
D Disk
D$ Disk Default share
Users Disk
Connection to failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)
NetBIOS over TCP disabled — no workgroup available

sudo mount -t cifs // Public/ -o user=stevee

Password for stevee@// ****

I still can't see the Win10 shares in Network on Mint though…

It is also possible to add the Share by entering the IP address of the Mint PC in Network or a browser:

Best practices

  • It is advisable to set Microsoft network client: Send unencrypted password to connect to third-party SMB servers to Disabled.


Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options

Check Services Required are running (maybe set to delayed start) on W10:

SSDP Discovery

UPnP Device Host

Function Discovery Provider Host

Function Discovery Resource Publication

AS usual n Windows, there is conflict between one app and another's info: PC says WORKGROUP in Basic Info:

but MSHOME.NET in Powershell:

PS C:\Users\stevee> Get-DnsClientCache

Entry RecordName Record Status Section TimeTo Data Data
Type Live Length
—– ———- —— —— ——- —— —— —-… PTR Success Answer 603061 8… PTR Success Answer 603061 8 AAAA NoRecords A Success Answer 603061 4 AAAA NoRecords A Success Answer 603061 4


Manipulating PDFs using PDFTK and PDF-Shuffler

A recent real example I needed was stripping a house sale fixtures and fittings form section from a solicitors bulk PDF. The required pages were from doc CCL \… etc. and pages required from p45-52, so, installing then scrolling to bottom of the man page for an example:

sudo apt-get install pdftk

CD into the doc's folder then:

pdftk CCL\ SALE\ PACK.pdf cat 45-52 output fixfittings.pdf 

Now I have just the 8 pages I require in a new PDF:

You can explore PDF related Apps from the menu bar, Admin, then Software Mgr and search "PDF":

PDF-Shuffler is more basic; you can select the pages then export/delete/rotate etc. with a RClick:


GParted MBR Weirdness – New fdisk MSDOS Partition Needed on Some Hard Disks

Just documenting the behaviour of Gparted that I have seen many times, with no logical explanation, for a new MBR not being written correctly(?) or not overwriting a prior GRUB MBR correctly (?) so not leading to correct booting, with some hard drives but not others.

Normally you write a new partition table for a Windows install (especially if you had linux on the disk) if you want to copy install files from a Win.iso to then boot and install, from the Device menu of Gparted.

Sometimes this fails to work as the Win install files are not booted into so hangs, and I found that using command line fdisk to create a new empty DOS partition first, then using Gparted again for recreating and formatting a say, 10GB Recovery partition for the install files, setting the boot flag, then rebooting solves the issue.


sudo fdisk /dev/sda

Seen after Win install, but showing the 10GB REC partition:

See the original Post here:

Re-install Win 7 With No DVD and Replace Laptop Auto Recovery Partition


Rescue Your System from an MBR corruption? grub rescue>

At the failed grub boot prompt you can assume the the non booting drive is /dev/sda1 to start and see if the insmod files are found: 

set prefix=(hdX,Y)/boot/grub

Or use the values determined by attaching the drive to a working linux install to find the partition order:

sudo fdisk -l
Disk /dev/sda: 119.2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x64a1f25a

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 231241727 231239680 110.3G 83 Linux
/dev/sda2 231241728 250068991 18827264 9G 5 Extended
/dev/sda5 231243776 250068991 18825216 9G 82 Linux swap / Solaris


sudo blkid
[sudo] password for stevee:
/dev/sda1: UUID="1d9ac196-b1df-4dd0-994d-b9c9b1e8f23f" TYPE="ext4" PARTUUID="64a1f25a-01"
/dev/sda5: UUID="82fc41dd-56d4-41e4-99a8-85338bbdf01b" TYPE="swap" PARTUUID="64a1f25a-05"
/dev/sdb1: UUID="f92a3d3c-adf4-48e0-8964-83f2b52e251c" TYPE="ext4" PARTUUID="b060933f-01"
/dev/sdb5: UUID="e1a2c04b-3517-47aa-9636-3d713b864cdd" TYPE="swap" PARTUUID="b060933f-05"

Back in the failed grub menu, type:

Example: If the Ubuntu system is on sda1, enter: set prefix=(hd0,1)/boot/grub

set root=(hdX,Y)

Confirm the correct X,Y values and press ENTER.

Example: If the Ubuntu system is on sda5, enter: set root=(hd0,5)

insmod normal

Load the normal module.

If the module loads there will be no message.

If the module fails to load, try the full path: insmod (hdX,Y)/boot/grub/normal.mod


Transition to the normal GRUB 2 mode with increased functionality.

If the module loads there will be no message, and may go to the next stage boot menu as normal.

If not, but the module loads, HELP, TAB completion and command recall using the UP/DN keys should be available. Check current settings:


(Optional) Review the current settings.

insmod linux

Load the linux module. An error message usually means the path is incorrect.

linux /vmlinuz root=/dev/sdXY ro

Selects the latest kernel.

Example: linux /vmlinuz root=/dev/sda5 ro

If the vmlinuz symlink does not exist in /, use the full path to the kernel in /boot

Example: linux /boot/vmlinuz-3.2.0-14-generic root=/dev/sda1 ro

initrd /initrd.img

Selects the latest initrd image.

If the initrd symlink does not exist in /, use the full path to the initrd image in /boot

If successful, after ENTER there will be a slight delay and no messages.


Boot to the latest kernel on the selected partition.

In the worst case, you may need to re-install grub via a working system, say a bootable USB drive then find the drive with the broken grub menu (say /dev/sda) and:

sudo grub-install.real /dev/sda


sudo update-grub2

This will allow the USB pen drive to boot the broken drive from the USB pen grub menu. When back in the prior broken system if it boots OK, remove the USB pen drive and re-run:

sudo update-grub2

You should now be able to reboot into this drive as the only drive on a system.

Quickest Cloning of Working Mint System

The only command I know of that clones an active system drive is DD, but it is very slow at about 30GB / hr, system specs can do this unlike rsync or cp -vr because it doesn't get stopped by it's own process in /proc or /sys.

The fastest way I have found to get another clone of your perfectly setup system is by fresh installing a new system on a new drive from USB install image (10 mins), then using rsync as below to update the missing files from your system drive to the clone. This means MYSQL DB's, updates, home dirs etc. can be transferred as rsync's default is to copy newer files over old ones and as most of your working system's files don't yet exist on the new install, they get transferred also.

After you have fresh installed from USB image to the clone drive, do the full updates to your working system so your files are definitely newer or the same versions as the new drive install (don't update the new install!!), or use an older installed version from your spare backup drives and mount that on the working system you want to clone. 

All files from the fully working system drive will transfer to the clone-to-be using rsync except those in bold (assuming your spare drive is mounted at /media/home/user, so it doesn't loop copy /media/home/user files over and over until full!).

The excluded are in bold, and {-n=dry-run} ALWAYS!:

sudo rsync /* /media/stevee/1586c82b-01d5-46cb-822d-81dbe57c5951/ –exclude={dev,media,proc,run,sys,tmp} -vahn

Note! the UUID number of the system drive will be copied to GRUB /boot/grub/grub.cfg file and /etc/fstab.

Change them before you boot the new drive as it will now have the UUID value of the cloned drive!

sudo blkid

/dev/sdb1: UUID="1341613a-6c85-4b03-837e-d0636ecf6adb" TYPE="ext4" PARTUUID="f4b5a292-01"

It's EASY to edit grub's files in vim:

Replace all cloned drive UUIDs in /the new drive's /etc/fstab and /boot/grub/grub.cfg with the new drive's UUID:

sudo vi /media/stevee/de1ea326-7478-4297-8bce-79cb77d682c9/boot/grub/grub.cfg

In vim, press : then add at the :


g for global means substitute every occurrence of "oldstring" on every line.

sudo vi /media/stevee/de1ea326-7478-4297-8bce-79cb77d682c9/etc/fstab

OR you can edit the GRUB boot menu of the new drive by BIOS booting to it then pressing E at the GRUB menu and removing all references to UUIDs and replace with root=/dev/sdb1 format and change the relevant (hd0,1) formats to the correct partition values and boot with F10 ensuring to sudo update-grub2 once the new drive has booted correctly.

IF you did not set the GRUB install on a multi drive system to the correct install drive, and it defaulted to /dev/sda, then you can install GRUB on any drive with:

sudo grub-install.real /dev/sdb

Cool Command #11 – cat /etc/*release; env

stevee@QuadMint ~ $ cat /etc/*release

DISTRIB_DESCRIPTION="Linux Mint 18.2 Sonya"
NAME="Linux Mint"
VERSION="18.2 (Sonya)"
PRETTY_NAME="Linux Mint 18.2"
cat: /etc/upstream-release: Is a directory

$ env
LESSOPEN=| /usr/bin/lesspipe %s
LESSCLOSE=/usr/bin/lesspipe %s %s

My Rsync Local WordPress Backup Examples

Make sure drives are MOUNTED first!

rm -vr –i=no /home/stevee/.cache/google-chrome/Default/Cache/*

mysqldump -u root -p wp > /var/www/quadwp.sql
mysqldump -u root -p DebianAdmin > /var/www/quadDA.sql

Always dry-run with -n first! Check the copy does what it should!!

sudo rsync /var/www/*  /media/stevee/87b55176-f602-48db-ac1c-4fe0101b1a79/www/ -vahn

sudo rsync /* /media/stevee/51800665-dd6d-4c80-adf4-cf8c0061d0be/ –delete-excluded –exclude={dev,media,proc,sys,home/stevee/.*} -vahn

rsync /var/www/* /1500/www/ –delete-excluded -vahn

sudo rsync /var/www/* /media/stevee/WinData/www/ –delete-excluded -vahn

New Mint Install? Want WordPress at Home? Full Steps I Take… 


I PERSONALLY DO ALL THIS POST steps, more or less in order, for a new Mint install, BEFORE MINT UPDATES or Backing up other files to this new install, so I can continue working during install while the first step sudo apt installs in blue are downloading first (lots!), to have all the functions I require.

All the steps below also enable a full install of your WPress DB at home if you do a full backup from your site that contains the content directories and the database. If you don't want to get involved in the DB side, you "could" always install WP from scratch in Mint, then import your Exported backup xml files (Posts, Pages etc.) using WPs import function and rebuild the site with a different theme for example…more time consuming.

sudo apt-get install ssh nmap vim automake autoconf module-assistant x11vnc nbtscan locate libnss-winbind winbind g++ libcurl3 gparted testdisk hardinfo k3b intel-microcode amd64-microcode sensors-applet totem vlc chromium-browser mysql-server wordpress apache2 libapache2-mod-php php-mbstring vsftpd php-curl php php-mysql

sudo passwd root

sudo smbpasswd -a stevee

vi /etc/samba/smb.conf
path = /media/
writeable = 1
browseable = 1

sudo mkdir /Share
sudo chown stevee.stevee /Share -R

WIFI stuff: modprobe -r iwl3945 iwl4965
modprobe iwl3945 ; modprobe iwl4965

sudo vi /etc/default/grub

GRUB_DISTRIBUTOR=lsb_release -i -s 2> /dev/null || echo Debian

sudo update-grub2

sudo vi /etc/nsswitch.conf
hosts: files wins mdns4_minimal [NOTFOUND=return] dns

sudo vi /etc/apache2/sites-enabled/000-default.conf

DocumentRoot /var/www
Alias "/DebianAdmin" "/var/www/DebianAdmin"

sudo vi /etc/apache2/apache2.conf

ServerName quad
<Directory /var/www>
Options FollowSymLinks
AllowOverride All
Require all granted

sudo service apache2 restart

Assume all wp files are unpacked into /var/www/ (or in a Backup):

Set all dirs/files to replace correct perms from 777 or other wrong install perms:

sudo cp -vr Backup/www    /var/
sudo chown stevee.www-data -R /var/www

sudo find /var/www/ -type d -exec chmod 755 -R {} \;

sudo find /var/www/ -type f -exec chmod 644 {} \;

/var/www/Search-Replace-DB-master $ ./srdb.cli.php -h localhost -n DebianAdmin -u root -p pass -s -r quad

or before DB import – g is global for every occurrence on every line:

sed -i 's/oldURL/newURL/g' quadDA.sql 

Import DB
cp -v Backup/www/*sql /var/www/
ls -l /var/www
mysql -u root -p
show databases ;
create database wp ;
create database DebianAdmin ;
use DebianAdmin ;
source /var/www/quadDA.sql ;
use wp ;
source /var/www/quadwp.sql ;

sudo service mysql restart

Export DB
sudo mysqldump -u root -p DebianAdmin > /var/www/quadDA.sql

sudo apt install vsftpd

sudo vi /etc/vsftpd.conf

# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd with two configuration files.
# Make sure, that one of the listen options is commented !!

# Uncomment this to allow local users to log in.

# Uncomment this to indicate that vsftpd use a utf8 filesystem.

sudo service vsftpd restart

for; Call to undefined function mb_regex_encoding()

sudo apt install php-mbstring

stevee@quad ~ $ nmap

Starting Nmap 7.01 ( ) at 2018-01-31 01:47 GMT
Nmap scan report for
Host is up (0.00015s latency).
Not shown: 995 closed ports
21/tcp open ftp

Config your router for ports 21 NAT to your PC IP addr/name so WP can get in/out for plugins, updates etc.:

Index No. 8
Service Name
Public Port 21
Private IP 192.168.1.x?
Private Port xxx

For Optimus:

sudo apt install php-curl

sudo service apache2 restart

Is php installed??

stevee@QuadMint ~ $ which php

sudo apt install php php-mysql

Importing Posts over WP limit – again, search for these lines in vim/nano pressing ":/" then paste the line to search for…press N for next for duplicate strings. e.g.

post_max_size (Rtn)

sudo vi /etc/php/7.0/apache2/php.ini

; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
post_max_size = 0

; Maximum allowed size for uploaded files.
upload_max_filesize = 20M

sudo service apache2 restart

stevee@quad ~ $ sudo vi /var/www/DebianAdmin/.htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /DebianAdmin/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /DebianAdmin/index.php [L]

# END WordPress

for Permalink postname failure:

sudo a2enmod rewrite

sudo service apache2 restart