Tag Archives: linux

Using rsync to copy a big file

rsync -avS --progress -h fromPath/fileToCopy destPath/
Code language: Bash (bash)

How can I use an old Ubuntu distribution with repositories?

The repositories for older releases that are not supported (like 11.04, 11.10 and 13.04) get moved to an archive server. There are repositories available at http://old-releases.ubuntu.com.
The reason for this is that it is now out of support and no longer receiving updates and security patches.
I would urge you to consider a supported distribution. If your computer is too old in terms of memory or processor then you should consider a distribution such as Lubuntu or Xubuntu.

If you want to continue using an outdated release then edit /etc/apt/sources.list and change archive.ubuntu.com and security.ubuntu.com to old-releases.ubuntu.com.
You can do this with sed: sudo sed -i -re ‘s/([a-z]{2}.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g’ /etc/apt/sources.list
sudo apt-get update # && sudo apt-get dist-upgrade

Setup iscsi

Init asd setup
sudo apt-get install open-iscsi
iscsiadm –mode discovery -t sendtargets –portal 192.168.1.x
iscsiadm –mode node –targetname iqn_identifier –portal 192.168.1.x –login
Should be mounted, see where with fdisk -l
mkdir /media/open-e
add this to /etc/fstab.
/dev/sdb2 /media/open-e ext4 _netdev,rw 0 0

First choice: disable an iSCSI target:
iscsiadm –m node -T iqn_identifier –portal 192.168.1.x:3260 -u

Second choice: delete the target’s record ID
iscsiadm -m node -o delete -T iqn.identifier –portal 192.168.1.x:3260

*** Ubuntu 20.04 setup howto ***
apt-get install tgt -y
systemctl status tgt

nano /etc/tgt/conf.d/iscsi.conf
backing-store /dev/sdf1 initiator-address 192.168.1.x incominguser iscsi-user password outgoinguser iscsi-target secretpass

The first line defines the name of the LUN. The second line defines the location and name of the storage device on the iSCSI Target server. The third line defines the IP address of the iSCSI initiator. The fourth line defines the incoming username/password. The fifth line defines the username/password that the target will provide to the initiator to allow for mutual CHAP authentication to take place.

Next, restart the iSCSI service to apply the changes:
systemctl restart tgt
tgtadm –mode target –op show

Install and Configure iSCSI Initiator
apt-get install open-iscsi -y
iscsiadm -m discovery -t st -p 192.168.1.x

define the name of the LUN device in initiatorname.iscsi file:
nano /etc/iscsi/initiatorname.iscsi
Add your iSCSI Target LUN name as shown below:

Next, you will need to define the CHAP information that you have configured on iSCSI target to access the iSCSI target from the iSCSI initiator. The node configuration file will exist in the directory ‘/etc/iscsi/nodes/‘ and will have a directory per LUN available.

You can define it by editing the following file:
nano /etc/iscsi/nodes/iqn.identifier/192.168.1.x\,3260\,1/default
Add / Modify the following lines:
node.session.auth.authmethod = CHAP
node.session.auth.username = iscsi-user
node.session.auth.password = password
node.session.auth.username_in = iscsi-target
node.session.auth.password_in = secretpass
node.startup = automatic

restart the iSCSI initiator service
systemctl status open-iscsi

verify the iSCSI connection
iscsiadm -m session -o show

login to the target iscsiadm --mode node --targetname iqn.2016-11:dss1.target0 --portal 192.168.1.x --login Then mount it (in my case it is /dev/sdf1)
Code language: JavaScript (javascript)

3DConnexion mouse problem, how to solve it



libinput list-devices
man 5 xorg.conf


cat /usr/lib/systemd/system/spacenavd.service

As root:
xhost +
systemctl restart spacenavd


# example file copy this to /etc/spnavrc

loginctl show-session 2 -p Type

# if changing some config files…
systemctl daemon-reload

# if using HAL
# create file /etc/hal/fdi/policy/spacenav.fdi

*** none of the above seams to work ***

Disables it Globally: disable it as pointer using libinput config file
# /usr/share/X11/xorg.conf.d/40-libinput.conf
Section “InputClass”
Identifier “3Dconnexion SpacePilot PRO “
MatchIsPointer “on”
MatchDevicePath “/dev/input/event26”
Driver “libinput”
Option “Ignore” “on”

SOLUTION: disable it as a mouse
xinput set-prop “3Dconnexion SpacePilot PRO ” “Device Enabled” 0
or this, not shure if this disable everything and not just as a pointer?
xinput disable [touchscreen id/name]

Add a script that runs everytime a input device is plugged inn
gsettings set org.gnome.settings-daemon.peripherals.input-devices hotplug-command ‘$HOME/bin/script.sh’

spacenavd does not use it as mouse.
x11 or gnome is using it as mouse pointer

It’s reported as:
idVendor=046d, idProduct=c629, bcdDevice= 4.11

installing the 3DxWare
download from https://3dconnexion.com/us/drivers-application/3dxware-10/
cp 3dxware-linux-v1-8-0.x86_64.tar.gz 3dxware-linux-v1-8-0.x86_64
cd 3dxware-linux-v1-8-0.x86_64

Fix the user bug with this C code

int main(int argc, char ** argv) {
if (argc != 2) {
fprintf(stderr, “Need a name to put in the structure\n”);
struct utmpx u;
memset(&u, 0, sizeof(u));
u.ut_type = USER_PROCESS;
u.ut_pid = getpid();
strcpy(u.ut_id, “:0”);
strcpy(u.ut_line, “:0”);
strcpy(u.ut_user, argv[1]);

compile and start it with your username as the argument.
then run install-3dxunix.sh
And it should be installed.
install the required font
apt install xfonts-75dpi
apt isntall xfonts-100dpi
fc-cache -f -v
(xhost +)
test it by running /etc/3DxWare/daemon/3dxsrv -d usb

Then start it:
open terminal, sudo root
xhost +
fixbuguser root # the C source code above
/etc/3DxWare/daemon/3dxsrv -d usb -debug

*** Works now under FreeCad and Blender ***
Download and compile the newest spacenavd from
then start freecad and push a button on 3dconnexion for the button config under tools->preferences to be un-grayed