Showing posts with label Technology. Show all posts
Showing posts with label Technology. Show all posts

Friday, October 11, 2024

Yaesu FT-450D ft8 setup

 My ft8 laptop died recently so I had to setup a replacement from scratch.

I did not remember my wsjtx settings so I spend quite a bit of time to figure them out.

What works for my rig is the following 


For future reference.


Friday, August 4, 2023

Working with hours minutes and seconds in HP Prime

 HP Prime has a button that can be used to express degrees minutes and seconds or, hours minutes and seconds it is the a b/c fraction button and it is a shifted operation.

Type the number of hours, press the key, then the number of minutes press the key and then the number of seconds and press the key.

This way we can perform calculations that are time based 

Tuesday, September 6, 2022

Ham activities

 Haven’t posted for a while, but in the meantime i have been active getting licensed as an amateur radio operator.

Got all three license levels in Uk

Foundation callsign MM7CVA 

Intermediate 2M0HTP

Full MM0NKK


Also became a member of oarc online community https://wiki.oarc.uk/start?do=profile

And the Livingston and district amateur radio club https://www.ladars.org.uk/cms/

Its fun, lots of things to learn and do.

Saturday, May 15, 2021

Unmounting stuck nfs mounts

 

This usually happens when the nfs server is down, you cannot umount the nfs mount, because the system will say "not found or server not reachable"

$ sudo umount /opt/logs/production

umount.nfs: nfs.local:/var/lib/backup: not found / mounted or server not reachable

umount.nfs: nfs.local:/var/lib/backup: not found / mounted or server not reachable

To fix this, you need to force mount it with lazy flag:

$ sudo umount -f -l /opt/logs/production
where -f is to do force unmount, and -l is for lazy unmounting. From man:
"Lazy  unmount.  Detach  the  filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore."

Post borrowed from: https://www.linuxwave.info/2013/06/unmounting-stuck-nfs-mounts.html

Thursday, May 6, 2021

Fuzzy finder

 I learned recently about the fzf linux cli command. This is a text finder similar to grep but a lot more powerful. It can be used not only to find text but files as well in an interaftive mode.


It exists as a package for debian and its github page is: https://github.com/junegunn/fzf

Saturday, April 24, 2021

Handy ffmpeg Cheatsheet

 https://gist.github.com/steven2358/ba153c642fe2bb1e47485962df07c730

First convert the subtitles to .ass format:
````
ffmpeg -i sub.srt sub.ass
````
Then add them using a video filter:

````
ffmpeg -i in.mp4 -vf ass=sub.ass out.mp4
````

## Extract the frames from a video

To extract all frames from between 1 and 5 seconds, and also between 11 and 15 seconds:

````
ffmpeg -i in.mp4 -vf select='between(t,1,5)+between(t,11,15)' -vsync 0 out%d.png
````

To extract one frame per second only:

````
ffmpeg -i in.mp4 -fps=1 -vsync 0 out%d.png
````

## Rotate a video

Rotate 90 clockwise:

````
ffmpeg -i in.mov -vf "transpose=1" out.mov
````

For the transpose parameter you can pass:

````
0 = 90CounterCLockwise and Vertical Flip (default)
1 = 90Clockwise
2 = 90CounterClockwise
3 = 90Clockwise and Vertical Flip
````

Use `-vf "transpose=2,transpose=2"` for 180 degrees.

## Download "Transport Stream" video streams

1. Locate the playlist file, e.g. using Chrome > F12 > Network > Filter: m3u8
2. Download and concatenate the video fragments:

````
ffmpeg -i "path_to_playlist.m3u8" -c copy -bsf:a aac_adtstoasc out.mp4
````

If you get a "Protocol 'https not on whitelist 'file,crypto'!" error, add the `protocol_whitelist` option:

````
ffmpeg -protocol_whitelist "file,http,https,tcp,tls" -i "path_to_playlist.m3u8" -c copy -bsf:a aac_adtstoasc out.mp4
````

## Mute some of the audio

To replace the first 90 seconds of audio with silence:

````
ffmpeg -i in.mp4 -vcodec copy -af "volume=enable='lte(t,90)':volume=0" out.mp4
````

To replace all audio between 1'20" and 1'30" with silence:

````
ffmpeg -i in.mp4 -vcodec copy -af "volume=enable='between(t,80,90)':volume=0" out.mp4
````

## Deinterlace

Deinterlacing using "yet another deinterlacing filter".

````
ffmpeg -i in.mp4 -vf yadif out.mp4
````

## Create a video slideshow from images

Parameters: `-r` marks the image framerate (inverse time of each image); `-vf fps=25` marks the true framerate of the output.

````
ffmpeg -r 1/5 -i img%03d.png -c:v libx264 -vf fps=25 -pix_fmt yuv420p out.mp4
````

## Extract images from a video

- Extract all frames: `ffmpeg -i input.mp4 thumb%04d.jpg -hide_banner`
- Extract a frame each second: `ffmpeg -i input.mp4 -vf fps=1 thumb%04d.jpg -hide_banner`
- Extract only one frame: `ffmpeg -i input.mp4 -ss 00:00:10.000 -vframes 1 thumb.jpg`

## Metadata: Change the title

````
ffmpeg -i in.mp4 -map_metadata -1 -metadata title="My Title" -c:v copy -c:a copy out.mp4

Sunday, April 18, 2021

Stripping audio from video

 Handy ffmpeg command to strip audio from video with high quality:

ffmpeg -i ../video/$i -q:a 0 -map a $i.mp3

Tuesday, December 22, 2020

Stripping spaces from filenames

 Here is a handy script for stripping spaces from filenames in a directory and all of its subdirectories:


#!/bin/bash


function strip_spaces_from_files {

  for i in *

  do

    newfilename=$(echo $i | tr -s ' ' | tr ' ' '_')

    if [ -e "$newfilename" ]

    then

      echo "$newfilename does not contain any spaces"

    else

      echo "stripping spaces from $newfilename"

      mv "$i" "$newfilename"

    fi

  done

}


INITIALDIR=$PWD

echo "Stripping spaces from current directory $INITIALDIR"

strip_spaces_from_files


echo "Stripping spaces from sub directories"


for subd in $(find ./ -type d)

do

  strippingdot=$(echo "${subd}"|sed 's/^..//')

  echo "switching to directory $INITIALDIR/$strippingdot"

  cd $INITIALDIR/$strippingdot

  echo "stripping spaces"

  strip_spaces_from_files

  echo "going back to initial directory $INITIALDIR"

  cd $INITIALDIR/

done

Friday, December 11, 2020

Validating yaml with python

 python -c 'import yaml, sys; yaml.safe_load(sys.stdin)' < url-monitor-extension-config.yml

Thursday, November 26, 2020

Python introspection blog post

 A great blog post about how to use python modules to inspect python code itself can be found here

Thursday, April 16, 2020

Veiryfing ssh fingerprints of a system

When trying to connect to a system via ssh for the first time you will get a message that you need to trust the ssh fingerprint of that system.

How do you know if the fingerprint displayed is the correct one, or if there is a man in the middle attack going on?

If you have another terminal open on the system you have you can go to /etc/ssh and execute the following:

for file in *sa_key.pub
do   ssh-keygen -lf $file
done
 

This will diplay the ssh fingerprints valid for this system so you can double check them.

Sunday, March 8, 2020

Enabling multiple displays with Thinkpad P52

When switching to power save mode nvidia disables the graphics card multiple display support.

It does not enable it back when switching to performance mode. This was done by creating a file in /lib/modprobe.d/nvidia-kms.conf and setting modeset to 1.

We can revert this change by changing the modeset to 0 or commenting this line. After rebooting, the external display works again.



Saturday, February 15, 2020

Separating filename from extension in bash

If we want to separate filename from extension in bash this is a neat and useful trick:


filename=$(basename -- "$fullfile")
extension="${filename##*.}"
filename="${filename%.*}"

Wednesday, January 22, 2020

Prioritization of network interfaces

If we have more than one network interfaces and want to prioritize routing via one of them we can do the following:

Check the priorities in the routing table:

/home/nickapos [nickapos@nickapos-ThinkPad-P52] [8:44]
> ip route                    
default via 192.168.17.1 dev enp0s31f6 proto dhcp metric 100
default via 192.168.1.254 dev wlp0s20f3 proto dhcp metric 600



Here we can see that we have two interfaces with different metric values enp0s31f6 has higher priority than wlp0s20f3, if we want to swap them we need to install ifmetric with
sudo apt install ifmetric 
and do:

sudo ifmetric wlp0s20f3 99

After this if we check the routing table:

/home/nickapos [nickapos@nickapos-ThinkPad-P52] [8:45]
> ip route                 
default via 192.168.1.254 dev wlp0s20f3 proto dhcp metric 99
default via 192.168.17.1 dev enp0s31f6 proto dhcp metric 100




we can see that wlp0s20f3 has higher priority so routing will happen by default through it. Only packages that can not be served by it will be routed via enp0s31f6,

Wednesday, August 28, 2019

Python patterns and antipatterns

Discovered a nice online python book about patterns and antipatterns here https://docs.quantifiedcode.com/python-anti-patterns/

Monday, April 15, 2019

Parsing and validating YAML

For anyone who is looking for ways to validate YAML files, there are multiple modules out there for python, ruby and perl.

If using pip then you can install yamllint program:
 pip install yamllint

and then do 
yamllint blah.yml

in Ruby you could do:
ruby -ryaml -e "p YAML.load(STDIN.read)"< data.yaml


Friday, March 15, 2019

Έλεγχος ποιότητας ιστοσελίδας

Σε περίπτωση που έχετε μια ιστοσελίδα για την οποία θέλετε να μάθετε αν είναι στημένη σωστά ή αν έχει διάφορα προβλήματα, υπάρχουν αρκετά εργαλεία, κάποια δωρεάν και κάποια όχι, τα οποία θα την αναλύσουν και θα σας παρουσιάσουν την ανάλυση τους σχετικά με την απόδοση και τα προβλήματα της. Μπορούν να προσομοιώσουν διαφορετικές πλατφόρμες.

Ένα απο αυτά είναι το https://yellowlab.tools/

Saturday, October 20, 2018

Speed test site

A quite nice speed test that I used to finetune my SQM-QOS. Its all HTML5 without the need for any flash plugins https://www.dslreports.com/speedtest