Tag Archives: GitHub

Move your GitHub page to GitLab Pages

4 Jul

If you are looking to move your website from GitHub Pages to GitLab Pages (and stick to Jekyll), here are the few steps you need to follow. Most of it is pretty straight-forward, but I thought I’d list the details and a couple more infos here.

Import your project

First, you need to import your repository from GitHub to GitLab. From the gitlab.com, you can do: + > New project > Import project > GitHub

Check the project settings

In your imported repository, check that Shared Runners are enabled (Settings > CI / CD > Runners settings)

Create a config file

From the online interface, create a .gitlab-ci.yml config file in your repo’s top directory to specify how the CI should test and build the page.
This code should be enough to start with:

image: ruby:2.3

variables:
 JEKYLL_ENV: production

before_script:
  - bundle install

test:
  stage: test
  script:
  - bundle exec jekyll build -d test
  artifacts:
    paths:
    - test
  except:
  - master

pages:
  stage: deploy
  script:
  - bundle exec jekyll build -d public
  artifacts:
    paths:
    - public
  only:
  - master

Change your URLs

Change your repository name to repo-owner-name.gitlab.io in both your project name and your path. (Settings > General > Advanced settings > Rename repository; make sure you replace “repo-owner-name” by your own.)

Change your remote in your local copy of the repository. This is probably what you want:

 git remote rm origin
 git remote add origin
 git push --set-upstream origin master

Remember to update your URL in your _config.yml file so your Liquid output markup that makes use of it works as expected.

And of course, remember to update your URL outside of your website too! (i.e. old website, other projects, other websites, social media profiles and pages…)

To redirect your old Github Page, you can use the jekyll-redirect-from plugin that’s already included in the Github Pages gems.

First, add this line to your _config.yml file to activate the plugin:

plugins:
  - jekyll-redirect-from

… and you can now add an extra redirect_to line in your pages. For example, in your index.html header:

---
layout: default
redirect_to:
  <span id="mce_SELREST_start" style="overflow:hidden;line-height:0;"></span>- http://studio-dessai.gitlab.io/
---

You can also add those two lines of HTML in your default head.html header, so all the pages that use it automatically use the new location (and so search engines take that into account):


			

(this was hinted by this StackOverflow answer.)

Troubleshooting

If you get a message from GitLab telling you that “Your pipeline has failed”, with an error message along those lines:

Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/style.scss':
 Invalid US-ASCII character "\xE2" on line 5
jekyll 3.7.3 | Error: Invalid US-ASCII character "\xE2" on line 5
ERROR: Job failed: exit code 1

… but you can build your Jekyll site locally, it probably means that there is an issue with the language settings used in GitLab’s Docker.
You can try adding the following extra variables in your .gitlab-ci.yml file:

variables:
  LC_ALL: "C.UTF-8"
  LANG: "en_US.UTF-8"
  LANGUAGE: "en_US.UTF-8"

(This was hinted from this Jekyll issue thread.)

Advertisements

Split a large audio file into tracks according to cue file on Linux

30 Jan

split2flac initYou might find it useful to divide a music release that consists of one entire audio file, according to the .cue file that comes with it. There is a very easy way to do this on Linux, thanks to an open source package called split2flac.

Note that the following instructions are for a debian-based distribution.

To use split2flac, you will need to download the latest files from the GitHub project, unpack the archive and move the executable to usr/bin. You can do that last thing with the following command:

sudo mv /path/to/slit2flac /usr/bin

 

As stated in the readme file, you have to have the two packages shntool and cuetools installed, which is easily done with the following command:

sudo apt-get install shntools cuetools

 

I use the default FLAC format output as it is an open standard and it is lossless even though it is smaller than a WAVE file for example. However, if you want other formats as outputs, you can create symlinks that will allow you to use extra commands that do exactly what they say:

cd /usr/bin
sudo ln -s split2flac split2mp3
sudo ln -s split2flac split2ogg
sudo ln -s split2flac split2m4a
sudo ln -s split2flac split2wav

 

If you want to use a lossy format, I recommend you use the open .ogg format.

You will then need to install extra packages depending on what you want to do. In my case, I had to have wavepack and flac too because I was going from a .wv file to .flac chuncks. If you want to use split2ogg to save some hard drive space, you will need vorbis-tools. If you get an error, it is most likely because you are missing a particular package for your format conversion. Have a look at the readme file to find out what you are missing.

You can then use this nifty tool, for example with the simple command:

split2flac path/to/audio/file/filename.wv

 

split2flac will automatically find the .cue file and the covers that are in the directory, and create a new folder with the covers and the split, tagged and converted tracks!

Enjoy!

split2flac tags your new converted tracks

split2flac tags your new converted tracks