Listing posts

Displaying posts 21 - 25 of 328 in total
Stadia bluetooth controller
mouse 474 · person cloud · link
Last update
2024-01-17
2024
01-17
« — »

bluetooth update

The first time you turn on the controller, it should enter pairing mode — the status light should flash orange. To enter pairing mode manually, hold the “Y + Stadia” buttons for 2 seconds. Once paired, the controller auto-connects to the last paired device when turned on.

What the status lights mean:

  • Flashing orange / Pairing mode, visible to other devices
  • Flashing white / Connecting to last paired device
  • Solid white / Connected to a device

flashing

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
sudo bash

{ cat <<EOF
# SDP protocol
KERNEL=="hidraw*", ATTRS{idVendor}=="1fc9", MODE="0666"
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="1fc9", MODE="0666"
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0d28", MODE="0666"
# Flashloader
KERNEL=="hidraw*", ATTRS{idVendor}=="15a2", MODE="0666"
# Controller
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="18d1", MODE="0666"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="9400", MODE="0660", TAG+="uaccess"
EOF
} | sudo tee /etc/udev/rules.d/70-stadiacontroller-flash.rules

udevadm control --reload-rules && udevadm trigger

references


~~~ * ~~~

Useful Android apps
Last update
2024-01-14
2024
01-14
«a collection of must have android apps for many common needs
apps/addons/plugins»

Stores: Google Play, NeoStore, F-Droid, Droid-ify, Aurora (src)

To check

General

Media

Games

System

Home automation

Svago


Other lists: Retrial, Finalboss77


~~~ * ~~~

Multimedia scripts for windows
mouse 1349 · person cloud · link
Last update
2024-01-14
2024
01-14
«scripts per organizzare i files multimediali ai suoceri»

external tools

comprimi_media

1
2
3
4
5
6
7
8
9
10
11
#!/bin/env ruby
dirs = %x[ find -mindepth 1 -maxdepth 1 -type d ].split("\n").sort

dirs.each do |d|
  puts "===== CARTELLA [ #{d} ] ====="
  print 'foto : '; system 'ls|egrep -i "(jpe*g|png|heic)$"|wc -l', chdir: d
  print 'video: '; system 'ls|egrep -i "(mp4|mov|avi|mpeg|hevc)$"|wc -l', chdir: d
  system 'comprimi_media.single', chdir: d
end

puts "\n\nFINE"

comprimi_media.single

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/env ruby

%w{ shellwords FileUtils progressbar }.each{|l| require l }

pb_opts = { progress_mark: '#', remainder_mark: '_', length: 79,
            starting_at: 0, format: '%t: %J
[%B] %e'
} all_files = Dir['*'].sort all_files.grep(/\.(aae)$/i).each{|f| FileUtils.rm_f f } re_images = /\.(jpe*g|png|heic)$/i files = all_files.grep(re_images) if files.size > 0 puts '' FileUtils.mkdir_p '_fatti' FileUtils.mkdir_p 'foto' pb = ProgressBar.create pb_opts.merge(title: "#{files.size} immagini", total: files.size) files.each do |f| pb.log " => #{f}" fout = f.sub(re_images, '.jpg') system %Q| convert -quality 80 #{f.shellescape} foto/#{fout.shellescape} | FileUtils.mv f, "_fatti/#{f}" if $?.to_i == 0 pb.increment end end re_videos = /\.(mp4|mov|avi|mpeg|hevc)$/i files = all_files.grep(re_videos) if files.size > 0 puts '' FileUtils.mkdir_p '_fatti' FileUtils.mkdir_p 'video' pb = ProgressBar.create pb_opts.merge(title: "#{files.size} video", total: files.size) files.each do |f| pb.log " => #{f}" fout = f.sub(re_videos, '.mp4') # https://superuser.com/questions/326629/how-can-i-make-ffmpeg-be-quieter-less-verbose system %Q| ffmpeg -hide_banner -loglevel error -stats -i #{f.shellescape} -c:v libx264 -c:a libmp3lame -b:a 128k video/#{fout.shellescape} | FileUtils.mv f, "_fatti/#{f}" if $?.to_i == 0 pb.increment end end if Dir['*'].reject{|f| File.directory? f }.size == 0 # elinmina fatti se tutto e' andato a buon fine FileUtils.rm_rf '_fatti' # elimina l'unica cartella presente dopo averne spostato i files nel parent if Dir['*'].size == 1 dir = Dir['*'].first system "mv -i * ..", chdir: dir FileUtils.rm_rf dir if $?.to_i == 0 end end # mostra evntuali cartelle _fatti ancora presenti dirs = %x[ find -mindepth 1 -type d -name _fatti ].split("\n").sort.map{|d| File.dirname d[2,300] } if dirs.size > 0 puts "Cartelle da controllare:" puts dirs end

misc ruby

1
2
3
4
5
# rename_foto_by_ts
ruby -e 'Dir["**/*"].grep(/\.jpg/i).sort.each{|f| system %Q[jhead -n"%Y-%m-%d_%H-%M-%S" "#{f}"] }'

# enumerate files
Dir['*'].sort.each_with_index{|f, i| File.rename f, "#{'%04d' % (i+1)}.mp4"}; nil

misc shell

1
2
3
4
5
# PDF to JPG
ls *.pdf | sed -r 's/(.+).pdf/pdftoppm -jpeg \0 \L\1.jpg/' | sh

# lossless rotate JPG
jpegtran -rotate 90 in.jpg > out.jpg

~~~ * ~~~

RVM install Ruby with jemalloc and YJIT
mouse 389 · person cloud · link
Last update
2023-12-26
2023
12-26
« — »

Note: YJIT is only available on arm64 and aarch64.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
apt install rustc           # needed by YJIT
apt install libjemalloc-dev # needed by jemalloc

# install
rvm install ruby-3.3.0 -C --with-jemalloc --enable-yjit

# jemalloc test 1
MALLOC_CONF=stats_print:true rvm 3.3.0 do ruby -e "exit"

# jemalloc test 2
ldd `which ruby` | grep jemalloc
#   => libjemalloc.so.2 => /lib/aarch64-linux-gnu/libjemalloc.so.2

# YJIT test
ruby --yjit -v
#   => ruby 3.3.0 (2023-12-25 revision 5124f9ac75) +YJIT [aarch64-linux]

# YJIT lazy loading:
ruby --yjit --yjit-disable -e "... ; RubyVM::YJIT.enable ; ..."

Source: jemalloc @ stackoverflow.com, YJIT docs and RVM howto


~~~ * ~~~

Kobo tools attachment
mouse 460 · person cloud · link
Last update
2023-12-19
2023
12-19
« — »

Resolutions

  • Sage: 1440x1920
  • Glo: 758x1024

Developer mode / hidden settings

  1. Type devmodeon in the searchbar, search and return to home screen
  2. New menu entry apperars: Settings > Device Information > Developer options
  3. Optional: type devmodeoff to disable it

NickelMenu / quick launcher

  1. Download latest KoboRoot.tgz from home page/github
  2. Connect Kobo to your PC
  3. Put KoboRoot.tgz into KOBOeReader/.kobo
  4. Eject your eReader and wait for it to reboot
  5. Ensure there is a new menu item in the bottom-right main menu entitled NickelMenu
  6. Connect Kobo to your PC again and create a file named KOBOeReader/.adds/nm/config, and follow the instructions in KOBOeReader/.adds/nm/doc to configure NickelMenu

Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
menu_item :main    :Browser (fullscreen)  :nickel_browser     :
menu_item :main    :Browser (modal)       :nickel_browser     :modal

# KOreader: prevent Kobo from scanning hidden folders on 4.17+
# https://github.com/koreader/koreader/wiki/Installation-on-Kobo-devices#important-notes
# ==> append in ".kobo/Kobo/Kobo eReader.conf":
#   [FeatureSettings]
#   ExcludeSyncFolders=(\\.(?!kobo|adobe).+|([^.][^/]*/)+\\..+)
menu_item :main    :KOReader              :cmd_spawn          :quiet  :exec  /mnt/onboard/.adds/koreader/koreader.sh

menu_item :main    :Plato                 :cmd_spawn          :quiet  :/mnt/onboard/.adds/plato/plato.sh

menu_item :main    :Invert Screen         :nickel_orientation :invert
menu_item :main    :Sudoku                :nickel_extras      :sudoku
#menu_item :main    :Solitaire             :nickel_extras      :solitaire
#menu_item :main    :WordScramble          :nickel_extras      :word_scramble
#menu_item :main    :Dump Syslog           :cmd_spawn          :logread > /mnt/onboard/.adds/syslog.log

menu_item :main    :USB connect           :nickel_misc        :force_usb_connection
menu_item :main    :IP Address            :cmd_output         :500:/sbin/ifconfig | /usr/bin/awk '/inet addr/{print substr($2,6)}'
menu_item :main    :Telnet                :cmd_output         :500:quiet :/usr/bin/pkill -f "^/usr/bin/tcpsvd -E 0.0.0.0 2023"
  chain_success:skip:5
    chain_failure                         :cmd_spawn          :quiet :/bin/mount -t devpts | /bin/grep -q /dev/pts || { /bin/mkdir -p /dev/pts && /bin/mount -t devpts devpts /dev/pts; }
    chain_success                         :cmd_spawn          :quiet :exec /usr/bin/tcpsvd -E 0.0.0.0 2023 /usr/sbin/telnetd -i -l /bin/login
    chain_success                         :dbg_toast          :Started Telnet server on port 2023
    chain_failure                         :dbg_toast          :Error starting Telnet server on port 2023
    chain_always:skip:-1
  chain_success                           :dbg_toast          :Stopped Telnet server on port 2023
menu_item :main    :FTP                   :cmd_spawn          :quiet:/usr/bin/pkill -f "^/usr/bin/tcpsvd -E 0.0.0.0 1021" || true && exec /usr/bin/tcpsvd -E 0.0.0.0 1021 /usr/sbin/ftpd -w -t 30 /mnt/onboard
  chain_success                           :dbg_toast          :Started FTP server on port 1021.

menu_item :main    :Sleep                 :power              :sleep
#menu_item :main    :Reboot                :power              :reboot
menu_item :main    :Power Off             :power              :shutdown

menu_item :library :Import books          :nickel_misc        :rescan_books_full

menu_item :browser :Quit                  :nickel_misc        :home
menu_item :browser :Open modal            :nickel_browser     :modal
menu_item :browser :Invert Screen         :nickel_orientation :invert

menu_item :selection_search :WebSearch    :nickel_browser     :modal:https://duckduckgo.com/?q={1|S|%}

Notes: - FTP: user = root, pass = empty - Telnet: pass = none

KOReader / alternative reader, swiss knife

See the user guide and wiki, then follow install instructions:

  1. Download the latest release from github
  2. Connect Kobo to your PC
  3. unzip -d /path/to/KOBOeReader/.adds/ koreader-kobo-v2023.04.zip
  4. prevent Kobo from scanning hidden folders on 4.17+, append in .kobo/Kobo/Kobo eReader.conf:

    1
    2
    [FeatureSettings]
    ExcludeSyncFolders=(\\.(?!kobo|adobe).+|([^.][^/]*/)+\\..+)
    
  5. add entry in NickelMenu, put in .adds/nm/config:

    1
    menu_item :main :KOReader :cmd_spawn :quiet :exec /mnt/onboard/.adds/koreader/koreader.sh
    
  6. Eject your eReader and enjoy

From the user guide a command to optimize images for the ereader with ImageMagick:

1
2
3
4
5
6
convert input-image.ext \
  -colorspace Lab -filter LanczosSharp -distort Resize 1404x1872 \
  -colorspace sRGB -background white -gravity center -extent 1404x1872! \
  -grayscale Rec709Luminance -colorspace sRGB \
  -dither FloydSteinberg -remap _eink_cmap.gif \
  -quality 75 output-image.ext

_eink_cmap.gif is also attached to this post.

Plato / alternative reader

See the forum thread and NickelMenu entry:

  1. Download the latest release from github
  2. Connect Kobo to your PC
  3. mkdir /path/to/KOBOeReader/.add/plato
  4. unzip -d /path/to/KOBOeReader/.adds/plato/ plato-0.9.36.7z
  5. prevent Kobo from scanning hidden folders on 4.17+, see KOReader instruction above
  6. add entry in NickelMenu, put in .adds/nm/config:

    1
    menu_item :main :Plato :cmd_spawn :quiet :/mnt/onboard/.adds/plato/plato.sh
    
  7. Eject your eReader and enjoy

Misc tools

  • kepubify -- EPUB to KEPUB converter written in Go (standalone executable)

QOL settings

  • full reference

  • enable screenshots by pressing power button (saves a PNG in kobo root dir), append in .kobo/Kobo/Kobo eReader.conf:

    1
    2
    [FeatureSettings]
    Screenshots=true
    
  • auto accept the Computer detected popup when plugged into a computer and enable devmodeon:

    1
    2
    3
    [DeveloperSettings]
    AutoUsbGadget=true
    EnableDebugServices=true
    
  • random screensaver (sleep/poweroff):

    1. put images in .kobo/screensaver
    2. Settings > Energy saving and privacy > check Show current read and Show book covers full screen
  • manual reset procedure: Sage, Glo