create local repo in rocky linux 8

How to create a local repo in Rocky Linux 8. Install nginx. Enable service. dnf install nginx systemctl enable nginx --now systemctl status nginx Create repo. dnf repolist dnf install createrepo yum-utils mkdir /usr/share/nginx/html/repos mkdir -p /usr/share/nginx/html/repos/{baseos,appstream} Sync repos. dnf reposync -g --delete -p /usr/share/nginx/html/repos/ --repoid=baseos --newest-only --download-metadata dnf reposync -g --delete -p /usr/share/nginx/html/repos/ --repoid=appstream --newest-only --download-metadata createrepo /usr/share/nginx/html/repos/baseos/ createrepo /usr/share/nginx/html/repos/appstream/ Create cron to sync repos daily. Create file called /etc/cron.daily/update-localrepos #!/bin/bash /bin/dnf reposync -g --delete -p /usr/share/nginx/html/repos/ --repoid=baseos --newest-only --download-metadata /bin/dnf reposync -g --delete -p /usr/share/nginx/html/repos/ --repoid=appstream --newest-only --download-metadata /usr/bin/createrepo /usr/share/nginx/html/repos/baseos/ /usr/bin/createrepo /usr/share/nginx/html/repos/appstream/ Create a file called /etc/nginx/conf.d/repos.conf. ...

January 30, 2022 · 1 min · ulysses

gcp cvs mount instructions

Here are the mount instructions for NFS and SMB drives for GCP Netapp CVS. NFS sudo yum install -y nfs-utils sudo apt-get install nfs-common sudo mkdir /condescending-sharp-hugle sudo mount -t nfs -o rw,hard,rsize=65536,wsize=65536,vers=3,tcp 10.49.253.6:/condescending-sharp-hugle /condescending-sharp-hugle SMB Mapping your network drive 1. Click the Start button and then click on Computer. 2. Click Map Network Drive. 3. In the Drive list, click any available drive letter. 4. In the folder box, type \\shared.mydomain.com\myshare. To connect every time you log on to your computer, select the Reconnect at sign-in check box. \\shared.mydomain.com\myshare 5. Click Finish.

January 28, 2022 · 1 min · ulysses

gcp list keys of service account

How to list all the keys of a GCP service account. gcloud iam service-accounts keys list \ --iam-account=your-service-account@your-project-id.iam.gserviceaccount.com \ --project project-id Result. Keys are redacted. KEY_ID CREATED_AT EXPIRES_AT DISABLED xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2022-01-10T19:21:18Z 2022-01-26T19:21:18Z xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2022-01-19T00:06:49Z 2022-02-04T00:06:49Z

January 26, 2022 · 1 min · ulysses

git switch from https to ssh

If you have trouble cloning a github repo using https, you can tell it to switch to SSH instead. Here’s the command. git config --global url.ssh://git@github.com/.insteadOf https://github.com/ I had to specify reconfigure when I ran terraform init. terraform init --reconfigure

January 20, 2022 · 1 min · ulysses

allow key access for user in ssh

Allow shared key access only for one user in SSH. Disable the password authentication for one user in your SSH config. Edit /etc/ssh/sshd_config. Match User username PasswordAuthentication no Restart the SSH service. service ssh restart Copy user’s public key to the destination server’s authorized file in ~/.ssh/authorized_keys. ssh-rsa AAAAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Back on your client, login via SSH. User will not be prompted for password since public key is already authorized on server. ssh username@server

January 16, 2022 · 1 min · ulysses

metadata url

Here’s the metadata URLs for both AWS and GCP. curl http://169.254.169.254/computeMetadata/v1/ -H "Metadata-Flavor: Google" curl http://169.254.169.254/latest/meta-data/

January 15, 2022 · 1 min · ulysses

json formatter

If you have a json file that needs formatting, you can use a built-in tool in Python. python -m json.tool sample.json Output will be printed on screen. You can also send the output to a file. python -m json.tool sample.json > sample2.json

January 12, 2022 · 1 min · ulysses

add alias in csh

How to add an alias in csh. Edit .cshrc file. Add an alias. alias hello ls -l Load. source .cshrc

January 8, 2022 · 1 min · ulysses

adding path in csh

How to add path in csh. Open or create .cshrc file. Add to an existing path. set path = ( /home/ubuntu $path ) Activate. source .cshrc

January 8, 2022 · 1 min · ulysses

lock a package in linux

Here’s how to lockdown a package to a specific version. Search for the current package. $ sudo rpm -qa | grep sdk google-cloud-sdk-365.0.1-1.x86_64 Install versionlock. yum install yum-plugin-versionlock Lock a package. yum versionlock google-cloud-sdk-365.0.1-1.x86_64 Display all locked versions. yum versionlock list Unlock and clear. yum versionlock clear

January 7, 2022 · 1 min · ulysses