Tuesday, August 27, 2024

Life Choices: Investing in the Future vs. Splurging on the Now

Investing $500 for a business -- too  much

Buy new phone $1500 -- no problem


Grocery Store -- $100 too much

Eating outside -- $500 lets goo


Learn new skill 2 hours -- too busy

Watch movie 3 hours -- lets rock


Choices we make are crazy...


***

Monday, August 19, 2024

Temporarily enable listening on a port on Linux

 To validate if a firewall access to specific port is accessible for remote connections or not can be validated as below.

On remote Linux machine run command "nc -l 14240", this will temporarily starts listening on the said port for a short duration.

If you want to persist then use "nc -L 14240"

Validate from your local Windows machine or another Linux server as described in post https://bypramod.blogspot.com/2024/08/telnet-alternative.html


***

Sunday, August 11, 2024

Network Time Protocol (NTP)

In Linux, Network Time Protocol (NTP) is the protocol used to synchronize the system clock with a remote server. 

NTP(Network time Protocol):

Validate if NTP is active by running below command, which provide output of current time, UTC time etc.

$ timedatectl

Example output:
$ timedatectl
Local time: Sat 2024-08-10 13:32:19 CDT
Universal time: Sat 2024-08-10 18:32:19 UTC
RTC time: Sat 2024-08-10 18:32:19
Time zone: America/Chicago (CDT, -0500)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no

If NTP is not activie, enable as below
$ sudo timedatectl set-ntp true
$ view /var/log/syslog | grep ntp

Install NTP client: An NTP client is a software component that synchronizes a computer’s clock with a reference time source, typically an NTP server. The client periodically requests the current time from the server and adjusts its local clock accordingly.
$ sudo apt install ntpdate
$ sudo apt install ntp

Verify: $ ntpstat, $ntpq -p

Sync time with Chrony:

Install as below
$ sudo apt install chrony
or
$ sudo yum install chrony
Verify By:
$ sudo service chronyd status
In RHEL7: vi /etc/chrony.conf
In RHEL6: VI /etc/ntp.conf

Some use full chronyc commands

1) For tracking
$ chronyc tracking

2) To know sync sources
$ chronyc sources
$ chronyc sources -v

3) To know stats
$ chronyc sourcestat

Summary:
NTP, chrony, openntpd are implementations of the Network Time Protocol (NTP). 

Chrony is more modern with improved timestamping, authentication and encrypting. It has smaller code size and lightweight than NTP and is default in RHEL variants.
NTP is traditional implementation and has larger code size and more resource intensive.
Openntpd is another implementation.

***

Saturday, August 10, 2024

How to fix Blogger/blogspot for "ads.txt" error

Google adsense showing error "Earnings at risk - You need to fix some ads.txt file issues to avoid severe impact to your revenue. Fix now"


1) Sign in to your Google adsense account.

2) Navigation on Left pane select "sites" --> Click on site URL correspondingly, example "bypramod.blogspot.com" --> Click "copy" 

Example replace publisher id: google.com, pub-id, DIRECT, f08c47fec0942fa0

3) Create file "ads.txt" with content copied from above step.

4) Upload "ads.txt" file to root directory of site.

5) Verify by "https://example.com/ads.txt"

   or

   Click on "sites" as in 2nd step and click on corresponding website and click "Check for updates"


In order to update for blogspot.

1) Go to www.blogger.com

2) Select the blog where ads.txt file to update

3) Navigation "settings" --> "Monetization" --> Enable custom ads.txt --> update/upload content from ads.txt file generated above.


***


Friday, August 9, 2024

Telnet Alternative

Using the "telnet" command in Linux can be risky due to its vulnerability to attacks, which is why many operating systems, particularly in corporate environments, have it disabled by default. Thankfully, there are safer alternatives for testing network connections.

On Linux: Using nc (Netcat)

Instead of relying on telnet, you can use the nc (Netcat) command to test connections. Here's how:

$ nc -zv 100.104.48.16 14240

Successful Connection:

If the connection is successful, you'll receive a confirmation message:

Connection to 100.104.48.16 14240 port [tcp/*] succeeded!

Failed Connection:

If the connection fails, you'll see an error like this:

nc: connect to 100.104.48.16 port 14240 (tcp) failed: Connection timed out

On Windows: Using Test-NetConnection

Windows users can use the Test-NetConnection cmdlet as an alternative. Here's an example command:

Successful Connection:

A successful connection will produce an output similar to this:

ComputerName : 100.14.16.3
RemoteAddress : 100.14.16.3
RemotePort : 14240
InterfaceAlias : Ethernet 3
SourceAddress : 17.19.4.78
TcpTestSucceeded : True

Failed Connection:

If the connection fails, you’ll see a warning message:

WARNING: TCP connect to (100.14.16.3 : 14240) failed

***

Sunday, August 4, 2024

Simple diversify your $100K

 I would suggest splitting into 4 equal parts

1) Invest $25k in index fund like VOO

2) Invest $25k in treasury bonds/bills like in https://www.treasurydirect.gov/

3) Invest $25k in individual stocks.

4) Rest $25K in High yield savings account


Also, I suggest doing some Life insurance, health insurance etc.

***