Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:tricks [2019-07-13 03:04] – created Odd Stråbølinux:tricks [2020-05-08 22:47] (current) – [PVC] Odd Stråbø
Line 6: Line 6:
 xhost +SI:localuser:test xhost +SI:localuser:test
 sudo su - test -c "DISPLAY=$DISPLAY kodi" sudo su - test -c "DISPLAY=$DISPLAY kodi"
 +</code>
 +
 +====== List OpenWRT/LEDE (OPKG) user-installed packages ======
 +Assumes there has been no package updates since system install time, only new packages added.
 +<code bash>
 +function opkg_list_user_installed() {
 +    TS=$(opkg status kernel | grep "Installed-Time:" | grep -oE '[0-9]+')
 +
 +    for pkg in $(opkg list-installed | cut -d ' ' -f 1); do
 +        ST=$(opkg status $pkg)
 +        if [ ! $(echo "$ST" | grep 'Installed-Time:' | grep -oE '[0-9]+') -eq $TS ]; then
 +            if echo "$ST" | grep -q '[S]tatus:.*user'; then
 +                echo $pkg
 +            fi
 +        fi
 +    done
 +}
 +</code>
 +
 +====== OpenWRT Update all packages ======
 +<code bash>
 +opkg update
 +opkg upgrade $(opkg list-upgradable | cut -d' ' -f0)
 +</code>
 +
 +
 +====== PVC ======
 +<code bash>
 +  $ pvc vm flush-locks Jellyfin
 +
 +  $ sudo rbd list vms
 +
 +  $ sudo rbd lock list vms/jellyfin_disk1
 +  There is 1 exclusive lock on this image.
 +  Locker          ID                   Address               
 +  client.80789691 auto 140104987332272 10.0.0.1:0/3183410785 
 +  
 +  $ sudo rbd lock remove vms/jellyfin_disk1 'auto 140104987332272' 'client.80789691'
 </code> </code>
Print/export