Thursday, 6 October 2022

 

Life is a running track

Things are moving fast
perhaps faster than I can follow
the feeling I can't grasp
or even swallow
I walk and the pressure is to run
I run and the pressure is to fly
nothing gives me any fun
only the desire to cry
Tears don't come out of eyes
Just the constant pain
I look around, I can't see anything
Just the emptiness in my veins
Just the pressure to run
Until when will I be running?
Why do I need to run at all?
Maybe life is a running track
and the finish line 
is death match

by Renato de Oliveira

Saturday, 4 June 2022

 Create a Yum Local repository

# yum install createrepo yum-utils epel-release nginx

# systemctl enable nginx

# systemctl start nginx

# systemctl status nginx

# firewall-cmd --zone=public --permanent --add-service=http

# firewall-cmd --reload

# mkdir -p /var/www/html/repos/{base,centosplus,extra,updates}

# reposync -g -l -d -m --repoid=base --newest-only --downloadcomps --download-metadata --download_path=/var/www/html/repos/

# reposync -g -l -d -m --repoid=centosplus --newest-only --downloadcomps --download-metadata --download_path=/var/www/html/repos/

# reposync -g -l -d -m --repoid=extras --newest-only --downloadcomps --download-metadata --download_path=/var/www/html/repos/

# reposync -g -l -d -m --repoid=updates --newest-only --downloadcomps --download-metadata --download_path=/var/www/html/repos/

# createrepo -v /var/www/html/repos/base/ -g comps.xml 

# createrepo -v /var/www/html/repos/centosplus/ -g comps.xml

# createrepo -v /var/www/html/repos/extras/ -g comps.xml

# createrepo -v /var/www/html/repos/updates/ -g comps.xml


Options error: --dh fails with 'dh2048.pem': No such file or directory (errno=2)

Options error: --cert fails with 'server.crt': No such file or directory (errno=2)

Options error: Please correct these errors.


-g – enables removing of packages that fail GPG signature checking after downloading.

-l – enables yum plugin support.

-d – enables deleting of local packages no longer present in the repository.

-m – enables downloading of comps.xml files.

--repoid – specifies the repository ID.

--newest-only – tell reposync to only pull the latest version of each package in the repos.

--download-metadata – enables downloading all the non-default metadata.

--download_path – specifies the path to download packages.


# vi /etc/nginx/conf.d/repos.conf

server {

        listen   80;

        server_name  192.168.10.1;  

        root   /var/www/html/repos;

        location / {

                index  index.php index.html index.htm;

                autoindex on;

        }

}


# systemctl restart nginx


Daily Update repository server

# vi /etc/cron.daily/update-localrepos

#!/bin/bash

##specify all local repositories in a single variable

LOCAL_REPOS=”base centosplus extras updates”

##a loop to update repos one at a time 

for REPO in ${LOCAL_REPOS}; do

reposync -g -l -d -m --repoid=$REPO --newest-only --download-metadata --download_path=/var/www/html/repos/

createrepo -g comps.xml /var/www/html/repos/$REPO/  

done

# chmod 755 /etc/cron.daily/update-localrepos


Client config


# vi /etc/yum.repos.d/local-repos.repo

[local-repo]

name=Local CentOS Repository

baseurl=http://192.168.10.1/base

gpgcheck=0

enabled=1


# yum repolist

# yum search nano

# yum install nano



 What is Docker

Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. By taking advantage of Docker’s methodologies for shipping, testing, and deploying code quickly, you can significantly reduce the delay between writing code and running it in production.


IMAGES

An image is a read-only template with instructions for creating a Docker container. Often, an image is based on another image, with some additional customization.


CONTAINERS

A container is a runnable instance of an image. You can create, start, stop, move, or delete a container using the Docker API or CLI. You can connect a container to one or more networks, attach storage to it, or even create a new image based on its current state.


Install Docker Centos


# curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo 

# yum sudo makecache

# yum install docker-ce --nobest

# systemctl enable docker

# systemctl status docker

# systemctl start docker

# docker run hello-world

# docker (list all command options)

# docker search browser (search for an image)

# docker pull centos (this will download an image to your local Docker repository)

# docker images (this will show all images stored onto your Docker repository)

REPOSITORY    TAG       IMAGE ID       CREATED         SIZE

centos        latest    300e315adb2f   5 days ago      209MB

hello-world   latest    bf756fb1ae65   11 months ago   13.3kB

#  docker run centos cat /etc/hosts (To run a command inside the centos container and exit)


# docker ps -l (This will list containers)

CONTAINER ID   IMAGE     COMMAND            CREATED              STATUS                          PORTS     NAMES

cf8ddd1911bb   centos    "cat /etc/hosts"   About a minute ago   Exited (0) About a minute ago             fervent_bose


# docker start cf8ddd1911bb (Re-run the same container using existing container ID)

# docker stop cf8ddd1911bb (this container is alread in exit state, but if you want to stop a running container use the command 'STOP')

# docker images (this command shows all images stored on your Docker repository)

REPOSITORY    TAG       IMAGE ID       CREATED         SIZE

centos        latest    300e315adb2f   5 days ago      209MB

hello-world   latest    bf756fb1ae65   11 months ago   13.3kB


Interactive SHELL within a container

# docker run -it centos bash (this command will start the container and initiate a BASH SHELL where you can interact with the container)

#exit and it will stop the container


# Keep container running and exit to host

<Ctrl>+<p> <Ctrl>+<q>


# docker ps -l

CONTAINER ID   IMAGE     COMMAND   CREATED              STATUS              PORTS     NAMES

7cf9311ecd3a   centos    "bash"    About a minute ago   Up About a minute             jovial_carver

# docker attach 7cf9311ecd3a   (To connect back to the container use the container ID)

# docker stop 7cf9311ecd3a   (to stop a container)

# docker kill 7cf9311ecd3a   (to kill a container)

Saturday, 15 August 2015

BRASIL, Um pais bonito

BRASIL, Um pais bonito
Um pais feliz
UM Pais pacifico
Um pais com musicas lindas
Compositores maravilhosos
Com uma natureza belissima
Com um povo batalhador
Com um povo forte
um Povo com amor
Amor pela vida
Nao pela morte
Um povo em busca
De dias melhores
Um povo sem direcao
Com muitos pobres
Um povo que divide
o pouco que se tem
um povo que resiste
e que quer o bem
Bem que ta deminuindo
e aos poucos evaporando
Bem que todos procuram
Mas nao sabem que estao procurando
Um povo com feridas
Marcas de um passado recente
Passado que vai e volta
E se torna presente
Um Brasil de prais lindas
de um domingao de sol
Brasil de samba e fevo
Brasil da paixao por futebol
Um brasil de violencia
Que chora por PAZ
Um Brasil de favelas e morros
de Sophias e socorros
que ja nao aguentam mais
Brasil que acroda cedo
Rala duro, mas que dorme no ponto
Sonha com o futuro
Sonha com um conto
Conto que nos faca acordar
Desse pesadelo
Que esta a nos cercar
Brasil um pais bonito
Esta comecando a desbotar
as poucos descolorindo
e toda sua beleza a se dessipar
O cotidiano com violencia
as ruas cheias de lixo
rios e mares poluidos
mangues e floreas destruidos
a agua ta acabando
Como a espercanca tambem
e o povo bonito sofrendo
e todos policos a quem
Nao ligam pra ninguem
so querem tirar, usar e usufruir
onde esta o lado certo
e quem esta do lado errado?
ninguem quer o bem
do mau que se alastra
um mau que destroi aos poucos
e a esperanca devasta
o sorriso ta amarelando
Ja nem tem mais dentes
ta perdendo as forcas
pra acordar cedo e ralar no batente
Brasil onde vais parar?
O que aconteceu contigo?
porque perdeste a capacidade de amar?
porque everedaste por este caminho
Tao dificil de voltar?
Brasil, enquanto houver esperanca
Eu vou lutar
Quero te ver feliz
Quero voltar a amar
Quero andar pelas ruas
sem me preocupar
Quero cumprimentar as pessoas
sem me amedrontar
quero ver o verde voltar a brotar
quero ver os rios e mares
limpos, bonitos sem poluicao
onde eu possa botar meus pes
quero escutar um samba
Com toda sua energia e felicidade
dancar ate de madrugada
com muita gente e fazer amizade
Em recife dancar o frevo
em Olinda subir a ladeira
coqueiros balancando com tranquilidade
contemplando a lua e o sol
o nordeste tao bonito
O Pantanal tao selvagem
o Rio tao colorido
Sao Paulo com sua bagagem
MInas do Pao e do queijo
Decompositores lindos
Como Flavio, Beto e Lo
Chico cade suas letras critas?
Caetano cade suas letras inteligentes?
e hora de todos nos juntarmos
e macharmos a frente
na luta pela igualdade
na luta pela paz
na luta pra trazer de volta o Brasil bonito
que esta se destruindo cada vez, mais e mais

por Renato de Oliveira

Friday, 31 July 2015

I've seen the dark


I've seen the dark
I experienced a fall
Everything was black
Surrounded by walls

I've been Down
I've seen below
No smile, only frown
No where to go

It is Time to rise
Be strong again
Surface and go above
And set free from the pain

See the sunshine
Feel the sun on my skin
See the blue skies
and the beauty around me

I've seen the dark
Dark I've never seen before
I don't want to be in the dark
Not anymore


By Renato de Oliveira.

Recovering the Root Password for SRX Series Devices

Last week I also had to break a password and did not remember how. So I had to research into it.
1. Reboot or power off and back on the juniper SRX
2. When the boot operation finishes, just press <SPACE> bar few times to have access to the boostrap loader prompt.
loader>boot -s

3. loader> System watchdog timer disabled
4. Set the new root password
                user@host>edit
     user@host# set system root-authentication plain-text-password
     user@host# commit

How to Factory Resta Juniper Firewall SRX

There are a couple of ways of factoring reset a Juniper firewall.


a) Having physical access to the firewall itself and you will find a button at front of the firewall.

All you need to do is find a paper clip and press the paper clip through the small hole and hold it for about 30 seconds.

b) If you have access to the the command line and can go to edit mode, do as follows:


  •                  root@firewall> edit
  •          root@firewall# load factory-default


Set root password:

root@firewall# set system root-authentication plain-text-password

root@firewall# commit

I am writing about this, because I had a firewall I started setting up few months ago and I had to reset it factory.