#OpenSSL cheat sheet This is a brief howto for socket programmers.
ex: 1024bits length key pair:
$> openssl genrsa -out myprivate.pem 1024
$> openssl rsa -in myprivate.pem -pubout -out mypublic.pem
// MarkupBuilder is a lot cleaner way of generating valid xml/html markup | |
// than writing tags as string and forgetting to close one ;) | |
def writer = new StringWriter() // html is written here by markup builder | |
def markup = new groovy.xml.MarkupBuilder(writer) // the builder | |
markup.html{ | |
table { | |
tr { | |
td(class:"row", "hello world!") |
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### | |
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget. | |
### You can download all the binaries one-shot by just giving the BASE_URL. | |
### Script might be useful if you need Oracle JDK on Amazon EC2 env. | |
### Script is updated for every JDK release. | |
### Features:- | |
# 1. Resumes a broken / interrupted [previous] download, if any. | |
# 2. Renames the file to a proper name with including platform info. |
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
Is a useful one-liner which will give you the full directory name of the script no matter where it is being called from
These will work as long as the last component of the path used to find the script is not a symlink (directory links are OK). If you want to also resolve any links to the script itself, you need a multi-line solution:
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
#To Decrypt Jenkins Password from credentials.xml | |
#<username>jenkins</username> | |
#<passphrase>your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J</passphrase> | |
#go to the jenkins url | |
http://jenkins-host/script | |
#In the console paste the script | |
hashed_pw='your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J' |
# Run Job Definition: nomad run sematext-agent-docker.nomad | |
# https://www.hashicorp.com/blog/nomad.html | |
# More Info: https://hub.docker.com/r/sematext/sematext-agent-docker/ | |
# http://blog.sematext.com/2015/12/15/docker-logging-partner-sematext-logsene/ | |
job "sematext-agent-docker" { | |
# set your region here | |
region = "global" | |
# Mandatory, parameter pls. change! | |
datacenters = ["us-west-1"] | |
# run this job globally |
#!/usr/bin/env ruby | |
require 'aws-sdk' | |
require 'pry' | |
require 'awesome_print' | |
require 'domainatrix' | |
# ------------------------------------------------------------------------------ | |
# Credentials | |
# ------------------------------------------------------------------------------ |
#!/bin/bash | |
# | |
# When you are working on your macbook sitting in cafe and you have to go pee, | |
# you need some way to guard you machine. | |
# | |
# Start this script, remove any earphones, and go do the job. | |
# The assumption is the thief will close the lid of the laptop before taking it away. | |
# This script detects the closing of the lid and plays some loud audio that will | |
# likely distract the thief and/or grab attention of nearby people, making the |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm