Skip to content

Instantly share code, notes, and snippets.

View adrianprecub's full-sized avatar

Adrian Precub adrianprecub

View GitHub Profile
@adrianprecub
adrianprecub / KeyUtils.java
Created March 22, 2018 11:41 — forked from d-smith/KeyUtils.java
Read and write passwords to a Java keystore file
package keystuff;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.security.KeyStore;
public class KeyUtils {
public static FileInputStream getFileInputStreamFromArg(String filePath) throws FileNotFoundException {
@adrianprecub
adrianprecub / README.md
Created January 17, 2018 14:54 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


@adrianprecub
adrianprecub / knife cheat
Last active April 19, 2017 11:05 — forked from ipedrazas/knife cheat
Hello!
# knife cheat
## Search Examples
knife search "name:ip*"
knife search "ipaddress:ip"
knife search "platform:ubuntu*"
knife search "platform:*" -a macaddress
knife search "platform:ubuntu*" -a uptime
knife search "platform:ubuntu*" -a virtualization.system
docker images | tail -n+2 | awk '{print $3}' | xargs -L1 docker rmi
@adrianprecub
adrianprecub / gist:5e3b6c13d65b7ca5d443568eb3e18dc3
Created April 19, 2017 10:01 — forked from madis/gist:4650014
Testing CORS OPTIONS request with curl
curl \
--verbose \
--request OPTIONS \
http://localhost:3001/api/configuration/visitor \
--header 'Origin: http://localhost:9292' \
--header 'Access-Control-Request-Headers: Origin, Accept, Content-Type' \
--header 'Access-Control-Request-Method: GET'
# http://nils-blum-oeste.net/cors-api-with-oauth2-authentication-using-rails-and-angularjs/#.UQJeLkp4ZyE
@adrianprecub
adrianprecub / elasticsearch.md
Created October 19, 2016 13:33 — forked from nicolashery/elasticsearch.md
Elasticsearch: updating the mappings and settings of an existing index

Elasticsearch: updating the mappings and settings of an existing index

Note: This was written using elasticsearch 0.9.

Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:

$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
  "_id": 1,
@adrianprecub
adrianprecub / CoDelConsumer.java
Created June 6, 2016 08:25 — forked from msackman/CoDelConsumer.java
Using the CoDel Queueing Consumer
package com.rabbitmq.examples;
import java.io.IOException;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.ConsumerCancelledException;
import com.rabbitmq.client.QueueingConsumerCoDel.Delivery;
import com.rabbitmq.client.QueueingConsumerCoDel;
@adrianprecub
adrianprecub / QueueingConsumerCoDel.java
Created June 6, 2016 08:14 — forked from msackman/QueueingConsumerCoDel.java
QueueingConsumer extended with the CoDel algorithm
// The contents of this file are subject to the Mozilla Public License
// Version 1.1 (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.mozilla.org/MPL/
//
// Software distributed under the License is distributed on an "AS IS"
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
// the License for the specific language governing rights and
// limitations under the License.
//
@adrianprecub
adrianprecub / auth.go
Created January 5, 2016 13:15 — forked from tristanwietsma/auth.go
Golang web server example
package main
import (
"encoding/base64"
"net/http"
"strings"
)
type handler func(w http.ResponseWriter, r *http.Request)