Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Veni, vidi, vici

Nicolo Giacomello nigimaster

💭
Veni, vidi, vici
  • NiGi
  • Utrecht, The Netherlands
View GitHub Profile
@nigimaster
nigimaster / iptabler.sh
Created Aug 10, 2020 — forked from Ttech/iptabler.sh
IPTABLE script
View iptabler.sh
#!/bin/bash
####################################
#### ####
#### 2012 Ttech ####
#### Bash Router Enabler ####
#### ####
####################################
# this should be the only part you need to modify
@nigimaster
nigimaster / iptables-config-script
Created Aug 10, 2020 — forked from LouWii/iptables-config-script
Bash script to configure iptables for a web server. Some rules can be removed depending on used services.
View iptables-config-script
#!/bin/sh
# Empty all rules
sudo iptables -t filter -F
sudo iptables -t filter -X
# Bloc everything by default
sudo iptables -t filter -P INPUT DROP
sudo iptables -t filter -P FORWARD DROP
sudo iptables -t filter -P OUTPUT DROP
@nigimaster
nigimaster / k8s-offline.md
Created May 5, 2020 — forked from antonputra/k8s-offline.md
Offline Kubernetes installation with kubeadm and CentOS 7 v1.10.5
View k8s-offline.md

On master and nodes

Set environment variables

export MASTER01=<user>@<server>:<path>/<to>/<remote>/<folder>

Install docker daemon | 17.03 version recommended with k8s v.1.10.5

@nigimaster
nigimaster / nginx.conf
Created Jan 30, 2020 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
View gitcheats.txt
# shortform git commands
alias g='git'
# push changes to an empty git repository for the first time
git push --set-upstream origin master
# Remove + and - from start of diff lines
git diff --color | sed "s/^\([^-+ ]*\)[-+ ]/\\1/" | less -r
# clear out git hooks
@nigimaster
nigimaster / collected-snippets
Last active Aug 17, 2020
Collected snippets
View collected-snippets
### Jenkins
# start Jenkins in Shutdown mode
# init.groovy
import jenkins.model.*;
Jenkins.instance.doQuietDown();
# How to Start, Stop or Restart your Jenkins Instance
http://<jenkins.server>/restart
http://<jenkins.server>/safeRestart
http://<jenkins.server>/exit
@nigimaster
nigimaster / multi_brach_dsl_with_custom_strategy_and_script_path.groovy Jenkins Job DSL for a Multi-Branch Pipeline that includes Branch Source Strategy & custom Jenkinsfile script path
View multi_brach_dsl_with_custom_strategy_and_script_path.groovy
// A new UUID must be generated for the first run and re-used for your Job DSL, the plugin updates jobs based on ID
UUID uuid = UUID.fromString("dd847135-8391-4f66-a54c-7f8781dc3119") // generate one @ https://www.uuidgenerator.net
multibranchPipelineJob("my_awesome_job") {
displayName "my awesome job"
description "multi-branch pipeline job thingy"
configure {
it / sources / 'data' / 'jenkins.branch.BranchSource' << {
source(class: 'jenkins.plugins.git.GitSCMSource') {
id(uuid)
@nigimaster
nigimaster / baseURL.groovy
Created Jun 21, 2019 — forked from fishi0x01/baseURL.groovy
This is a collection of groovy scripts I gathered and use for bootstrapping Jenkins. Most of this can also be achieved with the CasC Plugin https://github.com/jenkinsci/configuration-as-code-plugin
View baseURL.groovy
#!groovy
/*
* This script configures the Jenkins base URL.
*/
import jenkins.model.JenkinsLocationConfiguration
JenkinsLocationConfiguration location = Jenkins.instance.getExtensionList('jenkins.model.JenkinsLocationConfiguration')[0]
location.url = 'https://jenkins-as-code-poc.devtail.io/'