Skip to content

Instantly share code, notes, and snippets.

View ashishjullia's full-sized avatar
💻
Exploring

Ashish Jullia ashishjullia

💻
Exploring
View GitHub Profile
$ dig screego.ashishjullia.com +short
172.67.199.112
104.21.76.188
$ nc -vzw 1 172.64.80.1 3478
172.64.80.1 3478 (stun): Connection timed out
$ nc -vzw 1 104.21.76.188 3478
104.21.76.188 3478 (stun): Connection timed out
$ nc -vzw 1 172.64.80.1 80
172.64.80.1 80 (http) open
@ashishjullia
ashishjullia / visual-studio-code-remove-blank-lines-from-code.md
Last active September 1, 2023 17:15
visual-studio-code-remove-blank-lines-from-code

You can use regular expressions.

  1. Open your code in Visual Studio Code
  2. From Edit Menu, select Replace or use a short cut key (command + Option + F on Mac or Ctrl + H on Windows)
  3. In the find box type ^(\s)*$\n
  4. Leave the replace box empty
  5. Make sure the 'Use Regular Expression' is selected
  6. Select the 'Replace All' button

image

@ashishjullia
ashishjullia / Convert_a_private_key_to_a_single_line_using_sed_command_line_tool.md
Last active August 26, 2023 21:46
Convert a private key to a single line using sed command line tool.
sed ':a;N;$!ba;s/\n/\\n/g' certificate_file_name_or_key_file_name | sed 's/^[ \t]*//;s/[ \t]*$//'

Let's break it down step by step.

1. sed ':a;N;$!ba;s/\n/\\n/g' certificate_file_name_or_key_file_name:

  • :a: Define a label called 'a'.
  • N: Append the next line of input to the current pattern space (with an embedded newline).
@ashishjullia
ashishjullia / eks-kubernetes-resources-permissions.json
Last active July 26, 2023 02:12
eks-kubernetes-resources-permissions
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"eks:AccessKubernetesApi",
"eks:DescribeCluster",
"eks:ListClusters",
@ashishjullia
ashishjullia / federated-role-trust-policy-eks-console-access.json
Created July 26, 2023 02:09
federated-role-trust-policy-eks-console-access
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::<account-number>:user/<username>"
]
},