• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Contact
  • Archives
  • Search

Ulysses

7zip in Mac OS

April 6, 2022 by Ulysses

Install

brew install p7zip

brew install p7zip

Extract

7z x file.7z

7z x file.7z

Compress

7z a file.7z mydirectory

7z a file.7z mydirectory

Filed Under: Mac Tagged With: append, brew, extract, install, p7zip

Remove Extended Attributes on Mac

April 3, 2022 by Ulysses

If you have a file with @ sign at end, this is how to remove extended attributes on the Mac OS.

Example.

ls -l
-rwxr-xr-x@  4 username  staff   128 Mar 24 10:51 sample.txt

ls -l -rwxr-xr-x@ 4 username staff 128 Mar 24 10:51 sample.txt

Remove extended attributes.

xattr -c sample.txt

xattr -c sample.txt

Result

ls -l
-rwxr-xr-x  4 username  staff   128 Mar 24 10:51 sample.txt

ls -l -rwxr-xr-x 4 username staff 128 Mar 24 10:51 sample.txt

Filed Under: Linux, Mac Tagged With: attributes, extended, mac os, remove

GCP Backup Instance

April 3, 2022 by Ulysses

Here’s the script to backup GCP disks.

#!/bin/bash
now=$(date +%s)
disks=$(gcloud compute disks list --project project-id --filter="users:instance" --format="value(name)")
for disk in $disks
do
  gcloud compute disks snapshot $disk \
  --snapshot-names=$disk-$now \
  --zone=us-central1-a \
  --project=project-id \
  --async
done

#!/bin/bash now=$(date +%s) disks=$(gcloud compute disks list --project project-id --filter="users:instance" --format="value(name)") for disk in $disks do gcloud compute disks snapshot $disk \ --snapshot-names=$disk-$now \ --zone=us-central1-a \ --project=project-id \ --async done

Filed Under: Cloud, Linux Tagged With: backup, disks, gcp, manual, snapshots

Vi Search and Replace

April 3, 2022 by Ulysses

How to do search and replace in Vim.

Search for “foo” and replace it with “bar” in the current line. Use :s

:s/foo/bar/g

:s/foo/bar/g

Search for “foo” and replace it with “bar” in the entire document. Use :%s

:%s/foo/bar/g

:%s/foo/bar/g

You can also pipe instead of forward slash. Useful if your search contains a /.

:%s|foo/|bar|g

:%s|foo/|bar|g

Filed Under: Linux Tagged With: entire, file, replace, search, vim

Redhat 8 Network Manager

March 10, 2022 by Ulysses

In Redhat 8, every time you the Network Manager get’s restarted it overwrites /etc/resolv.conf. To prevent that from hapenning, create a new file called /etc/NetworkManager/conf.d/90-dns-none.conf and add the following lines. Restart Network Manager. Your /etc/resolv.conf should be unchanged.

[main]
dns=none

[main] dns=none

Restart Network Manager

$ systemctl reload NetworkManager

$ systemctl reload NetworkManager

Filed Under: Linux Tagged With: network manager, overwrite, prevent, redhat 8, resolv.conf

GCP Project Quotas

March 8, 2022 by Ulysses

Here’s how to get your project quotas in GCP.

gcloud compute project-info describe --project your-project-id

gcloud compute project-info describe --project your-project-id

Filed Under: Cloud Tagged With: gcloud, gcp, project, quotas

GCP Regional Quotas

March 8, 2022 by Ulysses

Here’s how to get Regional Quotas for your project in GCP.

gcloud compute regions describe us-central1 --project your-project-id

gcloud compute regions describe us-central1 --project your-project-id

Filed Under: Cloud Tagged With: gcloud, gcp, project, quotas, regional

Windows Check If Port is Listening

March 3, 2022 by Ulysses

Here’s how to check if port is listening on a Windows Server.

Log in to the destination server.

netstat -ano | find "443" | find "LISTEN"
tasklist /fi "PID eq "443"

netstat -ano | find "443" | find "LISTEN" tasklist /fi "PID eq "443"

Filed Under: Misc Tagged With: check, listening, netstat, port, tasklist, windows

  • « Go to Previous Page
  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to page 4
  • Interim pages omitted …
  • Go to page 118
  • Go to Next Page »

Copyright © 2022