Introduction
What ?
Brain is like a draft notebook. A place to store all my notes.
Why ?
While browsering dev.to, I found this article :
Then I decide to give this concept a shot.
Licence
You can do whatever the fuck you want with this.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright 2017 dashie
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
Tips
Resources
Tools
Youtube channels
- w2aew, ham, lab equip, howtos/tutorials
- TRX Bench, ham, lab equip, repairs
- FeedbackLoop, ham, lab equip, repairs
- The Radio Shop, ham, lab equip, repairs
- Électro-Bidouilleur, french, vulgarisation, tutos
- Mr Carlson's Lab, ham, lab equip, vintage radios, tubes, repairs
- glasslinger, vintage radios, tube making, repairs
- msylvain59, exotic stuff, teardowns
- The Signal Path, ham, lab equip, repairs, teardowns
- shango066, vintage radios, tubes TVs, repairs
Ham
lic fr
License FR - Legislation
License FR - Technique
TOS & ROS
\[ TOS = \left(\sqrt{\frac{P_{ref}}{P_{ém}}}\right) \times 100 \]
\[ ROS = \frac{100 + TOS}{100 - TOS} \]
Resources
VNA
Spectrum Analyzer
Other
DBs Units
Refs
dB
A logarithmic expression of the ratio of two power levels: \[ 10 \times \log_{10}\left(\frac{P1}{P2}\right) \]
P1 | P2 | \( \frac{P1}{P2} \) | dB |
---|---|---|---|
1 | 1 | 1 | 0 |
2 | 1 | 2 | 3 |
10 | 1 | 10 | 10 |
0.5 | 1 | 0.5 | -3 |
7.2 | 1.6 | 4.5 | 6.5 |
100 | 1 | 100 | 20 |
1000 | 1 | 1000 | 30 |
Since a dB is a ratio, it is not an absolute quantity, like a watt, etc.
To make it an absolute quantity, we must specify a reference.
dB suffix
- dBm -> reference is milliwatt (mW)
- dbµ -> reference is microwatt (µW)
- dBmV -> reference is millivolt (mV)
The suffix can turn dB into an absolute quantity dbM.
Example
10 MHz sinewave at 950mVpp into \( 50\Omega \).
\[ Vpp = 950mV \] \[ Vrms = \frac{Vpp}{2 \times \sqrt{2}} = \frac{950mV}{2 \times \sqrt{2}} = 336mV_{rms} \]
Therefore, the power in the \( 50\Omega \) load is:
\[ P = \frac{\left(Vrms\right)^2}{R} = \frac{0.336^2}{50} = 2.256mW \]
To express this in dBm, the reference is 1mW:
\[ dBm = 10\times\log_{10}\left(\frac{2.256mW}{1mW}\right) = 3.53dBm \]
In dBµ, the reference is 1µW:
\[ dBµ = 10\times\log\left(\frac{2.256 \times 10^{-3}}{1 \times 10^{-6}}\right) = 33.53dBµ \]
Voltage ratios
The dB relates to power, so we have to calculate power.
\[ 10\times\log\left[\frac{\frac{V1^2}{R}}{\frac{V2^2}{R}}\right] \]
\[ 10\times\log\left[\frac{V1^2}{R}\times\frac{R}{V2^2}\right] \]
\[ 10\times\log\left[\frac{V1^2}{V2^2}\right] \]
\[ 10\times\log\left[\left(\frac{V1}{V2}\right)^2\right] \]
\[ 2\times10\times\log\left[\frac{V1}{V2}\right] \]
\[ 20\times\log\left[\frac{V1}{V2}\right] \]
Thus, our 950mVpp can be expressed in dBmv
\[ V = \sqrt{P \times R} \]
\[ dBmv = 20\times\log\left(\frac{336mV}{1mV}\right) = 50.5dBmV \]
What about dBc ?
-
dBc means it is dB relative to some "carrier" power leev
-
very common in RF applications
dBs / table
Cable impedance
Take a cable section, and measures:
- LCR in C, connected to one end, other is open
- LCR in L, connected to one end, other is shorted
Use formula:
\[ Z = \sqrt{\frac{L}{C}} \]
C = 37.2pF
L = 0.10µH = 100nH
\[ Z = \sqrt{\frac{100 \times 10^{-9}}{37.2 \times 10^{-12}}} = 51.8\Omega \]
End-Fed Half-Wave
Length of wanted wire: \[ meters = \frac{300}{frequency in mhz} \]
Eg for 80m: \[ \frac{300}{3.5600} = 84.270 \]
Cut in half for the EFHW: 42.135 meters.
It will resonate on all harmonics: 7.100, 14.200, 28.400
Pair harmonics:
- 2, 4, 6, 8
Impair harmonics:
- 3, 5, 7, 9
To calculate frequencies just multiplicate the original frequency by the harmonic number.
Hardware
uSDX tips
Power usage
Around ~500mA in TX. Works with 3S 18650, power output dependent of battery voltage, makes around 4 to 5W in WSPR with 11.8V.
With 3S 18650, unknown capacity, WSPR 40% TX ratio runs for around 3h.
CAT mode
Only available with OLED IO Board.
Firmware needs the following:
#define CAT 1 // CAT-interface
NOT TESTED yet:
//#define CAT_EXT 1 // Extended CAT support: remote button and screen control commands over CAT
//#define CAT_STREAMING 1 // Extended CAT support: audio streaming over CAT, once enabled and triggered with CAT cmd, samplerate 7812Hz, 8-bit unsigned audio is sent over UART. The ";" is omited in the data-stream, and only sent to indicate the beginning and end of a CAT cmd.
Connection
- GND/RX/TX to an USB FTDI
- Audio OUT (mono) to USB sound card
- Mic/Key to USB sound card: T(ip)=Key, R(ing)=Mic, S(leeve)=GND, so connect Ring and Sleeve to the soundcard
- PTT is handled by CAT, nothing specific here
Generic settings
- TS-480
- 38400 bps
- 8n1
- NO Handshake, so NO RTS and DTR (force them low if possible)
- Polling 200ms
- Timeout 4000ms
FLRIG
- TS-480HX
- same generic settings
- Uncheck
RTS/CTS
- In
PTT-Generic
checkPTT via CAT
JS8
- Not using flrig, directly controlling the CAT interface
- RIG: Kenwood TS-480
- Same generic settings
- PTT Method: CAT
- Mode: Data/Pkt
- Split operation: none
WSJT-X
- Rig: FLRig FLRig
- Network server: 127.0.0.1:12345
- PTT Method: CAT
- Mode: None (any other mode will let the PTT stuck in transmit)
- Split operation: None
Lab/Ham Equipment
References
Directional Couplers
- LPC501 Directional Coupler
Attenuators
- Mini-Circuits HAT-10+ BNC, 10dB attenuator, DC-2000MHz
- Mini-Circuits VAT-10+ SMA, 10dB attenuator, DC-6000MHz
- Mini-Circuits UNAT-10+ N, 10dB attenuator, DC-6000MHz
DC Blocks
- Mini-Circuits BLK-89-S+ SMA-F/SMA-M
Frequency Counter
- FA-2 1Hz-12.4GHz
Spectrum Analyzer
Notes
spectrum analyzer input <> DC Block <> SMA to BNC <> DUT
spectrum analyzer input <> DC Block <> DUT
Connect TX to Spectrum Analyzer
TX <in[directional coupler]out><in[dummy load xxW]testing port> <10db attenuator> spectrum analyzer
__________
|
|
- ?
Max Power: take max input of spectrum analyzer, let's say +20dBm
You can calculate the max power in dBm:
100W = 50dBm
30W = 44dBm
\[ dBm = 10\times\log_{10}\left(\frac{30W}{0.001W (1mW)}\right) = 44.77dBm \]
Since they are too high related to the +20dBm max input, you can put the required attenuators to get down to 0dBm.
- 50dBm = -40dB + -10dB, or -50dB
- 44dBm = -40dB + 4dB
TX 50dBm <> dummy load -40dB <> -10dB <> 0dBm spectrum analyzer
Max Voltage, let's say, maximum 5V in:
30W in volts formula: \[ V = \sqrt{30W \times 50\Omega} = 38.7V \]
The equivalent dBm for the 5V max input of the instrument: \[ dBm = 20\times\log_{10}\left(\frac{5V}{0.224V (224mV = 0dBm)}\right) = 26.9dBm \]
Using 27dB attenuation will do the job.
Refs
- LPC501 Directional Coupler
- Dummy Load with "testing port"/tap/monitor (-40dB)
- See references for attenuators, directional couplers, etc.
- dBm units
Dummy Load
10MHz Reference
Note: AUX Ref In is Square Wave, not sine !
- Leo Bodnar GPSDO, ~99£, square wave, programmable, 1 output
- GPSDO, ~120€, square wave, 1 output
- Distribution Amplifier, ~65€, square wave, 8 outputs
- Cheapest way: NEO-x gps module with PPS output, programming the PPS to 10MHz is possible
Galvanometers frontplate symbols
Measurement type
symbol | meaning |
---|---|
![]() | Direct current circuit and/or d.c. responding measuring element |
![]() | Alternating current circuit and/or a.c. responding measuring element |
![]() | Direct and/or alternating current circuit and/or d.c.and a.c. responding measuring element |
![]() | Three-phase alternating current circuit (general symbol) |
![]() | One measuring element (E) for three-wire network |
![]() | One measuring element (E) for four-wire network |
![]() | Two measuring elements (E) for three-wire network with unbalanced loads |
![]() | Two measuring elements (E) for four-wire network with unbalanced loads |
![]() | Three measuring elements (E) for four-wire network with unbalanced loads |
Safety
symbol | meaning |
---|---|
![]() | Earth (ground) terminal |
![]() | Protective conductor terminal |
![]() | Frame or chassis terminal |
![]() | Equipotentiality |
![]() | On (Power) |
![]() | Off (Power) |
![]() | Equipment protected throughout by double insulation or reinforced insulation |
![]() | Caution, possibility of electric shock |
![]() | Caution, hot surface |
![]() | In position of a bi-stable push control |
![]() | Out position of a bi-stable push control |
Position of use
symbol | meaning |
---|---|
![]() | Instrument to be used with the dial vertical |
![]() | Instrument to be used with the dial horizontal |
![]() | Instrument to be used with the dial inclined (e.g. 60°) from the horizontal plane |
![]() | Example for instrument to be used as D-1, nominal range of use from 80° to 100° |
![]() | Example for instrument to be used as D-2, nominal range of use from –1° to +1° |
![]() | Example for instrument to be used as D-3, nominal range of use from 45° to 75° |
Accuracy class
symbol | meaning |
---|---|
![]() | Class index (e.g. 1) except when the fiducial value corresponds to the scale length or the indicated value or the span |
![]() | Class index (e.g. 1) when the fiducial value corresponds to the scale length |
![]() | Class index (e.g. 1) when the fiducial value corresponds to the indicated value |
![]() | Class index (e.g. 1) when the fiducial value corresponds to the span |
General symbols
symbol | meaning |
---|---|
![]() | Permanent-magnet moving-coil instrument |
![]() | Permanent-magnet ratiometer (quotientmeter) |
![]() | Moving permanent-magnet instrument |
![]() | Moving permanent-magnet ratiometer (quotientmeter) |
![]() | Moving-iron instrument |
![]() | Polarized moving-iron instrument |
![]() | Moving-iron ratiometer (quotientmeter) |
![]() | Ironless electrodynamic instrument |
![]() | Iron-cored electrodynamic (ferro-dynamic) instrument |
![]() | Ironless electro-dynamic ratiometer (quotientmeter) |
![]() | Iron-cored electro-dynamic (ferro-dynamic) ratiometer (quotientmeter) |
![]() | Induction instrument |
![]() | Induction ratiometer (quotientmeter) |
![]() | Bimetallic instrument |
![]() | Electrostatic instrument |
![]() | Vibrating-reed instrument |
![]() | Non-insulated thermocouple (thermal converter) |
![]() | Insulated thermocouple (thermal converter) |
![]() | Electronic device in a measuring circuit |
![]() | Electronic device in an auxiliary circuit |
![]() | Rectifier |
![]() | Shunt |
![]() | Series resistor |
![]() | Series inductor |
![]() | Series impedance |
![]() | Electric screen |
![]() | Magnetic screen |
![]() | Astatic instrument |
![]() | Magnetic field strength expressed in kiloamperes per metre, producing a variation corresponding to the class index (e.g. 2 kA/m) |
![]() | Zero (span) adjuster |
![]() | Refer to a separate document |
![]() | Electric field strength expressed in kilovolts per metre, producing a variation corresponding to the class index (e.g. 10 kV/m) |
![]() | General accessory |
![]() | Ferrous support of thickness X mm |
![]() | Ferrous support of any thickness |
![]() | Non-ferrous support of any thickness |
![]() | Noiseless earth (ground) terminal |
![]() | Signal low terminal |
![]() | Positive terminal |
![]() | Negative terminal |
![]() | Resistance range setting control |
![]() | Overload protection device fitted |
![]() | Overload protection device reset control |
Groups of environmental conditions
symbol | meaning |
---|---|
![]() | Instrument used in laboratory |
![]() | Instrument used outdoor or under conditions that the ambient temperature changes badly |
Testing voltage
symbol | meaning |
---|---|
![]() | Tested voltage, up to 500V |
![]() | Tested voltage, up to 2kV |
![]() | No test |
Examples
From left to right:
- Direct and/or alternating current circuit and/or d.c.and a.c. responding measuring element
- Tested up to 2kV
- unknown
- Instrument to be used with the dial vertical
- Moving-iron instrument
Blender
Various tips
Better sphere
- Add a cube
- Add Subdivision modifier (levels viewport: 3, render: 3, optimal display: unchecked)
- Add Cast modifier (factor: 1.43)
- Apply them
- Subdivide and smooth as wanted
Auto smooth whatever
- Green triangle
- Normals
- Auto smooth (checked, 30°)
Pipe thickness
- Use a Solidify modifier
Tips MySQL
Export all users and rights
mysql -e"select concat('show grants for ','\'',user,'\'@\'',host,'\'') from mysql.user" > user_list_with_header.txt
sed '1d' user_list_with_header.txt > ./user.txt
while read user; do mysql -e"$user" > user_grant.txt; sed '1d' user_grant.txt >> user_privileges.txt; echo "flush privileges" >> user_privileges.txt; done < user.txt
awk '{print $0";"}' user_privileges.txt >user_privileges_final.sql
rm user.txt user_list_with_header.txt user_grant.txt user_privileges.txt
Source: https://stackoverflow.com/a/30751822/465146
MySQL
UTF-8
Config
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
Switch all to UTF-8
DB="database_name"; ( echo 'ALTER DATABASE `'"$DB"'` CHARACTER SET utf8 COLLATE utf8_unicode_ci;' ; mysql "$DB" -e "SHOW TABLES" --batch --skip-column-names | xargs -I{} echo 'ALTER TABLE `'{}'` CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;' ) | mysql "$DB"
Check
SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='xxx';
Scripting tips
set -e
: stop on errorsset -u
: stop on unset $VARSset -o pipefail
: stop on | fail
Mkgmap howto
See https://openmtbmap.org/about-2/archive/render-maps-mkgmap/
Software requirements
You will need java !
Uses the Required tools & OpenTopoMap repository script/commands to get the latest mkgmap, splitter and bounds files.
Git checkout https://github.com/der-stefan/OpenTopoMap/, it will be used for the styles.
Map datas
Go to http://download.geofabrik.de/ and download the part you want, in .osm.bz2
format.
Splitting the map
java -Xmx1000m -ea -jar ..\splitter-r602\splitter.jar --max-nodes=600000 --overlap=4000 --max-areas=255 --description="zone-bonnieres" --mapid="12340000" --max-nodes="600000" --no-trim --overlap="4000" --status-freq="600" zone-bonnieres.osm
Compile the map
java -ea -Xmx1000M -jar ..\mkgmap-r4767\mkgmap.jar --style-file=G:\garmin\opentopomap-garmin\style\opentopomap --max-jobs --generate-sea=polygons,extend-sea-sectors,close-gaps=6000 --reduce-point-density=5.4 --x-reduce-point-density-polygon=5.4 --index --transparent --adjust-turn-headings --ignore-maxspeeds --ignore-turn-restrictions --remove-short-arcs=4 --description=zone_bonnieres --location-autofill=1 --route --country-abbr=fr --country-name=france --mapname=12340000 --family-id=1234 --product-id=1 --series-name="bonnieres_fr_%date%" --family-name="bonnieres_fr_%date%" --overview-mapname=mapset --area-name="Bonnieres_%date%_custom" -c template.args --gmapsupp
Zone bonnieres:
osmosis --read-xml enableDateParsing=no file=france-latest.osm --bounding-box top=49.06751 left=24.649 bottom=55.468 right=48.925 --write-xml file=zone-bonnieres.osm
https://www.openstreetmap.org/export#map=11/49.0509/1.5992 coords gps
SSL
Extracting private and public keys from a p12 file
Private key:
openssl pkcs12 -in file_name.p12 -nocerts -out private.key
with pass warning !!!
Certificates
openssl pkcs12 -in file_name.p12 -clcerts -nokeys -out public.crt
Ca certificates:
openssl pkcs12 -in file_name.p12 -cacerts -nokeys -out ca.crt
Generate a bundle:
openssl pkcs12 -in file_name.p12 -out cert.pem -nodes
then just use the parts wanted
Generate certificates bundle file
openssl pkcs12 -nokeys -in server-cert-key-bundle.p12 -out server-ca-cert-bundle.pem
Generate server key file
openssl pkcs12 -nocerts -nodes -in server-cert-key-bundle.p12 -out server.key
Some notes for ZOL on ROOT
In case of hdd replacement needed
Partitions
selected_disk=/dev/sda
wipefs --all --force "$selected_disk"
sgdisk -a1 -n1:24K:+1000K -t1:EF02 "$selected_disk"
sgdisk -n2:0:+2G -t2:BF01 "$selected_disk" # Boot pool
sgdisk -n3:0:"$tail_space_parameter" -t3:BF01 "$selected_disk" # Root pool
grub
selected_disk=/dev/sda
grub-install $selected_disk
# duplicate boot thingy from existing disk to newer one to be replaced
dd if=/dev/sdb of=/dev/sda
Networking shit
NMCLI bridge
nmcli con show
nmcli con add ifname brvm0 type bridge con-name brvm0
nmcli con modify brvm0 ipv4.method manual ipv4.address "10.0.0.8/24"
nmcli con modify brvm0 bridge.stp no
nmcli -f bridge con show brvm0
nmcli con up brvm0
Netplan bridge
network:
version: 2
ethernets:
eno1:
dhcp4: false
eno2:
dhcp4: true
bridges:
virbr1:
macaddress: "fa:rt:fa:rt:fa:rt"
dhcp4: true
interfaces: [eno1]
parameters:
stp: false
forward-delay: 0
network:
version: 2
ethernets:
eno1:
dhcp4: false
eno2:
dhcp4: true
bridges:
virbr1:
macaddress: "fa:rt:fa:rt:fa:rt"
dhcp4: true
interfaces: [eno1]
parameters:
stp: false
forward-delay: 0
brvm0:
dhcp4: false
addresses: [10.0.0.10/24]
parameters:
stp: false
Netplan VLAN
network:
version: 2
vlans:
vlan4000:
id: 4000
link: enp4s0
addresses: ['192.168.100.3/24']
Netplan Bridge hetzner
### Hetzner Online GmbH installimage
network:
version: 2
renderer: networkd
ethernets:
enp2s0:
dhcp4: no
dhcp6: no
bridges:
brpub0:
macaddress: fa:rt:fa:rt:fa:rt
dhcp4: no
dhcp6: no
parameters:
forward-delay: 1
stp: false
interfaces:
- enp2s0
addresses:
- 1.2.3.4/32
- 1:2:3:4::2/64
routes:
- on-link: true
to: 0.0.0.0/0
via: 1.2.3.4
gateway6: fe80::1
nameservers:
addresses:
- 8.8.8.8