Skip to content

Instantly share code, notes, and snippets.

View cbednarski's full-sized avatar

Chris Bednarski cbednarski

View GitHub Profile
package turbine
import (
"bytes"
"io"
"regexp"
"strings"
"github.com/russross/blackfriday/v2"
)
@cbednarski
cbednarski / fix-libappindicator.sh
Last active October 23, 2023 16:39
Update deb package with libappindicator3-1 dependency to use libayatana-appindicator3-1 instead. For Debian 11.
#!/bin/bash
# Copying: Public domain.
set -e
sourceName=$1
if [[ $sourceName == "" ]]; then
echo "Usage: fix-libappindicator.sh <.deb>"
@cbednarski
cbednarski / packer.log
Created July 8, 2016 19:15
Crash report for packer#3699
2016/07/08 12:02:19 [INFO] Packer version: 0.10.1
2016/07/08 12:02:19 Packer Target OS/Arch: darwin amd64
2016/07/08 12:02:19 Built with Go Version: go1.6.2
2016/07/08 12:02:19 Detected home directory from env var: /Users/mborodia
2016/07/08 12:02:19 Using internal plugin for amazon-ebs
2016/07/08 12:02:19 Using internal plugin for amazon-instance
2016/07/08 12:02:19 Using internal plugin for null
2016/07/08 12:02:19 Using internal plugin for virtualbox-ovf
2016/07/08 12:02:19 Using internal plugin for vmware-vmx
2016/07/08 12:02:19 Using internal plugin for azure-arm
{
"builds": [
{
"name": "docker",
"builder_type": "docker",
"build_time": 1465548378,
"files": null,
"artifact_id": "sha256:1e9543ee891b51e2918393bd2ce0840df860ee58eb002dc5f4bc8b4a9531d3f7"
},
{
@cbednarski
cbednarski / github-backup.sh
Created April 7, 2016 00:29
Backup github repos, courtesy @kikitux
#!/bin/bash
user="`basename ${0%.sh}`"
GHTEST="`curl -sS -I https://api.github.com 2>&1`"
RET=$?
if [ ${RET} -ne 0 ]; then
echo "ERR: check internet connection"
echo "${GHTEST}"
@cbednarski
cbednarski / statusline.sh
Last active September 24, 2016 17:15
Bash statusline
# Color codes look like this: \033[1;34m
#
# When used in a prompt, color codes and other special sequences have to be
# escaped so they are not counted in the width of the bash prompt. If the width
# is not calculated correctly backspace, up arrow, etc. will not work correctly.
#
# In the bash prompt itself (PS1) you should use the \[ \] an escape sequence.
# This indicates to bash that these characters are not part of the prompt.
#
# If you're using color codes in a bash function that is used in your prompt,
@cbednarski
cbednarski / docker-extract.json
Created March 28, 2016 23:34
Docker.app Packer Example
{
"builders": [
{
"type": "docker",
"image": "ubuntu",
"discard": true
}
],
"provisioners": [
{
@cbednarski
cbednarski / factorio.md
Last active April 3, 2024 01:14
Host a factorio server
@cbednarski
cbednarski / missing-from-vendor.log
Last active February 12, 2016 18:47
When building go with vendored dependencies, the error message for a missing dependency is not super intuitive.
post-processor/amazon-import/post-processor.go:139: cannot use session (type *session.Session) as type "github.com/aws/aws-sdk-go/aws/client".ConfigProvider in argument to s3manager.NewUploader:
*session.Session does not implement "github.com/aws/aws-sdk-go/aws/client".ConfigProvider (wrong type for ClientConfig method)
have ClientConfig(string, ...*"github.com/mitchellh/packer/vendor/github.com/aws/aws-sdk-go/aws".Config) "github.com/mitchellh/packer/vendor/github.com/aws/aws-sdk-go/aws/client".Config
want ClientConfig(string, ...*"github.com/aws/aws-sdk-go/aws".Config) "github.com/aws/aws-sdk-go/aws/client".Config
@cbednarski
cbednarski / di.fm-playlist.py
Created February 3, 2016 00:13
di.fm iTunes playlist importer
import re
"""
di.fm allows you to download a playlist of all your favorite channels. For some
reason when you open this playlist with iTunes only one of the channels is
added. This script splits the playlist file into many playlist files so you can
easily load all of your favorites into iTunes and enjoy di.fm streaming without
running Flash in your browser.
"""
items = open("di.pls").read().split("File")