install nodejs using PM2

install nodejs using PM2

https://github.com/Unitech/pm2

https://app.keymetrics.io

Leave a comment

Filed under Technical Links

Install RabbitMQ on ubuntu

from https://marcqualie.com/2012/12/install-rabbitmq-on-ubuntu-12.04

I’ve put together this simple install script that I compiled from the various tutorials on the rabbitmq site. It’s not intended to be anything new or that isn’t easily accessible; It’s simply the quickest way I’ve found to get up and running with the web interface out of the box.

echo "deb http://www.rabbitmq.com/debian/ testing main" > /etc/apt/sources.list.d/rabbitmq.list
wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
sudo apt-key add rabbitmq-signing-key-public.asc
apt-get update
apt-get install rabbitmq-server -y
service rabbitmq-server start
rabbitmq-plugins enable rabbitmq_management
rabbitmqctl add_user admin password
rabbitmqctl set_user_tags admin administrator
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
rabbitmqctl delete_user guest
service rabbitmq-server restart

Make sure you change the word “password” to the actual password you want to login with in the add_user line before running. The default port for the admin interface is 15672. You can use the management interface to finish off your configuration such as adding exchanges, queues, users and vhosts. Make sure to open the correct firewall ports (15672, 5672) if you are going to be accessing the box outside of a VPN or localhost.

Leave a comment

Filed under Technical Links

Windows Service as a console app Topshelf

Windows Service as a console app Topshelf

http://topshelf-project.com/

Leave a comment

Filed under Technical Links

asp.net sessions slow

http://stackoverflow.com/questions/3629709/i-just-discovered-why-all-asp-net-websites-are-slow-and-i-am-trying-to-work-out

Leave a comment

Filed under Technical Links

angular dynamic routes

http://stackoverflow.com/questions/25732164/recursive-ui-router-nested-views

one state and one parameters. ex:

.state('files', {
      url: '/files/{folderPath:[a-zA-Z0-9/]*}',
      templateUrl: 'tpl.files.html',
      controller: 'FileCtrl'
    });

Later we can dynamically generate navigation (links) like this

<a href="#/files/Folder1">
<a href="#/files/Folder1/SubFolder1/">
<a href="#/files/Folder1/SubFolder1/SubFolderA">
<a href="#/files/Folder1/SubFolder1/SubFolderB">
<a href="#/files/Folder1/SubFolder2/SubFolderX">

angular
.module(“fileApp”, [‘ui.router’])
.controller(‘FileCtrl’, function($scope, $state, $stateParams) {
$scope.state = $state.current
$scope.params = $stateParams;
})
.config([‘$stateProvider’, ‘$urlRouterProvider’,
function($stateProvider, $urlRouterProvider) {
$stateProvider
.state(‘home’, {
url: ‘/’,
templateUrl: ‘tpl.home.html’,
})
.state(‘files’, {
url: ‘/files/{folderPath:[a-zA-Z0-9/]*}’,
templateUrl: ‘tpl.files.html’,
controller: ‘FileCtrl’
});

$urlRouterProvider.otherwise(‘/files/’);
}
]);

Leave a comment

Filed under Technical Links

generate azure docker certificates

generate CA, server and client keys
https://docs.docker.com/articles/https/

First generate CA private and public keys:
openssl genrsa -aes256 -out ca-key.pem 2048
openssl req -new -x509 -days 365 -key ca-key.pem -sha256 -out ca.pem
pwd 123qweASD

Now that we have a CA, you can create a server key and certificate signing request (CSR). Make sure that “Common Name” (i.e., server FQDN or YOUR name) matches the hostname you will use to connect to Docker:
openssl genrsa -out server-key.pem 2048
openssl req -subj “/CN=$HOST” -new -key server-key.pem -out server.csr

Next, we’re going to sign the public key with our CA:
openssl x509 -req -days 365 -in server.csr -CA ca.pem -CAkey ca-key.pem -CAcreateserial -out server-cert.pem

For client authentication, create a client key and certificate signing request:
openssl genrsa -out key.pem 2048
openssl req -subj ‘/CN=client’ -new -key key.pem -out client.csr

To make the key suitable for client authentication, create an extensions config file:
echo extendedKeyUsage = clientAuth > extfile.cnf

Now sign the public key:
openssl x509 -req -days 365 -in client.csr -CA ca.pem -CAkey ca-key.pem -CAcreateserial -out cert.pem -extfile extfile.cnf

After generating cert.pem and server-cert.pem you can safely remove the two certificate signing requests:
rm -v client.csr server.csr

encode base64 for azure

~/.docker$ l
ca-key.pem ca.pem cert.pem key.pem server-cert.pem server-key.pem
~/.docker$ base64 ca.pem > ca64.pem
~/.docker$ base64 server-cert.pem > server-cert64.pem
~/.docker$ base64 server-key.pem > server-key64.pem
~/.docker$ l
ca64.pem ca.pem key.pem server-cert.pem server-key.pem
ca-key.pem cert.pem server-cert64.pem server-key64.pem

add in azure docker extension using the base 64 certificates

Leave a comment

Filed under Technical Links

css rotate table column headers

https://css-tricks.com/rotated-table-column-headers/

Leave a comment

Filed under Technical Links