Skip to content

Instantly share code, notes, and snippets.

@radut
radut / README.md
Created January 16, 2018 21:04 — forked from dnozay/README.md
Collection of useful stuff for interacting with gitlab.

Reset root/admin password

Lost the root/admin password? You can reset it using the command-line. Recipe adapted from gitlab issue #308.

# start the console
sudo gitlab-rails console
@radut
radut / k8s-pi.md
Last active February 22, 2019 09:44 — forked from alexellis/k8s-pi.md
K8s on Raspbian

Kubernetes on (vanilla) Raspbian Lite

Yes - you can create a Kubernetes cluster with Raspberry Pis with the default operating system called Raspbian. This means you can carry on using all the tools and packages you're used to with the officially-supported OS.

This is part of a blog post Serverless Kubernetes home-lab with your Raspberry Pis written by Alex Ellis.

Copyright disclaimer: Please provide a link to the post and give attribution to the author if you plan to use this content in your own materials.

Pre-reqs:

@radut
radut / osx-for-hackers.sh
Created August 30, 2018 13:01 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@radut
radut / README.md
Last active March 7, 2019 15:45 — forked from elsonrodriguez/README.md
Ceph Ansible Quickstart Guide

Quick and Dirty Ceph Cluster

This is a bare-bones guide on how to setup a Ceph cluster using ceph-ansible

This guide assumes:

  • Ansible is installed on your local machine
  • Eight Centos 7.2 nodes are provisioned and formatted with XFS
  • You have ssh and sudo access to your nodes

Ansible Setup

There are 3 plugins for generating to create a JAR-File in maven:

  • maven-jar-plugin
  • maven-assembly-plugin
  • maven-shade-plugin

maven-jar-plugin:This plugin provides the capability to build and sign jars.But it just compiles the java files under src/main/java and /src/main/resources/.It doesn't include the dependencies JAR files.

<!--exclude all xml files from the jar-->
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
#!/usr/bin/perl
use Getopt::Long;
use Switch;
use Net::Statsd;
$Net::Statsd::HOST = 'stats.krn.krone.at'; # Default
$Net::Statsd::PORT = 8125; # Default
%options = (
'help' => 0,
'cache' => 0,
@radut
radut / README-oneshot-systemd-service.md
Created March 9, 2019 18:30 — forked from drmalex07/README-oneshot-systemd-service.md
An example with an oneshot service on systemd. #systemd #systemd.service #oneshot

README

Services declared as oneshot are expected to take some action and exit immediatelly (thus, they are not really services, no running processes remain). A common pattern for these type of service is to be defined by a setup and a teardown action.

Let's create a example foo service that when started creates a file, and when stopped it deletes it.

Define setup/teardown actions

Create executable file /opt/foo/setup-foo.sh:

@radut
radut / docker-cleanup-resources.md
Created March 9, 2019 20:43 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// 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

@radut
radut / jinja_variables_types.yml
Created March 10, 2019 16:48 — forked from spiette/jinja_variables_types.yml
Test the variables types in jinja2 templates, used here with ansible
---
- hosts: all
gather_facts: no
vars:
string: "string"
list:
- item1
- item2
dict:
key1: value1
@radut
radut / java-sd_notify.java
Created March 11, 2019 23:19 — forked from yrro/java-sd_notify.java
The poor Java programmer's alternative to calling sd_notify
package systemd;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Paths;
import java.util.function.Supplier;
@lombok.extern.slf4j.Slf4j