Skip to content

Instantly share code, notes, and snippets.

View fishi0x01's full-sized avatar
💾
0x01

Karl Fischer fishi0x01

💾
0x01
View GitHub Profile
@fishi0x01
fishi0x01 / defaults-main.yml
Last active March 21, 2020 15:17
Snippets for ansible role structuring. Code for blog post https://fishi.devtail.io/weblog/2016/06/02/ansible-role-structuring/
sshd_port: 5133
sshd_groups:
- name: devops
ssh:
allow_tcp_fwd: True
allow_agent_fwd: True
x11_fwd: True
- name: developers
ssh:
@fishi0x01
fishi0x01 / dcom-access-x64.ps1
Last active March 4, 2021 07:38
Script to configure DCOM remote access on Windows machines. Code for blog post https://fishi.devtail.io/weblog/2015/01/16/enabling-dcom-windows-7-8-and-server-2012/
# Original script taken and modified from http://shrekpoint.blogspot.de/2012/08/taking-ownership-of-dcom-registry.html
#
# Enable remote DCOM access to the WbemScripting.SWbemLocator class on 64-bit Windows 7/8 and Server 2012 machines,
# by setting the necessary keys inside the registry.
# Use this script at your own risk.
# I do not guarantee that it works, nor do I give any kinds of support in case it doesn't
Try {
[void][TokenAdjuster]
} Catch {
FROM tomcat:8.0.38
# Place the code version inside the webapps directory
ARG PACKAGE_VERSION
RUN echo "${PACKAGE_VERSION}" >> /usr/local/tomcat/webapps/version.txt
COPY project.war /usr/local/tomcat/webapps/project.war
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
@fishi0x01
fishi0x01 / terraform-0.7.11-experimental-feature-bug
Last active November 22, 2016 13:46
Terraform 0.7.11 Experimental Feature Error on aws_instance resource
While running, Terraform sometimes tests experimental features in the
background. These features cannot affect real state and never touch
real infrastructure. If the features work properly, you see nothing.
If the features fail, this message appears.
The following failures happened while running experimental features.
Please report a Terraform bug so that future Terraform versions that
enable these features can be improved!
You can report an issue at: https://github.com/hashicorp/terraform/issues
@fishi0x01
fishi0x01 / baseURL.groovy
Last active June 15, 2023 19:55
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
#!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/'
@fishi0x01
fishi0x01 / keybase.md
Last active March 9, 2020 21:01
keybase.md

Keybase proof

I hereby claim:

  • I am fishi0x01 on github.
  • I am fishi0x01 (https://keybase.io/fishi0x01) on keybase.
  • I have a public key ASBC98LoqVmGXqBk9o2PyofHRZ7Ee5d2Yi5C09wcQsxuzAo

To claim this, I am signing this object:

node('master') {
stage('Checkout') {
// Clean workspace and checkout shared library repository on the jenkins master
cleanWs()
checkout scm
}
stage('Configuration') {
// set CasC config in master
sh('cp /var/jenkins_home/workspace/Admin/Configure/resources/config/configuration-as-code-plugin/jenkins.yaml /var/jenkins_home/jenkins.yaml')
projects = [
[name: "serviceA", cron: "@daily"],
[name: "serviceB", cron: "@hourly"],
[name: "serviceC", cron: "@daily"],
]
for(project in projects) {
folder("${project.name}")
---
jenkins:
systemMessage: "Powered automagically by Groovy and Configuration-as-Code Plugin\n\n"
numExecutors: 5
crumbIssuer:
standard:
excludeClientIPFromCrumb: false
remotingSecurity:
#! /bin/bash
usage() {
echo "measureTraffic.sh <targetIP>"
}
if [ -z "$1" ]; then
usage
exit 1
fi