Skip to content

Instantly share code, notes, and snippets.

View vholer's full-sized avatar

Vlastimil Holer vholer

View GitHub Profile
@vholer
vholer / iso2ext
Created March 15, 2020 15:22
ISO 9660 to ext2 conversion without root privileges
#!/bin/bash
# Simple conversion script of ISO 9660 image into image based
# on ext2/3/4 filesytem. Completely unprivileged, without needing
# to mount both images. Free to use under Apache 2.0 License.
# 2020, Vlastimil Holer <[email protected]>
set -e -o pipefail
TYPE=${TYPE:-ext2}
#!/bin/sh
# -------------------------------------------------------------------------- #
# Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
#!/usr/bin/env ruby
ONE_LOCATION=ENV["ONE_LOCATION"]
if !ONE_LOCATION
RUBY_LIB_LOCATION="/usr/lib/one/ruby"
VMDIR="/var/lib/one"
CONFIG_FILE="/var/lib/one/config"
else
RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby"
#!/bin/bash
set -xe
umask 0022
find . -type f -exec chmod a+r {} \;
find . -type d -exec chmod a+rx {} \;
# build1
M_ARCH=`puppet module build . | grep built | sed -e 's/^.*:\s*//'`
M_DIR=`echo ${M_ARCH} | sed -e 's/\.tar\.gz$//'`
#!/usr/bin/ruby
require 'optparse'
require 'rbvmomi'
# but have
OptionParser.new do |opts|
opts.on('-h', '--host=HOST', 'vCenter host') { |v| HOST=v }
opts.on('-u', '--user=NAME', 'vCenter login user') { |v| USER=v }
opts.on('-p', '--password=PASSWORD', 'vCenter password') { |v| PSWD=v }
if !ONE_LOCATION
LOG_LOCATION = "/var/log/one"
else
LOG_LOCATION = ONE_LOCATION + "/var"
end
LOG = LOG_LOCATION + "/onedb-fsck.log"
require 'nokogiri'
@vholer
vholer / glusterfs_rdma.te
Created June 30, 2015 14:35
Gluster RDMA SELinux module
module glusterfs_rdma 1.0.0;
require {
type glusterd_t;
type infiniband_device_t;
class capability ipc_lock;
class chr_file { read write open };
}

Keybase proof

I hereby claim:

  • I am vholer on github.
  • I am vholer (https://keybase.io/vholer) on keybase.
  • I have a public key whose fingerprint is AE18 D76F BCF1 2631 CE6E A40E EB54 9BAD EFD0 7C53

To claim this, I am signing this object:

@vholer
vholer / rhcs_update_node.sh
Created December 16, 2013 14:39
On RHCS cluster migrate all local services to another node, update operating system and reboot
#!/bin/bash
#
# On RHCS cluster migrate all local services to another
# node, update operating system and reboot
#
NODES=`cman_tool nodes -F type,name | awk '$1 == "M" { print $2 }'`
if [ `echo "${NODES}" | wc -w` -le 1 ]; then
echo "Not enough nodes ($NODES), at least 2 active needed"
exit 1
@vholer
vholer / test_torque_sched.aug
Created March 12, 2012 15:40
Augeas lens for Torque Scheduler
module Test_Torque_sched =
let conf="# First comment
round_robin: False all
by_queue: True prime
by_queue: True non_prime
strict_fifo: false ALL
fair_share: false ALL
help_starving_jobs true ALL
sort_queues true ALL