Skip to content

Instantly share code, notes, and snippets.

View gilangvperdana's full-sized avatar
🎓
Still Learning

Gilang Virga Perdana gilangvperdana

🎓
Still Learning
View GitHub Profile
@gilangvperdana
gilangvperdana / README.md
Last active July 11, 2024 11:28
Integrate Logging with Promtail & Loki

General

Hello world, in this topic actually I'm making a logging visualization in grafana for GeoIP purposes. As we know, GeoIP cannot use Prometheus, we have to use metrics in the form of raw logs, which is called logging. Because I don't have a lot of resources for running the ELK Stack, in the end I just ran logging with Promtail + Loki. Follow this technical for installation and integration of Promtail & Loki.

I will continue from this article to visualize it with Promtail + Loki.

Change nginx.conf

	log_format json_analytics escape=json '{'
						'"msec": "$msec", ' # request unixtime in seconds with a milliseconds resolution
						'"connection": "$connection", ' # connection serial number
@gilangvperdana
gilangvperdana / README.md
Created July 5, 2024 11:23
Fix OpenSSH Denied with Pubkey on Windows Server

General

Have you ever wanted to change SSH authentication on your Windows server with a public key and it failed after setting it? let's follow this step

Create authorized_keys

cd C:\Users\Administrator\.ssh
ssh-keygen
type id_rsa.pub > authorized_keys
@gilangvperdana
gilangvperdana / README.md
Last active June 17, 2024 08:31
Deploy Openstack Caracal Single Node on Ubuntu Jammy with Kolla Ansible

General

I just want to deploy an Openstack Caracal Version (you can follow the update of Openstack Release on here) on my Ubuntu Jammy as LAB. I do on VirtualBox. You can see my previous article here, i just deploy Openstack Xena on Ubuntu Focal in Cloud/VM.

Goals

  • I want to deploy single node with all role of Openstack (Management & Compute) Caracal on branch Master on top of Ubuntu Jammy (22.04LTS) on VirtualBox
  • I want to access with FQDN os.test.link for External & osint.test.link for Internal FQDN
  • I want to use secondary Disk for VM Volumes (Cinder)
  • I want to makesure all service call with TLS
@gilangvperdana
gilangvperdana / README.md
Last active June 8, 2024 16:49
Test Port Lisen on Linux & Windows

General

If you want to test connection (port listen) to another server you can use netcat. On linux will be ncat command & on windows will be ncat command.

Linux

  • Installation
apt install -y netcat
  • Usage
@gilangvperdana
gilangvperdana / README.md
Last active June 2, 2024 01:39
See Serial Number of Virtual Disk

General

Have you ever confused about virtual disk with same size? then you can't choose who the right one? you can check with :

  • SCSI ID
  • UUID

Check with UUID

  • Windows
wmic diskdrive where index=0 get serialnumber
@gilangvperdana
gilangvperdana / README.md
Last active May 9, 2024 06:15
Port Forwarding with Windows Server

General

If you want to port forwarding use windows server, you can use netsh command. for now it's compatible just for TCP (not UDP).

Show existing rule

netsh interface portproxy show all

Delete Existing Configuration

@gilangvperdana
gilangvperdana / README.md
Last active April 18, 2024 05:12
Reset RDP License
@gilangvperdana
gilangvperdana / README.md
Last active March 26, 2024 05:59
Search Online Package Linux

General

If you want to download offline package on your Linux you can use this command

1

apt-get --print-uris install package_name

will give you a list of urls for packages you need to download.

2

How to secure a Proxmox exposed host

When you look for tutorials on how to install Proxmox, it always stops after the initial installation - which is quite dangerous, since it leaves a Proxmox host being exposed to the internet while listening to Ports 22 and 8006.

Heck, there is not even any SSH-hardening covered - your SSH is typically set to default values, which means: Password-authentication with the root account is perfectly possible. While you can mitigate some of these things by harding SSH or by installing fail2ban (which we will do anyhow), the host still exposes ports 22 and 8006.

For a secure system, these ports (and actually, apart from one single port ANY ports) have to be disabled. The only acceptable management access to the system should either happen via a Jumpserver or - if not available - via a direct VPN-connection.

In this gist, you find all the required steps to secure your Proxmox exposed host. This gist should work for any Proxmox host with - say - Hetzner, OVH or other vendor

@gilangvperdana
gilangvperdana / README.md
Created March 10, 2024 14:47
Overwrite /etc/resolv.conf on Linux with Netplan Configuration

General

If you want to overwrite your /etc/resolv.conf configuration with Netplan configuration you can follow this step.

Remove & Link

sudo rm /etc/resolv.conf
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

Reference