RHCSA exam local repo subscription manager error, - linux

I took the RHCSA certification exam and Question 2 required me to create a local repo. I executed the command "yum config-manager --add-repo / path / to / AppStream", but when I executed the commands "yum clean all" and "yum install httpd", I was required to "subscription manager regisrty". I informed the supervisor about this. But he said that I was wrong. I told them that they had to solve it. And I did not move on to the next task in the exam. It took me a lot of time.
I wrote to the person who sent the exam results. they also just send me exam results. Where can I apply for this?

You cannot use that command in RHCSA exam.You have to add repo manually.

You need to create a repo in /etc/yum.repos.d/, These are the steps to create a local repo.
vim /etc/yum.repos.d/ #create a new file here.
#yum config looks in this folder when searching for repositories
#configure file as seen below with the given repo urls and name.
[AppStream] #this is just a tag name
name=AppStream #name of repo
baseurl=https://whatever.xyz.redhat.com/AppStream #url of repo you are given
gpgcheck=0 #this tells yum to not check gpgkeys for repo
enable=1 #this enables the local repo
yum clean all
This should work to have yum recognize the repos you want to connect to and install from. you may need to also log into the repo using
subscription-manager register #hit enter to add username and password.
Hopes this helps.

Related

GitLab projects failed their last repository check

I have received a gitlab alert mail stating that "One project failed its last repository check".
I did check the error in Gitlab admin panel as "Last repository check (just now) failed. See the 'repocheck.log' file for error messages." As suggested in Admin Panel in Gitlab, i have checked the repocheck.log file and the error is as below.
"Could not fsck repository: error: Could not read 0f188244898707e6090498bc03aafd8ac25e776e
failed to parse commit 0f188244898707e6090498bc03aafd8ac25e776e from object database for commit-graph
error: Could not read 4ab7111f3f8f1083cee8e33ec033c18edfefb0e9"
This happened the same with another repo last week. Even that had similar error message and it is not resolved yet. Tried to clone the same repo in another gitlab instance to recreate the issue but the repo check there seems to be fine.
Unable to find proper solution for that. Could any one please help on this.
It seems to be an active issue: https://gitlab.com/gitlab-org/gitaly/-/issues/2359#note_966195929 The issue is a couple of years old, but the note I link to, has updates from today, including info on fixes and workarounds.
In any case: The commit-graph is a relatively new feature and since it is a form of index into packed data, it can be recreated. So the corrupted repo can be easily fixed without loss of data.
It can be reproduced like this:
Visit a commit graph: Project sidebar / Repository / Graph
Delete one of the visible commits by rewriting history:
git checkout <branch>
git reset head~1
git commit -am "Replace last commit with a new one"
git push --force
Refresh the page of step 1
Now GitLab will send you "A commit graph at GitLab projects failed their last repository check" when it runs the repository check on a scheduled interval.
I'd consider it a bug that admins and maintainers get a warning about this, since nothing is wrong really. See the GitLab issues linked by Anders Bandholm for more details.
I've now come across and fixed this twice, I found the fix on the forum:
Find all your failed repos at your instance's admin panel: https://your-gitlab-instance/admin/projects?last_repository_check_failed=1
Open the repo from that page and copy down its Gitaly relative path, it should look like #hashed/d4/73/c530f048efdf2711df6fa15198ff48003583303624f8b97c174fadc2cab5e582.git
NOTE! The following commands should be run with the user that gitlab runs as. You can do this with sudo su [username], in my case the username was git. They will work with sudo, but it may create files or folders that the gitlab user won't be able to access.
Run the fsck command using the repo's relative path (This should output the same text as your /var/log/gitlab/gitlab-rails/repocheck.log file):
/opt/gitlab/embedded/bin/git -C /var/opt/gitlab/git-data/repositories/[Gitlab relative path] fsck
# example
/opt/gitlab/embedded/bin/git -C /var/opt/gitlab/git-data/repositories/\#hashed/d4/73/c530f048efdf2711df6fa15198ff48003583303624f8b97c174fadc2cab5e582.git fsck
Run the gc command using the repo's relative path. This may take a minute to complete.
/opt/gitlab/embedded/bin/git -C /var/opt/gitlab/git-data/repositories/[Gitlab relative path] gc
# example
/opt/gitlab/embedded/bin/git -C /var/opt/gitlab/git-data/repositories/\#hashed/d4/73/c530f048efdf2711df6fa15198ff48003583303624f8b97c174fadc2cab5e582.git gc
Run the fsck command again from step 3 to check that the command was successful
On the repo's page from step 2, click the blue Trigger repository check button

Remove a git fork on server

For school we use git to submit things. Every question here seems to be dealing with GitHub and isnt answering my specific question.
In our lab we were attempting to download the files but the prof was having issues on his end. He was asking me to try some commands etc. Anyways we did this:
ssh csci fork csci/Labs csci/$USER/Labs
git clone csci:csci/$USER/Labs
And it worked but the files had issues or something. He said he will get the sys admin to fix it. Then today he told me I need to delete my version on the server and just do it over again. I asked if I can just rm -r the folder but he said I need to delete the one on the git server - he said he doesnt know the command but I should be able to look it up.
I tried
git remote remove csci/Labs
but that did not work. I already deleted the local folder (before he told me about it actually) using rm -r Labs, and saying yes to the delete this git file warnings or whatever. So Im not sure where to go from here to delete it.
A repository is just a directory with working copy (though it is optional) and .git, so deleting the directory deletes the repository. To delete a remote repository you need to have access to the remote filesystem.
Try to run which should work also.
rm -rf .git

ThoughtWorks GO Add Pipeline - Failing to find GIT in PATH

"Failed to find 'git' on your PATH. Please ensure 'git' is executable by the Go Server and on the Go Agents where this material will be used."
I'm getting this when attempting to use GIT when creating a new build pipeline.
I'm not that experienced with Linux to know how to debug this and I can't find anything in the docs or via a google search.
GO was installed as root, so was GIT, the server has been rebooted since and I can run git in bash. "which git" shows that it is in /usr/bin. "export $path" shows that /usr/bin is in the PATH variable.
Can anyone recommend anything else to try?
Thanks.
The Go server and agent runs under user 'go' and therefore you will need to ensure git is in path for this user.
Change the user to go. If you get a prompt for password, put the password of the current logged in user.
$ sudo su - go
Then check if git is in path or simply check for the version
$ which git
$ git --version
If you don't get expected output for the above commands you might have to provide git executables to the user 'go', that is, you will need to add git in this user's PATH. Alternatively, you can provide the path in /etc/default/go-server
export PATH=$PATH:/path/to/git
I recall having this problem too, for me it was related to a local git repository that I did not share with the git daemon. Running the repository with the git daemon solved this problem for me.
URL for me starts with git://localhost, not sure if http will work too

grunt-init not creating any file(s)

I probably missed something here. I'm using Node 0.10.1 on Win7/64bit and installed grunt 0.4.1 with
npm install grunt
npm install -g grunt-cli
npm install -g grunt-init
Then I tried to install a template while in folder %USERPROFILE%
git clone git#github.com:gruntjs/grunt-init-gruntfile.git ~/.grunt-init/gruntfile
But git wants a passphrase for key [current folder]. So I just created a folder
%USERPROFILE%\.grunt-init\gruntfile\
and copied
https://raw.github.com/gruntjs/grunt-init-gruntfile/master/template.js
to it. Now I switched to the project folder and was able to start grunt-init with
grunt-init gruntfile
DOM involved? n
files concatenated or minified? Y
package.json? n
any changes? N
Process ends with "Done, without errors", but no file ist created, or at least I can't find it.
dont know how to clone into your userhome on windows, but IMPORTANT(!) you also need to copy the whole "root" directory ( https://raw.github.com/gruntjs/grunt-init-gruntfile/master/root) to '%USERPROFILE%.grunt-init\gruntfile\'
you know that this init-template will just create a gruntfile.js for you? (inside the root-directory you can see that). if you want to create a node-module, jquery-plugin and so on, use one of the other templates (grunt-init-node, grunt-init-jquery) and so on.
creating your own template is easy. just create a new folder in '%USERPROFILE%.grunt-init' with your template-name. add the template.js. add a root-directory where all the files are which you want to be copied, maybe add a rename.json (for folder and file-renamings) and maybe change some stuff in the template.js.
I think you are have few a different issues here - from your comments it looks like you are using a Windows.
The first issue is that you can't clone the repository. Having tried this myself, I found the problem was fixed by setting up a valid ssh key on my github account. So to clone this repository you need to create a github account and install ssh keys on both your machine and your github account. Github's documentation on how to do this is very good and can be found here for Windows https://help.github.com/articles/set-up-git#platform-windows.
The second issue is that the git clone command you are using won't work on a Windows machine as it supplies a path to a Linux home directory ~/.grunt-init/gruntfile.
From your comments I am guessing the %USERPROFILE%.grunt-init\gruntfile\ is the correct install directory for Windows and so changing your working directory to that and using the command git clone git#github.com:gruntjs/grunt-init-gruntfile.git should install it.
You may also consider working using Cygwin which allows you to use a linux working environment on a windows machine.
Happy node hacking.

gitolite hook for specific repository

I don't understand how do I create a post-receive hook for a specific repository in gitolite (non-root install)
My bare repository contains a website that should copy the working directory to the docRoot
(GIT_WORK_TREE=/path/htdocs git checkout -f) on update
Before gitolite, I would just update the hook for the specific repository.
Gitolite documentation mentions that all hooks should be at hooks/common so I don't understand how it works.
What should be the name of hooks, where it should be located and how it's structure should be changed (if it should)?
Update July 2013: what follows is for gitolite V2 (or 'g2'), which was the version used by the OP at the time (November 2011).
Update August 2013, with the latest gitolite 3.x:
You now have official specific repo hook:
it's basically just creating a symlink in <repo.git>/hooks pointing to some file inside $rc{LOCAL_CODE}/hooks/repo-specific (except the gitolite-admin repo)
All hooks in gitolite/hooks/common are replicated in all repositories managed by Gitolite, as detailed in the hook propagation documentation.
That means your hook script must take specific action depending on the repo which execute said hook.
You can either use the $GL_REPO variable (which gitolite set and pass to all its scripts for any git command it receives).
Or you can use some git configuration registered on the gitolite server, like the mirroring hook does. See the post-receive.mirrorpush hook.
The OP Eyal R adds in the comments:
But I still don't understand how it is done (I understand that $GL_REPO is used to determine which repo I am updating but I'm missing the practical part).
I have created a file called post-receive.test with echo "test", put it in $HOME/gitolite/hooks/common, ran gl-setup, ran push from workstation - nothing happens (no "test" output)
To which I replied:
The hook should appear in the hook directory of your repo on the gitolite server as a link, linking back to the .gitolite/common/hook. Note that it should be in $HOME/.gitolite/common/hook, not /gitolite.
The OP confirms the missing dot was the issue.
The process to add an hook is detailed in Hook propagation in gitolite, and their usage in "Using Hooks".
This is a fairly common need for someone using gitolite, and appears to be a little difficult to tie up loose ends when being not a very advanced user (at leas it was for me).
Following stackoverflow's and gitolite's links back and forth can be a little confusing. These are my conclusions and the path I followed to be able to achieve this.
As #VonC mentioned creating repository specific hooks is already possible since version 3.5.3.1 (github link)
Update/Upgrade Gitolite
The first thing you should do is update your gitolite repo. So ssh into your server that is hosting gitolite and move to the location where gitolite is installed (usually /home/git/gitolite) as the git user (usually git)
Example:
$ ssh myusername#devserver.com
$ sudo su - git
$ pwd
/home/git
$ cd gitolite
Then we have to upgrade gitolite. To do so, first we need to update the gitolite repository
$ git pull
Then we have to repeat the install command (make sure you use the same arguments as before)
$ ./install
And finally run the setup again.
$ gitolite setup
If that doesn't work, you probably haven't set up gitolite executable in your PATH, so you could do something like this:
$ src/gitolite setup
Gitolite Settings (The "RC" file)
This was one of the parts that confused me the most, but it ended up it was pretty straight forward.
The famous "rc" file is located at git's home directory /home/git/.gitolite.rc. There make sure you have a variable called LOCAL_CODE, you should see something like this on that file, if not, add it.
LOCAL_CODE => "$ENV{HOME}/.gitolite/local"
And in the "commands an feature to enable" section you should make sure that repo-specific-hooks is available, if not, add it.
ENABLE => [
# COMMANDS
# These are the commands enabled by default
'help',
'desc',
'info',
...,
...,
...,
'repo-specific-hooks'
...,
...,
...
]
Here is the link to the documentation
Writing Repository Specific Hooks
Finally, in your local gitolite-admin repository create the following directories hooks/repo-specific under the directory you just set in the LOCAL_CODE variable, for example:
gitolite_admin/local/hooks/repo-specific
After that you can actually add your hooks scripts to that location and manage them through the gitolite conf file as stated in the documentation. Make sure the scripts are executable.
repo foo
RW+ = #all
option hook.post-receive = deploy
Again, I hope this helps some of you guys.
Cheers!

Resources