Skip to content

Instantly share code, notes, and snippets.

View namuan's full-sized avatar
🎯
Focusing

namuan namuan

🎯
Focusing
View GitHub Profile
@namuan
namuan / opsworks_blue_green_deploy_test_long_version
Created December 13, 2015 12:34 — forked from rhenning/opsworks_blue_green_deploy_test_long_version
AWS OpsWorks full-stack blue/green deploy test
$ aws opsworks describe-stacks
{
"Stacks": [
{
"ServiceRoleArn": "arn:aws:iam::047170177871:role/aws-opsworks-service-role",
"StackId": "575e1389-1df3-427d-99d3-d60f89a41442",
"DefaultRootDeviceType": "ebs",
"Name": "rhenning_test",
"ConfigurationManager": {
"Version": "11.4",
@GrabConfig(systemClassLoader = true)
@Grapes([
@Grab(group = 'commons-codec', module = 'commons-codec', version = '1.10'),
@Grab(group = 'org.jsoup', module = 'jsoup', version = '1.8.1'),
@Grab(group = 'commons-lang', module = 'commons-lang', version = '2.6'),
@Grab(group = 'joda-time', module = 'joda-time', version = '2.3')
])
import org.jsoup.*
#!/usr/bin/env groovy
/**
* ====================================================================
* Author Jim LoVerde
* Copyright 2009 NVISIA, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@namuan
namuan / gvm_installer.sh
Created November 25, 2014 12:25
GVM Install script
#!/bin/bash
#
# Copyright 2012 Marco Vermeulen
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@namuan
namuan / gvm_init.sh
Created November 25, 2014 12:04
GVM init script
cat /home/ubuntu/.gvm/bin/gvm-init.sh
#!/bin/bash
#
# Copyright 2012 Marco Vermeulen
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@namuan
namuan / redash-bootstrap.sh
Created November 25, 2014 11:05
Bootstrap file for redash
#!/bin/bash
set -eu
REDASH_BASE_PATH=/opt/redash
FILES_BASE_URL=https://raw.githubusercontent.com/EverythingMe/redash/docs_setup/setup/files/
# Verify running as root:
if [ "$(id -u)" != "0" ]; then
if [ $# -ne 0 ]; then
echo "Failed running with sudo. Exiting." 1>&2
@namuan
namuan / Carte-Jekyll-Dockerfile.sh
Created November 22, 2014 12:54
Carte Jekyll Dockerfile
FROM ubuntu:14.04
# From http://maximeheckel.com/blog/2014/07/05/build-jekyll-blog-docker/
MAINTAINER Nauman Leghari
RUN apt-get update
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
@namuan
namuan / git-dropbox.sh
Created November 20, 2014 22:42
Setup Git in Dropbox
#!/bin/bash
# This script is used to create a bare git repo of your project
# in your dropbox folder.
# Author: Sai
usage()
{
cat << EOF
usage: $0 options
@namuan
namuan / createUserFirstInstall.sh
Last active June 13, 2017 21:06
Create user with admin
# check directory permissions 755 (.ssh) 644 (.ssh/authorized_keys)
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo '** Script must be run as root **'
exit 1
fi
if ! /bin/egrep -i "^admin\:" /etc/group &>/dev/null; then
echo "Creating the admin group"
@namuan
namuan / springFindAllClassesByInterface.groovy
Created October 24, 2014 10:22
Lookup all classes implementing a particular interface
import org.springframework.beans.factory.config.BeanDefinition
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
import org.springframework.core.type.filter.AssignableTypeFilter
import com.imon.basepackage.StatusCode.*
final ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false)
provider.addIncludeFilter(new AssignableTypeFilter(StatusCode.class))
final Set<BeanDefinition> components = provider.findCandidateComponents("com.imon.basepackage")