Brackets on Debian/Ubuntu…

Brackets

Adobe Brackets (once known as Edge) is a Open-Source cross-platform source/text editor for Web development written in HTML, CSS and Javascript.

Brackets is free and licensed under the MIT License and maintained on GitHub. Currently, Brackets has yet to achieve version 1.0. It gets updates roughly twice a month. Brackets, at the time, is under active development and may have a lot of bugs. Right now, it is at its Sprint 38th build. It offers support for many other non-web programming languages and styling languages like CSS, SCASS, SCSS, SASS, etc. It’s pretty much better than most of its competitors.

Brackets offers a Live File Preview which updates the web-page in question, if any styling changes are made. Brackets has it own plugin store and the extension to the editor is practically limitless. Depending on the use of plugins, Brackets can be customised and made much more powerful.

Installation of Brackets

This process will let you install Brackets on any system that is Debian based including Ubuntu, Linux Mint and any other distribution that is known to accept Debian packages.

1. Download Brackets

There are two editions of Brackets. You’ll have to download the one best suited for your processor architecture. A 32 bit system should use the 32 bit version. 64 bit can use either but the 64 bit version is recommended.

Download the 64 Bit version using the following link.
Brackets 64 Bit.

Or the 32 Bit version using the link below.
Brackets 32 Bit.

2. Install the Brackets package

Your browser will have downloaded the file to the Downloads folder.

Start the Terminal

Do this either by searching for the terminal and running it or from your application menu. OR, you could do it like us by using the keyboard shortcut [Ctrl][ALT][T].

Focus on the right folder

Assuming your package is in the Downloads folder, enter the following command.

cd Downloads

If your package isn’t in that folder, focus on the folder where it is. OR move the file from wherever it is into the Downloads folder and run the command.

Install the package

Enter the following command, sit back and watch as it completes.

sudo dpkg -i brackets-sprint-38*

3. Rejoice

You now have Brackets on your system.

Do let us know how it fares with you. We certainly had a lot of fun editing with it…

Ghost installation for Raspberry Pi…

Ghost is a new blogging platform. It has a refreshingly innovative and responsive UI – one that can clearly be seen as the future of blogging. You might want to visit Ghost’s website to know more about it. I promise, once you’ve learnt how it works, you won’t stop thinking about it. While you’re at it, do learn how it’s installed on the Raspberry Pi from our tutorial below.

GhostGhost runs on Node.js and, like WordPress, is free to download and use. It is expressly intended to be a blogging platform unlike the recent evolution of WordPress.

Wait! Node.js?!

500px-Node.js_logo.svg

Node.js is an event driven system that is written in Javascript and C++. It is known for its non-blocking I/O system and higher response speed with simultaneously lesser resource consumption. Node.js is widely used in chat web application, but can definitely do a lot more like handling entire blogs as it would with Ghost.

Installation of Ghost

There are a lot of operating systems available for the Raspberry Pi but, for this, we recommend using Raspbian. The rest will be a breeze.

1. Install Node.js

You will have to have Node.js installed on your Raspberry Pi. As a matter of fact we’ve written a tutorial on how you can do just that right here.

2. Acquire the Ghost setup

Download the package

To install Ghost, it’ll need to be download from the official website. Do that by entering the following in the terminal.

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

Unzip the package

Now that the package has been downloaded, it will have to be unzipped. You can simply do it by entering the command.

unzip ghost-latest.zip -d ghost

The package contents will fill a new directory by the name ghost.

3. Focus on the new folder

To set the Ghost folder ghost as current directory use the command.

cd ghost/

4. Install Ghost from the setup

After focusing on the ghost directory, we need to install it using NPM by entering the command below.

sudo npm install --production

5. Install a database management system

For your database management system you can choose your favourite one and use it with Ghost. We ourselves have done it a few times with MySQL and MariaDB. We’ve gone for SQLite for this tutorial – the Ghost configuration file by default uses SQLite. You can install SQLite3 using the command below.

sudo apt-get install sqlite3

6. Edit the configuration file

If you use MariaDB, MySQL or a different management system make the appropriate changes to the settings in config.js file of the Ghost setup.

Edit the config.js file to change the default host: and set the port: to 80 as seen below. That is, of course, unless you’re fine with using the default settings.

host: '0.0.0.0'

port: '80'

7. Set up Forever

Once we’re done editing config.js, we need to install Forever so we could continue running the Node.js web-server after the end of the SSH session.

Install forever

Enter this command.

sudo npm install forever -g

Set Node.js to run with Forever

This will let Node.js continue running despite being in production mode. Enter them one after another.

sudo NODE_ENV=production forever start index.js

sudo forever index.js --production

And that’s it!

You’ll have successfully created a Raspberry Pi hosted Ghost blog on its Node.js web server.

You’ll have to visit [the-IP-address-of-your-Raspberry-Pi]/ghost/ to access the process of creating your user account the first time. The process takes a while because the password is hashed using Bcrypt. Once done, that URL acts as your Ghost admin panel.

The blog can be accessed as a non-admin viewer using your Raspberry Pi’s IP address.

Cool, isn’t it?! Do leave us comments if you’ve decided to give it a try or have tried alternate methods for installation. Feedback is always appreciated. Do stay tuned for more on Ghost in the future…

Node.js installation for Raspberry Pi…

Node.js is a brilliant platform for creating network applications. It is mainly known for its non-blocking I/O and event driven system. In simple terms, Node.js can easily handle a large number of requests while simultaneously consuming lesser server memory. These are the attributes one should be looking for in a low power server like, you guessed it, Raspberry Pi. Here, you’ll learn how to setup Node.js for Raspberry Pi.

Node.js

ON

Raspberry Pi

Why use Node.js?

Node.js comes with a built in HTTP server library. This means it doesn’t require the help of any external piece of software to act as a web-server. Using Node.js alone one can have greater control of the web-server parameters.

Of course, all we care about it tinkering. Cool new web applications require Node.js to function and we like our Raspberry Pi not being a source of heat all the time. Of course, you could check the Wikipedia entry as well as their very own site.

Installing Node.js on Raspberry Pi

1. Download the Node.js package for ARM

As you must be aware, the Raspberry Pi sports an ARM11 chip. So, the package optimised for ARM will have to be downloaded. It can be done by entering the following command into the terminal.

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

2. Install the package

Once the download is complete, it needs to be installed and can be done using the following command.

sudo dpkg -i node_latest_armhf.deb

And that’s it! Quick, wasn’t it?

By its end, we will have NodeJS and NPM (Node Package Manager) installed on your Raspberry Pi.

Testing the installation

The process is pretty foolproof but it wouldn’t hurt to test the installation with a simple server script.

1. Write the server script

Below, we have written a script that displays “Hello World!” to the client.

var http = require('http');
http.createServer(function (request,response) {
 response.writeHead(200, {'Content-Type': 'text/plain'});
 response.end('Hello World!\n');
}).listen(8000)
console.log("Web Server running at http://127.0.0.1:8000")

Update: There’s a chance the code might not appear in with proper line-breaks on your PC. So, here below we’ve enlisted the above code in its right syntax:

#### Save the script in a file

Save the script in a .js javascript file. Something like greetings.js would be a good idea if you’re not feeling particularly creative.

2. Run the script

Use the node program from the command line to execute the server. Something like so.

node greetings.js

You’ll receive an output like this.

Hello World!

If you’d like you could visit http://127.0.0.1:8000 and be greeted “Hello World!”.

And that is that!

Stay tuned for more on Raspberry Pi, Node.js and all of the web-apps based on it. Do leave us comments if you’d like us to do anything for you…

Octopress installation on Raspberry Pi…

In this article, you’ll be learning how to install the Octopress Framework on your Raspberry Pi. We’ve tried it for some time now, and it is just plain amazing to work on. A blogging framework for hackers indeed.

Octo

What you’ll need

It is better to have all of these handy when getting started.

  • Raspberry Pi (obviously).
  • Raspbian with SSH enabled. If you haven’t already here’s how it’s done.
  • An internet connection; the Raspberry Pi needs to be connected to the internet at all times.

For this setup, we will be using NGINX and Ruby-Dev.

Why NGINX?

NGINX

NGINX, pronounced as “engine X”, is a lightweight event drive web server. It is very well known for it’s static file handling capabilities.

Let’s get started

1. SSH into the Raspberry Pi

Do this using your favourite piece of software. If you haven’t got one already we recommend Putty for Windows. Macs and most Linux distributions have SSH built in.

2. Install the essential packages

Install Ruby-Dev

We require Ruby-Dev for some dependencies of Octopress. Without Ruby-Dev, Octopress may face some issues during its bundle install process. In your SSH terminal enter the following command.

sudo apt-get install ruby ruby-dev

Install NGINX

Now that we have Ruby and Ruby-Dev installed, we’ll need to install NGINX.

sudo apt-get install nginx-full

Install GIT

GIT is required in order to fetch Octopress from its official GIT repository. Enter the following.

sudo apt-get install git

3. Clone the repository

This will clone the official Octopress repository into your Raspberry Pi’s home directory. You can choose where you wish to clone it. For instance, the following example clones it into the “octopress” folder.

git clone git://github.com/imathis/octopress.git <em>octopress</em>

4. Focus on the folder

Enter the following command, to set your current directory to where you’ve cloned the octopress repository.

cd <em>octopress</em>/

5. Install Octopress’ bundle

Before this happens “bundle” has to be installed. Don’t be intimidated. “Bundle” is a Ruby “gem” required in this process. As for what a “gem” is, it’s simply the equivalent of a package in Ruby.

Install “bundle”

So, to install Bundle we’ll use the following code.

sudo gem install bundle

Install the Octopress bundle

Since we’re focused on the octopress folder, the command simply installs the octopress bundle.

bundle install

6. Set up NGINX

Create the web-root

Create the web root in the folder /var/ named “www”.

sudo mkdir /var/www/

Change directory permissions

Set the permissions of the directory to allow all of read, write and execute to everyone. Here’s how it works.

sudo chmod 777 -R /var/www/

Change the default web directory

Edit the NGINX default configuration file to edit the default web directory.

sudo nano /etc/nginx/site-enabled/default

The NGINX default config should look like the following snippet.

server {
        #listen   80; ## listen for ipv4; this line is default and implied
        #listen   [::]:80 default_server ipv6only=on; ## listen for ipv6

        root /usr/share/nginx/www/; #change this web root
        index index.html index.htm;

        # Make site accessible from http://localhost/
        server_name localhost;

Edit the file to look like what follows.

server {
        #listen   80; ## listen for ipv4; this line is default and implied
        #listen   [::]:80 default_server ipv6only=on; ## listen for ipv6

        root /var/www; #this is the new web root
        index index.html index.htm;

        # Make site accessible from http://localhost/
        server_name localhost;```

### 7. Start NGINX

Now that the configuration has been edited, use this command to start NGINX.

`sudo /etc/init.d/nginx start`

### 8. Edit the Rakefile

The Rakefile is in the octopress folder. Its contents should look like this.

ssh_user = "user@domain.com"
ssh_port = "22"
document_root = "~/website.com/"
rsync_delete = false
rsync_args = "" # Any extra arguments to pass to rsync
deploy_default = "rsync"


Edit that to look like so.

ssh_user = "pi@you-pi-ipadress" # the pi@and ip-adress of your Raspberry Pi
ssh_port = "22"
document_root = "/var/www/" ## the web root where octopress public will be placed
rsync_delete = false
rsync_args = "" # Any extra arguments to pass to rsync
deploy_default = "rsync" #using rsync to deploy octopress


### 9. Deploy Octopress

Enter the following to deploy Octopress on NGINX.

`bundle exec rake gen_deploy`

And that’s it!!!

Now, you have Octopress blogging framework on your Raspberry Pi. It’s quick and brilliant. Here’s how mine looks.

<figure class="wp-caption aligncenter" id="attachment_2075" style="width: 640px">[![Octopress](https://revryl.com/wp-content/uploads/2013/12/Octopress-640x419.png)](https://revryl.com/2013/12/28/octopress-raspberry-pi/octopress/)<figcaption class="wp-caption-text">Pretty cool framework. I absolutely love its mobile responsiveness.</figcaption></figure>We’re constantly experimenting with the Raspberry Pi. You can actually [pay a visit](http://darrylpi.dlinkddns.com/) to the site and hopefully be able to experience it or whatever we’re doing at the moment. We hope our ISP doesn’t screw with us.

So, tell us about your experiences if you’ve tried Octopress. It certainly is a good Raspberry Pi project if anything.


Kernel 3.12 – A must upgrade to your Linux kernel…

Linux Kernel 3.12 has been released recently and is a stable kernel, meaning it is utterly safe to upgrade to. Kernel 3.12 comes with far more than simple bug fixes. It is pretty much comes with features that will revamp your system performance-wise from the ground up.

Kernel 3.12

There are a few things which you might find in the new kernel 3.12 when you make the switch. We couldn’t locate a change-log, so bear with it.

  • Improved Dynamic Power Management support for newer Radeon GPUs and other changes after the Radeon DPM feature was merged in Linux 3.11
  • A Snapdragon KMS/DRM driver from the Freedreno project for the Qualcomm Adreno
  • Runtime GPU power management for NVIDIA Optimus laptops to be able to dynamically power on/off secondary GPUs
  • Experimental support for DRM render nodes
  • AMD Berlin APU support for the first HSA server APU
  • Intel Haswell graphics improvements with eLLC DRAM support now enabled for the systems with Iris Pro 5200 graphics bearing dedicated memory for graphics
  • Staging driver updates
  • Sound drivers work well now
  • EXT4 gained new features of aggressive extent caching and better recovery
  • F2FS file-system improvements
  • Slidebar support for Ideapad series of Lenovo
  • XFS file-system improvements
  • BTRFS file-system performance improvements

I found five changes among these I would want for my Debian system. You must agree, that’s an impressive list of changes…

Installation of Kernel 3.12

The process lets you manually install the kernel on your Debian based system which includes Linux Mint and Ubuntu. The process is pretty fool-proof and two of our systems have successfully accepted its new kernel. However, we urge you to exercise reasonable precaution. Read it twice before starting. It’s all on you…

1. Launch the terminal

We like using [Ctrl][T]. But you can go through the longer route if you like.

2. Enter the commands

The commands have to be entered in the terminal precisely, in the exact order one after the previous is complete.

Focus on the temporary folder

cd /tmp

Download the latest kernel

wget http://dl.dropboxusercontent.com/u/47950494/upubuntu/kernel-3.12 -O kernel-3.12

Install the freshly downloaded kernel

chmod +x kernel-3.12

Apply the kernel

sudo sh kernel-3.12

3. Restart your system

If your terminal continues to remain in view, enter the following command. Else, you can do this in the traditional way at your earliest convenience.

sudo reboot

And that’s it. You now have a system with a fresh and stable new kernel. Enjoy!

Uninstalling Kernel 3.12

Being a stable release the kernel is guaranteed not to cause any trouble but there is a remote chance you might not like the reformed system. If you wish to roll back, all you need to do is enter the following command in a terminal window and you’re done.

sudo apt-get purge linux-image-3.12*

So, do tell us if you’ve found any improvements we might add to our unofficial change-log summary. Other than that, you can always contact us about things you’d like help for…