Skip to content

Instantly share code, notes, and snippets.

View it-praktyk's full-sized avatar

Wojciech Sciesinski it-praktyk

View GitHub Profile
@ryanburnette
ryanburnette / Caddyfile
Last active October 17, 2025 21:09
Caddy v2.1+ CORS whitelist
(cors) {
@cors_preflight{args.0} method OPTIONS
@cors{args.0} header Origin {args.0}
handle @cors_preflight{args.0} {
header {
Access-Control-Allow-Origin "{args.0}"
Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS"
Access-Control-Allow-Headers *
Access-Control-Max-Age "3600"
@wiz4host
wiz4host / setup-users.groovy
Created November 6, 2018 17:25 — forked from johnbuhay/setup-users.groovy
jenkins init.groovy.d script for configuring users
import jenkins.*
import hudson.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.common.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.jenkins.plugins.sshcredentials.impl.*
import hudson.plugins.sshslaves.*;
import hudson.model.*
import jenkins.model.*
import hudson.security.*
@DownGoat
DownGoat / pyvbox-import-error.md
Last active December 8, 2019 02:06
pyvbox - virtualbox api. ImportError: No module named xpcom.vboxxpcom

Missing module xpcom fix,

Traceback (most recent call last):
  File "vmc.py", line 24, in <module>
    vbox = virtualbox.VirtualBox()
  File "/usr/local/lib/python2.7/dist-packages/pyvbox-1.3.2-py2.7.egg/virtualbox/library_ext/vbox.py", line 22, in __init__
    manager = virtualbox.Manager()
  File "/usr/local/lib/python2.7/dist-packages/pyvbox-1.3.2-py2.7.egg/virtualbox/__init__.py", line 143, in __init__
    self.manager = vboxapi.VirtualBoxManager(mtype, mparams)
 File "/usr/local/lib/python2.7/dist-packages/vboxapi/__init__.py", line 989, in __init__
@jpswade
jpswade / devops_best_practices.md
Last active October 15, 2025 05:39
Devops Best Practices Checklist

Find the original here article here: Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, at the Agile Conference in Toronto, Andrew Shafer posted an offer to moderate an ad hoc "Birds of a Feather" meeting to discuss the topic of "Agile Infrastructure". Only one person showed up to discuss the topic: Patrick Debois. Their discussions and sharing of ideas with others advanced the concept of "agile systems administration". Debois and Shafer formed an Agile Systems Administrator group on Google, with limited success. Patrick Debois did a presentation called "Infrastructure and Operations" addressing

@bielawb
bielawb / ComputerName.Completer.ps1
Created September 28, 2016 18:31
Using TabExpansionPlusPlus to tab-complete CName -> HostName
Register-ArgumentCompleter -ParameterName ComputerName -ScriptBlock {
param(
$commandName,
$parameterName,
$wordToComplete,
$commandAst,
$fakeBoundParameter
)
$record = [System.Net.Dns]::Resolve($wordToComplete)
if ($record) {
#region Fix important *nix commands.
# PowerShell comes with some predefined aliases built-in that are designed to
# ease the transition from *nix to PowerShell. While this is well-intentioned,
# it hides the true power that is available in these *nix commands, and it
# makes it much more difficult to compare and contrast between native commands
# in PowerShell and their *nix counterparts. This block of code removes the
# predefined aliases that would otherwise hide these important *nix commands.
foreach ($nixCommand in @('cat','cp','curl','diff','echo','kill','ls','man','mount','mv','ps','pwd','rm','sleep','tee','type','wget')) {
@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@un33k
un33k / sed cheatsheet
Created August 22, 2011 13:28
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'