s
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
Setup mongadb instance | |
----------------------- | |
localhost$ mongo admin --username root --password hSFRP0Vf856R | |
cat ./bitnami_credentials | |
-> add 27017 port to SG | |
-> add monga user | |
db = db.getSiblingDB('reaction') | |
db.createUser( { user: "reactionUser", pwd: "reactionPwd", roles: [ "readWrite", "dbAdmin" ]} ) |
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
* * * * * python /root/main.py |
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
x=1; for i in *jpg; do counter=$(printf %04d $x); ln -s "~/timelapse/$i" /tmp/timelaps/img"$counter".jpg; x=$(($x+1)); done | |
/tmp/timelaps$ ffmpeg -f image2 -i img%04d.jpg a2.mpg |
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
SSH_ENV="$HOME/.ssh/environment" | |
function start_agent { | |
echo "Initialising new SSH agent..." | |
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" | |
echo succeeded | |
chmod 600 "${SSH_ENV}" | |
. "${SSH_ENV}" > /dev/null | |
/usr/bin/ssh-add; | |
} |
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 |
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
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
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
#!/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 | |
# |