Create a web project with Tailwind CSS

Project folder and Node.js activation

mkdir tailwind-demo
cd tailwind-demo
npm init

Install Tailwind CSS

npm install -D tailwindcss
npx tailwindcss init

You will have dev dependency for tailwind and tailwind.config.css

Configure path

Change content element like below to dedicate the directory.

content: ["./src/**/*.{html,js}"],

Add Tailwind directives

Create src folder and input.css file. You will have src/input.css, then add below lines.

@tailwind base;
@tailwind components;
@tailwind utilities;

Tailwind CSS Watch Tool into package.json

Add this watch script into your package.json scripts section. We will start our project with this command later.

"watch": "npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch"

Create a HTML page for testing purpose

Under src folder create an index.html file, then add below lines.

<!doctype html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="/dist/output.css" rel="stylesheet">
</head>
<body>
  <h1 class="text-3xl font-bold underline">
    Hello world!
  </h1>
</body>
</html>

Start your project

npm run watch

Open index.html file in your browser by using LiveServer or another testing tool. You will see the page with Tailwind support. Enjoy.

http://127.0.0.1:5500/src/index.html
Application Servers kategorisine gönderildi | Yorum yapın

Install Go on CentOS

Check Version

go version

Download and Unzip

wget https://go.dev/dl/go1.18.5.linux-amd64.tar.gz

tar -C /usr/local -zxvf go1.18.5.linux-amd64.tar.gz

Add to Environment Variable and Take Effect

vi /etc/profile

export PATH=$PATH:/usr/local/go/bin

source /etc/profile
Application Servers kategorisine gönderildi | Yorum yapın

Linux Best Practices

CPU
lscpu
cat /proc/cpuinfo

Memory Usage
free
cat /proc/meminfo
top
htop

Disk Usage
df -h
du -h

OS Check
cat /etc/os-release
cat /etc/system-release
lsb_release -a
sw_vers

Users
w, who, users
cat /etc/passwd


Groups
cat /etc/group

Change Password
passwd

Port Check
netstat -ant

Change Directory

cd /path/to/you/want/to/goİstediğin dizine geçer
cd -Eski çalıştığın dizine geçer
Linux kategorisine gönderildi | Yorum yapın

SFTP Configuration on CentOS

It is a cheat sheet for SFTP configuration on CentOS. Long version is on DigitalOcean.

Create a User

sudo adduser xfiles
sudo passwd xfiles

Create a Directory for File Transfers

sudo mkdir -p /var/sftp/uploads
sudo chown root:root /var/sftp
sudo chmod 755 /var/sftp
sudo chown xfiles:xfiles /var/sftp/uploads

Configure SSH Deamon

sudo vi /etc/ssh/sshd_config

Match User xfiles
ForceCommand internal-sftp
PasswordAuthentication yes
ChrootDirectory /var/sftp
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no

Restart SSD Deamon

sudo systemctl restart sshd

Test in the Server

sftp xfiles@localhost

Well Done!

Application Servers kategorisine gönderildi | Yorum yapın

VNC ile RHEL Uzak Masaüstü

  1. Önce bir desktop uygulaması yüklememiz lazım.
    yum groupinstall "GNOME Desktop"
  2. TigerVNC sunucusunu fontlarıyla birlikte yüklemeliyiz.
    yum install tigervnc-server xorg-x11-fonts-Type1
  3. 5903 portundan yayın yapabilmesi için bir service oluşturalım.
    cp /lib/systemd/system/[email protected] /etc/systemd/system/vncserver@:3.service
  4. Kullanıcı bilgisini tüm <USER> alanlarını değiştirerek güncelleyelim.
    vi /etc/systemd/system/vncserver@:3.service
  5. İlgili kullanıcıya geçiş yapıp vncserver için kullanıcı ve şifre oluşturalım.
    vncserver
  6. Aşağıdaki komutlarla da deamonu enable edip başlatalım
    systemctl daemon-reload
    systemctl start vncserver@:3.service
    systemctl enable vncserver@:3.service

Artık VNC viewer ile bağlanabiliriz 🙂

Linux kategorisine gönderildi | Yorum yapın

CentOS 7 & Red Hat Enterprise Linux 7 Java Kurulumu

  1. sudo -i
  2. yum update
  3. yum list available java\*
  4. yum install java-11-openjdk
  5. alternatives –config java
  6. choose you want
Java, Linux kategorisine gönderildi | Yorum yapın

Linux X11Forwarding

Linux sunucu ekranını kendi masaüstümüze çekmek için X11Forwarding açmamız lazım. Aşağıdaki komutlarla açabiliriz.

cat /etc/ssh/sshd_config
vi /etc/ssh/sshd_config

AddressFamily inet
X11Forwarding yes

service sshd restart

touch /home/user/.Xauthority
xauth list
xauth add

Application Servers kategorisine gönderildi | Yorum yapın

Docker Cheat Sheet

## Docker Version and Info
docker -v
docker info


## List Images
docker images

## List Containers (running, all)
docker container ls
docker container ls --all
docker ps
docker ps -a


## Run a New Container
docker run <image-name>
docker run --name
<name> <image-name>
docker run -p
<outer-port>:<inner-port> <image-name>
docker run -d -p
<outer-port>:<inner-port> <image-name>

## Start a Container
docker start <name>

## Stop a Container
docker stop <name>

## Remove a Container
docker rm <container-id>
docker rm -f
<container-id>

## Remove an Image
docker rmi <image-name>

## Remove All Stopped Containers
docker container prune

## Remove All Unused Images
docker image prune -a

## Connect to Docker via Bash
docker exec -it <name> bash

Install Docker
yum install docker

Start Docker Deamon
systemctl start docker

Create a Postgres Container
docker run -d --name my-postgres -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres

Create a Keycloak Server
docker run -d --name my-keycloak -e KEYCLOAK_USER=keyadmin -e KEYCLOAK_PASSWORD=keypass -p 7000:8080 jboss/keycloak 

Create a Konga Admin GUI
docker run -d --name my-konga -p 1337:1337 -e "TOKEN_SECRET=somerandomstring" -e "DB_ADAPTER=postgres" -e "DB_HOST=kong-database" -e "DB_PORT=5432" -e "DB_USER=kong" -e "DB_PASSWORD=kong" -e "DB_DATABASE=konga" -e "NODE_ENV=development" --net=kong-net pantsel/konga

Create a Docker Network
docker network create --driver bridge kong-net

Connecting a Docker Container to a Network
docker network connect kong-net kong-database

Docker Compose Pull
docker-compose pull && docker-compose down && docker-compose up -d

Docker kategorisine gönderildi | Yorum yapın