Skip to content

QUICKFix: SuperMicro MotherBoards doesn’t show FRU info on Chassis,Board and more. Fix FRU Values with IPMICFG on SuperMicro’s empty Board SerialNumber/Model/etc

Problem:

Some of SuperMicro’s new Servers and new and old motherboards doesn’t show Chassis , Board and Product Serial Numbers, Models, neighter any other FRU fields. It just shows empty fields without errors or anything.

SOlution

If you have thoose info you can fill in into the MB’s ipmi memroy via the supermicro’s IPMICFG tool. See below:

download ipmicfg for 32 or 64bit arch ( depends what you are using ) and for your server’s Operating System from here:

IPMICFG support: Windows, Linux
https://www.supermicro.com/en/solutions/management-software/ipmi-utilities

command-line howto:

get values(list values)

# ./IPMICFG-Linux.x86_64 -fru list
Board Mfg. Date/Time(BDT) = 1996/01/01 00:00:00 (00 00 00)
Board Manufacturer (BM) = Supermicro
Board Product Name (BPN) =
Board Serial Number (BS) =
Board Part Number (BP) = 
Product Manufacturer (PM) =
Product Name (PN) =
Product Part/Model Number (PPM) =
Product Version (PV) =
Product Serial Number (PS) =
Product Asset Tag (PAT) =
 set values: (example: set Chassis Type)

#./IPMICFG-Linux.x86_64 -fru CT 17h
#
 set values: (example set Chassis Serial Number)

#./IPMICFG-Linux.x86_64 -fru CS C1160LI30NM0041
#

All configurable Values and more config options you can list via the magic command

#./IPMICFG-Linux.x86_64 -help
#./IPMICFG-Linux.x86-64 -fru help

Chassis Types CheatSheat:

  • 01h = Other
  • 02h = Unknown
  • 03h = Desktop
  • 04h = Low Profile Desktop
  • 05h = Pizza Box
  • 06h = Mini Tower
  • 07h = Tower
  • 08h = Portable
  • 09h = LapTop
  • 0Ah = Notebook
  • 0Bh = Hand Held
  • 0Ch = Docking Station
  • 0Dh = All in One
  • 0Eh = Sub Notebook
  • 0Fh = Space-saving
  • 10h = Lunch Box
  • 11h = Main Server Chassis
  • 12h = Expansion Chassis
  • 13h = SubChassis
  • 14h = Bus Expansion Chassis
  • 15h = Peripheral Chassis
  • 16h = RAID Chassis
  • 17h = Rack Mount Chassis
  • 18h = Sealed-case PC
  • 19h = Multi-system Chassis
  • 1Ah = CompactPCI
  • 1Bh = AdvancedTCA
  • 1Ch = Blade
  • 1Dh = Blade Enclosure
  • 1Eh = Tablet
  • 27h = Blade

 

Here is SuperMicro’s official, original and full IPMICFG user guide: Click to main content

CheatSheat: USG change MAC address on WAN1 || WAN2 port(s)

Quick and dirty Howto: change/clone WAN’s mac addrss on UBNT USG Devices:

configure
set interfaces ethernet ethX mac XX:XX:XX:XX:XX:XX
commit
save
exit

That’s all.

Bye.

HOWTO: MacOSX shell script to change Finder contextual menu , add Comments to file

# comments=$(exiftool -ImageSize /Users/sto/Downloads/NUNCHAKU-BASIC_KATAX.jpg)
# file=/Users/sto/Downloads/NUNCHAKU-BASIC_KATAX.jpg

# osascript -e 'on run {f, c}' -e 'tell app "Finder" to set comment of (POSIX file f as alias) to c' -e end file://$file "$comments"

 

CheatSheat: UBNT USG Port Forwarding on WAN2

Port forwards are currently only provisioned to WAN1. If you have a multi-wan configuration, port forwards will need to be manually added to WAN2, as well as the firewall rules to allow those port forwards. This will require SSH or console access to the USG.

 

Port Forwards on WAN2 (USG)

This process is applicable to the USG only. The UDM-Pro has the option of selecting WAN/WAN2 within the port forward configuration in the controller (Settings > Routing & Firewall > Port Forwarding). It does not apply for UDM base model.

Port forwards are currently only provisioned to WAN1. If you have a multi-wan configuration, port forwards will need to be manually added to WAN2, as well as the firewall rules to allow those port forwards. This will require SSH or console access to the USG. Below is an example of a WAN2 port forward, where the WAN2 address is 100.11.12.13 on eth3, and the forwarded port 22 to internal address 172.16.0.7

1. Create a firewall rule on WAN_IN to allow the port forward.

2. Press Create New Rule while on the WAN IN page

3. Select the following:

  • Action: Accept
  • Protocol: TCP
  • Destination Port group > Create port group
    • name: SSH
    • port: 22

4. Leave all else at defaults, and press Save.

5. SSH to the USG and type the following:

configure
set service nat rule 4000 description "WAN2 tcp 22"
set service nat rule 4000 destination address 100.11.12.13
set service nat rule 4000 destination port 22
set service nat rule 4000 inbound-interface eth3
set service nat rule 4000 inside-address address 172.16.0.7
set service nat rule 4000 inside-address port 22
set service nat rule 4000 protocol tcp
set service nat rule 4000 type destination
commit;exit
Click to copy

5. The port forward should now work on WAN2 when tested externally.

NOTES:
  • The NAT rule can be anywhere between 1-4999, with the lower number taking priority over the rules following it. You can also type the “?” key at any time in the command to bring up a list of available options you can type in.
  • The changes made in SSH are not persistent across any provisions by the controller or reboots of the USG itself. A config.gateway.json file has to be created in order to make these changes permanent – see here.
  • If you’re testing the port forward internally, which is sourced from a client on a LAN or VLAN behind the same USG, hairpin NAT is needed. To add this, follow step 4 again, but change the “inbound-interface” to the interface of the LAN or VLAN you’re sourcing the traffic from. If the source address and inside-address (target of the port forward) are on the same subnet, an additional SNAT (Source NAT) masquerade rule will need to be added to avoid asymmetric routing.
  • If multiple ports are used in a single rule, “inside-address port” cannot/should not be used and/or needed as traffic will be forwarded to same ports as it is destined to on WAN interface. If it is desired to forward multiple ports to a host then separate rules should be created.

 

READ FULL DOCUMENTATION!

SOurce: https://help.ui.com/hc/en-us/articles/235723207-UniFi-USG-UDM-Port-Forwarding-Configuration-and-Troubleshooting#2.2

 

 

HOWTO: Build custom configured Live CENTOS 7 iso ( in-here: boot into cli )

┌─[✗]─[sto@thinkpado]─[~]
└──╼ $sudo mount Downloads/Live_CENTOS-storage_tools.iso /mnt/media/
mount: /mnt/media: WARNING: device write-protected, mounted read-only.

┌─[✗]─[sto@thinkpado]─[~]
└──╼ $sudo cp -vfrp /mnt/media/* /tmp/centos/
'/mnt/media/EFI/TRANS.TBL' -> '/tmp/centos/EFI/TRANS.TBL'
'/mnt/media/EFI/BOOT/BOOTX64.efi' -> '/tmp/centos/EFI/BOOT/BOOTX64.efi'
'/mnt/media/EFI/BOOT/grub.cfg' -> '/tmp/centos/EFI/BOOT/grub.cfg'
'/mnt/media/EFI/BOOT/grubx64.efi' -> '/tmp/centos/EFI/BOOT/grubx64.efi'
'/mnt/media/EFI/BOOT/TRANS.TBL' -> '/tmp/centos/EFI/BOOT/TRANS.TBL'
'/mnt/media/EFI/BOOT/fonts/TRANS.TBL' -> '/tmp/centos/EFI/BOOT/fonts/TRANS.TBL'
'/mnt/media/EFI/BOOT/fonts/unicode.pf2' -> '/tmp/centos/EFI/BOOT/fonts/unicode.pf2'
'/mnt/media/isolinux/boot.cat' -> '/tmp/centos/isolinux/boot.cat'
'/mnt/media/isolinux/efiboot.img' -> '/tmp/centos/isolinux/efiboot.img'
'/mnt/media/isolinux/initrd0.img' -> '/tmp/centos/isolinux/initrd0.img'
'/mnt/media/isolinux/isolinux.bin' -> '/tmp/centos/isolinux/isolinux.bin'
'/mnt/media/isolinux/isolinux.cfg' -> '/tmp/centos/isolinux/isolinux.cfg'
'/mnt/media/isolinux/macboot.img' -> '/tmp/centos/isolinux/macboot.img'
'/mnt/media/isolinux/TRANS.TBL' -> '/tmp/centos/isolinux/TRANS.TBL'
'/mnt/media/isolinux/vesamenu.c32' -> '/tmp/centos/isolinux/vesamenu.c32'
'/mnt/media/isolinux/vmlinuz0' -> '/tmp/centos/isolinux/vmlinuz0'
'/mnt/media/LiveOS/osmin.img' -> '/tmp/centos/LiveOS/osmin.img'
'/mnt/media/LiveOS/squashfs.img' -> '/tmp/centos/LiveOS/squashfs.img'
'/mnt/media/LiveOS/TRANS.TBL' -> '/tmp/centos/LiveOS/TRANS.TBL'
'/mnt/media/TRANS.TBL' -> '/tmp/centos/TRANS.TBL'

┌─[sto@thinkpado]─[~]
└──╼ $cd /tmp/centos/
┌─[sto@thinkpado]─[/tmp/centos]
└──╼ $cd LiveOS/
┌─[✗]─[sto@thinkpado]─[/tmp/centos/LiveOS]
└──╼ $su –
Password:
┌─[root@thinkpado]─[~]
└──╼ #cd /tmp/centos/LiveOS/

┌─[✗]─[sto@thinkpado]─[/tmp/centos/LiveOS]
└──╼ $sudo unsquashfs squashfs.img
Parallel unsquashfs: Using 4 processors
1 inodes (65536 blocks) to write

[==============================================================================================-] 65536/65536 100%

created 1 files
created 2 directories
created 0 symlinks
created 0 devices
created 0 fifos

┌─[✗]─[sto@thinkpado]─[/tmp/centos/LiveOS]
└──╼ $sudo chmod 777 squashfs-root
┌─[sto@thinkpado]─[/tmp/centos/LiveOS]
└──╼ $cd squashfs-root/
┌─[sto@thinkpado]─[/tmp/centos/LiveOS/squashfs-root]
└──╼ $cd LiveOS/

┌─[✗]─[sto@thinkpado]─[/tmp/centos/LiveOS/squashfs-root/LiveOS]
└──╼ $sudo mkdir ext3fs
┌─[sto@thinkpado]─[/tmp/centos/LiveOS/squashfs-root/LiveOS]
└──╼ $sudo mount -oloop ext3fs.img ext3fs

┌─[sto@thinkpado]─[/tmp/centos/LiveOS/squashfs-root/LiveOS]
└──╼ $sudo chroot ext3fs

# Doing the inside linux persistent configuration ( boot into CLI mode )

[root@thinkpado /]# systemctl set-default multi-user.target
rm '/etc/systemd/system/default.target'
ln -s '/usr/lib/systemd/system/multi-user.target' '/etc/systemd/system/default.target'
[root@thinkpado /]# exit

┌─[sto@thinkpado]─[/tmp/centos/LiveOS/squashfs-root/LiveOS]
└──╼ $cd ..
┌─[sto@thinkpado]─[/tmp/centos/LiveOS/squashfs-root]
└──╼ $cd ..

┌─[sto@thinkpado]─[/tmp/centos/LiveOS/squashfs-root/LiveOS]
└──╼ $sudo umount ext3fs
┌─[✗]─[sto@thinkpado]─[/tmp/centos/LiveOS/squashfs-root/LiveOS]
└──╼ $sudo rmdir ext3fs

┌─[root@thinkpado]─[~]
└──╼ #cd /tmp/centos/LiveOS/

┌─[root@thinkpado]─[/tmp/centos/LiveOS]
└──╼ #mv squashfs.img squashfs.img.orig

┌─[root@thinkpado]─[/tmp/centos/LiveOS]
└──╼ #mksquashfs squashfs-root/ squashfs.img -noappend -always-use-fragments
Parallel mksquashfs: Using 4 processors
Creating 4.0 filesystem on squashfs.img, block size 131072.
[==========/ ] 7290/65536 11%r[==========\ ] 7466/65536 11%
[==========| ] 7482/65536 11%
[==========/ ] 7497/65536 11%

[==============================================================================================-] 65536/65536 100%

Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072
compressed data, compressed metadata, compressed fragments,
compressed xattrs, compressed ids
duplicates are removed
Filesystem size 781116.89 Kbytes (762.81 Mbytes)
9.31% of uncompressed filesystem size (8388864.48 Kbytes)
Inode table size 54233 bytes (52.96 Kbytes)
20.67% of uncompressed inode table size (262346 bytes)
Directory table size 48 bytes (0.05 Kbytes)
82.76% of uncompressed directory table size (58 bytes)
Xattr table size 55 bytes (0.05 Kbytes)
100.00% of uncompressed xattr table size (55 bytes)
Number of duplicate files found 0
Number of inodes 3
Number of files 1
Number of fragments 0
Number of symbolic links 0
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 2
Number of ids (unique uids + gids) 1
Number of uids 1
root (0)
Number of gids 1
root (0)
┌─[root@thinkpado]─[/tmp/centos/LiveOS]
└──╼ #rmdir squashfs-root/
rmdir: failed to remove 'squashfs-root/': Directory not empty
┌─[✗]─[root@thinkpado]─[/tmp/centos/LiveOS]
└──╼ #rmdir squashfs-root
rmdir: failed to remove 'squashfs-root': Directory not empty
┌─[✗]─[root@thinkpado]─[/tmp/centos/LiveOS]
└──╼ #rm -rf squashfs-root
┌─[root@thinkpado]─[/tmp/centos/LiveOS]
└──╼ #rm -rf squashfs.img.orig
┌─[root@thinkpado]─[/tmp/centos/LiveOS]
└──╼ #cd ..
┌─[root@thinkpado]─[/tmp/centos]
└──╼ #genisoimage -o /root/Live_CENTOS-CLI-storage_tools.iso -b isolinux/isolinux.bin -c isolinux/boot.cat --no-emul-boot --boot-load-size 4 --boot-info-table -R -J -v -T -V "CentOS-7-livecd-x86_64" .
I: -input-charset not specified, using utf-8 (detected in locale settings)
genisoimage 1.1.11 (Linux)
Scanning .
Scanning ./EFI
Scanning ./EFI/BOOT
Scanning ./EFI/BOOT/fonts
Excluded: ./EFI/BOOT/fonts/TRANS.TBL
Excluded: ./EFI/BOOT/TRANS.TBL
Excluded: ./EFI/TRANS.TBL
Scanning ./isolinux
Excluded by match: ./isolinux/boot.cat
Excluded: ./isolinux/TRANS.TBL
Excluded: ./TRANS.TBL
Scanning ./LiveOS
Excluded: ./LiveOS/TRANS.TBL
Writing: Initial Padblock Start Block 0
Done with: Initial Padblock Block(s) 16
Writing: Primary Volume Descriptor Start Block 16
Done with: Primary Volume Descriptor Block(s) 1
Writing: Eltorito Volume Descriptor Start Block 17
Size of boot image is 4 sectors -> No emulation
Done with: Eltorito Volume Descriptor Block(s) 1
Writing: Joliet Volume Descriptor Start Block 18
Done with: Joliet Volume Descriptor Block(s) 1
Writing: End Volume Descriptor Start Block 19
Done with: End Volume Descriptor Block(s) 1
Writing: Version block Start Block 20
Done with: Version block Block(s) 1
Writing: Path table Start Block 21
Done with: Path table Block(s) 4
Writing: Joliet path table Start Block 25
Done with: Joliet path table Block(s) 4
Writing: Directory tree Start Block 29
Done with: Directory tree Block(s) 6
Writing: Joliet directory tree Start Block 35
Done with: Joliet directory tree Block(s) 6
Writing: Directory tree cleanup Start Block 41
Done with: Directory tree cleanup Block(s) 0
Writing: Extension record Start Block 41
Done with: Extension record Block(s) 1
Writing: The File(s) Start Block 42
1.18% done, estimate finish Wed May 20 12:25:18 2020
2.35% done, estimate finish Wed May 20 12:25:18 2020
3.53% done, estimate finish Wed May 20 12:25:18 2020
4.70% done, estimate finish Wed May 20 12:25:18 2020
5.88% done, estimate finish Wed May 20 12:25:18 2020
7.06% done, estimate finish Wed May 20 12:25:18 2020
8.23% done, estimate finish Wed May 20 12:25:18 2020
9.41% done, estimate finish Wed May 20 12:25:18 2020
10.58% done, estimate finish Wed May 20 12:25:18 2020
11.76% done, estimate finish Wed May 20 12:25:18 2020
12.94% done, estimate finish Wed May 20 12:25:18 2020
14.11% done, estimate finish Wed May 20 12:25:18 2020
15.29% done, estimate finish Wed May 20 12:25:18 2020
16.47% done, estimate finish Wed May 20 12:25:18 2020
17.64% done, estimate finish Wed May 20 12:25:18 2020
18.82% done, estimate finish Wed May 20 12:25:18 2020
19.99% done, estimate finish Wed May 20 12:25:23 2020
21.17% done, estimate finish Wed May 20 12:25:22 2020
22.34% done, estimate finish Wed May 20 12:25:22 2020
23.52% done, estimate finish Wed May 20 12:25:22 2020
24.69% done, estimate finish Wed May 20 12:25:22 2020
25.87% done, estimate finish Wed May 20 12:25:21 2020
27.05% done, estimate finish Wed May 20 12:25:21 2020
28.22% done, estimate finish Wed May 20 12:25:21 2020
29.40% done, estimate finish Wed May 20 12:25:21 2020
30.58% done, estimate finish Wed May 20 12:25:21 2020
31.75% done, estimate finish Wed May 20 12:25:21 2020
32.93% done, estimate finish Wed May 20 12:25:21 2020
34.10% done, estimate finish Wed May 20 12:25:20 2020
35.28% done, estimate finish Wed May 20 12:25:20 2020
36.45% done, estimate finish Wed May 20 12:25:20 2020
37.63% done, estimate finish Wed May 20 12:25:20 2020
38.80% done, estimate finish Wed May 20 12:25:20 2020
39.98% done, estimate finish Wed May 20 12:25:20 2020
41.16% done, estimate finish Wed May 20 12:25:20 2020
42.33% done, estimate finish Wed May 20 12:25:20 2020
43.51% done, estimate finish Wed May 20 12:25:20 2020
44.69% done, estimate finish Wed May 20 12:25:20 2020
45.86% done, estimate finish Wed May 20 12:25:20 2020
47.04% done, estimate finish Wed May 20 12:25:20 2020
48.21% done, estimate finish Wed May 20 12:25:20 2020
49.39% done, estimate finish Wed May 20 12:25:20 2020
50.56% done, estimate finish Wed May 20 12:25:19 2020
51.74% done, estimate finish Wed May 20 12:25:19 2020
52.92% done, estimate finish Wed May 20 12:25:19 2020
54.09% done, estimate finish Wed May 20 12:25:19 2020
55.27% done, estimate finish Wed May 20 12:25:19 2020
56.44% done, estimate finish Wed May 20 12:25:19 2020
57.62% done, estimate finish Wed May 20 12:25:19 2020
58.80% done, estimate finish Wed May 20 12:25:19 2020
59.97% done, estimate finish Wed May 20 12:25:19 2020
61.15% done, estimate finish Wed May 20 12:25:19 2020
62.32% done, estimate finish Wed May 20 12:25:19 2020
63.50% done, estimate finish Wed May 20 12:25:19 2020
64.67% done, estimate finish Wed May 20 12:25:21 2020
65.85% done, estimate finish Wed May 20 12:25:21 2020
67.03% done, estimate finish Wed May 20 12:25:20 2020
68.20% done, estimate finish Wed May 20 12:25:20 2020
69.38% done, estimate finish Wed May 20 12:25:20 2020
70.55% done, estimate finish Wed May 20 12:25:22 2020
71.73% done, estimate finish Wed May 20 12:25:22 2020
72.91% done, estimate finish Wed May 20 12:25:23 2020
74.08% done, estimate finish Wed May 20 12:25:26 2020
75.26% done, estimate finish Wed May 20 12:25:28 2020
76.43% done, estimate finish Wed May 20 12:25:29 2020
77.61% done, estimate finish Wed May 20 12:25:32 2020
78.78% done, estimate finish Wed May 20 12:25:34 2020
79.96% done, estimate finish Wed May 20 12:25:36 2020
81.14% done, estimate finish Wed May 20 12:25:40 2020
82.31% done, estimate finish Wed May 20 12:25:41 2020
83.49% done, estimate finish Wed May 20 12:25:41 2020
84.67% done, estimate finish Wed May 20 12:25:41 2020
85.84% done, estimate finish Wed May 20 12:25:42 2020
87.02% done, estimate finish Wed May 20 12:25:42 2020
88.19% done, estimate finish Wed May 20 12:25:41 2020
89.37% done, estimate finish Wed May 20 12:25:41 2020
90.54% done, estimate finish Wed May 20 12:25:41 2020
91.72% done, estimate finish Wed May 20 12:25:40 2020
92.89% done, estimate finish Wed May 20 12:25:40 2020
94.07% done, estimate finish Wed May 20 12:25:40 2020
95.25% done, estimate finish Wed May 20 12:25:40 2020
96.42% done, estimate finish Wed May 20 12:25:39 2020
97.60% done, estimate finish Wed May 20 12:25:39 2020
98.78% done, estimate finish Wed May 20 12:25:39 2020
99.95% done, estimate finish Wed May 20 12:25:39 2020
Total translation table size: 6249
Total rockridge attributes bytes: 2866
Total directory bytes: 10240
Path table size(bytes): 78
Done with: The File(s) Block(s) 425030
Writing: Ending Padblock Start Block 425072
Done with: Ending Padblock Block(s) 150
Max brk space used 23000
425222 extents written (830 MB)

┌─[root@thinkpado]─[/tmp/centos]
└──╼ #ls -lahtr /root/

 

That’s All.

Quick How-TO: Execute scripts on remote server via ssh

It’s not about  one liners and/or simple scripts. It’s suitable for multiline scripts, however an example for one liner is also included.

 

vim /tmp/ma_script.sh

1 #!/bin..... 
2 echo 
3 mecho
4 fi

and then:

ssh user@remote_server < /tmp/ma.script.sh

That’s all. Goodbay.

To execute a single script or a one liners just add it in underscopes after the ssh connection command line, a.k.a:

ssh user@remote_server 'echo ;mecho;exit;fi..'

 

Thanks. Bye,

HOWTO: Generate and Send FlowControl MAC Pause frames :: from linux

  1. To generate a flow control MAC pause frame , run the following:
    echo 0000 01 80 C2 00 00 01 00 00 00 00 00 00 88 08 00 01 FF FF 00 00 |
    text2pcap - /tmp/flow-control.pcap
  2. Once you have that you should be able to simply broadcast MAC pause frame using tcpreplay and issuing the following command:
    tcpreplay -p 300 -l 600 -i eth0 /tmp/flow-control.pcap
    

    With that command it should stop traffic for about 2 seconds, which should be long enough that it is obvious even with ping if you are seeing the frames recognized. You can also check ethtool -S eth1 on the Intel adapter to verify if any flow control events were found in the statistics.

You can find used tools via:

for text2pcap:

MacOSXbrew install wireshark Debianapt-get install wireshark-common Ubuntuapt-get install wireshark-common Alpineapk add wireshark Arch Linuxpacman -S wireshark-cli Kali Linuxapt-get install wireshark-common CentOSyum install wireshark Fedoradnf install wireshark-cli Raspbianapt-get install wireshark-common Dockerdocker run cmd.cat/text2pcap text2pcappowered by Commando
for tcpreply:
MACOSX: port install tcpreplay
Debian: apt install tcpreplay
CentOS: yum install tcpreplay

 

examples info Found at Source: Intel e1000 mailing list at sourceforge. You can read full thread here: https://sourceforge.net/p/e1000/mailman/message/33041871/

FIX (Solved): standard_init_linux.go:207: exec user process caused “exec format error” !! issue: docker container not starting and exit with error: standard_init_linux.go:207: exec user process caused “exec format error”

When your docker image is build with a custom shell script to be executed on container start, e.g.

CMD ["/path_to_scripts/script.sh"]

and when you start the container it exist with error: standard_init_linux.go:207: exec user process caused “exec format error”

the solution is just to put the shell scripting standard first line:

#!/bin/bash 
or 
#!/bin/sh

and .. of course chmod +x on the script.sh 🙂

That’s all.

CheatSheat: ffmpeg convert flac to mp3

find $1 -type f -iname “*.flac” -exec ffmpeg -n -i {} -codec:a libmp3lame -q:a 0 -map_metadata 0 -id3v2_version 3 -write_id3v1 1 -vsync 2 {}.mp3

CheatSheet: ffmpeg split video+audio in 1 video file, aka ffmpeg mp4+m4a = mp4 (with audio)

 

ffmpeg -i video.mp4 -i audio.m4a -c:a copy -c:v copy video-with-audio.mp4

that’s all without re/transcoding neither video nor audio.