Share a Mercurial repository on github (macOS)

Local macOS configuration

Python & Mercurial

This was tested on macOS El Capitan, with Pyhton 2.7 and Mercurial 4.2.2

Install Hg-Git

You will need the Hg-Git Mercurial plugin.

It can be installed with Python's package installer pip.

Install pip first:

$ wget https://bootstrap.pypa.io/get-pip.py
$ python get-pip.py

Install Mercurial (eventually) & Hg-Git:

$ sudo pip install mercurial
$ sudo pip install hg-git

Enable the extension:

$ vi ~/.hgrc:
[extensions]

hggit =

SSH key for github

create SSH key (details)

  • ssh-keygen -t rsa -b 4096 -C "someone@example.com"

add it to your github account (details)

  • $ pbcopy < ~/.ssh/id_rsa.pub
  • Github: Settings -- SSH / GPG Keys -- New SSH key -- paste clipboard

Configure & share repository

create empty github repository

  • create on github
  • copy its URL
configure local empty repository
$ mkdir myrepo
$ cd myrepo
$ hg init

set username & include github URL as default 
$ vi .hg/hgrc

[ui]
username = Someone Example
 <someone@example.com>

[paths]
default = git+ssh://git@github.com/someoneaccount/myrepo.git

Push & pull

Upload local changes to github

hg addremove
hg commit
hg bookmark -r default master
hg push

Integrate locally changes made on github

hg pull -u


Looking for a Web Designer and/or Front End developer to join a future startup in Valencia

We are building a team that will participate in the startup acceleration program by Bbooster.

This is an intensive program of 4 months (June to September), at the end of which we expect to get funding (65% of the projects got it in past editions and we believe ours is among the best :-).

Ideally full-time on-site in Valencia as a founder, but we are also open to some other kind of collaboration like part-time or remote.

The project will be an internet portal initially focused in the tourism sector and collaborative economy. 

Current team members have expertise in business, marketing and backend development. We need to cover the graphical design/UI/front end area.

Interested? Contact me on Linkedin

 




Email Round Trip Monitoring

If you administer an email server as I do, it's very useful to have an automated monitoring system that checks often that it works properly.

My first try on any new feature I want to add to my non-fatally-critical systems is to use an external service, specially if it can be done for free. Whereas there is a number of server monitoring services, most don't include roundtrip email monitoring, at least on their free plan. 

The only one I found to include it is...

Force HTTPS & www

You want to force any URL that doesn't include either:

  1. HTTPS
  2. www subdomain
to be redirected to the corresponding URL including both.

The following directives in the .htaccess file worked for me for a simple static site:

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} ^domain.com$ [NC]
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

There must be a way to make the first condition generic and avoid hardcoding domain.com, I just didn't investigate it, maybe you already know how & can comment below ;-)