Sunday, February 7, 2021

Julia programming language notes

 julialang.org

https://docs.julialang.org/en/v1/manual/unicode-input/

https://benlauwens.github.io/ThinkJulia.jl/latest/book.html

 

Documentation is not clear,  big memory footprint (125MB RAM), slow to start first time on Windows.

The language is dynamic, no way to specify exactly function arguments and return value for a type (e.g. as a type of an argument to another function, or a type of a variable holding a function object).

An error can be spotted only during execution, e.g. if the return type does not match the type of the expression returned from the function.

Manjaro/archlinux drive encryption notes

https://wiki.archlinux.org/index.php/Dm-crypt/System_configuration

Need to have normal ext4 boot partition, vfat EFI partition, and an encrypted partition. 

Kernel boot image must have dmcrypt support:

/etc/mkinitcpio.conf

...

HOOKS=(base udev autodetect keymap modconf block encrypt filesystems keyboard fsck)

...

/etc/default/grub:
GRUB_CMDLINE_LINUX="cryptdevice=UUID=88.-..888:cryptroot:allow-discards"


/etc/fstab: 

# /dev/mapper/cryptroot
UUID=111-11-...       /               ext4            rw,noatime      0 0

# /dev/nvme0n1p6
UUID=222-22-...       /boot           ext4            rw,relatime     0 0

# /dev/nvme0n1p2
UUID=333..          /boot/efi       vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro
      0 0

 

Sunday, December 27, 2020

mount encfs on login on ubuntu

Install libpam-encfs.

Edit /etc/security/pam_encfs.conf : 

Recommended: comment out the line

encfs_default --idle=1 

This flag will unmount your encrypted folder after 1 minute of inactivity. If you are automounting this on login, you probably would like to keep this mounted for as long as you are logged in.

At the bottom, comment any existing demo entries and add:

#USERNAME SOURCE TARGET PATH ENCFS Options FUSE Options foo /home/foo/EncryptedFolder /home/foo/DecryptedFolder -v allow_other

Make sure to initialize EncryptedFolder with the same user password.

Also, if you see the following line, remove allow_root from the options. Otherwise, it will be in conflict with allow_other defined above.

fuse_default allow_root,nonempty


Next, edit /etc/fuse.conf: Uncomment:

user_allow_other

To test your config, open a new virtual terminal (e.g. Ctrl+Alt+F4) and login. You should see pam successfuly mount your EncFS folder.

Should be enough.


See more at https://wiki.archlinux.org/index.php/EncFS#Mount_at_login_using_pam_encfs


Wednesday, December 16, 2020

Manjaro mdns fix

Install and enable avahi service. Enable systemd-resolved.service:

systemctl status systemd-resolved.service

make a symbolic link:

sudo ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf


Check:

getent hosts mypc.local

Friday, April 24, 2020

HP 6510b linux boot fix

If there are dkms errors on boot/blank screen with Intel x3100 etc. graphics, boot kernel with
 
video=SVIDEO-1:d

Windows rsync alternative

Copy all files recursively from drive D to E:\WinData subfolder:

Robocopy.exe D:\ E:\WinData /e /z /dcopy:DAT /xd "System Volume Information" /xd "$RECYCLE.BIN" /A-:SH

Fix hidden directory (robocopy bug):








attrib -s -h E:\WinData

Sunday, January 5, 2020

xubuntu 18.04 mouse sensitivity fix

If GUI mouse sensitivity settings don't work try using commands:

> xinput

 Will output:

Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
⎜   ↳ Logitech USB Receiver                       id=9    [slave  pointer  (2)]
⎜   ↳ Logitech USB Receiver Consumer Control      id=10    [slave  pointer  (2)]
⎜   ↳ Logitech USB Laser Mouse                    id=15    [slave  pointer  (2)]

Remember those id's or use "Logitech USB Receiver" and "Logitech USB Laser Mouse" device names in the following commands.

> xinput list-props 'Logitech USB Laser Mouse'
Device 'Logitech USB Laser Mouse':
    Device Enabled (155):    1
    Coordinate Transformation Matrix (157):    1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    libinput Natural Scrolling Enabled (289):    0
    libinput Natural Scrolling Enabled Default (290):    0
    libinput Scroll Methods Available (291):    0, 0, 1
    libinput Scroll Method Enabled (292):    0, 0, 0
    libinput Scroll Method Enabled Default (293):    0, 0, 0
    libinput Button Scrolling Button (294):    2
    libinput Button Scrolling Button Default (295):    2
    libinput Middle Emulation Enabled (296):    0
    libinput Middle Emulation Enabled Default (297):    0
    libinput Accel Speed (298):    1.000000
    libinput Accel Speed Default (299):    0.000000
    libinput Accel Profiles Available (300):    1, 1
    libinput Accel Profile Enabled (301):    1, 0
    libinput Accel Profile Enabled Default (302):    1, 0
    libinput Left Handed Enabled (303):    0
    libinput Left Handed Enabled Default (304):    0
    libinput Send Events Modes Available (274):    1, 0
    libinput Send Events Mode Enabled (275):    0, 0
    libinput Send Events Mode Enabled Default (276):    0, 0
    Device Node (277):    "/dev/input/event11"
    Device Product ID (278):    1133, 49257
    libinput Drag Lock Buttons (305):   
    libinput Horizontal Scroll Enabled (306):    1

We need to set 'libinput Accel Speed' property to 1.0 value for maximum speed.

> xinput set-prop 'Logitech USB Laser Mouse' 'libinput Accel Speed' 1.0

Make a bash script and add it to "Session and Startup":

#!/bin/bash
#xinput set-prop 15 298 1.0
#xinput set-prop 9 298 1.0

xinput set-prop 'Logitech USB Laser Mouse' 'libinput Accel Speed' 1.0
xinput set-prop 'Logitech USB Receiver' 'libinput Accel Speed' 1.0