Useful linux commands
To clone a hard disk, use the dd command with the following syntax in a command line:
sudo dd if=/dev/sdb of=/dev/sdc bs=4096 conv=notrunc,noerror,sync
where if is input, source and of is output, target. This command should be issued to hard drives that are not in use. For example, use a live PEN from which a terminal can be used.
To share a folder in linux the most versatile way is using samba. Therefor please install the samba packages using
apt-get install command.
Install the samba server:
sudo apt-get install samba
Install the samba client:
sudo apt-get install smbclient
After installing samba, edit the file named
smb.conf generally located in
The following changes are to add a folder that is shared without security and can be read/write by everyone.
Search for the work "security". If the security setting is preceded with the symbol #, remove it and change your file so that it contains the following 2 extra lines:
security = user
map to guest = bad user
guest account = your_user_name
where your_user_name should be equal to a existing user name of the machine running samba. This means that all the changes made on the folder remotely will be assigned to the user name indicated on this setting.
Add the folder to be shared. In the example below I am sharing a folder named "work" that will also appear on the network as "work". The setting with  is the network name. The following lines can be added anywhere on the file, but normally are added on the bottom of the file.
path = /home/my_machine/work
available = yes
browsable = yes
public = yes
writable = yes
Save and restart samba:
or, if you are using systemd
/usr/sbin/service smbd restart
Tool table limit (257 instead of 56)
By default the tool limit of linuxcnc is 56 tools. This is normally to low (after all we are not working with a >10 year controller). To solve this two changes must be made in the source code as described below:
The file linuxcnc.nml is located at:
Two changes should be made:
Replace the value 16384 of line number 10:
B emcStatus SHMEM localhost 16384 0 0 2 16 1002 TCP=5005 xdr
B emcStatus SHMEM localhost 33792 0 0 2 16 1002 TCP=5005 xdr
and replace the value 8192 of line number 15:
B toolSts SHMEM localhost 8192 0 0 5 16 1005 TCP=5005 xdr
B toolSts SHMEM localhost 33792 0 0 5 16 1005 TCP=5005 xdr
The file emctool.h is located at:
One change should be made:
Replace the value 56 of line number 23:
define CANON_POCKETS_MAX 56
define CANON_POCKETS_MAX 257
Compile and have fun with more tools!