Monday, 20 February 2023

SSL Certificate on UDM-PRO 2.4.x

 

To get some SSL certs onto a UDM-PRO (V2.4.27)

copy the SSL certificate for the host (generated or bought) and the key file to:

/data/unifi-core/config/unifi-core.crt
/data/unifi-core/config/unifi-core.key
reboot

Then for the Guest Portal a Java Keystore file is used.

password for keystore
aircontrolenterprise
openssl pkcs12 -export -in /data/unifi-core/config/unifi-core.crt -inkey /data/unifi-core/config/unifi-core.key -out unifi.p12 -name unifi -caname root
and then import the keystore

keytool -importkeystore -deststorepass aircontrolenterprise -destkeypass aircontrolenterprise -destkeystore /usr/lib/unifi/data/keystore -srckeystore unifi.p12 -srcstoretype PKCS12 -srcstorepass aircontrolenterprise -alias unifi
and just to make sure reboot 

reboot

Then to ensure the Guest portal redirect correctly to the DNS record and not the IP address.














Set the "Profiles" > "Guest Hotspot" > "Advanced" to:
1: Manual
2: Ensure HTTPS Redirection is on
3: Redirect Using Hostname 
4: insert the FQDN of the UDM-PRO (or matching Certificate name that can resolve)


Sunday, 2 October 2022

Firefox Snap Update

 




Should you get the pending update of Firefox snap message, below commands should resolve the issue.

sudo killall firefox
sudo snap refresh
Link to Firefox Snap here

Saturday, 30 July 2022

Sync files with rclone

 





I needed a way to sync files faster than rsync and found that rclone can sync local folders as well, the --transfers parameter drastically improved the transfer.

rclone sync /source/eBooks/ /target/eBooks/ -P -L --transfers 8
Link to rclone here

Sunday, 25 July 2021

Convert aac to mp3


Converting to MP3 with FFmpeg CLI:



Example to convert an AAC to MP3 with ffmpeg:

ffmpeg -i source.aac -c:a libmp3lame -ac 2 -q:a 2 target.mp3
Link to FFmpeg here

Thursday, 18 October 2018

Samsung UE40D5520RK Bootloop


After many years the Samsung TV decided it's time to go into a boot loop.

With some googl'ing the following remote combinations were found:

INFO -MENU - MUTE - POWER ON RC

This combination bring up the manufacturers menu where the TV can perform a factory reset.

And for a firmware upgrade : MUTE 2 5 8 EXIT

Unfortunately with the boot-loop scenario there is not enough time to perform these actions therefore I had to do the following:


For hardware reset, RESET and M_E_SDA (hole 1 and 4) - short circuit these two contacts and turn the TV on whilst on after about 20 seconds remove the link between these who contacts. Then power off and power the tv back on, this should also reset the tv to factory defaults.

After doing that, the tv still continued with the boot-loop, procured some Aerosol Freeze Spray from RS Components, and froze the IC numbered 1302. Do spray it for a while to ensure the IC cool down to a temperature where it will reset.
Low and behold ,after that the tv started without an issue and factory reset. I took the opprtunity to do a firmware upgrade via USB and all is working again.

Information was found  on Digisaster website.


Wednesday, 16 May 2018

Ubuntu 17.10 Netplan

Netplan

Ubuntu 17.10 networking completely changed with the introduction of netplan, below the basic configuration to configure networking.

The new configuration files can be located at:

/etc/netplan/*.yaml
and to set a static IP address:

network:
 version: 2
 renderer: networkd
 ethernets:
   ens33:
     dhcp4: no
     dhcp6: no
     addresses: [192.168.1.2/24]
     gateway4: 192.168.1.1
     nameservers:
       addresses: [8.8.8.8,8.8.4.4]

and then to apply the changes:

sudo netplan apply

Sunday, 21 January 2018

Node.js application in production (with restart)


Node.js applications can be managed and restarted upon a rebooted with PM2, which is a process manager for Node.js applications.



To install the Node.jsmodule:
sudo npm install -g pm2
To start and daemonize any application:
pm2 start application.js

Then to generate an automatically-configured startup script for your machine
pm2 startup
pm2 startup upstart
[PM2] You have to run this command as root. Execute the following command:
sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup upstart -u ...
Copy and paste the command.

Once you have started all the Node.js applications you want to manage across server restarts or reboots.


pm2 save
and to remove it from startup
pm2 unstartup

Same needs to be done after npm update or upgrade (unstartup then startup)

Init systems

  • systemd: Ubuntu >= 16, CentOS >= 7, Arch, Debian >= 7
  • upstart: Ubuntu <= 14
  • launchd: Darwin, MacOSx
  • openrc: Gentoo Linux, Arch Linux
  • rcd: FreeBSD
  • systemv: Centos 6, Amazon Linux


Tuesday, 16 January 2018

Linux bash to find files and exlude permission denied

So this is another of those "post to self" notes.
Lots of times you need to search for a file or directory under a user account and get this long list of "Permission Denied" entries back.

The below find command will exclude those.

Terminal command to find a directory with name image: 
find / -name image -type d 2>&1 | grep -v "Permission denied"





Thursday, 23 November 2017

RoboCopy for maximum throughput

Another one of those notes to self:

Below command is very useful to achieve high throughput on a copy process on Microsoft platforms (do play around with MT )

As the MT[:N] argument creates  multi-threaded copies with N threads and will depend on your machines processor and memory configuration.

Example to keep to a local folder in sync with a remote source:

robocopy \\source\Calibre\eBooks\ F:\Calibre\eBooks /MT:64 /MIR /Z

Technet artice on RoboCopy here.

Sunday, 1 October 2017

3D Printer Software - Linux

After many years I eventually made the jump and acquired a entry level 3D printer (Anet A8). This series will be use for lessons learned and application stack I find most useful for me.

Summary:

  1. FreeCAD 0.17 for design and exported as .stl file
  2. Repetier-Host as Slicer (Slicer Prusa Edition) and 3d printer host (open .stl and convert to .gcode and print)

Detail:

FreeCAD 0.17

As I am not in a production environment and FreeCAD development seem to be very active at the moment I am using the Daily PPA to update my system.

https://launchpad.net/~freecad-maintainers/+archive/ubuntu/freecad-daily
For Slicing (that is the most important part according to me as it will tell the printer how to print the model)

Slic3r

http://slic3r.org
It is working and I can't find any fault with it currently , however I still need to tweak the settings (e.g. slicing in Slic3r vs Cura vs Repetier-Host) give me 3 different results ito. amount of filament to be used when selecting the same density etc.

Cura 2.6.1

https://ultimaker.com/en/products/cura-software
https://launchpad.net/~thopiekar/+archive/ubuntu/cura 
the software worked but once I tried Repetier-Host I don't use this anymore.
For some reason currently the relation between design and print is out of proportion. I still need to investigate further.

Repetier-Host 2.0.5

The Repetier-Host AppImage is a single executable file that contains all required libraries and also includes CuraEngine, Slic3r and Slic3r Pruse Edition.

https://www.repetier.com/download-now/ 
I found this to be great and user friendly and the progress display and log file is very good.

As most 3d-ers I printed a few small projects and ran into what I assume is the most common "how do I do this ..." scenarios e.g.
  • What is the best way to change filament
  • What is the correct temperatures for my rig 
  • How do i get this print of the heatbed ....

Changes / additions:

Borosilicate Glass Plate

After a few prints I decided the builders tape type is not working for me and added a "Signstek 3D Printer MK2 MK3 Heated Bed Borosilicate Glass Plate Panel 213*200*3m" secured by "Heat Resistant Kaptop tape"

I am extremely happy with this upgrade; prints are sticking well and taking it off is a matter of waiting 2 minutes for the bed to cool a bit and then it just pops off.


Spool holder

I have printed the following spool holders to make sure the feeding of filament is resistance free.



Lessons learned:

As stated in many forums and guides - leveling is the most important of all!!!