Skip to content

Instantly share code, notes, and snippets.

View czhujer's full-sized avatar

Patrik Majer czhujer

View GitHub Profile
@czhujer
czhujer / .gitlab-ci.yml
Last active June 27, 2024 15:43
terraform in CI/CD
variables:
CI_IMAGE_NAME: "azure/terraform/tf-common/docker-alpine-terraform"
CI_IMAGE_TAG: "v1.77.0"
CI_IMAGE_DIGEST: "sha256:945269f7ee71274c2e228ae2134a43ad720b5c4c1577b6640fa9e7d7ca4207f7"
CI_IMAGE: "${CI_IMAGE_NAME}:${CI_IMAGE_TAG}@${CI_IMAGE_DIGEST}"
# because of smt like https://gitlab.com/gitlab-org/gitlab-runner/-/issues/27668
FF_USE_NEW_BASH_EVAL_STRATEGY: 1
# for terraform and future CI stuff
# CI_GITLAB_TOKEN:
# value: "XXX" # filled-up in ENV vars (if needs, put into ENV vars your gitlab PAT.. :) )
require 'spec_helper'
describe "CentOS basic checks" do
describe service('sshd') do
it { should be_enabled }
it { should be_running }
end
describe port(7866) do
it { should be_listening }
@czhujer
czhujer / docker-compose-k6-demo-elasticsearch-with-monitoring.yml
Created November 3, 2023 20:16
docker-compose for k6-demo-elasticsearch :: with monitoring
# https://www.elastic.co/blog/getting-started-with-the-elastic-stack-and-docker-compose
# https://github.com/grafana/k6/blob/master/docker-compose.yml
# https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html
# https://github.com/elastic/dockerfiles/tree/8.10/elasticsearch
---
version: "3.8"
volumes:
certs:
driver: local
---
version: "3.8"
volumes:
# certs:
# driver: local
esdata01:
driver: local
networks:
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
labels:
name: default-deny-instance-metadata
spec:
egress:
- to:
- ipBlock:
@czhujer
czhujer / container-build-runner.sh
Created September 18, 2022 21:19
container build with gitlab ci
#!/bin/bash
set -euo pipefail
set +x
PWD=$(pwd)
#env | grep -E "CI_COMMIT_SHA|CI_COMMIT_REF_NAME"
#echo "pwd: ${PWD}"
echo "run container build in container.."
@czhujer
czhujer / vagrant-cheat-sheet.md
Created October 1, 2019 07:33 — forked from wpscholar/vagrant-cheat-sheet.md
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)

tmux shortcuts & cheatsheet

action command(s)
start new tmux
start new with session name tmux new -s myname
attach tmux a # (or at, or attach)
attach to named tmux a -t myname
list sessions tmux ls
kill session tmux kill-session -t myname
@czhujer
czhujer / update-coreos-cloud-config.sh
Last active September 18, 2015 07:09 — forked from maxclaus/update-coreos-cloud-config.sh
Update coreos cloud config
#!/bin/bash
SERVER_IP=<MY_SERVER_IP>
# copy cloud-config.yml to the server
scp cloud-config.yml core@$SERVER_IP:~/
# validate cloud-config file
ssh core@$SERVER_IP "coreos-cloudinit -validate --from-file ~/cloud-config.yml"
if [[ $? == "0" ]]; then
@czhujer
czhujer / javascript_resources.md
Last active August 29, 2015 14:24 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage