Change local port in Sendmail

28 Apr, 2020


First we must change the port(2525) for the daemon in the following file: nano /etc/mail/

DAEMON_OPTIONS(`Port=2525,Addr=, Name=MTA-v4')dnl
DAEMON_OPTIONS(`Port=587,Addr=, M=Ea, Name=MSP-v4')dnl

To be able to send message to port 2525 with the commands mail and sendmail, we will have to modify the following file and create a SMART_HOST in this: nano /etc/mail/

VERSIONID(`$Id:, v 8.15.2-3 2015-12-10 18:02:49 cowboy Exp $')
define(`RELAY_MAILER_ARGS',`TCP $h 2525')dnl
FEATURE(`msp', `[]')dnl

Apply settings whit the following commands:

make -C /etc/mail
m4 /etc/mail/ > /etc/mail/
m4 /etc/mail/ > /etc/mail/

Restart de daemon sendmail: systemctl restart sendmail

Check that the daemon is running on the port we want:

# lsof -i -P -n | grep sendmail
sendmail- 31492     root    4u  IPv4 10544619      0t0  TCP (LISTEN)
sendmail- 31492     root    5u  IPv4 10544620      0t0  TCP (LISTEN)

With this we can already send the email with the change local port:

echo "Test Email" | mail -s "Subject Here"

Examples Nanorc

14 Oct, 2019


Syntax Files


Paths nanorc syntax files

  • sudo nano /usr/share/nano/markdown.nanorc
  • sudo nano /usr/local/share/nano/markdown.nanorc

Example sysntax for Markdown

syntax "markdown" "\.md$" "\.markdown$"

## Quotations
color cyan "^>.*"

## Emphasis
color green "_[^_]*_"
color green "\*[^\*]*\*"

## Strong emphasis
color brightgreen "\*\*[^\*]*\*\*"
color brightgreen "__[\_]*__"

## Underline headers
color brightblue "^====(=*)"
color brightblue "^----(-*)"

## Hash headers
color brightred "^#.*"

## Linkified URLs (and inline html tags)
color brightmagenta start="<" end=">"

## Links
color brightmagenta "\[.*\](\([^\)]*\))?"

## Link id's:
color brightmagenta "^\[.*\]:( )+.*"

## Code spans
color yellow "`[^`]*`"

## Multi-line code span
color yellow start="^```$" end="^```$"

## Links and inline images
color brightmagenta start="!\[" end="\]"
color brightmagenta start="\[" end="\]"

## Lists
color yellow "^( )*(\*|\+|\-|[0-9]+\.) "

Include yours syntax files nano ~/.nanorc

include /usr/local/share/nano/*   

Massive editor json for Kubernetes

16 Jul, 2019


In this post we will see the use of a custom bash (kmae and kselect) function that can save you time in your Kuberentes environments.

The idea is to interact with Kubernetes to be able to quickly edit a large amount of resources using grep filters; external (kubectl get pod) and internal (kubectl get pod -o json).


Kmae: It can be very dangerous if it is not used with caution, it saves three days of json edited to be able to recover them in the case of needing them in $HOME/.kmae. You can create backup of your cluster in json using:  

To test it you can create an environment with several nginx with the following for:

for i in $(seq 1 6); do
  kubectl create namespace nginx-$i;
  kubectl create deploy nginx-$i -n nginx-$i --image=nginx;

  Gif tty  

We will use kselect to test your filters in the first place:



Example: Get json path spec.strategy.rollingUpdate of the nginx with name nginx-1 to 3 and generation equal to 1 in all namespaces

kselect deploy "(nginx-[1-3])" '"observedGeneration": 1' .spec.strategy.rollingUpdate --all-namespaces


In the second place, modify the spec.strategy.rollingUpdate of the three deployments at the same command:




kmae deploy "(nginx-[1-3])" '"observedGeneration": 1' '{"spec":{"strategy":{"rollingUpdate":{"maxUnavailable": "50%", "maxSurge": "45%"}}}}' --all-namespaces


We tested the previous kselect that does not return anything because the generation number changed:

kselect deploy "(nginx-[1-3])" '"observedGeneration": 1' .spec.strategy.rollingUpdate --all-namespaces

If it works if we change the generation:

kselect deploy "(nginx-[1-3])" '"observedGeneration": 2' .spec.strategy.rollingUpdate --all-namespaces


One last test with modification of replicas:

kselect deploy "(nginx-[1-3])" '"observedGeneration": 2' .spec.replicas --all-namespaces
kmae deploy "(nginx-[1-3])" '"observedGeneration": 2' '{"spec":{"replicas":2}}' --all-namespaces
kselect deploy "(nginx-[1-3])" '"observedGeneration": 3' .spec.replicas --all-namespaces


Clean enviroment:

for i in $(seq 1 6); do 
  kubectl delete deploy nginx-$i -n nginx-$i --force --grace-period=0;
  kubectl delete namespace nginx-$i --force --grace-period=0;