Skip to content

Instantly share code, notes, and snippets.

Robin Smidsrød robinsmidsrod

Block or report user

Report or block robinsmidsrod

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@robinsmidsrod
robinsmidsrod / vbox_named_config.diff
Last active Sep 27, 2017
Updated VirtualBox named configuration that works with iPXE commit 74d90b33 (almost everything is disabled now)
View vbox_named_config.diff
diff --git a/src/config/vbox/general.h b/src/config/vbox/general.h
index 06b45f1a..aceae74f 100644
--- a/src/config/vbox/general.h
+++ b/src/config/vbox/general.h
@@ -1,12 +1,17 @@
/* Disabled from config/defaults/pcbios.h */
+#undef IMAGE_ELF
+#undef IMAGE_MULTIBOOT
+#undef IMAGE_BZIMAGE
@robinsmidsrod
robinsmidsrod / console.h
Created Jun 5, 2017
iPXE console.h customization for useful logging to syslog
View console.h
/* Everything but LOG output to BIOS console */
#undef CONSOLE_PCBIOS
#define CONSOLE_PCBIOS ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_LOG )
#define CONSOLE_VESAFB
/* Everything but TUI output to syslog console */
#undef CONSOLE_SYSLOG
#define CONSOLE_SYSLOG ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_TUI )
#undef LOG_LEVEL
View order_by.diff
1c1
< (CASE pc.parent_sort_key
---
> (CASE COALESCE(pc.parent_sort_key)
6c6
< (CASE pc.parent_sort_key
---
> (CASE COALESCE(pc.parent_sort_key)
11c11
< (CASE pc.parent_sort_key
View _compute_container_sort_key.sql
CREATE OR REPLACE FUNCTION public._compute_container_sort_key (
in_container_id uuid
)
RETURNS text AS
$body$
WITH container_default_sort_key AS (
SELECT * FROM (VALUES
('folder', 'index_asc'),
('album', 'index_asc'),
('blog', 'updated_desc')
View list_container_by_parent.sql
SELECT
c.container_id AS id
FROM container c
JOIN container_tree ct ON ct.child_container_id = c.container_id
WHERE ct.parent_container_id = 'dec521e1-432e-4304-8ba8-6cf59590d99b'
ORDER BY
CASE COALESCE( 'index_asc', _compute_container_sort_key('dec521e1-432e-4304-8ba8-6cf59590d99b') )
WHEN 'index_asc' THEN c.sort_number ASC NULLS LAST, collkey(c.title, 'nb_NO') ASC
WHEN 'index_desc' THEN c.sort_number DESC NULLS FIRST, collkey(c.title, 'nb_NO') DESC
WHEN 'size_asc' THEN c.sort_number ASC NULLS LAST, collkey(c.title, 'nb_NO') ASC -- same as index_asc
View _compute_container_sort_key.sql
WITH container_default_sort_key AS (
SELECT * FROM (VALUES
('folder', 'index_asc'),
('album', 'index_asc'),
('blog', 'updated_desc')
) AS kv (container_type, default_sort_key)
)
SELECT COALESCE(NULLIF(NULLIF(c.sort_key, ''), 'default'), cdsk.default_sort_key) AS container_sort_key
FROM container c JOIN container_default_sort_key cdsk USING(container_type)
WHERE c.container_id = '6b6c8837-f3e5-4e63-a42b-5c07fd4b56ad';
View disable_vmbus_time_sync.sls
disable_vmbus_time_sync_on_startup:
file.line:
- name: /etc/rc.local
- match: "/usr/local/sbin/vmbus_time_sync disable"
- content: "/usr/local/sbin/vmbus_time_sync disable"
- mode: ensure
- before: "exit 0\n"
View user_has_permission_on.sql
SELECT (
-- Check access for objects
'container' = 'object' AND ( -- in_type
SELECT EXISTS (
-- Owner has all rights
SELECT 1
FROM object o
WHERE o.object_id = '82195a7e-86a2-4235-bcd6-126492273e64' -- in_element_id
AND o.owner_id = '86d09109-64cc-4aa6-9336-b49b8ae71f2c' -- in_account_id
) OR EXISTS (
View play_next_audio.js
<html>
<body id="#wrapper_object_content">
<h1>test</h1>
<div><a class="audio_mpeg" href="link1">link1</a></div>
<a class="audio_mpeg" href="link2">link2</a>
<p><a class="audio_mpeg" href="link3">link3</a></p>
</body>
</html>
$(document).ready( function() {
View gist:0f0983b1f34a4e20e5ca6db50a38056e
open my $minified_js, '-|', "minify_js.sh", $js_file or die("minify_js.sh failed: $!")
You can’t perform that action at this time.