Tuesday, July 16, 2019

message filter backup in Thunderbird


since the addon has died, the file with the file needs to be restored when the Thunderbird program is stopped.  Kill all instances, then use the following to deal with it

http://kb.mozillazine.org/Filters_%28Thunderbird%29#Export.2FImport

Export/Import

The message filters for each account are stored in a "msgFilterRules.dat" file in the accounts "local directory". The local directory is specified near the bottom of each accounts server settings by the browse button. You could copy that file over the corresponding file in another account. You could also copy and paste filters from one file to another using a text editor. Its a ASCII text file whose format is not hard to figure out.
There is a Message Filter Import/Export but several comments on that add-ons web page claim it doesn't work anymore.

--30--

Sunday, July 7, 2019

qemu and kvm server install



https://www.cyberciti.biz/faq/install-kvm-server-debian-linux-9-headless-server/

Step 1: Install kvm

Type the following apt-get command/apt command:
$ sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils libguestfs-tools genisoimage virtinst libosinfo-bin
If you want normal/regular user can manage virtual machines. Add user vivek to libvirt and libvirt-qemu using usermod command:
$ sudo adduser vivek libvirt
$ sudo adduser vivek libvirt-qemu

Reload group membership with the help of newgrp command:
$ newgrp libvirt
$ newgrp libvirt-qemu

Verify your group membership with id command:
$ id
Please note that you need to use the following command to connect to KVM server:
$ virsh --connect qemu:///system
$ virsh --connect qemu:///system command
$ virsh --connect qemu:///system list --all


Step 3: Configure bridged networking on Debian

I am going to create bridge Interface br0 as the network connection in VM guests configuration for eth0 interface:
$ sudo vi /etc/network/interfaces.d/br0
Append the following:
## make sure all config related to eth0 deleted ##
auto br0
iface br0 inet static
 address 192.168.2.23        ## set up/netmask/broadcast/gateway as per your setup
 broadcast 192.168.2.255
 netmask 255.255.255.0
 gateway 192.168.2.254
 bridge_ports eth0    # replace eth0 with your actual interface name
 bridge_stp off       # disable Spanning Tree Protocol
        bridge_waitport 0    # no delay before a port becomes available
        bridge_fd 0          # no forwarding delay

Restart the networking service on Linux:
$ sudo systemctl restart network-manager
To see current networking setting for KVM, run:
$ sudo virsh net-list --all


You need to configure a KVM guest domain on a bridged network. So create a file named bridge.xml as follows a text editor such as NA command:
$ sudo vi /root/bridged.xml
Append the following config:
<network>
  <name>br0</name>
  <forward mode="bridge"/>
  <bridge name="br0"/>
</network>
Save and close the file in vi/vim.
$ sudo virsh net-define --file /root/bridged.xml
$ sudo virsh net-autostart br0
$ sudo virsh net-start br0


Create CentOS 7 VM

In this example, I’m creating CentOS 7.x VM with 2GB RAM, 2 CPU core, 1 nic and 40GB disk space, enter:
$ sudo virt-install \
--virt-type=kvm \
--name centos7 \
--ram 2048 \
--vcpus=2 \
--os-variant=rhel7 \
--virt-type=kvm \
--hvm \
--cdrom=/var/lib/libvirt/boot/CentOS-7-x86_64-DVD-1708.iso \
--network=bridge=br0,model=virtio \
--graphics vnc \
--disk path=/var/lib/libvirt/images/centos7.qcow2,size=40,bus=virtio,format=qcow2

To configure vnc login from another terminal over ssh and type:
$ sudo virsh dumpxml centos7 | grep vnc
<graphics type='vnc' port='5901' autoport='yes' listen='127.0.0.1'>

You can also use the following command:
$ sudo virsh vncdisplay centos7
Please note down the port value (i.e. 5901). You need to use an SSH client to setup tunnel and a VNC client to access the remote vnc server. Type the following SSH port forwarding command from your client/desktop:
$ ssh vivek@server1.cyberciti.biz -L 5901:127.0.0.1:5901
Once you have ssh tunnel established, you can point your VNC client at your own 127.0.0.1 (localhost) address and port 5901 as follows:

Step 5 – Use virt-builder to create VM

Above method (virt-install) works nicely but if you need quickly building new virtual machines, try virt-builder.

How to list the virtual machines available

$ virt-builder --list | more
You can use the grep command to filter out only x86_64 arch based VMs:
$ virt-builder --list | grep x86_64

Create Debian 9.x VM

Create Debian 9 VM with 10GB disk space, 2GB ram, 2 vCPU and random password for root account, run:
$ sudo virt-builder debian-9 \
--size=10G \
--format qcow2 -o /var/lib/libvirt/images/debian9-vm1.qcow2 \
--hostname debain9-vm1 \
--network \
--timezone Asia/Kolkata


Finally import image with virt-install command:
$ sudo virt-install --import --name debian9-vm1 \
--ram 2048 \
--vcpu 2 \
--disk path=/var/lib/libvirt/images/debian9-vm1.qcow2,format=qcow2 \
--os-variant debian9 \
--network=bridge=br0,model=virtio \
--noautoconsole


You can login to your VM using x0E4iZ8sHjA6ekb6 password for root account:
$ sudo virsh list --all
$ virsh console debian9-vm1

  





--30--

Running PDP10/KLH10 on Raspberry Pi



copied from Keith Halewood's facebook note 7/7/2019

https://www.facebook.com/notes/dec-computer-users/running-pdp10klh10-on-raspberry-pi/394084557900778/


This is a bit of a work in progress so beware the rough edges.
The PDP-10 (KLH10) distribution from github seems to have been modified to make it more general purpose so the various bits of documentation on the net seem to be a little out of date or confusing, so here’s how I got it to work so that I could install the Panda distribution of TOPS-20 onto it, along with DECnet (connection to HECnet) and TCP-IP. LAT too, was a bit of a surprise.
Firstly, the raspberry Pi. I’m running the minimal ‘buster’ version with a WIRED network. I have also used ‘apt-get install’ to install the following:

screen
bridge-utils
uml-utilities
autogen
autoconf
build-essential (if on minimalist install, such as debian, for example)
 
The Pi’s networking configuration has a fixed IP address so I’ve switched off the standard dhcp client and I rely entirely on the content of /etc/network/interfaces. For me, the contents look roughly like:

auto lo br0 tap1 tap2 tap3
iface lo inet loopback
iface eth0 inet manual
iface tap1 inet manual
pre-up ip tuntap add tap1 mode tap user simh
iface tap2 inet manual
pre-up ip tuntap add tap2 mode tap user simh
iface tap3 inet manual
pre-up ip tuntap add tap3 mode tap user simh
iface br0 inet static
bridge_ports eth0 tap1 tap2 tap3
bridge_fd 0
address 192.168.x.y
netmask 255.255.255.0
gateway 192.168.x.a

where x.y and x.a are the host addresses of your pi and default gateway. ‘simh’ is the userId of the non-privileged user under which you run your simulations. What has been set up here is a bridge device linking the real ethernet device eth0 and pseudo devices tap1, tap2, tap3 - usable by SIMH and by the PDP10 emulator.
Download and unzip the KLH10 emulator:
$ curl -L https://github.com/PDP-10/klh10/archive/master.zip > klh10-master.zip
$ unzip -o klh10-master.zip
Go into the ./klh10-master directory and edit the configure file. Find the CFLAGS setting and change the -O3 into -O2
Go back up a directory level.
Create another directory, say klh10-build and go into it and:
$ ../klh10-master/autogen.sh
Assuming you’ve installed autogen, autoconf etc., you should see a few files and directories magically appear in your current directory (klh10-build).
Type:
$ make
and watch it building the kl, ks and ks-its models in the appropriate subdirectories. You should see the compiler compiling with -O2. This is important. The -O3 optimisation seems to mess up something critical in the simulators.
Go into the bld-kl directory and you’ll see some executables like:
dpni20, dprpxx, dptm03, enaddr, kn10-kl, udlconv, uexbconv, vdkfmt, wfconv, wxtest.
Copy these to a location where you’ll be running the simulator with a configuration file and disc image file(s).
kn10-kl is the simulator executable. When running a simulation, it’ll fire up instances of dprpxx and dpni20. The dpni20 executable will need to be setuid root, ie:
# chown root:root dpni20
# chmod u+s dpni20
It’s annoying because the whole point about ‘tap’ network interfaces defined above is that a non-privileged user, ie. simh as defined above, should be able to exert full control over its side of the device.
WORK IN PROGRESS
Panda distribution of TOPS-20 , installation and configuration - see
 http://www.ldx.ca/notes/tops-20-notes.html

Talk about the workaround for the network connection and the fact it doesn’t use the tap device you want it to.... etc...
NCP might take a while to start... or not.
Using screen to let you detach the pdp10’s console...
Connections via TCP/IP, DECnet. LAT appears to work much better than DECnet’s CTERM.

--30--

Thursday, July 4, 2019

Imagemagick and command line "convert" to create pdf files



 https://itsfoss.com/convert-multiple-images-pdf-ubuntu-1304/

Command Line:

sudo apt-get install imagemagick
 
convert image1.jpg image2.png image3.bmp output.pdf
 
  
Convert tool, with gui support:

gscan2pdf


--30--

Friday, June 14, 2019

NFS file mounting and sharing notes




show remote shares on a system:

showmount -e <nas host name or ip>

Install NFS on Ubuntu (client and server)

https://vitux.com/install-nfs-server-and-client-on-ubuntu/

--30--

Thursday, June 6, 2019

mount sd card image on linux (dd)


Drivers in linux kernel when media is inserted create /dev entries for supported media organizations such as with sd creating /dev/sda1, etc. as well as the media dev entry /dev/sda.

With images, the loop mount has no support to break up the image into partitions, and require using the loop mount capability to find a supported file system by using offsets into the image.

These offsets are in byte counts, so knowledge of the blocksize of the original media is needed to calculate these offsets.

Also it was noted that some file systems don't support protections in the way linux does with access control in the file system, but just on the overall media.  Microsoft fat is the main culprit in that regard.  An option can be used to set the mounted media point properly for read access only or read/write.

https://askubuntu.com/questions/445979/how-to-mount-sd-card-image-created-with-dd

Mount with offset to partition

To avoid the need to create separate images for each partition or installing a utility like kpartx, you can mount each partition individually by specifying an offset in the mount command.
First examine the partitions in the image file and determine the offset by using fdisk:
$ fdisk -u -l rpi_image280914 

Disk rpi_image280914: 16.0 GB, 16012804096 bytes
255 heads, 63 sectors/track, 1946 cylinders, total 31275008 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
Disk identifier: 0x000cdac7

           Device Boot      Start         End      Blocks   Id  System
rpi_image280914p1   *        2048      514047      256000    c  W95 FAT32 (LBA)
rpi_image280914p2          540672    31242239    15350784   83  Linux
Take the Start sector of the partition you want and multiply that value by the Units size. So if you want the second partition you'll get 540672 * 512 = 276824064.
Now create a folder and mount the partition:
mkdir rpi_partition2
sudo mount -o loop,offset=276824064 rpi_image280914 rpi_partition2/
Once you are done doing what you want with the partition data:
sudo umount rpi_partition2/
rm -r rpi_partition2/

https://www.daniweb.com/hardware-and-software/linux-and-unix/threads/22358/mounting-a-fat32-drive-in-linux

permissions for vfat.

2. Windows doesn't support UNIX-style permissions, and you can only apply permissions to the entire filesystem, not to individual Windows files/folders. This is done with the "umask" option of the mount command. In /etc/fstab, change the mount entry for your Windows partition to this:
/dev/hda6 /mnt/fat vfat users,defaults,umask=000 0 0
(the "users" option allows anyone to mount/unmount the drive and overrides the default , which is that only root is allowed to mount/unmount.)
- When issuing the mount command manually, the syntax is:
mount -t vfat -o umask=000 /dev/hda6 /mnt/fat

The value of the permission bits used with umask are the opposite of those used with the chmod command. For example, the following pairs are equivalent:
umask=000 and chmod 777
umask=022 and chmod 755

--30--

Wednesday, June 5, 2019

Raspberry Pi zero video notes




Mpeg video

MJPG Streamer

To run the camera stream from a USB webcam we'll make use of the package mjpg-streamer. Before we can install this we'll need to install a few dependencies first.
sudo apt-get update
sudo apt-get install libjpeg8-dev imagemagick libv4l-dev uvcdynctrl git cmake -y
After installing the dependencies, run the following commands to install mjpg-streamer.
git clone https://github.com/jacksonliam/mjpg-streamer.git
cd mjpg-streamer/mjpg-streamer-experimental
make USE_LIBV4L2=true clean all
sudo make install
sudo usermod -aG video pi
sudo modprobe bcm2835-v4l2
cd ../../
rm -rf mjpg-streamer
Start the camera livestream by running the following command.
mjpg_streamer -i 'input_uvc.so --device /dev/video0 --fps 30 --resolution VGA --quality 65' -o 'output_http.so'
If you followed all above instructions and everything went ok, you should now be able to see the stream when browsing to http://your-raspberry-pi.local:8080?action=stream. After you verified the stream is working, cancel by running ctrl+c and move on to the next section.

https://wouterdeschuyter.be/blog/how-to-create-a-15-dollar-web-controllable-camera-with-a-raspberry-pi-zero


--30--