Dimas Maulana

Dimas Maulana

Developer

Welcome to my website! I am a developer with a current focus on React and Go. My experience encompasses both front-end and back-end development, enabling me to design and develop seamless and efficient applications.

List SSH Config Host

In SSH configuration files, you can define multiple hosts with different settings. To list all the defined hosts in your SSH config file using the sed command, you can use the following command:

1
2
```bash
sed -n '/^#/!s/Host //p' ~/.ssh/config

Here's what this command does:

- `sed` is a stream editor for filtering and transforming text.
- `-n` tells `sed` to suppress automatic printing.
- `/^#/!s/Host //p` is a `sed` expression:
  - `/^#/` matches lines that start with `#`, which are comments in the SSH config file.
  - `!` negates the match, so it selects lines that do not start with `#`.
  - `s/Host //` replaces the word "Host" with an empty string, effectively removing it from the line.
  - `p` instructs `sed` to print the modified lines.

When you run this command, it will display a list of host names defined in your SSH config file, excluding any commented-out entries. This can be useful to quickly see the configured hosts on your system.

SSH Proxy Jump: Simplifying Secure SSH Connections

Secure Shell (SSH) is a widely-used protocol for securely connecting to remote servers over an untrusted network, such as the internet. SSH ensures the confidentiality and integrity of data exchanged between the client and server. However, managing SSH connections to servers with complex network configurations can be challenging. This is where SSH Proxy Jump, also known as SSH Jump Host or SSH Bastion Host, comes in handy.

SSH Proxy Jump allows you to connect to a target server through an intermediate server, known as a jump host or bastion host. This intermediate server acts as a gateway, helping you traverse complex network topologies while maintaining security. In this article, we’ll explore how to use SSH Proxy Jump both via the command line and through SSH configuration files.

Essential Vim Commands for Log Messages and Plugin Mapping Details

Vim is a powerful text editor that offers a wide range of features and commands to enhance your productivity. In this article, we will explore two essential Vim commands that will help you manage log messages and check mapping details with plugins.

1. Viewing Log Messages

In Vim, log messages can be useful for debugging or understanding the history of your editing session. To view all log messages, you can use the :messages command. Here’s how it works:

Connect Kubectl Pods Kubernetes

To connect to a pod in Kubernetes using kubectl port-forward, you can follow the command you provided:

1
kubectl port-forward kubernetes-dashboard-7798c48646-ctrtl 8443:8443 --namespace=kube-system

This command is useful when you want to access a service running inside a Kubernetes pod from your local machine. Here’s a breakdown of the command:

  • kubectl port-forward: This is the command for port forwarding in Kubernetes.
  • kubernetes-dashboard-7798c48646-ctrtl: This is the name of the pod you want to connect to. Replace it with the actual name of the pod you want to access.
  • 8443:8443: This specifies the port forwarding configuration. It forwards port 8443 on your local machine to port 8443 on the pod. You can adjust the port numbers as needed.
  • --namespace=kube-system: This flag specifies the namespace in which the pod is located. In this case, it’s in the kube-system namespace.

After running this command, you can access the service running inside the pod on your local machine by connecting to https://localhost:8443 in your web browser. Make sure that the service you want to access is listening on port 8443 inside the pod for this to work.

About Bash Profile and Bash.Rc on Mac OS

The macOS Terminal.app uses a series of scripts and configuration files to set up the shell environment before you see the command prompt. Here’s an overview of these files and how they are executed:

  1. /etc/profile: This is a system-wide configuration file that is executed for all users when they start a new shell session. It sets up environment variables and configurations that are applicable to all users.

  2. /etc/bashrc: This file is also system-wide and is typically sourced (executed) by /etc/profile. It can contain additional configurations and environment variables that apply to all users and all shell sessions.

Moving Files From Google Drive Except Google Drive Files

If you want to move all files from Google Drive except for the ones with specific Google extensions (.gshortcut, .gdoc, .gsheet, .gslides, .gform, .gjam, .gmap, .gsite), you can use the rsync command with the --exclude option to specify the file extensions to be excluded. Additionally, you can exclude common system files like “Icon?” and “.DS_Store” to avoid transferring them. Here’s the command to achieve this:

1
rsync -avP --exclude="*.gshortcut" --exclude="*.gdoc" --exclude="*.gsheet" --exclude="*.gslides" --exclude="*.gform" --exclude="*.gjam" --exclude="*.gmap" --exclude="*.gsite" --exclude="Icon?" --exclude=".DS_Store" --remove-source-files "Google Drive ([email protected])/example/" ./temp

Explanation of the command:

0%