Hexo for multiple sites? - ejs

What's the best way of creating multiple Hexo sites? I wanted to redo all of my sites (I have around 10 sites in total) would I just run:
$ hexo init site1
$ hexo init site2
$ hexo init site3
... and so on? Is there a better way of dealing with multiple sites?
Thanks in advance.

Yes, with Hexo you may have multiple sites (with multiple themes on they) and use same plugins with same Hexo version in single root Hexo dir (no need to duplicate main node_modules directory).
To do this, need to use commands with alternate configuration specified.
Init Hexo site.
Create empty site1.yml file and paste all content from main Hexo _config.yml.
Create empty site2.yml file and paste all content from main Hexo _config.yml.
All this 3 files must be in Hexo root directory. And then specify needed configuration:
$ hexo clean --config site1.yml && hexo g --config site1.yml
$ hexo clean --config site2.yml && hexo g --config site2.yml
$ hexo s --config site1.yml
$ hexo d --config site1.yml
Input hexo -h for advanced info.

d:/hexo1
d:/hexo3
d:/hexo2
create multiple directory and d:/hexo2> hexo init

Related

wget download only the sub directory

i need to download only the sub directory named pyVim with all its content ,but i
am getting the parents as well , even that i tried the following options:
wget -r --no-parent http://server/pub/scripts/pyVim
getting : server directory with its subdirectories
tried:
wget -r -X pub,scripts --no-parent http://server/pub/scripts/pyVim
tried few more options ,none of those works
i just need to download pyVim directory with its content to the current directory.
You said pyVim is a directory, but then the URL you passed to wget indicates that pyVim is a file in the directory scripts.
To explicitly tell wget that pvVim is a directory pass a trailing /. So your final command is:
wget -r --no-parent http://server/pub/scripts/pyVim/

Kubernetes-Mesos: building problems

I am following the instructions on: http://kubernetes.io/docs/getting-started-guides/mesos/#deploy-kubernetes-mesos
git clone https://github.com/kubernetes/kubernetes
cd kubernetes
export KUBERNETES_CONTRIB=mesos
make
-bash-4.2$ pwd
~/kubernetes
-bash-4.2$ ls
api contrib federation Makefile release
build CONTRIB.md Godeps Makefile.generated_files test
CHANGELOG.md CONTRIBUTING.md hack _output third_party
cluster DESIGN.md hooks pkg Vagrantfile
cmd docs LICENSE plugin vendor
code-of-conduct.md examples logo README.md www
-bash-4.2$ make
make: *** No rule to make target `/*.go', needed by `_output/bin/deepcopy-gen'. Stop.
Do I need to do something before make or something?

Symlinking unicorn_init.sh into /etc/init.d doesn't show with chkconfig --list

I'm symlinking my config/unicorn_init.sh to /etc/init.d/unicorn_project with:
sudo ln -nfs config/unicorn_init.sh /etc/init.d/unicorn_<project>
Afterwards, when I run chkconfig --list my unicorn_ script doesn't show. I'm adding my unicorn script to load my application on server load.
Obviously, this is not allowing me to add my script with:
chkconfig unicorn_<project> on
Any help / advice would be awesome :).
Edit:
Also, when I'm in /etc/init.d/ and run:
sudo service unicorn_project start
It says: "unrecognized service"
I figured this out. There were two things wrong with what I was doing:
1) You have to make sure your unicorn script can play nice with chkconfig by adding the below code below #!/bin/bash. Props to digitalocean's blog for the help.
# chkconfig: 2345 95 20
# description: Controls Unicorn sinatra server
# processname: unicorn
2) I was attempting to symlink the config/unicorn_init.sh file when I was already in the project directory which was creating a dangling symlink (pink colored symlink ~> should be teal) by using a relative path. To fix this, I removed the dangling symlink and provided the absolute path to the unicorn_init.sh file.
To debug this I used ll in the /etc/init.d/ directory to see r,w,x permissions and file types, was running chkconfig --list to see a list of services in /etc/init.d/ and also was trying to run the dangling symlink in my /etc/init.d directory with sudo service unicorn_<project> restart
Hope this helps someone.

Capistrano error tar: This does not look like a tar archive

INFO [050fe961] Running mkdir -p /home/rails/rails-
capistrano/releases/20140114234157 on staging-rails
DEBUG [050fe961] Command: cd /home/rails/rails-capistrano/repo && ( PATH=/opt/ruby/bin:$PATH GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/rails/git-ssh.sh mkdir -p /home/rails/rails-capistrano/releases/20140114234157 )
INFO [050fe961] Finished in 0.142 seconds with exit status 0 (successful).
INFO [2dea2fe5] Running git archive feature/Capistrano | tar -x -C /home/rails/rails-capistrano/releases/20140114234157 on staging-rails
DEBUG [2dea2fe5] Command: cd /home/rails/rails-capistrano/repo && ( PATH=/opt/ruby/bin:$PATH GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/rails/git-ssh.sh git archive feature/Capistrano | tar -x -C /home/rails/rails-capistrano/releases/20140114234157 )
DEBUG [2dea2fe5] fatal: Not a valid object name
DEBUG [2dea2fe5] tar: This does not look like a tar archive
DEBUG [2dea2fe5] tar:
DEBUG [2dea2fe5] Exiting with failure status due to previous errors
I am confused about two things:
Why is Capistrano running git archive here:
git archive feature/Capistrano | tar -x -C /home/rails/rails-capistrano/releases/20140114234157
Why is tar failing?
I had the same issue, until I realized I was pulling the nonexistent branch from git.
Deleting app_name/repo also fixed this issue for me.
This happens when the repo in the server to deploy is messed up. We're talking about the bare git repo that Capistrano by default would put in /var/www/$application/repo (for other people's reference).
In your case it does not have a local feature/Capistrano branch so when running git archive feature/Capistrano nothing is output to that | pipe. To confirm, ssh into the server, cd into /home/rails/rails-capistrano/repo, and run git branch.
It's running git archive as a way to export the selected branch's tree. git archive "writes it out to the standard output" so Capistrano redirects that to tar in order to uncompress the archive immediately into your new release directory.
(Why Capistrano chose this instead of git checkout defeats me.)
tar fails because it's receiving nothing d:
I can think of two possible solutions/ways to troubleshoot:
ssh into the server and manually delete the repo folder (e.g. in your case /home/rails/rails-capistrano/repo) as mentioned by #lugolabs
make sure the server's repo is using the remote you're expecting (ssh in, cd into repo/, and run git remote -v) -- you may just need to update your :repo_url in deploy.rb (and delete the repo/ dir).
I think that folder gets populated via a git pull, so it shouldn't be empty. If you do see it empty the issue is from the git not the tarball.
The issue I had was my capistrano deploy.rb repository URL was set to a different one than that project i was working in. In order to fix this issue, I also had to logon to the server and delete the app_name/repo folder which must have been caching the original bad remote URL.
Whenever I have hit this error it was because the branch specified in my deploy/environment.rb file wasn't checked into git. Do an add / commit / git push origin branch_name and that will likely make things work.
You can set your branch on deploy.rb with:
set :branch, "main"
source
Note: the default branch is master
I'm using Bedrock Roots (wordpress) for development, capistrano for deploys and git flow.
Stumbled upon this error when tried to deploy, while on hotfix/x.x.x branch locally. So I finished current (merged changes to develop branch) and then successfully deployed.

Capistrano and deployment of a website from Github

So, I had what I thought was a fairly simple Capistrano use case: I want to deploy a PHP site from Github. But I'm running into a lot of problems. When I run cap deploy, Capistrano is able to clone the Github repo (the deploy:update_code step), but then in the deploy:finalize_update step it says
executing "rm -rf /var/www/sitename.com/releases/20100611144519/log /var/www/sitename.com/releases/20100611144519/public/system /var/www/sitename.com/releases/20100611144519/tmp/pids &&\\\n mkdir -p /var/www/sitename.com/releases/20100611144519/public &&\\\n mkdir -p /var/www/sitename.com/releases/20100611144519/tmp &&\\\n ln -s /var/www/sitename.com/shared/log /var/www/sitename.com/releases/20100611144519/log &&\\\n ln -s /var/www/sitename.com/shared/system /var/www/sitename.com/releases/20100611144519/public/system &&\\\n ln -s /var/www/sitename.com/shared/pids /var/www/sitename.com/releases/20100611144519/tmp/pids"
followed by
executing "find /var/www/sitename.com/releases/20100611144519/public/images /var/www/sitename.com/releases/20100611144519/public/stylesheets /var/www/sitename.com/releases/20100611144519/public/javascripts -exec touch -t 201006111445.23 {} ';'; true"
I don't really understand what's going on here. It then gives an error:
*** [err :: sitename.com] find: `/var/www/sitename.com/releases/20100611144519/public/images': No such file or directory
and another error for each of the stylesheets and javascripts directories.
What's going on? I realize that Capistrano is primarily for deploying Rails and other Ruby apps, but I'm using the capistrano-php gem. I'd appreciate any help.
Capistrano default behavior is to 'touch' all assets files. (To make sure that any cache get the deployment date). Assets are images, stylesheets, etc.
If your PHP application is not using these directories, capistrano complains in such an ugly way.
To disable asset timestamps updates, simply add:
set :normalize_asset_timestamps, false
to your deploy.rb