- Smarter completion. A few examples:
- context sensitive -- if you have file "name1" and directory "name2", "cd nam<TAB>" completes to "name2/"
- "tar xf <TAB>" completes to tarballs only. "unrar x <TAB>" completes to RARs only. etc.
- rsync / scp completion: "rsync host:anything/<TAB>" shows you files on host under anything/
- also works with rsync:// URLs
- SSH host completion from ~/.ssh/config & ~/.ssh/known_hosts
- lots of other smart completions: Rake tasks, git commands & SHAs, dpkg packages, dash-options for most commands, etc etc.
Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.
Terminology:
- Producers send messages to brokers
- Consumers read messages from brokers
- Messages are sent to a topic
Sample TCP server-client implementation using openssl in ruby
Use the wrapper shell script to create ssl certificates ./openssl.sh -newca
, enter the details and the required files will be generated to ./demoCA
dir from where you run the script. cacert.pem
will be your ssl-certificate and private/cakey.pem
will be your ssl-key
Start SSL Server using:
ruby ssl_server.rb 9099 demoCA/cacert.pem demoCA/private/cakey.pem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl' | |
# | |
# Program to demonstrate Certificate Signing Request using openssl | |
# | |
# Create a new key | |
def gen_key(name) | |
key = OpenSSL::PKey::RSA.new 1024 | |
file = File.new name, "w" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# - | |
# Script to install standalone puppet | |
# - | |
OS=`uname -s` | |
REV=`uname -r` | |
MACH=`uname -m` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sshable () { | |
[[ $# -ne 3 ]] && { echo "requires instance, ssh_user, ssh_key arguments"; return; } | |
instance=$1 | |
ssh_user=$2 | |
ssh_key=$3 | |
command=$(ssh -t -t -o ConnectTimeout=2 -o StrictHostKeyChecking=no -o BatchMode=yes -o UserKnownHostsFile=/dev/null -p 22 -i ${ssh_key} ${ssh_user}@${instance} "echo" &>/dev/null) | |
until $command; do | |
echo -e ".\c" | |
done | |
echo "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class String | |
def undent | |
gsub(/^.{#{slice(/^ +/).length}}/, '') | |
end | |
end | |
#Usage: | |
test = <<-EOS.undent | |
testing unindent | |
..another line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = ashrithr | |
email = [email protected] | |
[color] | |
ui = auto | |
[credential] | |
helper = osxkeychain | |
[core] | |
excludesfile = /Users/ashrith/.gitignore_global | |
[difftool "sourcetree"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Licensed to the Apache Software Foundation (ASF) under one or more | |
# contributor license agreements. See the NOTICE file distributed with | |
# this work for additional information regarding copyright ownership. | |
# The ASF licenses this file to You under the Apache License, Version 2.0 | |
# (the "License"); you may not use this file except in compliance with | |
# the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |