Skip to content

Instantly share code, notes, and snippets.

View jacobbednarz's full-sized avatar
💭
I may be slow to respond.

Jacob Bednarz jacobbednarz

💭
I may be slow to respond.
View GitHub Profile
#!/usr/bin/sudo ruby
#
# revealer.rb -- Deobfuscate GHE .rb files.
#
# This is simple:
# Every obfuscated file in the GHE VM contains the following code:
#
# > require "ruby_concealer.so"
# > __ruby_concealer__ "..."
2024-03-20T08:18:57.264+1100 [INFO] Terraform version: 1.7.5
2024-03-20T08:18:57.264+1100 [DEBUG] using github.com/hashicorp/go-tfe v1.41.0
2024-03-20T08:18:57.264+1100 [DEBUG] using github.com/hashicorp/hcl/v2 v2.19.1
2024-03-20T08:18:57.264+1100 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1
2024-03-20T08:18:57.264+1100 [DEBUG] using github.com/zclconf/go-cty v1.14.1
2024-03-20T08:18:57.264+1100 [INFO] Go runtime version: go1.21.8
2024-03-20T08:18:57.264+1100 [INFO] CLI args: []string{"/Users/jacob/.asdf/installs/terraform/1.7.5/bin/terraform", "apply", "-auto-approve"}
2024-03-20T08:18:57.264+1100 [TRACE] Stdout is not a terminal
2024-03-20T08:18:57.264+1100 [TRACE] Stderr is a terminal of width 283
2024-03-20T08:18:57.264+1100 [TRACE] Stdin is a terminal
2024-03-19T15:44:40.333+1100 [INFO] Terraform version: 1.7.5
2024-03-19T15:44:40.333+1100 [DEBUG] using github.com/hashicorp/go-tfe v1.41.0
2024-03-19T15:44:40.333+1100 [DEBUG] using github.com/hashicorp/hcl/v2 v2.19.1
2024-03-19T15:44:40.333+1100 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1
2024-03-19T15:44:40.333+1100 [DEBUG] using github.com/zclconf/go-cty v1.14.1
2024-03-19T15:44:40.333+1100 [INFO] Go runtime version: go1.21.8
2024-03-19T15:44:40.333+1100 [INFO] CLI args: []string{"/Users/jacob/.asdf/installs/terraform/1.7.5/bin/terraform", "apply", "-auto-approve"}
2024-03-19T15:44:40.333+1100 [DEBUG] Attempting to open CLI config file: /Users/jacob/.terraformrc
2024-03-19T15:44:40.333+1100 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2024-03-19T15:44:40.333+1100 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
ᐅ TF_LOG=DEBUG terraform apply
2021-12-27T11:15:24.564-0600 [INFO] Terraform version: 1.1.2
2021-12-27T11:15:24.565-0600 [INFO] Go runtime version: go1.17.2
2021-12-27T11:15:24.565-0600 [INFO] CLI args: []string{"terraform", "apply"}
2021-12-27T11:15:24.565-0600 [DEBUG] Attempting to open CLI config file: /Users/yen/.terraformrc
2021-12-27T11:15:24.565-0600 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021-12-27T11:15:24.565-0600 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021-12-27T11:15:24.565-0600 [DEBUG] ignoring non-existing provider search directory /Users/yen/.terraform.d/plugins
2021-12-27T11:15:24.565-0600 [DEBUG] ignoring non-existing provider search directory /Users/yen/Library/Application Support/io.terraform/plugins
2021-12-27T11:15:24.565-0600 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
# Cloudflare Access Service tokens example.
#
# This is a code sample for using Cloudflare Access using service
# tokens. To execute this sample, you'll need to setup a new service
# token (client ID and client secret) as well as an Access Policy that
# allows the non-identity to access the resource. For assistance setting
# up the Cloudflare Access Service Token and the Access Policy, please
# refer to the documentation linked below.
#
# Prerequisites:
0.00011992454528809
0.0055930614471436
6.7949295043945E-5
9.2029571533203E-5
0.00070881843566895
0.00023818016052246
0.00063109397888184
0.0012919902801514
0.00021719932556152
0.00012302398681641
@jacobbednarz
jacobbednarz / drupal_write_record_example.php
Last active December 30, 2015 04:29
Example of using drupal_write_record over a conditional db_insert and db_update.
<?php
// Let's say for argument sake $query is a database query that checks for the
// presence of an existing record and returns FALSE if nothing is found. In this
// example, we need to check for an existing record and update the row if it
// exists or create a new entry if it doesn't.
/**
* Bad
*/
#!/usr/bin/php -q
<?php
/**
* @file
* Script to automate the transfer of all databases and files from one
* environment to another using Acquia Cloud API.
*/

Exporting Views

This guide assumes you have a module ready to save the views but it does not have any Views integration or folder structure. Skip ahead if you've already created the folders and Views Hooks.

  • Add the views folder to your module.
  • Create a file called MODULENAME.views.inc inside the views folder.
  • Add a default_views folder inside the views folder.

Your module directory structure should now resemble something like this:

@jacobbednarz
jacobbednarz / drupal-quick-dump.sh
Created May 8, 2013 05:13
Dump MySQL tables excluding certain tables.
#!/bin/bash
# Take a MySQL DB dump excluding some tables.
#
# Usage:
# ./drupal-quick-dump user host database
USER="$1"
HOST="$2"
DB="$3"
DATE=`date +%Y%m%d`