Skip to content

Instantly share code, notes, and snippets.

View rfay's full-sized avatar

Randy Fay rfay

View GitHub Profile
@rfay
rfay / gist:ba875e761ae41d86c433fbe4f4259d1c
Created June 30, 2019 23:36
redirection of https to http
$ sudo apt-get install rkt
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
rkt
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 72.5 MB of archives.
After this operation, 85.1 MB of additional disk space will be used.
Err:1 https://download.opensuse.org/repositories/home:/rfay/Debian_9.0 ./ rkt 1.6.0-0
package main
import (
"fmt"
"path/filepath"
)
func main() {
matches, _ := checkForFileInSubdirs(".", "junk.txt")
fmt.Printf("Matches for 'junk.txt: %v\n", matches)
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
digest = "1:6da51e5ec493ad2b44cb04129e2d0a068c8fb9bd6cb5739d199573558696bb94"
name = "github.com/Azure/go-ansiterm"
packages = [
".",
"winterm",
composer install
Loading composer repositories with package information
The "https://composer.typo3.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
https://composer.typo3.org could not be fully loaded, package information was loaded from the local cache and may be out of date
Updating dependencies (including require-dev)
@rfay
rfay / d8test_setup.sh
Created March 18, 2018 20:42
Experimental setup of Drupal 8 testing for ddev
#!/bin/bash
# This script runs inside the ddev web container and sets up Drupal 8 testing.
# It assumes a regular Drupal 8 checkout, with the docroot in the project root.
# It can be added to the config.yaml as a step to automatically happen on start
# - Run this manually with "ddev exec ./d8test_setup.sh"
# - Run this in the container (after "ddev ssh) by just running "./d8test_setup.sh"
# - Run it automatically run on start by adding it to the project's config.yaml:
#hooks:
@rfay
rfay / f-117628-7092-1a3fldf.fmkmbtvs4i
Created July 29, 2017 03:14
Example generated (untouched) schtasks xml file
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.3" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2017-07-29T02:48:29.015Z</Date>
<Author>DESKTOP-NGH86C2\rfay</Author>
<URI>\surf-windows-ddev3</URI>
</RegistrationInfo>
<Triggers>
<LogonTrigger>
<Enabled>true</Enabled>
$ git diff
diff --git a/cmd/ddev/cmd/start.go b/cmd/ddev/cmd/start.go
index 4c0ce0c..4e26895 100644
--- a/cmd/ddev/cmd/start.go
+++ b/cmd/ddev/cmd/start.go
@@ -73,7 +73,7 @@ func init() {
StartCmd.Flags().StringVarP(&dbImage, "db-image", "", "", "Change the image used for the app's database server")
StartCmd.Flags().StringVarP(&webImageTag, "web-image-tag", "", "", "Override the default web image tag")
StartCmd.Flags().StringVarP(&dbImageTag, "db-image-tag", "", "", "Override the default web image tag")
- StartCmd.Flags().StringVarP(&plugin, "plugin", "p", "legacy", "Choose which plugin to use")
@rfay
rfay / gist:fb043e166daa68270494c7b8b9c0b35a
Created March 6, 2017 22:28
iterm setup for changing your background in a particular place
The basics of iterm profile switching are here: https://www.iterm2.com/documentation-automatic-profile-switching.html
I used this config for ssh-based profile switching: https://www.evernote.com/l/AA9QPrDKFGFGRI_QrTfVcAwOQsTAmrxz8PEB/image.png
I did this in .bashrc/.zshrc to handle kubectl switches. This might be a little iffy depending on your actual config and how you manage it.
function iterm2_print_user_vars() {
export kube_context=$(kubectl config current-context 2>/dev/null)
iterm2_set_user_var kube_context $kube_context
@rfay
rfay / iterm2badge.md
Last active December 19, 2016 17:05
Iterm2 badge config for kube config info

Iterm2 Badge config: \(session.username)@\(session.hostname)\n\(user.kube_context)

Addition to .bashrc (or whatever runs on new shell):

function iterm2_print_user_vars() {
  iterm2_set_user_var kube_context $(kubectl config current-context 2>/dev/null)
}

iterm2 config

SELECT TOP 1000 pi.SubscriberId,
STUFF((
SELECT ',' + tct.CategoryType + '=' + tc.CategoryDescription
FROM SML_Auth.dbo.TSL_User_Categories tuc
LEFT JOIN SML_Auth.dbo.TSL_Categories tc ON tc.CategoryId=tuc.CategoryId
LEFT JOIN SML_Auth.dbo.TSL_CategoryTypes tct ON tc.CategoryTypeId=tct.CategoryTypeId
WHERE pi.SubscriberId=tuc.SubscriberId
FOR XML PATH('')),1,1, '') AS categories
FROM TES_Connect_SML.dbo.TES_PROFILE_PERSONALINFORMATION pi
GROUP BY pi.SubscriberId