sftp command line

Here are command lines you can within SFTP. Login. sftp username@servername Commands available from the local client. lls lcd lmkdir lpwd lumask Commands available on remote server. cd chmod chown exit get help ln ls mkdir put pwd rename rm rmdir version !

February 6, 2022 · 1 min · ulysses

extend lvm logical volume

How to extend a LVM logical volume. Extend the physical drive. gcloud compute disks resize data-drive --size=40GB SSH to a server and extend the physical volume. $ pvresize /dev/sdb Physical volume "/dev/sdb" changed 1 physical volume(s) resized or updated / 0 physical volume(s) not resized $ pvs PV VG Fmt Attr PSize PFree /dev/sdb vg lvm2 a-- $ vgs VG #PV #LV #SN Attr VSize VFree vg 1 1 0 wz--n- $ lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert data vg -wi-ao---- Extend the logical volume. ...

February 5, 2022 · 2 min · ulysses

setup lvm on a vm

How to setup Logical Volume Manager on a VM. Install LVM. yum install lvm2 Check the disks available. We are going to run LVM on /dev/sdb. $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 20G 0 disk ├─sda1 8:1 0 200M 0 part /boot/efi └─sda2 8:2 0 19.8G 0 part / sdb 8:16 0 20G 0 disk Create a physical volume on /dev/sdb. $ pvcreate /dev/sdb Physical volume "/dev/sdb" successfully created. $ pvs PV VG Fmt Attr PSize PFree /dev/sdb vg lvm2 a-- Create a volume group called vg. ...

February 5, 2022 · 3 min · ulysses

gcp reset windows password

How to reset password of a GCP Compute Engine running on Windows OS. gcloud compute reset-windows-password servername \ --zone us-central1-a \ --project your-project-id Output This command creates an account and sets an initial password for the user [firstname_lastname] if the account does not already exist. If the account already exists, resetting the password can cause the LOSS OF ENCRYPTED DATA secured with the current password, including files and stored passwords. For more information, see: https://cloud.google.com/compute/docs/operating-systems/windows#reset Would you like to set or reset the password for [firstname_lastname] (Y/n)? y Resetting and retrieving password for [firstname_lastname] on [servername] Updated [https://www.googleapis.com/compute/v1/projects/your-project-id/zones/us-central1-a/instances/servername]. WARNING: Instance [servername] does not appear to have an external IP address, so it will not be able to accept external connections. To add an external IP address to the instance, use gcloud compute instances add-access-config. password: xxxxxxxxxxxxxxx username: firstname_lastname

February 4, 2022 · 1 min · ulysses

gcp terraform second drive

How to add a second drive on GCP Compute Engine using Terraform. provider "google" { project = "your-project-id" zone = "us-central1-c" } resource "google_compute_disk" "data-drive" { name = "data-drive" type = "pd-standard" zone = "us-central1-c" size = "20" } resource "google_compute_attached_disk" "attach-data-drive" { count = 1 disk = google_compute_disk.data-drive.id instance = google_compute_instance.test.id } resource "google_compute_instance" "test" { name = "test" machine_type = "e2-micro" boot_disk { initialize_params { image = "rocky-linux-cloud/rocky-linux-8" } } scheduling { preemptible = true automatic_restart = false } network_interface { network = "default" access_config { } } }

February 4, 2022 · 1 min · ulysses

yum cache corruption

If you’re getting a “HTTP Error 404 – Not Found” error when trying to run yum update, it could be a corrupted cache. Clear the cache on the system by running the following. yum clean all rm -rf /var/cache/yum/* Run yum update again. The errors should be gone.

February 4, 2022 · 1 min · ulysses

gcp compute add startup-script to metadata

How to add a startup-script to metadata. The script executes every time VM is started. gcloud compute instances add-metadata instance-name \ --project your-project-id \ --zone us-central1-c \ --metadata=startup-script='#! /bin/bash sudo -i echo "Time: $(date)" >> /tmp/date.txt'

February 2, 2022 · 1 min · ulysses

gcp create scheduled snapshots

How to create scheduled snapshots in GCP. gcloud compute resource-policies create snapshot-schedule hourly \ --description "my hourly schedule" \ --max-retention-days 7 \ --start-time 00:00 \ --hourly-schedule 1 \ --region us-central1 \ --on-source-disk-delete keep-auto-snapshots \ --storage-location US Add snapshot schedule to a disk. gcloud compute disks add-resource-policies disk-name \ --resource-policies hourly \ --zone us-central1-a gcloud compute disks create disk-name \ --resource-policies hourly \ --zone us-central1-a List snapshot schedules. gcloud compute resource-policies list Describe snapshot schedule. ...

February 2, 2022 · 1 min · ulysses

aws elb ssl listener

Here’s how to update SSL certificates to AWS ELB. Import SSL certificate aws acm import-certificate \ --certificate fileb://example.crt \ --private-key fileb://example.key \ --certificate-chain fileb://example-bundle.crt \ --tags Key=Name,Value=mydomain.com_20220107 \ --profile default Add SSL to a listener. aws elbv2 add-listener-certificates \ --listener-arn arn:aws:elasticloadbalancing:us-east-1:xxxxxxxxxxxxx:listener/app/elbname/xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx \ --certificates CertificateArn=arn:aws:acm:us-east-1:xxxxxxxxxxxx:certificate/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ --profile default Modify listener. Set SSL certificate as default. aws elbv2 modify-listener \ --listener-arn arn:aws:elasticloadbalancing:us-east-1:xxxxxxxxxxxxx:listener/app/elbname/xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx \ --certificates CertificateArn=arn:aws:acm:us-east-1:xxxxxxxxxxxx:certificate/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ --profile default Remove SSL from a listener. aws elbv2 remove-listener-certificates \ --listener-arn arn:aws:elasticloadbalancing:us-east-1:xxxxxxxxxxxxx:listener/app/elbname/xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx \ --certificates CertificateArn=arn:aws:acm:us-east-1:xxxxxxxxxxxx:certificate/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ --profile default

January 31, 2022 · 1 min · ulysses

gcp gcloud compute scp

Here’s how to download/upload files using gcloud compute scp. Make sure you are authenticated. gcloud auth login How to download. gcloud compute scp --recurse your-server:/home/username/yaml.tar.gz . \ --project your-project-id \ --zone us-central1-a \ --internal-ip How to upload. gcloud compute scp --recurse yaml.tar.gz your-server:/home/username/ \ --project your-project-id \ --zone us-central1-a \ --internal-ip

January 31, 2022 · 1 min · ulysses