Skip to content

Instantly share code, notes, and snippets.

View HCatInputFormat.java
public class HCatInputFormat extends InputFormat<SerializableWritable<Writable>, HCatRecord> {
private final org.apache.hcatalog.mapreduce.HCatInputFormat input;
public HCatInputFormat() {
input = new org.apache.hcatalog.mapreduce.HCatInputFormat();
}
@Override
public RecordReader<SerializableWritable<Writable>, HCatRecord> createRecordReader(
View README.md
View Ambari default admin password
1. Stop Ambari server
2. Log on to ambari server host shell
3. Run 'psql -U ambari-server ambari'
4. Enter password **** (this password is stored in
/etc/ambari-server/conf/password.dat)
5. In psql:
update ambari.users set
user_password='538916f8943ec225d97a9a86a2c6ec0818c1cd400e09e03b660fdaaec4af29ddbb6f2b1033b81b00'
where user_name='admin'
6. Quit psql
View airflow_config.go
// Generate airflow config to stdout.
// To start service the from scratch, put this in src/airflow_config/airflow_config.go and run:
// export GOPATH=$(pwd)
// export PATH=$PATH:$GOPATH/bin
// go get k8s.io/client-go/1.4/kubernetes
// go install airflow_config && airflow_config > airflow.yaml
// kubectl create -f airflow.yaml
package main
import (
@dvasilen
dvasilen / config.go
Created Nov 20, 2016 — forked from kozikow/config.go
Prototype generating config from go code
View config.go
package main
import (
"os"
"k8s.io/client-go/1.4/pkg/api"
"k8s.io/client-go/1.4/pkg/runtime/serializer/json"
"k8s.io/client-go/1.4/pkg/util/intstr"
)
@dvasilen
dvasilen / config_gen.go
Created Nov 20, 2016 — forked from kozikow/config_gen.go
Config generation
View config_gen.go
package main
import (
"fmt"
"os"
"k8s.io/client-go/1.4/pkg/api/unversioned"
"k8s.io/client-go/1.4/pkg/api/v1"
"k8s.io/client-go/1.4/pkg/apis/extensions/v1beta1"
"k8s.io/client-go/1.4/pkg/runtime"
@dvasilen
dvasilen / golang-tls.md
Created Nov 22, 2016 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
View golang-tls.md
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
    
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
openssl ecparam -genkey -name secp384r1 -out server.key
@dvasilen
dvasilen / aescmd.go
Created Feb 9, 2017 — forked from josephspurrier/aescmd.go
Golang - Encrypt, Decrypt, File Read, File Write, Readline
View aescmd.go
package main
import (
"bufio"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"fmt"
"io"
"io/ioutil"
@dvasilen
dvasilen / tls-client.go
Created Feb 15, 2017 — forked from michaljemala/tls-client.go
SSL Client Authentication Golang sample
View tls-client.go
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)