Skip to content

Instantly share code, notes, and snippets.

View nvtkaszpir's full-sized avatar

Michał Sochoń nvtkaszpir

  • _KaszpiR_
View GitHub Profile
@nvtkaszpir
nvtkaszpir / packer-virtualbox-while-kvm
Created January 7, 2015 15:16
When running packer to build virtualbox image while KVM runs
2015/01/07 16:02:08 [INFO] Packer version: 0.7.5 9cd66feeacbd9cb318b72eb5ed59428c5b8c37ac+CHANGES
2015/01/07 16:02:08 Packer Target OS/Arch: linux amd64
2015/01/07 16:02:08 Built with Go Version: go1.3.3
2015/01/07 16:02:08 [DEBUG] Discoverd plugin: amazon-chroot = /home/kaszpir/packer/packer-builder-amazon-chroot
2015/01/07 16:02:08 [DEBUG] Discoverd plugin: amazon-ebs = /home/kaszpir/packer/packer-builder-amazon-ebs
2015/01/07 16:02:08 [DEBUG] Discoverd plugin: amazon-instance = /home/kaszpir/packer/packer-builder-amazon-instance
2015/01/07 16:02:08 [DEBUG] Discoverd plugin: digitalocean = /home/kaszpir/packer/packer-builder-digitalocean
2015/01/07 16:02:08 [DEBUG] Discoverd plugin: docker = /home/kaszpir/packer/packer-builder-docker
@nvtkaszpir
nvtkaszpir / data.json
Created April 6, 2016 05:54 — forked from rowanu/data.json
Visualising EC2 Security Groups
[
{
"name": "AppName-AppServer-ASG-SG",
"id": "sg-b8ce4cc0",
"ingress": [
{
"name": "AppName-AppServer-ELB-SG",
"protocol": "tcp",
"fromPort": 8080
}
@nvtkaszpir
nvtkaszpir / README.md
Created July 31, 2016 16:55 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


Index:

#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
# remove unused volumes:
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <(
#!/bin/bash
for dir in $( find -L /sys/block/ -maxdepth 1 -type d -name zram* ); do
if [ ! -d "$dir" ]; then
echo "status: disabled"
exit 0
fi
mem_used_total="$(cat $dir/mem_used_total)"
orig_data_size="$(cat $dir/orig_data_size)"
@nvtkaszpir
nvtkaszpir / Jenkinsfile.groovy
Created July 31, 2017 09:49
jenkinsfile create parameter in job
pipeline {
parameters {
choice(
name: 'super_choices',
choices: 'alpha\nbravo\ncharlie',
description: 'its time to choose, default is alpha'
)
stage("Prepare env") {
steps {
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#