This file contains 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 SalesForceIdValidator { | |
private ID_REGEX = /^[0-9a-zA-Z]{15}([0-9a-zA-Z]{3})?$/; | |
private ID_EXPAND_ARRAY = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5']; | |
constructor(private id: string) {} | |
public IsValid(): boolean { | |
if (!this.id) { | |
console.warn('[SalesForceIdValidator] id is empty'); | |
return false; |
This file contains 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
# Allows to quickly enable access using rsa public key | |
# Example usage: | |
# ./enable_ssh example.com | |
cat ~/.ssh/id_rsa.pub | ssh $1 "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys" |
This file contains 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
cd /usr/share/elasticsearch | |
sudo bin/plugin install elasticsearch/license/latest | |
sudo bin/plugin install elasticsearch/watcher/latest | |
sudo service elasticsearch restart | |
This file contains 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
cinst console2 | |
Install-ChocolateyPinnedTaskBarItem "$env:programfiles\console\console.exe" | |
cinst notepad2 | |
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions | |
cinst TelnetClient -source windowsFeatures | |
cinst 7zip.commandline | |
cinst far | |
cinst displayfusion |
This file contains 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
sudo apt-get install -y npm | |
npm install elasticdump | |
sudo ln -s /usr/bin/nodejs /usr/bin/node | |
cd node_modules/elasticdump/bin/ | |
./elasticdump --input=http://localhost:9200/.kibana --output=$ --type=data --searchBody='{"filter": { "or": [ {"type": {"value": "dashboard"}}, {"type" : {"value":"visualization"}}, {"type" : {"value":"search"}}] }}' > kibana-exported.json | |
./elasticdump --input=kibana-config.json --output=http://localhost:9200/.kibana --type=data |
This file contains 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
curl -XPUT http://localhost:9200/logstash?pretty -d '{ | |
"template": "logstash*", | |
"settings": { | |
"index.refresh_interval": "5s" | |
}, | |
"mappings": { | |
"_default_": { | |
"_all": { | |
"enabled": true, | |
"omit_norms": true |
This file contains 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
cd /opt | |
sudo wget https://download.elastic.co/kibana/kibana/kibana-4.3.1-linux-x64.tar.gz | |
sudo tar -zxvf kibana-4.3.1-linux-x64.tar.gz | |
sudo mv kibana-4.3.1-linux-x64 kibana | |
sudo rm kibana-4.3.1-linux-x64.tar.gz | |
cd /etc/init.d | |
sudo wget https://raw.githubusercontent.com/akabdog/scripts/master/kibana4_init | |
sudo update-rc.d kibana4_init defaults 95 10 |
This file contains 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
### Install Oracle Java 8, this means you agree to their binary license!! | |
cd ~ | |
sudo add-apt-repository -y ppa:webupd8team/java | |
sudo apt-get update | |
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections | |
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections | |
sudo aptitude -y install oracle-java8-installer | |
### Download and Install ElasticSearch |
This file contains 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 Program | |
{ | |
private static readonly AutoResetEvent AutoResetEvent = new AutoResetEvent(false); | |
static void Main(string[] args) | |
{ | |
Console.CancelKeyPress += OnCancelKeyPress; | |
//TODO: do work here | |
AutoResetEvent.WaitOne(); |