Skip to content

Instantly share code, notes, and snippets.

@jimmidyson
jimmidyson / generate_password_hash.sh
Created Jun 12, 2014
Generate SHA512 password hash from password with random salt
View generate_password_hash.sh
SALT=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 18 | head -1` \
python -c "import crypt, getpass, pwd, os; print crypt.crypt('password', '\$6\$' + os.environ['SALT'] + '\$')"
@jimmidyson
jimmidyson / docker-ssh.sh
Created Jul 7, 2014
SSH into a Docker container
View docker-ssh.sh
#!/bin/bash
export DOCKER_HOST=tcp://$1:4243
PID=$(docker inspect --format {{.State.Pid}} $2)
if [ -n "$PID" ]; then
ssh -t docker-ssh@$1 sudo nsenter --target $PID --mount --uts --ipc --net --pid
fi
@jimmidyson
jimmidyson / 1_atomic-setup.md
Last active Aug 29, 2015
OpenShift v3 setup - WORK IN PROGRESS
View 1_atomic-setup.md

Skip if you're not using Atomic.

If using Fedora/Centos/RHEL Atomic, make sure you've either added a second disk big enough for your Docker images/containers. If you've added a second disk, then you should edit /etc/sysconfig/docker-storag-setup & add in the following:

DEVS=/dev/vdb

Then run sudo docker-storage-setup & your new disk will be used for docker storage.

View keybase.md

Keybase proof

I hereby claim:

  • I am jimmidyson on github.
  • I am jimmidyson (https://keybase.io/jimmidyson) on keybase.
  • I have a public key whose fingerprint is 5E87 7349 6DCB FB12 0E38 4322 2863 494B 281B E805

To claim this, I am signing this object:

View add-user-from-github.sh
#!/bin/bash
for user in "$@"
do
echo "Adding ${user}"
useradd -m ${user}
mkdir /home/${user}/.ssh
curl https://github.com/${user}.keys >> /home/${user}/.ssh/authorized_keys
chmod 700 /home/${user}/.ssh
chmod 600 /home/${user}/.ssh/authorized_keys
View gist:0a548993f4d1de3096d7
IMAGE CONTAINER CPU % MEM USAGE/LIMIT MEM % NET I/O
fabric8/fabric8-jbpm-designer:latest 0130551529b6 0.09% 1.399 GiB/15.37 GiB 9.10% 0 B/0 B
fabric8/fabric8-forge:2.0.40.1 42797a90723d 0.09% 782.3 MiB/15.37 GiB 4.97% 0 B/0 B
openshift/origin:v0.4.2 afb9f4367253 5.16% 405.1 MiB/15.37 GiB 2.57% 0 B/0 B
fabric8/app-library:2.0.40.1 72de55aa2e05 0.05% 372 MiB/15.37 GiB 2.36% 0 B/0 B
fabric8/elasticsearch-k8s:1.5.0 1349b4db9abc 0.66% 350.6 MiB/15.37 GiB 2.23% 0 B/0 B
fabric8/cdelivery:2.0.40.1 2db6eaa57160 0.08% 246.3 MiB/15.37 GiB 1.57% 0 B/0 B
fabric8/hubot-notifier:2.0.40.1 ceb437182ae1 0.06% 207.9 MiB/15.37 GiB 1.32%
@jimmidyson
jimmidyson / replication_controllers.json
Last active Aug 29, 2015
Clustering on Kubernetes & OpenShift3 using DNS - replication controllers
View replication_controllers.json
{
"apiVersion": "v1beta1",
"id": "elasticsearch-client-rc",
"kind": "ReplicationController",
"labels": {
"component": "elasticsearch",
"type": "client"
},
"desiredState": {
"podTemplate": {
@jimmidyson
jimmidyson / labels.json
Created Apr 17, 2015
Clustering on Kubernetes & OpenShift3 using DNS - labels.json
View labels.json
"labels" : {
"component" : "elasticsearch",
"type": "client"
}
@jimmidyson
jimmidyson / client-service.json
Created Apr 17, 2015
Clustering on Kubernetes & OpenShift3 using DNS -
View client-service.json
{
"id": "elasticsearch",
"apiVersion": "v1beta1",
"kind": "Service",
"containerPort": 9200,
"port": 9200,
"selector": {
"component": "elasticsearch",
"type": "client"
}
@jimmidyson
jimmidyson / cluster-service.json
Created Apr 17, 2015
Clustering on Kubernetes & OpenShift3 using DNS - cluster service
View cluster-service.json
{
"id": "elasticsearch-cluster",
"apiVersion": "v1beta1",
"PortalIP": "None",
"kind": "Service",
"containerPort": 9300,
"port": 9300,
"selector": {
"component": "elasticsearch"
}