Sunday, June 21, 2026

bash file testing

 
Bash File Testing

-b filename - Block special file
-c filename - Special character file
-d directoryname - Check for directory Existence
-e filename - Check for file existence, regardless of type (node, directory, socket, symlink, etc.)
-f filename - Check for regular file existence not a directory
-G filename - Check if file exists and is owned by effective group ID
-G filename set-group-id - True if file exists and is set-group-id
-k filename - Sticky bit
-L filename - Symbolic link
-O filename - True if file exists and is owned by the effective user id
-r filename - Check if file is a readable
-S filename - Check if file is socket
-s filename - Check if file is nonzero size
-u filename - Check if file set-user-id bit is set
-w filename - Check if file is writable
-x filename - Check if file is executable

How to use:

#!/bin/bash
file=./file
if [ -e "$file" ]; then
    echo "File exists"
else 
    echo "File does not exist"
fi 

--30--

netgear readynas login for older units, ssh access

netgear  
ssh -oKexAlgorithms=+diffie-hellman-group1-sha1,diffie-hellman-group14-sha1 -oHostKeyAlgorithms=+ssh-rsa root@<ip>

admin login rejects after connect.  Use admin on 6.0 and later units

--30--

Sunday, June 14, 2026

iTead DAC+ Version 2 Pihat PIFI

 Review and Measurements of PiFi DAC+ Pi Sound Card

This is a review and detailed measurements of itead's PiFi DAC+ Version 2 Raspberry Pi sound card (DAC). It was kindly purchased by a member and drop shipped to me. It costs US $40 but company has it on sale for US $36.50. It competes with the HifiBerry DAC+ whose pro version I recently reviewed. Unlike that unit, the PiFi DAC+ does not have independent clock source and must be using I^2 S clock. It is said that this clock has more jitter so will be interesting to see if that is the case in measurements.

Here is what it looks like:




The common TI PMC5122 DAC chip is used which retails for $2.40. So not hard to imagine how these things sell so cheaply. There are a few extra bits on this such as a post regulator an IR input port and a 3.5 mm jack. The latter is just mirroring RCA connectors and as such, has high impedance. While it will make sound, don't be tempted to use it as a headphone jack as it will likely have anemic bass and low power levels.

DAC Audio Measurements
As with the other Pi DACs I have tested, I used Ropieee OS image to stream content to the DAC over the network using Roon media player. Here is our dashboard view when playing a 24-bit, 1 kHz tone:

Conclusions
Using the same recipe as the HifiBerry DAC+, the itead PiFi DAC+ falls short in measurements. We were barely good enough with Hifiberry but now are behind the game with some 7 dB higher amount of distortion. Seeing how itead PiFi DAC+ is more expensive anyway, I see no reason to recommend it over HifiBerry offerings.

----------------------------------------------------
My I2S DAC (P1F1 DAC+ v2.0) works perfectly with RuneAudio release version: 0.4 (build: beta-20141216) with the audio output setting as HiFiBerry DAC+ (I2S). The sound is astonishing and better than most of USBDAC interface.

Only trusted workaround that can be found for your DAC or AMP is on the following link.


first find your DAC that are listed on the link and follow the steps to make your DAC
work properly. I have PiFi DAC+ (AliExpress) and it worked after I followed the steps given
under the section of

----------------------------------------------------



Note that this card has an IR receiver built in. The IR receiver is connected to GPIO26. Remove JP2 to disable the IR receiver.

sudo nano /etc/modules
Comment out (#) the following line:

snd_bcm2835
Add the following lines:

bcm2708_dmaengine
snd_soc_pcm512x
snd_soc_hifiberry_dacplus
snd_soc_bcm2708_i2s
Now we need to load the correct device tree file by editing /boot/config.txt:

sudo nano /boot/config.txt
Add the following lines at the end of the file:

dtparam=i2c_arm=on
dtparam=i2s=on
dtoverlay=hifiberry-dacplus
Save the file (Ctrl-X, Y, Enter)

Create the sound.conf file as follows:

sudo nano /etc/asound.conf

pcm.!default  {
 type hw card 0
}
ctl.!default {
 type hw card 0
}
Save the file (Ctrl-X, Y, Enter) and reboot

sudo reboot
After reboot, check if the DAC is selected as your sound card:

aplay -l
You should see this:

card 0: sndrpihifiberry [snd_rpi_hifiberry_dacplus], device 0: HiFiBerry DAC+ HiFi pcm512x-hifi-0
Subdevices: 0/1
Subdevice #0: subdevice #0
Make all changes to /etc/mpd.conf as described in "Build the software".

Install mediaplayer as described in "Build the software".

GPIO Pin Usage:

GPIO2-3 are used for configuration. GPIOs 18-21 are used for the sound interface. You can’t use them for any other purpose.
----------------------------------------------------



iTead PiFi DAC+ Raspberry Pi DAC Audio Measurements.png


The output level is a hair higher than HifiBerry DAC at a little over 2 volt which is fine. What is not so fine is the much lower SINAD (signal over noise and distortion). While the HifiBerry DAC+ PRO achieved 92 dB, we have a shortfall of 7 dB. This places the PiFi in our bottom tier of all DACs tested to date:
Best Audio DACs reviewed and Measured 2019.png


Multitone test likewise shows a step down in performance:

iTead PiFi DAC+ Raspberry Pi DAC 7-tone multitone Audio Measurements.png


I like to see 95+ dB here and we are way short of that at just 78 dB.

Jitter response while again worse that HifiBerry DAC+ Pro, is still quite good:
iTead PiFi DAC+ Raspberry Pi DAC Jitter Audio Measurements.png


So not sure what all the screaming is about regarding the I^S Clock. The DAC chip's PLL is likely cleaning it up good.

Filter response is different flavor of bad from HifiBerry:
iTead PiFi DAC+ Raspberry Pi DAC White Noise Filter Response Audio Measurements.png


As with Jitter, probably not an audible concern though.

--30--


Thursday, June 11, 2026

Change permissions with find command example.

 Basic Example: Find and chmod
To find and delete all .log files in the current directory and its subdirectories, use this command: [1, 2, 3]
bash
find .  -exec chmod 777 {} \;
Use code with caution.
Understanding the Syntax Breakdown
  • find .: Starts the search in the current directory.
  • options follow
  • -type f: Restricts the search specifically to files, ignoring folders.
  • -name "*.log": Matches files with a .log extension.
  • -exec: Tells find to run a command on every match.
  • chmod 777: The external command you want to run.
  • {}: A placeholder that find dynamically replaces with the filename of each match.
  • \;: Terminates the -exec sequence. The backslash escapes the semicolon so your shell does not process it first.

Thursday, June 4, 2026

intel cpu temp sensor and general sensors

 
https://askubuntu.com/questions/15832/how-do-i-get-the-cpu-temperature

sudo apt-get install lm-sensors 
After installation type the following in terminal

sudo sensors-detect
You may also need to run

sudo service kmod start
It will ask you few questions. Answer Yes for all of them. Finally to get your CPU temperature type sensors in your terminal.

sensors


--30--