Ownership and Borrowing in Rust

I’ve been having a lot of fun learning Rust. I’ve been going through the second version of the Rust book and have covered uptil chapter 6 – Enums and Pattern Matching.

One of the unique things about Rust is the Ownership system. I had some doubts understanding this. Searching on Google lead me to this little website – http://intorust.com/ that has some really cool videos explaining – ownership and borrowing.

The author, Nicholas D. Matsakis, has a lot of other interesting work that you can read at http://smallcultfollowing.com/babysteps/

On another note, I’ve been pushing my Rust code to the repository here. I’ll be happy to receive any feedback.

Updating ghost-cli process name

Imagine you’ve created your new Ghost install but have set it up with the incorrect process name. The official documentation does not tell us how to update it, it just tells us that it can be set using the --pname flag during initial installation. Let’s look at how we can update the process name after we’ve installed our site.

Continue reading “Updating ghost-cli process name”

Disinfecting a Windows machine

So last weekend my sister came to me with a slow performing Windows 8.1 Acer laptop. She wanted me to format it and install a new copy of Windows 8.1.

I’ve been using Debian for the last 3 years. Previously I was dual booting between Windows and Debian in-order to play DOTA 2 with my friends, but since Valve released DOTA 2 on Linux, I’ve had little reason to open my Windows installation. As you’d expect I didn’t have a Windows 8.1 setup disc or ISO lying around. I debated whether to shift her to a clean KDE based Debian machine and she agreed as long as her desktop looked nice but I changed my mind when I saw the software she was using –

  1. Cyberlink PowerDirector Pro
  2. Cyberlink PhotoDirector
  3. Bunch of free games

I’m sure I’d be able to find alternatives for the above, but it’d be too much of a learning curve for her, plus setting up a KDE machine from scratch would take some time.

I decided to investigate the reason for slowness, and possibly fix the problem itself. Upon further discussion with her, I found out that the laptop was not only slow, but was infected with some sort of a malware. She was getting permission errors while opening certain folders, and a lot of the folders were hidden.

Continue reading “Disinfecting a Windows machine”

Renewing Let’s Encrypt certificate

Have the following command setup in my crontab to renew the certificate for this blog, and for the main website – thecurlybraces.com

30 3 1 */2 *  /opt/letsencrypt/certbot-auto renew --pre-hook "" --post-hook "service nginx restart"

This causes the command to run, at 03:30 on day-of-month 1 in every 2nd month.

Output

-------------------------------------------------------------------------------
Processing /etc/letsencrypt/renewal/thecurlybraces.com.conf
-------------------------------------------------------------------------------
Cert is due for renewal, auto-renewing...
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for thecurlybraces.com
http-01 challenge for blog.thecurlybraces.com
Waiting for verification...
Cleaning up challenges

-------------------------------------------------------------------------------
new certificate deployed without reload, fullchain is
/etc/letsencrypt/live/thecurlybraces.com/fullchain.pem
-------------------------------------------------------------------------------

Congratulations, all renewals succeeded. The following certs have been renewed:
  /etc/letsencrypt/live/thecurlybraces.com/fullchain.pem (success)
Running post-hook command: service nginx restart

Incase you want to add more domains to an existing certificate, use the following command –

sudo /opt/letsencrypt/certbot-auto --expand -d blog.thecurlybraces.com -d thecurlybraces.com -d bitsnpieces.thecurlybraces.com --pre-hook "" --post-hook "service nginx restart"

This assumes that you have only a single certificate. If you’ve more, you’ll have to use --cert-name. Read more here.

Just putting this here for reference, and with the hope that it might be useful for someone else.

Setting up a blog using Ghost on Debian

My web hosting’s annual payment date was drawing close, and instead of renewing it, I decided I’d rent a server on Digital Ocean for 10$ a month. It turns out to be a lot more expensive but gives me the option to use the server for something other than just blogging and running PHP application.

After shifting to this new server, the first thing to do was to migrate my blog here. WordPress is an amazing platform, but over the years it has evolved to something a lot more than just a blogging tool. Besides the new kid on the block – Ghost, was creating a lot of buzz for its simplicity. I wanted to give it a try.

I setup my Digital Ocean server with Debian (Jessie 8.2). Node.js is required to run Ghost. Since I wanted to use this server for multiple applications, I decided I’d put nginx as a front facing proxy/compression server.

This blog item is a guide for setting up Ghost on a server running Debian. Let’s start,

Continue reading “Setting up a blog using Ghost on Debian”

My tools on Linux

Update 2016-01-16

Development of Crunchbang has now stopped. There are a few community spin-offs available, Bunsen Labs and Crunchbang++. I’m now using a netinst version of Debian at home with the i3 window manager, and Bunsen Labs on my office laptop. Both are working well. I’m still using the same set of software for my work, in addition to a few more, so this post is still valid.


I’ve been using Linux at home and work for over 5 months now. I’m using a Debian based distribution called Crunchbang. Over these past few months I’ve developed/programmed using multiple technologies and have gathered a collection of tools, that I use on a daily basis.

NameTypeLink
Eclipse with NodeEclipse – Check UpdateIDE for Node.jsLink
NetbeansIDE for PHPLink
DbeaverGUI client for Cassandra and othersLink
MySQL WorkbenchMySQL/MariaDB GUI clientLink
DiaFlowchart and DiagramsLink
SoapUITesting – API and Web ServicesLink
TildaDrop down terminalLink
MeldMergetoolLink
RemminaGTK RDP ClientLink
TomboyNote Taking AppLink
GMTPMTP ClientLink
GIMPImage manipulationLink
Continue reading “My tools on Linux”