GitLab CE on Ubuntu

Standard

GitLab CE(Community Edition) is an open source self-hosted, Git Server, that can be hosted on any server, that meets its requirements. It’s easy to install and setup, it gives you the freedom, you want with your Git repository and projects.

You can install GitLab on your Ubuntu Server by following the steps below.

If you are planning to get a VPS that will host your GitLab server, I recommend Digital Ocean

Installing dependencies used by GitLab.

“`
sudo apt-get install curl openssh-server ca-certificates postfix
“`

Installing GitLab repository.

“`
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
“`

Installing GitLab

“`
sudo apt-get install gitlab-ce
“`

If you are having issues downloading the package, then try this method using `apt-fast`.

```
sudo add-apt-repository ppa:saiarcot895/myppa

sudo apt-get update


</div>Installing fast.

<div class="highlighter-rouge">```
sudo apt-get install apt-fast  

Now download the GitLab package with `apt-fast`.

```
sudo apt-fast gitlab-ce
```

Once this is done. You can configure GitLab.

```
sudo gitlab-ctl reconfigure
```

The default user account credentials are:

username: root

password: 5iveL!fe

It’s ready, now you can visit your private GitLab, and start pushing your code.

Thank your for reading.

Have a question? leave a comment below.

Everything you need to know about static sites

Standard

Static sites are websites that don’t use a pre-processor or backend service daemon or Database, these websites are purely written in client side languages like HTML, CSS, and JavaScript. It is one of the oldest ways of creating web content, but the popularity of it has dropped, which is not true, the popularity has dropped only in graphs that display, what tools are used to build websites.

Static sites are easy to create, if the right tools are used, it is a great way to build websites are serving web content, because it does not require any pre-processing of special setup, it can run on any base Web Server.

It takes a lesser resource because it’s just static files, no server side response or rendering to be done.

It has a shorter downtime and a faster response time, it does not require a Database to fetch content, so it doesn’t rely on a backend or Database. It is safer because Database and server side hacks don’t work on them.

There are many ways to create a static site, but only a few are beginner friendly, like Jekyll a blog-aware static site generator written in Ruby that uses Markdown of writing content and Liquid for logical templating, it has a well written documentation, that can be a very good place for beginners.

Jekyll is also one of the most popular static site generator and powers most of the GitHub Pages websites, it is not the only one, it’s just popular due to the functionality and simplicity it offers. here is a list of all the static site generators.

The good thing about these static site generators are, that there are so many of them, that offers various different functionality and features, written in various languages, they give you freedom and comfort to choose and let you choose it based on which language you know better.

So, you don’t have to stick to Jekyll, if you like Python, you can use Pelican or if you are Gopher(Golang coder) you can use Hugo.

Static sites are a good alternative, to Database driven and Flat File CMS.

It is a great choice, if you want to have a blog or portfolio, that does not need a fancy backend

Pre-processing can be done, when compiling files into static content, for example using of Sass or Less for stylesheets, use of Markdown for web content, logical templating for generating a difference in pages being generated. All the pre-processing that has to be done, is done while before or while compiling.

It can be dynamic too if you use dynamic, async client side scripts, you can fetch web content, dynamically.

The only downside is that it does not work for everyone, especially people who would like to use an admin interface, that can do things serve sided, like login and signup pages and front end editing for web content.

App Review: Pocket

Standard

Pocket is an app that lets you save web content for reading it later, it is a great app for users, like me who like reading on the go and want to access all their web content in one place.

It lets you save the specific web page using a browser extension or pasting the URL in the “Save a URL” option, in its web interface or Chrome app or mobile application.

The app is available on a wide range of popular platforms, which lets you access all the content you love reading, on every device you have this app installed.

It automatically syncs your content on all your devices. It offers offline support, which makes it a must have for users who don’t use mobile data or don’t have internet access in every place they travel.

I discovered this app while searching for an app that stores all my web content, that can be made available on all my devices, so it would save my time and let me read a thing I love when I am at college in my free.

The app offers tagging which is a very helpful, especially if you read web content on various genres and like to sort, things you are going to read. It also lets you archive and ticks articles you have read so you have only a list of things you have not read.

The app comes with a dark theme, which turns the background to dark gray and gray text, it’s good for users who read in the night or who don’t like a white background with black text.

I am not a big fan of the dark theme, because it does not style everything nicely and only makes text reading better in dark.

The overall styling feels very nice.

The app has made me more comfortable and systematic because it lets me manage and sort web content, I love reading and I don’t have to keep a lot of tabs open in my browser when I come back home for continuing to read. This app is a lifestyle changer as a reader.

The app sports a feature called “Listen”, it lets the app read for you.

Recently the Pocket team added a recommended list, this list will offer content based on the genre you read and prefer reading and will try its best to serve relevant content, that you might love reading.

In my case, most of the time the app has given me relevant content.

Everything at once.

The app is great for reading, offers dark theme, available on all the popular platforms, saves time and has a nice way of sorting, offers an offline reading. Recommended list give the right recommendations most of the time, a must have if you read a lot of webs content

With the launch of iOS 9 and updated version of Pocket, you can now search your web content using spotlight. It also has an option called “Listen” that lets the app read for you in “Siri’s voice”.

Thank you for reading, leave a comment below.

Ghost on Pi

Standard

Ghost is open source blogging platform written in Node.js that offers self hosting and hosted service.

We are going to self host Ghost on a Raspberry Pi.

This guide will take you through the steps of setting up a self hosted Ghost production environment.

I am working on this setup with a clean install of Raspbian and headless setup, you can lean how to enable SSH from here.

You can SSH into your Raspberry Pi(Mac/Linux). If you are a Windows user you need to use Putty

“`
ssh pi@the-ip-address-of-the-pi
“`

The default username and password of the Raspbian install is.

user: pi

password: raspberry

Installing Node.js

Downloading Node.js(NPM ships with it)

“`
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
“`

Installing Node.js(required by Ghost)

“`
sudo dpkg -i node_latest_armhf.deb
“`

Installing Sqlite required by Ghost.

“`
sudo apt-get install sqlite3
“`

Installing NGINX(used to reverse proxy Ghost)

“`
sudo apt-get install nginx-full
“`

Installing Supervisor(to manage Ghost)

“`
sudo apt-get install supervisor
“`

#### Ghost setup

This will download the latest version of Ghost.

“`
wget https://ghost.org/zip/ghost-latest.zip
“`

Unzipping the folder we just downloaded.

“`
unzip ghost-latest.zip -d Ghost
“`

Set `Ghost/` as the current directory

```
cd Ghost/
```

Installing dependencies used by Ghost using `NPM`.

```
npm install --production
```

Run the command below to see everything works fine.

```
npm start --production
```

Time to setup turn Ghost into a service.

Creating the <code class="highlighter-rouge">ghost.conf file for Supervisor to manage Ghost.

```
touch /etc/supervisor/conf.d/ghost.conf
```

Editing the file, you can choose any editor you like.

```
nano /etc/supervisor/conf.d/ghost.conf
```

Add these lines to the `ghost.conf` file.

```
[program:ghost]
command = npm start --production
directory = /home/pi/Ghost/
user = pi
autostart = true
autorestart = true
stdout_logfile = /var/log/supervisor/ghost.log
stderr_logfile = /var/log/supervisor/ghost_err.log
environment = NODE_ENV="production"
```

Now save the file, in nano CTRL + X + Y.

You can start Supervisor, if it did not start after installing.

```
service supervisord start
```

Now set Supervisor to run on startup.

```
sudo update-rc.d supervisord defaults
```

Starting Ghost service we just created.

```
sudo supervisord start ghost
```

Ghost will be running in production in port 2368.

Reverse proxying Ghost with NGINX.

Editing the <code class="highlighter-rouge">default file.

```
nano /etc/nginx/sites-enabled/default
```

Add these lines

```
server {
listen 80;
server_name yourdomain.com; # Change this to your hostname

    location / {
    proxy_pass       http://127.0.0.1:2368;
    proxy_set_header Host      $host;
    proxy_set_header X-Real-IP $remote_addr;
    }

}

</div>Save the file

Now restart NGINX.

<div class="highlighter-rouge">```
service nginx restart  

Now visit your Raspberry Pi ip address. You will be presented with a beautiful setup screen.

You can edit the Ghost hostname and other settings by editing the <code class="highlighter-rouge">config.js stored in the Ghost folder.

Services like DynDNS can be used to manage hostname, if you want your Ghost blog to be public and use a domain name instead of the ip address.

If you have any questions or problem, leave a comment below.