Git post-receive hook stopped copying files to web directory [closed] - linux

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
Disclaimer: I'm a git newbie.
I followed the following post: Setting up your git repos the normal way (here on stackoverflow) to get a --bare repo set up at /home/www-data/themename.git and a post-receive hook working that copied everything to my /var/www/domain.com/htdocs/wp-content/themes/themename/ folder. (I followed the instructions on that post exactly). Everything was working perfectly.
However, today I wanted to take a look inside that post-receive hook and ran cat /home/www-data/themename.git/hooks/post-receive. If you didn't notice, I accidentally placed two spaces after cat instead of one. Which overwrote everything in the file rather than displaying it. Looking back, I should have just used nano. So I opened the post again, and copied the code snipped from the post and pasted it into my post-receive hook again. But now it doesn't do anything. The files aren't copied.
Thinking that maybe it was a permissions issue, I ran chown -R www-data:www-data on /var/www and that didn't work. I also ran chown -R www-data:www-data on /home/www-data and that also didn't work. Lastly I ran chmod +x /home/www-data/themename.git/hooks/post-receive to make the file executable in case it stopped being, and that also doesn't work.
Also, git pull still works correctly in the /var/www/domain.com/htdocs/wp-content/themes/themename/ directory.
Any suggestions to fix this? Or should I just create the repos and directories from scratch again?

This started working again after the server was rebooted.

Related

Problem running Android Studio on Ubuntu 20.04 terminal [duplicate]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed last year.
Improve this question
I installed go on ubuntu 16.04 from the archive and tried to test my installation by issuing the command go on my terminal. It keeps prompting me / not root-owned 1000:0.
I installed go on /usr/local folder and also included it into my path as instructed on the official golang installation. I removed go and tried to install it again, but found the same result. It sounds more of a linux root permission issue, but I have no clue how to fix it. I tried other commands that I installed from archive and they work perfectly fine. Any kind of help would be appreciated.
It seems to complain that the system root directory / has the wrong owner. This is a security problem because you don't want to have regular users changing system files at will. It looks like you changed this on purpose at some point in the past; change it back, or reinstall your system if you have wrecked more permissions than just this one.
sudo chown root /
For the record, the proper way to give yourself limited system access is to use sudo. Add yourself to sudoers (usually this is already set up by the OS installer on any reasonably consumer-oriented Linux distro) and when you need privileges for something, run that command with sudo.
Simple, in the command line:
sudo chown root:root /
In addition to the root permission issue I had, I also found that I installed go using snap to: snap install --classic go, which wasn't a good idea. I was also unable to remove the go folder in /snap, even as root. I now reinstall my system and hopefully the issue will be solved.
sudo chown root /var
This will solve your problem

Log files with same content after build [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I performed Poky build fetching the latest master branch from git
git clone -b rocko git://git.yoctoproject.org/poky.git
Set up the Environment using the following command
source poky/oe-init-build-env
Then executed bitbake command
bitbake core-image-full-cmdline
Bitbake did generate root file system, kernel image .. I was looking at the log files of the bitbake in build/tmp/log/cooker/qemux86 folder
There are two files with the same content:
- console-latest.log
- 20171224045428.log
Why we have two logs of the same content
console-latest.log is a symlink that points to the latest real console file 20171224045428.log. It allows to keep previous console logs and have an easy single way to access the latest console log.
In Yocto, a lot of log files work this way, see manual log section.

Replace the contents of a github repository with the contents of a folder [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I'm trying to replace the contents of a github repository with the contents of a folder. I've tried git push, but it doesn't seem to do anything unless I add each of the files individually using the command line. Is there any command that I can use to replace the contents of the repository with the folder's contents?
My repository is here: https://github.com/jarble/downloadedModules
git add adds your modified files to the queue to be committed later
The following are the steps to add a file and push to the repository:
git add <file/folder>
git commit -m "Checkin in code"
git push -u origin master
For detailed explanation refer to this answer

Increase the size of APT::Cache-Limit [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
When I updated my Ubuntu system with update manager, I encountered an error, and now the update manager is stuck. The error message is:
An unresolvable problem occurred while initializing the package
information.
Please report this bug against the 'update-manager' package and
include the following error message:
'E:Dynamic MMap ran out of room. Please increase the size of
APT::Cache-Limit. Current value: 25165824. (man 5 apt.conf), E:Error
occurred while processing moonlight-tools (NewVersion1), E:Problem
with MergeList
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_lucid-proposed_universe_binary-i386_Packages,
E:The package lists or status file could not be parsed or opened.'
I googled on how to increase the cache-limit, and changed /etc/apt/apt.conf.d/70debconf to
APT::Cache-Limit "100000000"
But this solution doesn't work. The problem wasn't fixed.
What should I do to fix this problem?
These steps worked for me in Ubuntu 16:
Add line APT::Cache-Limit "100000000"; to file /etc/apt/apt.conf.d/70debconf
Delete all corrupted merge lists.
sudo rm /var/lib/apt/lists/* -vf
Then running an update with following command will automatically create
a good new /var/lib/dpkg/status file.
sudo apt-get update
Instead of adding the line APT::Cache-Limit "100000000"; to the file /etc/apt/apt.conf.d/70debconf add it to the file /etc/apt/apt.conf.d/20archive which solved the problem for me.
Have you tried the /etc/apt/apt.conf.d/20archive and setting the max size and max age values?
1/27/2017
Mepis 12 Variant:
When attempting to activate all the available repositories in Mepis 12, Synaptic will gripe,
"E: Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start."
and crash out on exit, subsequently refusing to restart.
Mepis users who need the full spectrum of available repos should edit the content of the "80mepis" file in the /etc/apt/apt.conf.d/ directory to read
APT::Cache-Limit "100000000";
as suggested for the /etc/apt/apt.conf.d/70debconf file in similar affected distros, as above. My Mepis 12 Final Edition installations have all, to date, required this fix in order to to enable a full complement of repositories on demand.
Heartfelt thanks to the others who have gone before. As a longtime public Mepis installer, I think cleaning the system with
rm /var/lib/apt/lists/* -vf
mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
cp /var/lib/dpkg/status-old /var/lib/dpkg/status
and then doing a
apt-get update
command from the command line, all as su (aka root),as suggested above, is a very good idea too. And that is all. 0{:-)o[
You may attempt to clean the APT-list which may be corrupted, and then replace it with an existing, working one.
sudo rm /var/lib/apt/lists/* -vf
sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
sudo apt-get update
You can try to refer here for more info: https://justinalex.com/ubuntu-fixing-the-apt-repository-and-package-manager-2/
May be due to server resource limitation, setting APT::Cache-Limit "100000000"; didn't work for me.
My last resort stop resource intensive service for temporary and perform the upgrade.
Thanks,

Linux console: git command not found on x64 Cent OS [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have a completely fresh install of 64 Bit Cent OS 5.7, this is in VirtualBox on top of 64-bit XP.
I'm trying to install SSU.
Problem: The command 'git' was not found. See "code" below please.
Have tried looking this up: /usr/local/git/ does not exist: git: command not found (on OS X 10.5)
I don't care about source code: I just want git to work so SSU will install so I can try to access the bank on what seems like a huge whim.
I am signed in to Gnome as root and seem to be able to access my computer normally without being harassed about passwords excessively and can create or edit files.
[root#localhost ~]# $ git clone https://github.com/wesabe/ssu
bash: $: command not found
Concerns
Unfortunately every single time I ask these kinds of questions and don't make clarifications I end up having to make those clarifications. So...
No negativity or rudeness intended what-so-ever: if the answer involves editing a text file or copy-and-paste actions please tell me the locations to do so in the file manager instead of console commands. I'm perfectly okay copying and pasting console commands for things that really should be done in the console though.
Note: there appear to be numerous "git" commands and numerous "ssu" commands. I do NOT know the difference between them and would really prefer someone who has solid expertise to answer so that I nor others end up accidentally trashing our copies of Linux as it's been very difficult to get anything to work and stay working thus extending my personal stay with XP.
I will be more than happy to both accept an answer and thumbs it up should it be helpful.
I would first try installing git. As root:
yum install git
According to here,
yum install git-core
If that doesn't work you could add the EPEL source. There are also RPMs for git.

Resources