Skip to content

Instantly share code, notes, and snippets.

@pavankjadda
pavankjadda / How to create Spring Boot app as Ubuntu service.md
Created September 27, 2019 04:16
How to create Spring Boot app as Ubuntu service?

How to create Spring Boot app as Ubuntu service?

  1. Create service named employee using vi command
    sudo vim /etc/systemd/system/employee.service
    
  2. Copy paste the following content into the file and make sure to change the ExecStart command arguments
    [Unit]
    Description=Employee Spring Boot application service
    
    
@superseb
superseb / README.md
Last active April 24, 2024 05:03
Generate self signed certificates for Rancher 2.x

Generate self signed certificates for Rancher 2.x

Generate certificates

docker run -v $PWD/certs:/certs \
  -e SSL_SUBJECT=test.example.com \
  -e SSL_DNS=test.example.com,test2.example.com \
  -e SSL_IP=10.0.0.1 \
 superseb/omgwtfssl
@dideler
dideler / bot.rb
Last active April 17, 2024 08:40
Sending a notification message to Telegram using its HTTP API via cURL
# Use this script to test that your Telegram bot works.
#
# Install the dependency
#
# $ gem install telegram_bot
#
# Run the bot
#
# $ ruby bot.rb
#
@superseb
superseb / cleanup.sh
Last active June 19, 2023 10:03
Cleanup host added as custom to Rancher 2.0
#!/bin/sh
# OUTDATED: please refer to the link below for the latest version:
# https://github.com/rancherlabs/support-tools/blob/master/extended-rancher-2-cleanup/extended-cleanup-rancher2.sh
docker rm -f $(docker ps -qa)
docker volume rm $(docker volume ls -q)
cleanupdirs="/var/lib/etcd /etc/kubernetes /etc/cni /opt/cni /var/lib/cni /var/run/calico /opt/rke"
for dir in $cleanupdirs; do
echo "Removing $dir"
rm -rf $dir
done
@innovia
innovia / kubernetes_add_service_account_kubeconfig.sh
Last active January 29, 2024 23:00
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@stefansundin
stefansundin / openssh-7.3.sh
Last active September 13, 2022 21:03
Install OpenSSH 7.3 in Ubuntu 16.04
# WARNING: Use this at your own risk. It will probably break your other packages and cause other havoc.
# These days you should just upgrade to Ubuntu 18.04.
$ ssh -V
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g 1 Mar 2016
wget https://launchpadlibrarian.net/277739251/openssh-client_7.3p1-1_amd64.deb
wget https://launchpadlibrarian.net/298453050/libgssapi-krb5-2_1.14.3+dfsg-2ubuntu1_amd64.deb
wget https://launchpadlibrarian.net/298453058/libkrb5-3_1.14.3+dfsg-2ubuntu1_amd64.deb
wget https://launchpadlibrarian.net/298453060/libkrb5support0_1.14.3+dfsg-2ubuntu1_amd64.deb
@techgaun
techgaun / readme.md
Created February 5, 2017 04:44
OpenSSH 7.4 on Ubuntu 16.04

Installing OpenSSH 7.4 on Ubuntu 16.04

sudo apt install -y build-essential libssl-dev zlib1g-dev
wget "http://mirrors.evowise.com/pub/OpenBSD/OpenSSH/portable/openssh-7.4p1.tar.gz"
tar xfz openssh-7.4p1.tar.gz
cd openssh-7.4p1
./configure
make
sudo make install
#! /bin/bash
function valid_required_envs() {
# Configs
required_envs=(KUBE_CONTEXT KUBE_SERVER)
# Securities
required_envs+=(KUBE_CERTIFICATE_AUTHORITY)
required_envs+=(KUBE_CLIENT_CERTIFICATE KUBE_CLIENT_KEY)
errors=()
@Saanch
Saanch / StructureMapJobFactory.cs
Last active December 6, 2018 11:27
StructureMapJobFactory Quartz.net IoC using StructureMap
public class StructureMapJobFactory : IJobFactory
{
private static readonly ILog Logger = LogProvider.GetCurrentClassLogger();
private readonly IContainer _container;
public StructureMapJobFactory(IContainer container)
{
this._container = container;
}
@AD7six
AD7six / default
Created August 13, 2014 10:30
/etc/default/virtualbox - If you're bored shitless of virtualbox preventing your computer from shutting down cleanly; and concequently needing to check your disks on every boot - this is the file for you to edit
# Defaults for virtualbox initscript
# sourced by /etc/init.d/virtualbox
# installed at /etc/default/virtualbox by the maintainer scripts
#
# This is a POSIX shell fragment
#
# Set this to 1 if you would like the virtualbox modules to be loaded by
# the init script.