Skip to content

Instantly share code, notes, and snippets.

View mohsen0's full-sized avatar

Mohsen mohsen0

  • Qudini
  • London, UK
View GitHub Profile
@mohsen0
mohsen0 / ami-clean.sh
Created May 26, 2022 09:55 — forked from garlandkr/ami-clean.sh
Clean-up an Amazon EC2 instance before creating an AMI
#!/bin/bash
# Run this script with:
# bash <(curl -s https://gist.github.com/garlandkr/e80674b49270b0199fa6/raw/ami-clean.sh
function print_green {
echo -e "\e[32m${1}\e[0m"
}
print_green 'Clean Yum'
@mohsen0
mohsen0 / squid.conf
Created April 28, 2021 08:32 — forked from hpcorona/squid.conf
simple squid3 configuration to allow all to connect to all
#Recommended minimum configuration:
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl localnet src 0.0.0.0/8 192.168.100.0/24 192.168.101.0/24
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
@mohsen0
mohsen0 / hikari-pool.txt
Created April 1, 2021 14:07 — forked from nitishakalwadi/hikari-pool.txt
Spring Boot Hikari New Relic
1. Enable hikari mbean registry in application.properties
spring.datasource.hikari.register-mbeans=true
2. Add the new relic custom instrumentation yml file in the extensions directory where new relic agent is present
name: hikari-db
version: 1.0
enabled: true
jmx:
- object_name: com.zaxxer.hikari:type=Pool (SpringBootJPAHikariCP)
@mohsen0
mohsen0 / self-signed-certificate-with-custom-ca.md
Created February 4, 2021 09:18 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096

Installing SSHPASS

SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.

Installing on Ubuntu

apt-get install sshpass

Installing on OS X

@mohsen0
mohsen0 / mvncolor.sh
Created February 19, 2016 11:58 — forked from katta/mvncolor.sh
Script to add colors to maven output
#!/usr/bin/env bash
# Formatting constants
export BOLD=`tput bold`
export UNDERLINE_ON=`tput smul`
export UNDERLINE_OFF=`tput rmul`
export TEXT_BLACK=`tput setaf 0`
export TEXT_RED=`tput setaf 1`
export TEXT_GREEN=`tput setaf 2`
export TEXT_YELLOW=`tput setaf 3`