Skip to content

Instantly share code, notes, and snippets.

@jedy
jedy / go_scp.go
Last active May 31, 2022 07:20
an example of scp in golang
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
package main
import (
"fmt"
"golang.org/x/crypto/ssh"
)
const privateKey = `content of id_rsa`
@smoser
smoser / debconf-get-selections
Created August 9, 2012 02:20
debconf-get-selections
#!/usr/bin/perl
#
# The goal of this is to read a bunch of variables from debconf
# To implement a "late_command_runparts" like function.
# Ie, you would populate the preseed with content like:
# late-command-d late-command/90-fix-hosts string content-for-fix-hosts
# late-command-d late-command/10-install-my-packages string payload
#
# Then, in the actual late_command, we would suck out all those
# values, and run them by doing something like this:
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active April 29, 2025 08:29
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@fancyremarker
fancyremarker / .bash_login.jenkins
Last active March 6, 2023 19:21
[A.] Scripts related to Jenkins client setup
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
@robfe
robfe / QrCodeElement.cs
Created November 9, 2011 22:20
WPF templated control for QrCode.codeplex.com
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using Gma.QrCodeNet.Encoding;
namespace Gma.QrCodeNet.Wpf
{
public class QrCodeElement : Control