<![CDATA[Proudlygeek]]>http://www.gianlucabargelli.com/Ghost v0.4.2Wed, 21 May 2014 10:40:08 GMT60<![CDATA[HipstaDeploy]]>HipstaDeploy

A bash script for generating and deploying static websites on Amazon Cloudfront.

Imgur

Why this stuff?

Deploying a static website (blogs are probably the best suited) on a CDN will give you tremendous amounts of speed from all around the world compared to a dynamic host for a relatively cheap price.

You can use HipstaDeploy with any kind of local blog installation like Ghost, Wordpress or Jekyll.

Requisites

Right now HipstaDeploy expects you to have installed s3_website:

gem install s3_website  

Installation

Just run this command if you wanna do a quick Hipstallation:

curl -s https://gist.githubusercontent.com/proudlygeek/9551019ff48053ae5bf3/raw/install.sh | sh  

This will download the bash script into /usr/local/bin, so check if is in your env PATH var.

You can check your installation by typing:

hipdep -h  

If you prefer the Good Old Ways you can just clone this repository and run:

./deploy.sh

Usage

On the first run you'll have to create file named 's3_website.yml' with this command:

s3_website cfg create  

Edit this file with your AWS Credentials:

s3_id: YOUR_AWS_S3_ACCESS_KEY_ID  
s3_secret: YOUR_AWS_S3_SECRET_ACCESS_KEY  
s3_bucket: your.blog.bucket.com  

Now just fire up HipstaDeploy with:

hipdep  

HipstaDeploy will ask you if you want to deploy your static folder to Amazon CloudFront, say Y to rock on!

Your static files will be generated from URL http//localhost:2368 (yes, that's a Ghost blog) and will be saved in a folder named _site.

You can override this behavior by using the -u and -o flags:

hipdep -u http://blog.local:8080 -o static_file  

License

MIT

]]>
http://www.gianlucabargelli.com/new-post-test/6627d10d-db1f-4437-a564-fb9550eb980aTue, 20 May 2014 14:06:50 GMT
<![CDATA[This is a test!]]>Let's play a little bit :)

Some random stuff

What about some gist?

And this should be colorized:

function() {  
    colorMePlease();
}

And some PHP:

<?php

$args = bson_decode(base64_decode($argv[1]));
$out = "Spawned with args " . print_r($args, 1);

sleep(5);

print base64_encode(bson_encode(array('output' => $out)));

flush();  
exit(0);  

What about some Golang?

package cage

import (  
    "github.com/streadway/amqp"
)

type Queue struct {  
    AmqpConnection amqp.Connection
    Channel *amqp.Channel
    InQueue amqp.Queue
    OutQueue amqp.Queue
    In <-chan amqp.Delivery
    Out chan *ResultPayload
}

type ResultPayload struct {  
    CorrelationId string
    Output string
}

type AmqpConnection func(string) (*amqp.Connection, error)

func (q *Queue) Init(bindingKey string, amqpDial AmqpConnection) {  
    conn, err := amqpDial("amqp://guest:guest@localhost:5672/")
    //conn, err := AmqpConnect()
    if err != nil {
        failOnError(err, "Failed to connect to RabbitMQ")
        defer conn.Close()
    }

    q.Channel, err = conn.Channel()

    if err != nil {
        failOnError(err, "Failed to open a channel")
        defer q.Channel.Close()
    }

    err = q.Channel.ExchangeDeclare(
        "cage_exchange",                    // name
        "direct",                           // kind
        false,                              // durable  
        false,                              // auto delete
        false,                              // internal
        false,                              // no wait
        nil,                                // arguments
    )
    if err != nil {
        failOnError(err, "Failed during Exchange declaration")
        defer q.Channel.Close()
    }

    q.InQueue, err = q.Channel.QueueDeclare(
        "",                                 // name,
        false,                              // durable, 
        false,                              // delete when unusued,
        false,                              // exclusive,
        false,                              // noWait,
        nil,                                // arguments
    )

    q.Channel.QueueBind(
        q.InQueue.Name,                     // name
        bindingKey,                         // binding key
        "cage_exchange",                    // exchange
        false,                              // no wait
        nil,                                // arguments                        
    )

    q.OutQueue, err = q.Channel.QueueDeclare(
        "Services." + bindingKey + ".OUT",  // name,
        false,                              // durable, 
        false,                              // delete when unusued,
        false,                              // exclusive,
        false,                              // noWait,
        nil,                                // arguments
    )

    q.In, err = q.Channel.Consume(q.InQueue.Name, "", false, false, false, false, nil)
    if err != nil {
        failOnError(err, "Failed to register a consumer")
    }

    q.Out = make(chan *ResultPayload)
}
]]>
http://www.gianlucabargelli.com/this-is-a-test/5a49887d-579d-483d-9757-f3beb0e7ca85Sat, 19 Apr 2014 16:37:09 GMT
<![CDATA[Welcome to Ghost]]>You're live! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. You can manage your content by signing in to the admin area at <your blog URL>/ghost/. When you arrive, you can select this post from a list on the left and see a preview of it on the right. Click the little pencil icon at the top of the preview to edit this post and read the next section!

Getting Started

Ghost uses something called Markdown for writing. Essentially, it's a shorthand way to manage your post formatting as you write!

Writing in Markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use shortcuts to style your content. For example, a list:

  • Item number one
  • Item number two
    • A nested item
  • A final item

or with numbers!

  1. Remember to buy some milk
  2. Drink the milk
  3. Tweet that I remembered to buy the milk, and drank it

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

What about Images?

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

The Ghost Logo

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

Quoting

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

Wisdomous - it's definitely a word.

Working with Code

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

.awesome-thing {
    display: block;
    width: 100%;
}

Ready for a Break?

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.


Advanced Usage

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://www.gianlucabargelli.com/welcome-to-ghost/e7d55ad6-ac65-4732-af8f-4898f19b9e48Sat, 19 Apr 2014 16:22:02 GMT