Friedrich Ewald My Personal Website


  • Installing nodeJS and setting up an alias

    Under Ubuntu 14, installing nodejs is relatively easy. At first one needs to to the obvious sudo apt-get update followed by a sudo apt-get install nodejs With this two easy steps you have a nodejs installation on your system which you could easily check with node -v. If the installation was successful, this command prints the current installed nodejs version. In my case this was the version v0.10.25 which is a bit outdated but could be sufficient if you do not plan to serve files or sites over the internet. In this case you should install the latest version from directly because of some severe security issues with the older versions. In my case it was not done with installing node because the directory, where nodejs was installed to nor was in the PATH neither there was a symlink to nodejs. For some reason, some programs rely on node, others rely on nodejs. So the goal was to use the same program for each command and also make it available in the PATH to access it directly. After asking stackoverflow, I was proposed to create an alias in the .bashrc file like this:

    alias nodejs='/usr/bin/nodejs'
    Conclusion: Do not change the path, change the bash profile as the path easily can break since it depends on the order of the different folders.

  • Playing with git hooks

    Git scm offers a very interesting technique, called hooks. A hook is basically a trigger which is fired after the specific event occurs. If you create a new git repository with git init the folder .git/hooks with a couple of sample shell scripts is created. I personally use a hook to automate the deployment process of this website. After a commit is made, I automatically run a jekyll build and then copy the newly created site to the server. My current post-commit script looks like the following, simple but effective:

    jekyll build
    scp -r _site/* [email protected]:/home/user/html/
    ##Update 2015-12-11 I slightly changed the deploy script to only update changed files because I realized that the time to update the homepage will increase with every posting. For this reason I had to use rsync. Now the scripts looks as follows:
    jekyll build
    rsync --update --progress -r _site/* [email protected]:/home/user/html/
    The easiest way to synchronize over SSH is with a certificate.

  • First experiments with Jekyll

    Today, I’m trying out how to build this website with jekyll. With jekyll one can easily write markdown and yml files and create static pages from it. The advantages are obvious. No problems with scripts and security issues since all the files are HTML5, CSS and only a bit of Javascript. Also there is no need for complex server configuration or any high server speed. A simple webspace with FTP or SSH access is enough.

Page: 27 of 27 Next