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
curl -X PUT http://localhost:9200/twitter_33/ -d ' | |
{ | |
"mappings": { | |
"tweet": { | |
"_timestamp" : { | |
"enabled" : "yes", | |
"path" : "post_date" | |
}, | |
"properties": { | |
"message": { |
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
FROM centos:6 | |
MAINTAINER Oskars G. | |
RUN yum -y install openssh-server | |
RUN ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_dsa_key | |
RUN ssh-keygen -q -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key | |
RUN ssh-keygen -q -N "" -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key | |
RUN sed -i "s/#UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config | |
RUN sed -i 's/#UsePAM no/UsePAM no/g' /etc/ssh/sshd_config |
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 java.util.Date; | |
import java.util.Random; | |
public class PrimCalc { | |
private static int range = 100000; | |
private static int iterations = 100000; | |
public static void main(String[] args) { | |
PrimCalc primCalculator = new PrimCalc(); |
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
<127.0.0.1> ESTABLISH CONNECTION FOR USER: vagrant | |
<127.0.0.1> REMOTE_MODULE uri method=PUT url=http://localhost:9200/_snapshot/s3_backups_grafana | |
<127.0.0.1> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/Users/xxxxx/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o Port=2222 -o IdentityFile="/Users/xxxxx/.vagrant.d/insecure_private_key" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 127.0.0.1 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1433428044.88-119207179644196 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1433428044.88-119207179644196 && echo $HOME/.ansible/tmp/ansible-tmp-1433428044.88-119207179644196' | |
<127.0.0.1> PUT /var/folders/_1/pg5y8ygn4gdbcyxhw1x6lhxw0000gn/T/tmpgpjvIl TO /home/vagrant/.ansible/tmp/ansible-tmp-1433428044.88-119207179644196/uri | |
<127.0.0.1> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPe |
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
{ | |
"taskDefinitionArn": "arn:aws:ecs:eu-west-1:960921042111:task-definition/elasticsearch:21", | |
"revision": 21, | |
"containerDefinitions": [ | |
{ | |
"volumesFrom": [], | |
"portMappings": [ | |
{ | |
"hostPort": 9201, | |
"containerPort": 9200 |
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 | |
# | |
# Sample for getting temp session token from AWS STS | |
# | |
# aws --profile youriamuser sts get-session-token --duration 3600 \ | |
# --serial-number arn:aws:iam::012345678901:mfa/user --token-code 012345 | |
# | |
# Based on : https://github.com/EvidentSecurity/MFAonCLI/blob/master/aws-temp-token.sh | |
# |
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 client = new XMLHttpRequest(); | |
client.open('GET', '/builddate.txt'); | |
client.onreadystatechange = function() { | |
alert(client.responseText); | |
} | |
client.send(); |
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
docker run -it --cpu-shares=256 --memory=128M --oom-kill-disable jess/stress -c 1 -i 1 -m 1 --vm-bytes 512M -t 30s -v |
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 | |
docker_machine_name="dev" | |
password="qwerty123" | |
ip=$(docker-machine ip $docker_machine_name) | |
openssl pkcs12 -export -in ~/.docker/machine/machines/$docker_machine_name/server.pem -inkey ~/.docker/machine/machines/$docker_machine_name/server-key.pem -out ~/.docker/machine/machines/$docker_machine_name/cert.pfx -password pass:$password | |
curl --cacert ~/.docker/machine/machines/$docker_machine_name/server.pem --cert ~/.docker/machine/machines/$docker_machine_name/cert.pfx --pass $password https://$ip:2376/version | jq . |
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
# set admin user | |
# docker exec -it postgres sh -c "psql -h postgres -U puser" | |
# \c postgres | |
# update users set user_admin=TRUE; | |
version: '2' | |
services: | |
gogs: | |
image: gogs/gogs:0.9.0 | |
container_name: gogs |