Skip to content

Instantly share code, notes, and snippets.

@ondrej-kvasnovsky
ondrej-kvasnovsky / vertica-commands
Last active July 31, 2018 10:30
Vertica commands
-- login to vsql
vsql -Ulogin -wpassword
-- number of running processes
ps -ef | grep -i vertica-udx-R | wc -l
-- list all nodes thet are UP
admintools -t list_allnodes | grep UP
-- restart a node
# get setting
echo "stats settings" | nc localhost 11211
# get current memory usage
echo "stats" | nc -w 1 localhost 11211 | awk '$2 == "bytes" { print $2" "$3 }'
# start in verbose mode
/usr/local/bin/memcached -vv
# start with higher memory
@ondrej-kvasnovsky
ondrej-kvasnovsky / commands.md
Last active April 25, 2020 19:43
Commands to install and configure ElasticSearch on Ubuntu

Install ElasticSearch and Java

1  wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
2  sudo dpkg -i elasticsearch-1.0.1.deb
3  sudo update-rc.d elasticsearch defaults 95 10
4  sudo add-apt-repository ppa:webupd8team/java
5  sudo apt-get update
6  sudo apt-get install oracle-java7-installer
7  java -version
@ondrej-kvasnovsky
ondrej-kvasnovsky / _Events.groovy
Last active August 10, 2016 06:48
How to run custom Grails test types/phases - functional tests
eventTestPhasesStart = { phasesToRun ->
functionalTests << "phantom"
}
@ondrej-kvasnovsky
ondrej-kvasnovsky / create-index.json
Last active December 26, 2015 19:49
JDBC river from MySql to ElasticSearch
PUT /_river/jdbc_river_1/_meta
{
"type" : "jdbc",
"jdbc" : {
"url": "jdbc:mysql://localhost:3306/yourDb",
"user": "login",
"password": "pass",
"sql" : "SELECT * FROM Transactions WHERE user_id = 1",
"index" : "my_jdbc_index",
"type" : "my_jdbc_type",
Proven hints to follow when your pull request got too many negative comments:
1. say you will do it later
2. choose other reviewers and add your manager for official approval
3. decline it and create a new pull request, but rather try other reviewers
@ondrej-kvasnovsky
ondrej-kvasnovsky / install-elasticsearch-centos.sh
Last active August 23, 2019 16:50
Commands for ElasticSearch installation on CentOS 6.4
# install missing libraries (if any)
cd ~
sudo yum update
yum install java-1.7.0-openjdk.x86_64
yum install unzip
yum install mc
yum install wget
yum install curl
# get and unpack elasticsearch zip file
@ondrej-kvasnovsky
ondrej-kvasnovsky / _Events.groovy
Last active December 21, 2015 02:59
Grails and Logback: Provide default logback configuration for development environment
import ch.qos.logback.classic.Level
import ch.qos.logback.classic.Logger
import ch.qos.logback.classic.LoggerContext
import ch.qos.logback.classic.encoder.PatternLayoutEncoder
import ch.qos.logback.classic.joran.JoranConfigurator
import ch.qos.logback.core.ConsoleAppender
import grails.util.Environment
import org.apache.commons.logging.Log
import org.apache.commons.logging.LogFactory
import org.slf4j.LoggerFactory;
@ondrej-kvasnovsky
ondrej-kvasnovsky / client.js
Last active August 3, 2021 17:34
How to send email from Meteor JS framework.
Template.welcomePage.events({
'click #send-email-button': function () {
var email = {
to: '[email protected]',
from: '[email protected]',
replyTo: '[email protected]',
subject: "test email",
text: "hello lover boy"
};
Meteor.call('sendEmail', this.userId, email);
@ondrej-kvasnovsky
ondrej-kvasnovsky / oauth.js
Last active October 18, 2021 22:39
How to login with GitHub account and add the GitHub credentials to existing user account
isProdEnv = function () {
if (process.env.ROOT_URL == "http://localhost:3000") {
return false;
} else {
return true;
}
}
Accounts.loginServiceConfiguration.remove({
service: 'google'