Skip to content

Instantly share code, notes, and snippets.

@marhan
marhan / release.sh
Created June 1, 2020 19:07 — forked from devster/release.sh
Relase git tag script
#!/bin/bash
# Script to simplify the release flow.
# 1) Fetch the current release version
# 2) Increase the version (major, minor, patch)
# 3) Add a new git tag
# 4) Push the tag
# Parse command line options.
while getopts ":Mmpd" Option
@marhan
marhan / gist:f6783cd361d118a576eadc5350a4d4c9
Created March 19, 2018 14:33 — forked from pburkholder/gist:a9cdde0b33be8d5e3c08
Shared examples in rspec/serverspec.....

Create the following folder structure in your cookbook:

test
└── integrationq
    ├── helpers
    │   ├── serverspec
    │   │   ├── shared_serverspec_tests
    │   │   │   └── shared_tests2.rb
    │   │   └── spec_helper.rb
@marhan
marhan / docker-macos-terraform.md
Created February 22, 2018 20:07 — forked from brianshumate/docker-macos-terraform.md
The Simplest Terraform with Docker on macOS

If you'd like to experiment with Terraform on macOS locally, a great provider for doing so is the Docker provider. You can get set up in a few simple steps, like so:

1. Install Docker

Install Docker for Mac if you have not already.

@marhan
marhan / server_hardening.md
Created December 2, 2017 21:04 — forked from vivianspencer/server_hardening.md
Debian 8 Hardening

Debian 8 Hardening

  1. Update root's mail recipient. Open /etc/aliases replacing [email protected] with an administrator's email address. This is where logs will be emailed.

    root:     [email protected]
    
  2. Update the the default umask to 027. Edit the file /etc/init.d/rc and change the following setting:

umask 027

@marhan
marhan / ConnectTimeoutTest.java
Created August 9, 2017 10:15 — forked from anthavio/ConnectTimeoutTest.java
How to simulate connect timeout error and test it
import java.net.HttpURLConnection;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketTimeoutException;
import java.net.URL;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@marhan
marhan / EmbeddedMessageQueueResource.java
Created August 6, 2017 22:45 — forked from mlaccetti/EmbeddedMessageQueueResource.java
Apache QPid as embedded MQ broker
package laccetti.test;
import org.apache.qpid.server.Broker;
import org.apache.qpid.server.BrokerOptions;
import com.google.common.io.Files;
/**
* We shouldn't need external things for testing
*/
<!DOCTYPE html>
<html>
<head>
<title>AWS SDK for JavaScript - Sample Application</title>
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.65.0.min.js"></script>
<!-- <script src="https://sdk.amazonaws.com/js/aws-sdk-2.7.20.min.js"></script> -->
</head>
<body>
<div id="results"></div>
@marhan
marhan / Dockerfile
Created February 3, 2017 16:01 — forked from nknapp/Dockerfile
Traefik setup as reverse-proxy with docker and letsencrypt
FROM traefik:camembert
ADD traefik.toml .
EXPOSE 80
EXPOSE 8080
EXPOSE 443
import org.apache.log4j.*
import grails.util.Holders
myconfig {
myvariable {
workdir = 0
}
}
log4j = {
@marhan
marhan / gist:1326995
Created October 31, 2011 06:11 — forked from thilko/gist:1326295
code retreat links
how to organize a code retreat from alex boloaca
http://bit.ly/9nzhql
... and another page
http://bit.ly/bRTX5D
introduction about code retreats from the inventor
http://coderetreat.com
the role of the facilitator