All posts by Ramesh Jha

GNOME Sudoku : A desktop Sudoku puzzle game app for Ubuntu

I guess, you’ve heard of sudoku before or have solved any sudoku puzzle at some point of time in your life. Sudoku is one of the most popular number-puzzle game, which was originated in Japan. Probably, it’s the best tool to overcome boredom, specially, when you have nothing much around to do in your home, office or school. You can find Sudoku puzzles in your newspapers, magazines, websites (just Google it) and mobile app stores.

In sudoku puzzle, you are provided with incomplete 9×9 grid (9 rows & 9 columns). Your goal is to fill the empty grids with digits keeping in mind that each row, column and 3×3 section contains numbers only from 1 to 9 with each number used only once in each section.

GNOME Sudoku

For Ubuntu (Linux Mint) users like us, who wants to play sudoku puzzle on desktop can install an app called Gnome Sudoku. Gnome Sudoku is an open-source program and was written in Python.

Features

It’s lightweight, handy and has very simple interface. It comes with easy, medium, hard and very-hard difficulty levels which makes the Sudoku solving even more challenging. While solving the puzzle, the games are automatically saved so you don’t have to worry about saving them. It reloads the last unfinished game when you restart the application. Beside that, you can also create your own 9×9 sudoku puzzle and save the board into PDF file formats for printing.

sudoku

To install Gnome-Sudoku in Ubuntu system, open the terminal and run the following command :

sudo apt-get update
sudo apt-get install gnome-sudoku

 
When you’re done installation, go ahead and launch the app. Next, just select the difficulty level and start solving the puzzle. It’s not going to be easy every-time, just keep trying.

Note : It’s a guest post by Mr. Ambuj Kumar. You should also checkout his recent website http://anysudokusolver.com. It’s an online sudoku solver, And very handy when you are stuck.

Notes – a simple note taking app for Ubuntu/Linux

Notes is a simple and minimalistic note-taking application. It’s a free and open source cross platform app. It offers a simple writing pad for entering plain text, without any style. It can be used for anything – writing short notes, poems, todo list, ideas or long articles/essays etc.

notes screenshot

Notes is build using Qt framework (an open source cross-platform toolkit), inspired by the default notes app from Mac OS X (Yosemite). Although, I find the Mac like icons (minimize, close, maximize) little odd as it doesn’t look blended with XFCE desktop, but I like the simplicity and elegancy of app.

Installing Notes in Ubuntu

In Ubuntu 16.04 LTS, it’s already available in official repository. you can install it from the Ubuntu Software Center.

For older version (e.g Ubuntu 14.04 LTS) or other Debian derivatives such as Linux Mint, first download the debian package and install it using Ubuntu software Centre or GDebi package installer.

Also check out the github page if you want to follow the updates on new features or report any bug etc. Let me know (comment below) your feedback if you use this app for taking notes.

Getting started with Go language on Ubuntu/Linux

Go (Golang) is an open source programming language developed at Google. It’s a compiled and statically typed language like C/C++/Java. It’s lightweight and fast, with small memory footprint and its support for concurrency, networking and multi-processing makes it an interesting choice for specific projects.

I use Go for building small command line apps and rewriting some parts of Sinatra/Rails(Ruby based web frameworks) applications in Go. It helps me save lots of CPU power and RAM after I rewrote some CPU intensive modules in Go. Ruby(Sinatra/Rails) is my default choice for new web projects, but I’m thinking of trying Golang(net/http) for my next project, especially if the performance/speed is critical.

Setting up Go in Ubuntu [14.04]

1. Download the package from the official page.

2. Extract it (to /usr/local or anywhere else)

sudo tar -C /usr/local -xzf go1.5.3.linux-amd64.tar.gz

3. Set the path correctly
Open bash config file using nano (or your preferred text editor).

nano ~/.bashrc

And append the following line.

export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:$GOPATH/bin
export GOBIN=$GOPATH/bin

4. Reload Bash (to apply the new config)

source ~/.bashrc

Type go in the terminal to check if the command is available. Next, you can start writing programs in Golang.

Writing your first program in Go

Lets write a simple “Hello World” Program (hello.go) that would simply print something using fmt.

package main
import "fmt"

func main() {
  fmt.Println("Hello World!")
}

Compile

go build hello.go

Run

./hello

Recommended Links

KeePassX – The Best Password Manager for Ubuntu/Linux

KeePassX is a cross-platform password manager application. It has very high security standards. Since, it stores data locally in encrypted format, it’s probably a better alternative to any online password manager. If you want to share it across multiple devices/platforms just sync the database file using some apps like Dropbox. Make sure you’re synchronizing the encrypted file(*.kdb), not the raw *.xml export or anything else.

add password keepassx

It has simple and lightweight graphical interface, with all the basic features, to make password management easier for everyone. It comes in very handy if you manage lots of online accounts at various sites, because having a unique and strong password for each website is highly recommended. With KeePassX, the Master Password is all you need to remember.

Installing/Setting up KeePassX on Ubuntu [14.04 LTS]

It’s very likely (in most common GNU/Linux distributions – Debian, Ubuntu, Linux Mint etc) that it’s already there in your default package repository. Just open a terminal (default shortcut : Ctrl+Alt+t) and type

sudo apt-get install keepassx

After installing KeePassX, set up the Master Password or Key. And you should also configure/specify the location for storing the database file. KeePassX will prompt you to enter the master key every time you open the application. Keep a very long Master password (I use 22 letters with lower & upper case letters, numbers and special characters) and remember that. On the other hand, you could also use key pairs instead of password. (or both if you wish)

Additional features include a random password generator, storing urls, comments, usernames, attachments etc in a simple and easy way. Passwords can be easily organized in multiple groups and unique icons can be specified for each group.

Visit the official site to know more about the features (or to get package for other distro) and drop a comment here if you’ve any question/issue related to KeePassX.

Adding SSL to a Rails Application

Adding SSL to a new or existing Rails application isn’t really that difficult. If the website exists for a while and you want to move to https, then you must properly redirect (301) visitors to the new url. If it’s a new website, then it’s probably a good idea to use SSL from the start. (it’s must if you collect any kind of sensitive data from the users)

Assumptions : It’s a Rails 4 app, running with nginx, passenger and Ubuntu 14.04 Server. (preferably on VPS, or somehow you should be able to update nginx configs and so). For SSL certificate, I would recommend Comodo PositiveSSL Certificate from NameCheap @ $9 a year, unless you’ve a good reason to spend more on that.

SSL Setup

First, generate a key and then CSR for buying a SSL certificate. Enter the required info as required. Watch out for Common Name / FQDN field, it must match with the domain (in this case : example.com).

openssl genrsa -out example.com.key 2048
openssl req -new -key example.com.key -out example.com.csr

Then copy the content of above csr file to your clipboard (use xclip, a command line utility) and paste that into SSL order form.

xclip -sel clip < path_to_your_csr_directory/example.com.csr

Next, you’ll receive a confirmation email. After confirming that, they will email you the certificate. (usually within few hours)

Once you receive the ssl certificate (usually in *.zip format), extract the zip file (containing certificates) and concatenate them in right order to get a single certificate file.

cat www_example_com.crt COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt AddTrustExternalCARoot.crt > ssl-bundle.crt

Now, you need to upload these two files – ssl-bundle.crt and example.com.key (the private key, generated earlier) to the server. (use scp. e.g scp target_file user@server_ip:file_name)

Preparing Rails for SSL

Enable SSL in production mode, by updating the config/environments/production.rb file.

config.force_ssl = true

And you also need to make sure all the external resources (e.g fonts, images, css, js etc) are loaded securely over https only.

Nginx setup

Login to VPS/Server and create/update your nginx config for ssl.

sudo nano /etc/nginx/sites-available/example.com

A sample nginx config for Rails Application.

Now, enable that nginx config and reload the server.

sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/example.com
sudo service nginx reload