Listing posts
Displaying posts 16 - 20 of 338 in total
Multimedia scripts
Last update
2024-09-05
2024-09-05
«scripts per organizzare i files multimediali a suoceri e moglie»
MOGLIE / ANDROID
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 | # ----- FOTO ------------------------------------------------------------------- # resize f.jpg to _f.jpg ruby -e '%w{fileutils shellwords}.each{|l| require l}; lista=Dir["**/*"].grep(/\.jpg/i).sort; lista.each_with_index{|f,i| '\ 'puts "#{((i+1)/lista.size.to_f*100).to_i}%\t#{f}"; next if File.basename(f).start_with?("_"); system %Q[ '\ 'vips jpegsave #{f.shellescape} /tmp/rz.jpg --Q 80 && '\ 'jhead -autorot /tmp/rz.jpg && '\ 'mv /tmp/rz.jpg #{File.dirname(f).shellescape}/_#{File.basename(f).shellescape} && '\ 'rm -f #{f.shellescape} || echo ERRORE ] }' # rename by exif/file date ruby -e 'lista=Dir["**/*"].grep(/\.jpg/i).sort; lista.each_with_index{|f,i| '\ 'print "#{((i+1)/lista.size.to_f*100).to_i}%\t"; '\ 'system %Q[jhead -n"%Y-%m-%d_%H-%M-%S" "#{f}"] }' ## OR rename _f.jpg to f.jpg #ruby -e 'lista=Dir["**/*"].grep(/\.jpg/i).sort; lista.each_with_index{|f,i| '\ #'puts "#{((i+1)/lista.size.to_f*100).to_i}%\t#{f}"; next unless File.basename(f).start_with?("_"); '\ #'File.rename(f, File.join(File.dirname(f), File.basename(f).sub(/^_/, ""))) }' # crea sottocartelle foto e video (per ogni cartella avente files video) ruby -e 'Dir["**/*"].grep_v(/\.jpg/i).map{|f| File.dirname(f) if File.file?(f) }.compact.sort.uniq.each{|d| '\ 'Dir.chdir(d){ files = Dir["*"]; system "mkdir -p foto video"; '\ 'files.each{|f| dst = (f =~ /\.jpg/i ? :foto : :video); File.rename(f, "#{dst}/#{f}") } } }' # zippa cartelle di sole foto ruby -e 'require "shellwords"; Dir["**/*"].grep(/\.jpg/i).map{|f| File.dirname(f) }.compact.sort.uniq.each{|d| '\ 'puts d; Dir.chdir(File.join d, ".."){ n=File.basename(d); system "zip -r #{n.shellescape}.zip #{n.shellescape} && rm -rf #{n.shellescape}" } }' # ----- AUDIO ------------------------------------------------------------------ # converti video neri in MP3 => ffmpeg -i in.mp4 -ab 128k out.mp3 mdkir audio && cd audio for i in *.mp4; ffmpeg -i $i -ab 128k (string replace mp4 mp3 $i); end # fish #for i in *.mp4; do ffmpeg -i "$i" -ab 128k "${i%.*}.mp3"; done # bash rm -f *.mp4 # ----- VIDEO ------------------------------------------------------------------ # converti video MP4 in AVI/h264 for i in (find -type f -iname "*.mp4" -printf '%s\t%p\n' | sort -n | cut -f 2) echo $i vid2all -l -v 2048 -a 192 --no-expand --no-resize $i /mnt/ramd/out.avi \ && mv /mnt/ramd/out.avi (string replace -i mp4 avi $i) \ || touch (string replace -i mp4 ERR $i) end find -type f -name "*.ERR" # sposta tutti gli MP4 for i in (find -type f -iname "*.mp4"|sed -r 's/^..//'); mv -i $i (echo $i|sed -r 's/ /_/g ; s/\//--/g'); end |
SUOCERI / WINDOWS
external tools
- ffmpeg for windows
- jhead
- VisiPics photo duplicate finder
- WinDirStat folder tree size
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 |
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 |
~~~ * ~~~
Thunderbird useful add-ons and tricks
Last update
2024-09-02
2024-09-02
« — »
Settings
1 | security.dialog_enable_delay = 100 # faster enabling of dialog boxes buttons (download, confirm) |
Add-ons
- TBSync -- sync addressbook & calendar interface
- Provider for CalDAV & CardDAV -- DAV provider for TBSync
- XNote++
Obsolete
- Auto Compress File
- EditEmailSubject
- Expression Search / GMailUI
- FireTray -- minimize to tray icon, fork of foudfou/FireTray
- gContactSync
- Google Calendar Tab -- GitHub page
- Super Date Format
Date format
TB uses the system locale settings in order to display the date and time, you can change them by setting the LANG
environment variable:
1 2 3 4 5 | #!/bin/bash # http://kb.mozillazine.org/Date_display_format # https://bugzilla.mozilla.org/show_bug.cgi?id=1426907 export LANG=it_IT.UTF-8 # DD/MM/YYYY HH.MM exec /opt/thunderbird/thunderbird |
Dark theme
- Install TT DeepDark theme
- Preferences > Display > Formatting > Fonts & Colors > Colors button, then swap Text and Background colors
- If you write HTML emails: Preferences > Composition > General, then swap Text and Background colors
Logging
1 | MOZ_LOG=SMTP:4,timestamp MOZ_LOG_FILE=tb.log thunderbird |
~~~ * ~~~
Useful Android apps
Last update
2024-08-30
2024-08-30
«a collection of must have android apps for many common needs
apps/addons/plugins»
apps/addons/plugins»
Stores: Google Play, NeoStore, F-Droid, Droid-ify, Aurora (src)
To check
- FP4 alt. camera
- Secure Camera
- Open Camera
- GCam: wichaya, nikita
- Games:
- lemuroid -- libretro emulator
- lightblocks -- tetris clone for any device
- Metal Slug: Awakening
- Librera Reader -- eBook and PDF reader
- MaterialFiles -- file manager
- Multi profiles:
- Phonograph -- material music player
- Image gallery:
- Goodwy apps / gh
- Audio Recorder
- FossifyOrg -- a SimpleMobileTools fork before acquisition
- Immich / hp / gh -- Self-hosted backup solution for photos and videos
- FV File Manager + Shizuku bridge -- workaround android 13 locking /Android/data
General
- Add Country Code -- fix contacts
- AfterShip -- post tracking
- AndrOpen Office -- libre office port
- BigSMS
- CalcTape
- Decathlon Coach -- home, esercizi da 10/15'/gg
- DeepL Translate
- Etar -- OpenSource Calendar
- Event Flow Widget
- Firefox focus
- Free-OTP+ / Free-OTP -- free TOTP autenticator
- Google Drive -- copy to clipboard share option
- KeePassDroid
- Classic notes lite -- notepad on steroids
- Trireme -- gh, deluge thin client (torrent)
- Nova Launcher + TeslaUnread -- unread badges
- Lightning browser
- Off+ -- turn off screen hack
- OperaMini
- Pixeful icon pack -- inexpensive icon pack (usable with Nova launcher)
- Pl@ntNet -- plant recognition
- Power Toggles
- QR Droid -- bar/qrcode scanner
- Screen Off -- lock display widget
- Should I Answer? -- call spam blocker
- SMS Backup & Restore
- Sound Profile -- rich sound profile manager
- Sygic -- car navigator
- Telegram -- IM
- Textra -- customizable SMS app
- TouchPal -- very customizable multi-mode keyboard
- Vuze -- torrent downloader
- Wallabag -- save articles to read later
WPS Office -- MSOffice compatibleuse AndrOpen Office
Media
- Boldbeast Recorder / hp -- audio & call recorder
- BookReader -- ebook reader (epub, ecc)
- Camera FV-5
- Flym feed reader
- iMediaShare -- media caster
- YouTube Vanced -- YT ad free + background play
- Perfect Viewer -- image viewer
- Piktures -- simple & powerful gallery
- Pulsar -- music player
- Radio alarm clock++
- Radio FM Italia
- Simple Last.fm Scrobbler
- Smart Recorder -- audio recorder
- Snapseed -- rich image editor
- Sound Hound -- song search by your own whistles and voice!
- VLC -- rich video player + DLNA renderer
Games
- Alien Vs Space invaders
- Day Off
- Destiny Child -- dedicated post
- Deus Ex Go
- Dungeon cards
- GamePad Tester -- test controller
- GRIS
- Hearts Free
- Jelly Splash
- Lara Croft Go
- Live2DViewerEX -- steam license
- Picross Luna I & Picross Luna II
- Pigeon Pop, alt
- Progressbar95
Puzzle Fighter- Shattered Pixel Dungeon foss -- github, f-droid
- Snes9x EX+
- --- to see ---
- Fist of the north star (Hokuto no Ken)
- Honkai Impact 3rd
- The King of Fighters ALLSTAR
System
- AccuBattery -- alert when reaching xx% charge level
- CPUz | Device Info HW
- DavX5 -- CalDAV, CardDav sync
- DiskUsage -- xdiskusage port
- Ghost Commander -- TotalC./MC/NC foss clone
- Hacker's Keyboard -- full PC keyboard
- Heliboard -- opensource keyboard, gh
- JuiceSSH
- Let's Print Droid -- CUPS client
- Let's Print PDF
- Open in browser
- OpenVPN
- Override DNS
- QuickEdit Pro -- fast text editor
- Quick Sync widget -- sync Google account
- Remote Ripple -- vnc viewer
- SANEDroid -- SANE client
- Simple Mobile Tools -- replacements for all fundamental apps
- sockstun -- create a VPN via a Socks5 service
- Tasker -- homepage
- Termux
- Titanium backup
- Total commander -- rich file manager MC style
- Turbo VPN -- AD supported free VPN
- Wi-Fi on/off widget
- ZArchiver -- supports many archive types (7zip)
Home automation
- ~
mydlink Home~ -- socket D-Link DSP-W215 - SmartLife -- rbg lamp LOFTer 10W
- TP-Link Tapo -- socket Tapo P100
Svago
Other lists: Retrial, Finalboss77
~~~ * ~~~
Ruby URI escape
Last update
2024-08-23
2024-08-23
«encode/decode URI»
URI.escape
is deprecated and not fully conformant to RFC specs.In ruby >=3.2 you can use
CGI.escapeURIComponent
:
1 2 3 4 | require 'cgi' "https://a.com/b/" + "#{ CGI.escapeURIComponent path_component }" + "?#{CGI.escapeURIComponent my_key}=#{CGI.escapeURIComponent my_value}" |
- In ruby <3.2 you can use
obj.to_param
andHash#to_query
, it callsObject#to_query
implemented as:
1 | def to_query(key) = "#{CGI.escape(key.to_param)}=#{CGI.escape(to_param.to_s)}" |
Source: bibwild, stackoverflow
~~~ * ~~~
MySQL/MariaDB comandi utili
Last update
2024-08-20
2024-08-20
« — »
backup all databases
1 2 3 4 5 6 7 8 | # save mysqldump \ -u root -pROOTPASS \ --all-databases --single-transaction | \ xz > dbs.sql.xz # restore zcat dbs.sql.gz | mysql -u root -pROOTPASS |
abilita nuovo utente
1 2 3 | # sudo mariadb CREATE USER 'nome'@'localhost' IDENTIFIED BY 'pass-utente'; GRANT ALL PRIVILEGES on *.* to 'nome'@'localhost'; |