Archive for Uncategorized

Mac TimeMachine drive on Samba share

First, create a Samba share on the easiest way. For example, mine:

[macbook-pro-14]
  path = /mnt/data/backups/macbook-pro-14
  read only = no
  browseable = yes
  guest ok = no
  valid users = @ronhks
  force user = ronhks
  force group = ronhks

Open the DiskUtility.app macos app.

On it, create a new file drive image:

You can find it in the menu bar.

Create az Image, with these parameters:

Format: Mac OS Extended (Journaled)
Image format: sparse disk image

Mount the created image.

Set the TimeMachine to use the mounted image:
sudo tmutil setdestination -a /Volumes/{network-drive}

oh-my-zsh p10k git branch name shortened

I use this and I experiened like this:

The branch name is shortened and can’t read.

So I have to change this line in `~/.p10k.zs` The line is AROUND at line 400 :

from: (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line

to: (( $#branch > 40 )) && branch[20,-20]="…" # <-- this line.
It the branch name is over 40 char, It wil be cut from the 20th chat til the last 20 char.

src: https://stackoverflow.com/questions/61667666/keep-git-branch-name-untruncated-in-shell-using-p10k-oh-my-zsh-theme

Intellij IDEA Golang own package problem

I really like IDEA for developing.

I worked on a golang project and I organised my code into separate packages

The project built without problem in console (go build).

But, in IDEA I got this error:

$GOPATH/go.mod exists but should not

The solution is,

after the module support is turned on (IDEA/preferences/languages/go/Go modules : checkbox), it cannot exist with GOPATH, so just remove the project from GOPATH at IDEA/preferences/languages/go/GOPATH

Run MiniDLNA from docker

For reusage:

docker run -d \
-p 8200:8200 \
--restart=on-failure:3 \
--name minidlna \
-v /opt/minidlna/cache:/minidlna/cache \
-v /mnt/data/series:/media/series \
-v /mnt/data/movies:/media/movies \
-v /mnt/data/child:/media/child \
-v /mnt/data/torrent:/media/torrent \
-v /mnt/data/music:/media/music \
-v /mnt/data/pics:/media/pictures \
-e MINIDLNA_MEDIA_DIR_1=V,/media/series \
-e MINIDLNA_MEDIA_DIR_2=V,/media/movies \
-e MINIDLNA_MEDIA_DIR_3=V,/media/child \
-e MINIDLNA_MEDIA_DIR_3=V,/media/torrent \
-e MINIDLNA_MEDIA_DIR_3=A,/media/music \
-e MINIDLNA_MEDIA_DIR_3=PV,/media/pictures \
-e MINIDLNA_FRIENDLY_NAME=DNS-DLNA \
vladgh/minidlna

Docker img ipv6 problem

On my host the ipv6 is disabled. I had to start a docker image, which would like to use ipv6.

This conflict provides this error message:

Error response from daemon: driver failed programming external connectivity on endpoint CONTAINER_NAME(HASH): Error starting userland proxy: listen tcp6 [::]:PORT_NUMBER: socket: address family not supported by protocol

The resolution, to define the IP address in port mapping (for DHCP, with global definition):

docker run -p 0.0.0.0:HOST_PORT:CONTAINER_PORT

Or in docker-compose.yml like this:

version: "3.9"
services:
  SERVICE_NAME:
    image: IMG
    container_name: CONTAINER_NAME
    ports:
      - "0.0.0.0:HOST_PORT:CONTAINER_PORT"

Gentoo USB serial passthrough KVM

I have a Conbee II Zigbee receiver. After a restart the USB passthrought stopped working (on the guest VM I always get errors like:

usb 2-2: new low-speed USB device number 25 using uhci_hcd
usb 2-2: Invalid ep0 maxpacket: 64 usb
usb2-port2: unable to enumerate USB device

So I decided, passthrough the USB serial. It’s a little tricky 🙂

    <serial type='dev'>
      <source path='/dev/ttyACM0'/>
      <target type='isa-serial' port='1'>
        <model name='isa-serial'/>
      </target>
    </serial>

The trick is the serial type because it is dev.

src: http://baitisj.blogspot.com/2021/02/serial-device-passthrough-from-linux.html

ConBee 2 firmware upgrade on Ubuntu

Requirements:

Installed Deconz software. Downloadable, here: http://deconz.dresden-elektronik.de/ubuntu/stable/

Download the lates firmware from here:

http://deconz.dresden-elektronik.de/deconz-firmware/?C=M;O=D
(deCONZ_ConBeeII_0x)

Stop all services:

$ sudo systemctl stop deconz && sudo systemctl stop deconz-gui

Stop ModemManager if it is installed:

$ sudo systemctl stop ModemManager

Update the firmware:

sudo GCFFlasher_internal -t 60 -d /dev/ttyACM0 -f <LOCATION_OF_THE FIRMWARE_IMG>/deCONZ_ConBeeII_0x1234567.bin.GCF

src: https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Update-deCONZ-manually

Unuable Remmina with squares as characters

I use Ubuntu 20.04 and sometime remmina makes me a joke….

If you start remmina, and you see like this:

remmina uses squares like on that pics

Try this:

rm -rf ~/.cache/fontconfig && sudo fc-cache -r -v

Acutally, it resolves me the problem.

Hassio with supervisor on Gentoo by docker

Supervisor, first start

Docker pull:

docker pull homeassistant/qemux86-64-homeassistant:landingpage

Than, start it:

docker run -d --name hassio_supervisor \
--privileged \
--security-opt apparmor:unconfined \
--security-opt seccomp=unconfined \
-v /run/docker.sock:/run/docker.sock \
-v /run/dbus:/run/dbus \
-v "/opt/hassio/data":/data \
-e SUPERVISOR_SHARE="/opt/hassio/data" \
-e SUPERVISOR_NAME=hassio_supervisor \
-e HOMEASSISTANT_REPOSITORY="homeassistant/qemux86-64-homeassistant" \
homeassistant/amd64-hassio-supervisor:224

Linux Desktop experiences

DRAFT

A long-long years ago (til 2007) I used linux as desktop (Gentoo exactly).

After, the windows 7 and the 10 also will be a very-very good PC OSs.

BUT I tried the Ubuntu 20.04, and it seems work wine from 1 month at my 2in1 PC with WWAN card (DELL 7390).

I would like to collect some useful programs which I found very userful, fast and maintined (actually).

Program typeLinux programWindows alternative
(what I liked to use)
Screenshot maker and editorFlameshotGreenshot
Clipboard managerCopyQDitto
LauncherULauncherLaunchy
File managerDouble CommanderTotal Commander
SSH session managerRemminaKitty
VNC session managerRemminaUltraVNC
RDP session managerRemminaRDCman (discontinued)