Maciej

Introduction

Referring to the Critical vulnerability in Apache Log4j library, about which you can read in the link below will show a simple script with which we will be able to diagnose whether there is log4j on our system.

How check this ?

  • Download script and run
##For Ubuntu
root@master:/home/ozyrys# wget https://gist.githubusercontent.com/spy86/5d701751f3177f612faa21ca46b53f54/raw/2572cf9975da912f7b45e66e6c3a4bb3ac7de245/check_for_ubuntu.sh
root@master:/home/ozyrys# chmod +x check_for_ubuntu.sh
root@master:/home/ozyrys# ./check_for_ubuntu.sh
##For CentOS
root@master:/home/ozyrys# wget https://gist.githubusercontent.com/spy86/73f772de95b73cb4b77d7cca9abdd924/raw/71c98174de0b7cf90d30bf2ac4ddca351a4edf45/check_for_centos.sh
root@master:/home/ozyrys# chmod +x check_for_centos.sh
root@master:/home/ozyrys# ./check_for_centos.sh

Photo by Glenn Carstens-Peters on Unsplash

Command Comparison

Since TSV import is troublesome for both MySQL and PostgreSQL, it is best to create your own script to convert TSV to SQL.

PostgreSQL/MySQL information_schema

Since information_schema is a SQL standard, the same SQL can be used in either case.

Table list

Column list

Setup Default Connection

In PostgreSQL this is set by environment variable

export PGDATABASE = DB name
export PGHOST = host
export PGPORT = port number
export PGUSER = username
export PGPASSWORD = password

The password can also be set with ~/.pgpass

In MySQL we can set all in ~/.my.cnf

[client]
database = DB name
user = username
password = password

Introduction

If you really forget all the options, just type journalctlto see all the saved logs, if a long line is truncated, you can scroll to the right by pressing the arrow keys

Let’s start

View recent messages

root@test:/home/ozyrys# journalctl -e

Detailed information

root@test:/home/ozyrys# journalctl -ex

Monitor logs just like tail -f

root@test:/home/ozyrys# journalctl -f

Show only messages for specific services

root@test:/home/ozyrys# journalctl -u sshd

You can specify the full path of the executable file as in.

root@test:/home/ozyrys# journalctl /usr/sbin/sshd

Display only the end of the log

root@test:/home/ozyrys# journalctl -n 100

Display all messages from startup

root@test:/home/ozyrys# journalctl -b

Photo by Panos Sakalakis on Unsplash

Introduction

I will show you how to quickly change the proxy of the browser and the LAN to connect to using the command line.

You need administrator privileges to execute the command .

Preparation

Check Interface Name

netsh interface show interface

Virtual settings

Settings01:

  • Proxy: 10.21.21.100:8080
  • Ip Address: 10.21.21.10
  • Mask: 255.255.0.0
  • Gateway: 10.21.21.1
  • DNS: 10.21.21.200

Settings02:

  • Proxy: 172.10.1.100:9090
  • Ip Address: 172.10.0.10
  • Mask: 255.255.0.0
  • Gateway: 172.10.0.1
  • DNS: 172.10.0.200

Switch to Settings01

Switch to Settings02

Maciej

Maciej

DevOps Consultant. I’m strongly focused on automation, security, and reliability.