Skip to content

Instantly share code, notes, and snippets.

View bashofmann's full-sized avatar

Bastian Hofmann bashofmann

View GitHub Profile

In Rancher, install the elemental UI extension and the elemental operator into the local cluster. See https://elemental.docs.rancher.com/next/rancher-vmware/#part-1-rancher-configuration

Create a machine registration endpoint with the defaults and Download the registration endpoint file.

On an intel mac or some x86 vm (I used the AWS VM where Rancher is running on):

Download the iso generation script

wget -q https://raw.githubusercontent.com/rancher/elemental/main/.github/elemental-iso-add-registration && chmod +x elemental-iso-add-registration
@bashofmann
bashofmann / migrate-app.sh
Created March 18, 2022 16:18
Script to migrate Rancher catalog apps to plain helm3
#!/bin/sh
#set -x
set -e
usage() {
echo ""
echo "usage:"
echo "$0 [options]"
echo " -c | --context: rancher cluster k8s context to use"
<?php
$root = realpath(__DIR__ . '/../..');
$files = glob($root . '/build/inspectionOutput/*.xml');
$out = new XMLWriter;
$out->openMemory();
$out->setIndent(true);
$allFiles = [];
foreach ($files as $file) {
<?php
namespace rg\core\cli\helper;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Symfony\Component\Console\Output\OutputInterface;
class CliSearchHelper {
private $inputStream;
@bashofmann
bashofmann / CustomVarDump.php
Created July 31, 2014 18:03
Custom vardump implementation
<?php
class Debug {
/** @var array */
private static $undumpableClasses = [
\PDO::class,
\Mongo::class,
\MongoClient::class,
\Doctrine\MongoDB\Connection::class,
<?php
class Bar {
public function __construct($someVar) {
}
}
class Foo {
vz.embed.getStaticContentUrl('key_resource_rich', function(staticUrl) {
var params = [];
params[opensocial.Message.Field.TYPE] = opensocial.Message.Type.PUBLIC_MESSAGE;
var message = opensocial.newMessage('message ' + staticUrl, params);
var recipient = "OWNER";
opensocial.requestSendMessage(recipient, message, function(response) {
});
}, {"q" : "vz netzwerke"});
{
var params = [];
params[opensocial.Message.Field.TYPE] = opensocial.Message.Type.PUBLIC_MESSAGE;
var message = opensocial.newMessage(' bla blub bla ');
var recipient = "OWNER";
opensocial.requestSendMessage(recipient, message, function(response) {
console.log(response.hadError());
if (! response.hadError()) {
console.log(response.get('recipients'));
}
});
<?php
//require the php OAuth library
require_once "../lib/oauth.php";
class MyOAuthSignatureMethod_RSA_SHA1 extends OAuthSignatureMethod_RSA_SHA1 {
protected function fetch_public_cert(&$request) {
$s = curl_init();
curl_setopt($s,CURLOPT_URL,$_GET['xoauth_signature_publickey']);
curl_setopt($s, CURLOPT_RETURNTRANSFER, 1);
$cert = curl_exec($s);