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 | |
| name=fooAlert-$RANDOM | |
| url='http://localhost:9093/api/v1/alerts' | |
| bold=$(tput bold) | |
| normal=$(tput sgr0) | |
| generate_post_data() { | |
| cat <<EOF | |
| [{ |
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 -eu | |
| # Increase Virtual Memory for Elasticsearch on GKE | |
| # https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html | |
| # Dependencies: kubectl, gcloud, jq | |
| nodes() { | |
| kubectl get nodes -o custom-columns=n:.metadata.name --no-headers | |
| } |
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
| import { Injectable } from '@angular/core'; | |
| import { HttpErrorResponse, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; | |
| import { Observable } from 'rxjs/Observable'; | |
| import 'rxjs/add/operator/mergeMap'; | |
| import { AuthService } from './auth.service'; | |
| @Injectable() | |
| export class TokenInterceptor implements HttpInterceptor { |
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
| import { Injectable } from 'angular2/core'; | |
| import { Storage } from './storage'; | |
| import { CurrentUser } from '../interfaces/common'; | |
| @Injectable() | |
| export class Authentication{ | |
| private _storageService : Storage; | |
| private _userKey : string = "CURRENT_USER"; | |
| constructor(storageService : Storage){ |
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
| define([ | |
| 'angular', | |
| 'angularUiRouter', | |
| 'uiRouterExtras', | |
| 'uiRouterExtrasStatevis', | |
| 'ocLazyLoad', | |
| 'core/module', | |
| 'core/services/settings', | |
| 'states/core' |
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
| Producer | |
| Setup | |
| bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1 | |
| bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3 | |
| Single thread, no replication | |
| bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196 |
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
| var cfg = require('../config').Config, | |
| qs = require('querystring'), | |
| request = require('request'); | |
| request = request.defaults({jar: true}) | |
| exports.awesome = function(req, res){ | |
| headers = {}; |
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
| <!-- country codes (ISO 3166) and Dial codes. --> | |
| <select name="countryCode" id=""> | |
| <option data-countryCode="GB" value="44" Selected>UK (+44)</option> | |
| <option data-countryCode="US" value="1">USA (+1)</option> | |
| <optgroup label="Other countries"> | |
| <option data-countryCode="DZ" value="213">Algeria (+213)</option> | |
| <option data-countryCode="AD" value="376">Andorra (+376)</option> | |
| <option data-countryCode="AO" value="244">Angola (+244)</option> | |
| <option data-countryCode="AI" value="1264">Anguilla (+1264)</option> | |
| <option data-countryCode="AG" value="1268">Antigua & Barbuda (+1268)</option> |
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
| -- 1. apt-get install prosody-trunk | |
| -- 2. Checkout prosody-modules on Google Code | |
| -- 3. Move all modules to /usr/lib/prosody/modules | |
| -- 4. Move the mod_smacks module to mod_smacks2 and copy it to mod_smacks3 | |
| -- 5. Move the files in mod_smacks* to match the new names | |
| -- 6. In mod_smacks3/mod_smacks3.lua s/urn:xmpp:sm:2/urn:xmpp:sm:3/g | |
| -- 7. Set the Prosody configuration to: | |
| admins = { "ADMIN@HOST" } | |
| daemonize = true |
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
| define(['angular', 'services'], function (angular) { | |
| 'use strict'; | |
| return angular.module('myApp.controllers', ['myApp.services']) | |
| .controller('IndexCtrl', ['$scope', 'googleService', function ($scope, googleService) { | |
| $scope.login = function () { | |
| googleService.login().then(function (data) { | |
| // do something with returned data | |
| console.log(data.email); |
NewerOlder