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
Created May 17, 2024 10:24
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

@gilangvperdana
gilangvperdana / README.md
Last active February 23, 2024 07:31
Create Mountpoint with Volume Group

General

If you want to create an mountpoint with Volume Group you can follow this step.

Topology

image

Case

  • We have 2 disk (/dev/sdb & /dev/sdc)
  • We want to combine that 2 disk to one Mountpoint (/mnt)
  • We want to dynamicly extend that disk if we have a new disk
@gilangvperdana
gilangvperdana / README.md
Created February 9, 2024 13:12
Auto DHCLIENT Spesific interface when Booting

General

If you need dhclient spesific interface every VM booting you can try this workaround

Workaround

for Example spesific interface on this workaround are ens18

  • Create this script
sudo nano /etc/init.d/dhclient-ens18
@gilangvperdana
gilangvperdana / README.md
Last active March 10, 2024 16:08
VirtualBox CLI
@gilangvperdana
gilangvperdana / install-tmux.sh
Created February 8, 2024 07:22 — forked from pokev25/install-tmux.sh
Install tmux 2.8 on centos 7
# Install tmux 2.8 on Centos
# install deps
yum install gcc kernel-devel make ncurses-devel
# cd src
cd /usr/local/src
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -LO https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz