Skip to content

Instantly share code, notes, and snippets.

View traversal.go
package main
import (
"context"
"fmt"
liburl "net/url"
"github.com/vmware/govmomi"
"github.com/vmware/govmomi/property"
"github.com/vmware/govmomi/session"
View simple.js
var __process__ = process
var printFinal = function(string) {
process.stdout.write('' + string, function() {
__process__.exit(0)
});
}
printFinal("ok")
View uglify.js
(function(program, execJS) { execJS(program) })(function(global, process, module, exports, require, console, setTimeout, setInterval, clearTimeout, clearInterval, setImmediate, clearImmediate) { // https://developer.mozilla.org/en/JavaScript/Reference/global_objects/array/foreach
if (!Array.prototype.forEach)
{
Array.prototype.forEach = function(fun /*, thisp */)
{
"use strict";
if (this === void 0 || this === null)
throw new TypeError();
View gist:81ac24931b2ba46751cc61957df29747
require "execjs"
class ExecJS::ExternalRuntime
def exec_runtime(filename)
r, w = IO.pipe
pid = Kernel.spawn("#{binary} #{filename}", :out => w, :err=>[:child, :out])
puts "#{binary} PID: #{pid}"
w.close
Process.wait(pid)
View uglify.js
// https://developer.mozilla.org/en/JavaScript/Reference/global_objects/array/foreach
if (!Array.prototype.forEach)
{
Array.prototype.forEach = function(fun /*, thisp */)
{
"use strict";
if (this === void 0 || this === null)
throw new TypeError();
View wait_for_updates.rb
require "rbvmomi"
vim = RbVmomi::VIM.connect(
host: "127.0.0.1",
port: "8989",
insecure: true,
username: "root",
password: "vmware"
)
View gist:5f8a9615f2027f7c97e7c88d629cedb7
def load_system_schedules
+ _log.info("Loading system scheduled...")
schedules_for_all_roles
schedules_for_scheduler_role
schedules_for_database_operations_role
@@ -214,7 +215,9 @@ class MiqScheduleWorker::Runner < MiqWorker::Runner
:first_at => time_at
) { enqueue(:storage_scan_timer) }
+ _log.info("scheduling ems_refresh...")
View gist:1bda71f35dc013dd87db985c3a8cf036
schedule_settings_for_ems_refresh = ExtManagementSystem.supported_subclasses.each.with_object({}) do |klass, hash|
next unless klass.ems_type
every = ::Settings.ems_refresh[klass.ems_type].try(:refresh_interval) || ::Settings.ems_refresh.refresh_interval
every = every.respond_to?(:to_i_with_method) ? every.to_i_with_method : every.to_i
hash[klass] = every unless every == 0
end
View gist:212c3aafedf6deded5d7552574f4f21c
adam@desktop:~/src/manageiq/manageiq$ rails s
** override_gem("byebug", :require=>"byebug") at /home/grare/adam/.bundler.d/byebug.rb:1
** override_gem("manageiq-ui-classic", :path=>"/home/grare/adam/src/manageiq/manageiq-ui-classic") at /home/grare/adam/src/manageiq/manageiq/bundler.d/overrides.rb:12
=> Booting Puma
=> Rails 5.2.4.4 application starting in development
=> Run `rails server -h` for more startup options
** ManageIQ master, codename: Lasker
Puma starting in single mode...
* Version 4.3.7 (ruby 2.7.2-p137), codename: Mysterious Traveller
* Min threads: 5, max threads: 5
View gist:55fb2e513f8d3153955a19ec5ee618e0
# cat /etc/login.defs
#
# Please note that the parameters in this configuration file control the
# behavior of the tools from the shadow-utils component. None of these
# tools uses the PAM mechanism, and the utilities that use PAM (such as the
# passwd command) should therefore be configured elsewhere. Refer to
# /etc/pam.d/system-auth for more information.
#
# *REQUIRED*