cloudflared tunnel on ubuntu

 Berikut tutorial pembuatan Cloudflare Tunnel step-by-step lengkap dengan gambar dari tangkapan layar Anda, untuk pemahaman yang praktis dan rapi:
1️⃣ Login ke Cloudflare Dashboard

    Akses: https://dash.cloudflare.com/

    Masuk menggunakan akun email Anda.

    Pilih akun yang akan digunakan untuk tunnel.

2️⃣ Masuk ke menu Zero Trust → Tunnels

    Klik Zero Trust di sidebar.

    Pilih Networks → Tunnels.

    Anda akan melihat daftar tunnel aktif dan tidak aktif.

3️⃣ Klik Create a Tunnel

    Klik tombol + Create a tunnel.

4️⃣ Pilih metode koneksi tunnel

    Pilih Cloudflared (Recommended).

    Klik Select Cloudflared.

5️⃣ Ikuti instruksi instalasi Cloudflared

Jika belum menginstall cloudflared:

# Tambah GPG key
sudo mkdir -p --mode=0755 /usr/share/keyrings
curl -fsSL https://pkg.cloudflare.com/cloudflare-main.gpg | sudo tee /usr/share/keyrings/cloudflare-main.gpg >/dev/null

# Tambah repository
echo 'deb [signed-by=/usr/share/keyrings/cloudflare-main.gpg] https://pkg.cloudflare.com/cloudflared any main' | sudo tee /etc/apt/sources.list.d/cloudflared.list

# Update dan install
sudo apt-get update

sudo apt-get install cloudflared

6️⃣ Jalankan tunnel dengan token

Setelah cloudflared terinstall, Anda bisa:

    Jalankan otomatis saat boot:

sudo cloudflared service install <TOKEN_YANG_DISEDIAKAN>

    Atau jalankan manual:

cloudflared tunnel run --token <TOKEN_YANG_DISEDIAKAN>


Token didapat dari tampilan pembuatan tunnel.
7️⃣ Tunnel berhasil dibuat

Tunnel Anda akan muncul di daftar dengan status HEALTHY jika berjalan normal.

8️⃣ Konfigurasi Routes

Jika ingin mengarahkan domain ke server lokal Anda:

    Klik Configure pada tunnel.

    Tambahkan Public Hostname sesuai domain/subdomain dan arahkan ke port lokal server Anda (misal port 80/443).

    Simpan konfigurasi.

 

Gunakan systemctl status cloudflared untuk memeriksa status tunnel jika menggunakan service.

Livewire upload file error ketika production http ke https

Ringkasan ini tidak tersedia. Harap klik di sini untuk melihat postingan.

Livewire Error The Command PDF To text Upload file / Library ini adalah wrapper PHP untuk binary pdftotext dari Poppler, berfungsi untuk mengubah file PDF menjadi teks secara akurat dan cepat.

 


📌 Upload PDF dan Konversi ke Teks di Laravel Livewire

1️⃣ Install library


composer require spatie/pdf-to-text

Install pdftotext di server:

    Ubuntu/Debian:


sudo apt-get install poppler-utils

CentOS:


sudo yum install poppler-utils

macOS:


    brew install poppler

2️⃣ Buat Livewire Component


php artisan make:livewire UploadPdfText

3️⃣ Edit UploadPdfText.php

<?php

namespace App\Http\Livewire;

use Livewire\Component;
use Livewire\WithFileUploads;
use Spatie\PdfToText\Pdf;

class UploadPdfText extends Component
{
    use WithFileUploads;

    public $file;
    public $parsedText;

    public function parsePdf()
    {
        $this->validate([
            'file' => 'required|file|mimes:pdf|max:20480', // Max 20MB
        ]);

        $path = $this->file->getRealPath();
        $text = Pdf::getText($path);

        $this->parsedText = $text;
    }

    public function render()
    {
        return view('livewire.upload-pdf-text');
    }
}

4️⃣ Buat upload-pdf-text.blade.php


<div class="p-6 bg-white border rounded shadow">
    <h2 class="text-lg font-semibold mb-4">Upload PDF dan Konversi ke Teks</h2>

    <input type="file" wire:model="file" accept="application/pdf" class="mb-2">
    <div wire:loading wire:target="file">Mengupload...</div>

    <button wire:click="parsePdf"
        class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600">Proses PDF</button>

    @if ($parsedText)
        <div class="mt-4">
            <h3 class="font-semibold mb-2">Hasil Teks:</h3>
            <pre class="p-2 bg-gray-100 rounded max-h-[400px] overflow-auto text-sm">{{ $parsedText }}</pre>
        </div>
    @endif
</div>

5️⃣ Tambahkan ke Route atau Blade


Di halaman Blade:

@livewire('upload-pdf-text')

Atau route untuk testing:

Route::get('/upload-pdf', function () {
    return view('pdf-upload-page'); // berisi @livewire di atas
});

✅ Hasil


🔹 User upload file PDF.
🔹 Tekan tombol Proses PDF.
🔹 Teks dari PDF akan ditampilkan di layar, siap untuk di-copy atau disimpan ke DB.

JIKA TERJADI ERROR DAN BERMASALAH DENGAN /usr/bin/pdftotext

 Direkomendasikan: Gunakan Wrapper Script

Buat shell script kecil untuk membungkus pdftotext dengan LD_LIBRARY_PATH kosong, lalu arahkan Spatie ke script ini.
📁 Langkah-langkah:
1. Buat file /usr/local/bin/pdftotext-wrapper

Isi file dengan:

#!/bin/bash
LD_LIBRARY_PATH= /usr/bin/pdftotext "$@"

2. Jadikan script bisa dieksekusi:

chmod +x /usr/local/bin/pdftotext-wrapper

3. Ubah kode PHP:

use Spatie\PdfToText\Pdf;

$text = Pdf::getText('/path/to/file.pdf', '/usr/local/bin/pdftotext-wrapper');

🔚 Kesimpulan:

    LD_LIBRARY_PATH harus dikosongkan, jadi gunakan LD_LIBRARY_PATH=

    Tapi karena Pdf::getText() tidak mendukung parameter ketiga, kamu tidak bisa langsung menyetel env di situ

    Solusi paling bersih: Gunakan wrapper script yang menyetel env kosong, lalu arahkan Pdf::getText() ke script itu 






Resize an UNDO tablespace Oracle 10g

1.

sqlplus SYS AS SYSDBA

2.

SELECT file_name, tablespace_name, bytes/1024/1024 UNDO_SIZE_MB, SUM(bytes/1024/1024) OVER() TOTAL_UNDO_SIZE_MB FROM dba_data_files d WHERE EXISTS (SELECT 1 FROM v$parameter p WHERE LOWER (p.name)='undo_tablespace' AND p.value=d.tablespace_name);

3.
alter database datafile '/oracle/ora10g/ecms/syscom01.dbf' resize 4G;


Note: It is not recommended to grow any data files above 20 GB in size. If a tablespace needs to be grown over 20 GB a new datafile has to be added.



source  : https://www.ibm.com/docs/en/tnpm/1.4.4?topic=administration-resize-undo-tablespace


https://forums.oracle.com/ords/apexds/post/resize-datafile-5440

How to increase PROCESSES initialization parameter. ORA-00020 maximum number of processes exceeded..

 ORA-00020 maximum number of processes exceeded

Cause: All process state objects are in use.

Action: Increase the value of the PROCESSES initialization parameter.


ORA-00020 comes under "Oracle Database Server Messages". These messages are generated by the Oracle database server when running any Oracle program.



1.   Login as sysdba

   sqlplus / as sysdba

   

2. Check Current Setting of Parameters

   sql> show parameter sessions;

   sql> show parameter processes;

   sql> show parameter transactions;


3.   If you are planning to increase "PROCESSES" parameter you should also plan to increase "sessions and "transactions" parameters

   A basic formula for determining these parameter values is as follows:

   

      processes=x

      sessions=x*1.1+5

      transactions=sessions*1.1

      

4.   These paramters can't be modified in memory. You have to modify the spfile only (scope=spfile) and bounce the instance.

   sql> alter system set processes=500 scope=spfile;

   sql> alter system set sessions=555 scope=spfile;

   sql> alter system set transactions=610 scope=spfile;

   sql> shutdown abort
   sql> startup



#source : https://www.linkedin.com/pulse/how-increase-processes-initialization-parameter-ora-00020-jain

CIFS (Common Internet File System) how to mount file from network sharing folder Ubuntu

CIFS stands for Common Internet File System. It's a network file system protocol that allows computers to share files and printers over a network. It's widely used in Windows environments but can also be used on Linux and macOS systems.

 

 

Create a Mount Point:

 

Bash
sudo mkdir /mnt/vbox

 

Mount the Share: Use the following command to mount the share:
Bash
 

sudo mount -t cifs //server_ip_address/share_name /mnt/mount_point -o username=your_username,password=your_password

 

To ensure that files created within a CIFS mount are owned by root, you can use the uid and gid options when mounting the share:

sudo mount -t cifs //server_ip_address/share_name /mnt/mount_point -o username=your_username,password=your_password,uid=0,gid=0

 

uid 0 = user root

gid 0  = group root


To view the UID (user ID) and GID (group ID) of files and directories using the ls command on Ubuntu, you can use the -l option:
Bash

ls -l

Gunakan kode dengan hati-hati.

This will display a long listing of files and directories, including the following information for each:

    Permissions: The file permissions in the format rwxrwxrwx (read, write, execute permissions for owner, group, and others).
    Link count: The number of hard links to the file.
    Owner: The username of the file owner.
    Group: The group name of the file.
    File size: The size of the file in bytes.
    Modification date: The date and time the file was last modified.
    Filename: The name of the file or directory.

To see the numerical UID and GID instead of the usernames and group names, you can use the -n option:
Bash

ls -ln

Gunakan kode dengan hati-hati.

This will display the numerical UID and GID in the owner and group columns, respectively.

Example:

-rw-r--r-- 1 user_name group_name 1024 Nov  6 12:34 file.txt

In this example:

    -rw-r--r--: The file permissions
    1: The number of hard links
    user_name: The owner of the file
    group_name: The group of the file
    1024: The file size in bytes
    Nov 6 12:34: The modification date and time
    file.txt: The filename

If you need more detailed information about a specific file, you can use the stat command:
Bash

stat file.txt

Gunakan kode dengan hati-hati.

This will display a wealth of information about the file, including its inode number, block size, access time, modification time, change time, and more.