My notes from the Meet Chef course at http://pluralsight.com/training/Courses/TableOfContents/meet-chef
Chef is a Ruby framework for automating, reusing and documenting server configuration. It's like Unit tests for your servers.
#!/bin/bash | |
domain=$1 | |
port=$2 | |
if [ -z "$domain" ] || [ -z "$port" ]; then | |
echo "Usage: domain-alias <domain> <port>" | |
exit 1 | |
fi |
private const string onlineUsersCacheKey = "OnlineUsers"; | |
// The SignalR Hub | |
readonly UserActivityHub userActivityHub = new UserActivityHub(); | |
/// <summary> | |
/// This method is fired when the application starts up. | |
/// </summary> | |
protected void Application_Start() | |
{ |
namespace UsersOnlineExample.Utils | |
{ | |
using System.Collections.Generic; | |
using Microsoft.AspNet.SignalR; | |
using Microsoft.AspNet.SignalR.Hubs; | |
[HubName("userActivityHub")] | |
public class UserActivityHub : Hub | |
{ |
<div id="usersCount"></div> | |
<script src="~/Scripts/jquery-1.8.2.min.js"></script> | |
<script src="~/Scripts/jquery.signalR-1.1.3.js"></script> | |
<script src="/signalr/hubs" type="text/javascript"></script> | |
<script> | |
$(function () { | |
// Reference the auto-generated proxy for the hub. | |
var userActivity = $.connection.userActivityHub; | |
// Create a function that the hub can call back to display messages. |
@echo off | |
if _%1_==__ goto USAGE | |
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem -subj "/CN=My Cert Name" | |
openssl pkcs12 -export -out mycert.pfx -inkey mycert.pem -in mycert.pem -passout pass:%1 | |
openssl x509 -inform pem -in mycert.pem -outform der -out mycert.cer | |
openssl pkcs12 -in mycert.pfx -nodes -passin pass:%1 | openssl x509 -noout -fingerprint | |
openssl x509 -in mycert.pem -noout -fingerprint |
/* | |
Serve is a very simple static file server in go | |
Usage: | |
-p="8100": port to serve on | |
-d=".": the directory of static files to host | |
Navigating to http://localhost:8100 will display the index.html or directory | |
listing file. | |
*/ | |
package main |
{url:'stun:stun01.sipphone.com'}, | |
{url:'stun:stun.ekiga.net'}, | |
{url:'stun:stun.fwdnet.net'}, | |
{url:'stun:stun.ideasip.com'}, | |
{url:'stun:stun.iptel.org'}, | |
{url:'stun:stun.rixtelecom.se'}, | |
{url:'stun:stun.schlund.de'}, | |
{url:'stun:stun.l.google.com:19302'}, | |
{url:'stun:stun1.l.google.com:19302'}, | |
{url:'stun:stun2.l.google.com:19302'}, |
My notes from the Meet Chef course at http://pluralsight.com/training/Courses/TableOfContents/meet-chef
Chef is a Ruby framework for automating, reusing and documenting server configuration. It's like Unit tests for your servers.
JSON, MessagePack, and Google's Protocol Buffers are all awesome. Here's how they're awesome on different client environments and how to use them on your rails env.
Some links:
Output from Ruby Client:
/** | |
* Encodes multi-byte Unicode string into utf-8 multiple single-byte characters | |
* (BMP / basic multilingual plane only). | |
* | |
* Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars. | |
* | |
* Can be achieved in JavaScript by unescape(encodeURIComponent(str)), | |
* but this approach may be useful in other languages. | |
* | |
* @param {string} unicodeString - Unicode string to be encoded as UTF-8. |