giovedì 31 luglio 2025

cast to Android TV with audio

 The google-chrome feature Cast -> Cast, save & share does't fork - TV is seen, but no real connection and a crash indeed.

Using gnome-display-network-displays does work, but for the audio I had to follow the advice here

https://www.reddit.com/r/Ubuntu/comments/gvtzpb/ubuntu_2004_lts_x86_64_trying_to_use_paprefs_but/


I had the same issue:


If you do


strace paprefs 2>&1 |grep /lib/pulse


you see that some modules in /usr/lib/pulse-13.99/modules are not found.


There is no directory /usr/lib/pulse-13.99; it is called /usr/lib/pulse-13.99.1


I made a symlink:


sudo bash


cd /usr/lib/


ln -s pulse-13.99 pulse-13.99.1


exit


and now it worked.


Then, in pavucontrol, I had to choose, under Recording (!), Monitor of built-in Audio Stereo  

venerdì 4 agosto 2023

SSH Tunneling

Very mindful and smart

 https://reznok.com/ssh-tunneling-magic/

martedì 12 gennaio 2021

export DISPLAY after sudo and impersonating another user


Very useful!

The following article teaches how to use xauth add

https://www.thegeekdiary.com/how-to-set-x11-forwarding-export-remote-display-for-users-who-switch-accounts-using-sudo/

" if you try to switch to another user on the remote system and export the display again, you would get and error – “Error: Can’t open display:”.

# ssh -X root@remotehost
# su - [username]
# export DISPLAY=x.x.x.x:y.y 
# xclock 

Error: Can't open display: x.x.x.x:y.y

" 

domenica 13 marzo 2016

Unable to read SD card under Ubuntu 15.10 - install exfat-fuse

A SD card, fully working when plugged in the camera, was unreadable under ubuntu

dmesg output:

[  306.770447] sd 8:0:0:0: [sdb] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  306.770456] sd 8:0:0:0: [sdb] Sense Key : Not Ready [current]
[  306.770465] sd 8:0:0:0: [sdb] <> ASC=0xff <> ASCQ=0xff
[  306.770469] sd 8:0:0:0: [sdb] CDB: 
[  306.770473] Read(10): 28 00 00 00 00 00 00 00 08 00
[  306.770490] blk_update_request: I/O error, dev sdb, sector 0
[  306.770496] Buffer I/O error on dev sdb, logical block 0, async page read

tail /var/log syslog output:
Mar 13 21:36:54 hp-notebook kernel: [  445.630036] scsi 9:0:0:0: Direct-Access     Multiple Card  Reader     1.00 PQ: 0 ANSI: 0
Mar 13 21:36:54 hp-notebook kernel: [  445.631353] sd 9:0:0:0: Attached scsi generic sg2 type 0
Mar 13 21:36:55 hp-notebook kernel: [  446.010314] sd 9:0:0:0: [sdb] Attached SCSI removable disk
Mar 13 21:36:36 hp-notebook systemd-udevd[265]: error opening USB device 'descriptors' file
Mar 13 21:36:55 hp-notebook systemd-udevd[265]: error: /dev/sdb: No medium found

marco@hp-notebook:~$ sudo ls -l /dev/disk/by-id|grep /sd.$
lrwxrwxrwx 1 root root  9 mar 13 21:38 ata-ST9500420AS_5VJ56BCJ -> ../../sda
lrwxrwxrwx 1 root root  9 mar 13 21:36 usb-Multiple_Card_Reader_058F63666433-0:0 -> ../../sdb
lrwxrwxrwx 1 root root  9 mar 13 21:38 wwn-0x7744542657581436928x -> ../../sda
marco@hp-notebook:~$ sudo ls -l /dev/disk/by-id|grep /sd.$
lrwxrwxrwx 1 root root  9 mar 13 21:38 ata-ST9500420AS_5VJ56BCJ -> ../../sda
lrwxrwxrwx 1 root root  9 mar 13 21:38 wwn-0x7744542657581436928x -> ../../sda
marco@hp-notebook:~$ sudo ls -l /dev/disk/by-id|grep /sd.$
lrwxrwxrwx 1 root root  9 mar 13 21:38 ata-ST9500420AS_5VJ56BCJ -> ../../sda
lrwxrwxrwx 1 root root  9 mar 13 21:39 usb-Multiple_Card_Reader_058F63666433-0:0 -> ../../sdb
lrwxrwxrwx 1 root root  9 mar 13 21:38 wwn-0x7744542657581436928x -> ../../sda
marco@hp-notebook:~$ sudo ls -l /dev/disk/by-id|grep /sd.$
lrwxrwxrwx 1 root root  9 mar 13 21:38 ata-ST9500420AS_5VJ56BCJ -> ../../sda
lrwxrwxrwx 1 root root  9 mar 13 21:39 usb-Multiple_Card_Reader_058F63666433-0:0 -> ../../sdb
lrwxrwxrwx 1 root root  9 mar 13 21:38 wwn-0x7744542657581436928x -> ../../sda
marco@hp-notebook:~$ sudo ls -l /dev/disk/by-id|grep /sd.$
lrwxrwxrwx 1 root root  9 mar 13 21:38 ata-ST9500420AS_5VJ56BCJ -> ../../sda
lrwxrwxrwx 1 root root  9 mar 13 21:39 usb-Multiple_Card_Reader_058F63666433-0:0 -> ../../sdb
lrwxrwxrwx 1 root root  9 mar 13 21:38 wwn-0x7744542657581436928x -> ../../sda
Turned out that installing exfat fuse was enough:

sudo apt-get install exfat-fuse

domenica 9 agosto 2015

NetworkManager's dnsmasq has hardcoded cache-size=0: workaround

I wanted to use dnsmasq caching facilities, but it seems Network-Manager uses its own version of dnsmasq with hardcoded options (hey guys, you're trying to let me feel a good programmer!) After half an hour of searching I found here this elegant workaround
wanted dnsmasq managed by NetworkManager with caching enabled, but as the other answer said, --cache-size=0 is hard-coded and can't be changed with configuration. So what I ended up doing was the following, as root:

mv /usr/sbin/dnsmasq /usr/sbin/dnsmasq.real

and then creating a new file, /usr/sbin/dnsmasq with the following content:

#!/bin/bash args=$(echo "$@" | sed 's/--cache-size=0/--cache-size=1000/') /usr/sbin/dnsmasq.real $args

make sure you

chmod +x /usr/sbin/dnsmasq

, and change the cache-size from 1000 to whatever you want, enjoy your LTS release with a DNS cache!

domenica 10 maggio 2015

zenithink c93 2f won't boot - restore factory rom

Fucked up a friends' Zenithing c93 trying to put CM11.00 by Christian Troy on it (http://www.slatedroid.com/topic/97786-custom-rom-cyanogenmod-11-442-for-amlogic-8726mx-by-christiantroy-update-2014-04-19/).
Something went wrong. Tablet was bricked.
I used this tutorial http://www.slatedroid.com/topic/95977-howto-create-a-rescue-sd-card-for-pretty-much-every-amlogic-8726-mx-device/ to resurrect it.
It worked only as I copied literally* the 1BF-1CF content from the tutorial, since the partition on my sd table was different and copying bytes from it to u-boot.bin resulted in an unreadable partition.

* 01 03 01 0B 11 A2 11 00 08 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

venerdì 8 maggio 2015

ImageMagick scripts collection

Very very nice collection of ImageMagick scripts, fit for all purposes!
Don't reinvent the wheel and look at

http://www.fmwconcepts.com/imagemagick/downsize/index.php