Skip to content

Instantly share code, notes, and snippets.

Avatar

Jon Gillies jongillies

  • USA
View GitHub Profile
View grub-test.sh
#!/usr/bin/env bash
cat << EOF > grub.orig.conf
# If you change this file, run 'update-grub' afterwards to update
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
@jongillies
jongillies / create_vm.sh
Created Mar 9, 2017 — forked from sickbock/create_vm.sh
VirtualBox PXE boot
View create_vm.sh
#!/bin/bash
cd ${myVMs}
MyVM=testvm
vboxmanage unregistervm ${MyVM} --delete
rm -rf ${MyVM}
mkdir ${MyVM}
cd ${MyVM}
vboxmanage createhd --filename ${MyVM}.vdi --size 30720
vboxmanage createvm --name ${MyVM} --ostype RedHat_64 --register
vboxmanage modifyvm ${MyVM} --memory 6172 --vram=12 --acpi on --nic1 NAT # optional second NIC # --nic2 bridged --bridgeadapter2 enp0s25
View keybase.md

Keybase proof

I hereby claim:

  • I am jongillies on github.
  • I am supercoder (https://keybase.io/supercoder) on keybase.
  • I have a public key ASCoYvsqjGhtXlIAHmYT_RUadTlk03IT0CeDoEhfMJE7CQo

To claim this, I am signing this object:

@jongillies
jongillies / ldap.py
Created Sep 29, 2015
Default /etc/tower/conf.d/ldap.py
View ldap.py
###############################################################################
# LDAP AUTHENTICATION SETTINGS
###############################################################################
# Ansible Tower can be configured to centrally use LDAP as a source for
# authentication information. When so configured, a user who logs in with
# a LDAP username and password will automatically get an account created for
# them, and they can be automatically placed into multiple organizations as
# either regular users or organization administrators. If users are created
# via an LDAP login, by default they cannot change their username, firstname,
View gist:651464b395ab8830610a
#!/usr/bin/env ruby
Payment = Struct.new(:payee, :amount, :tags)
Dateline = Struct.new(:date)
TRANSACTIONS = [
Dateline.new("2015-01-01"),
Payment.new("Milliways", 25476, "dining travel"),
Payment.new("Sirius Cybernetics", 7839),
Payment.new("Old Pink Dog Bar", 2790, "dining"),
Dateline.new("2015-01-02"),
@jongillies
jongillies / gist:6004025
Created Jul 15, 2013
How can i do for create or update using the API with RocketPants (From: https://github.com/filtersquad/rocket_pants/issues/5)
View gist:6004025
class UsersController < RocketPants::Base
version 1
def index
expose User.paginate per_page: 10, page: params[:page]
end
def show
expose user
@jongillies
jongillies / ProcessInfo.cs
Created Sep 22, 2012
Find out your process filename in C#
View ProcessInfo.cs
namespace Supercoder.Tools
{
public class ProcessInfo
{
public static string MyName()
{
return(System.IO.Path.GetFileName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName));
}
}
}
@jongillies
jongillies / Platform.cs
Created Sep 22, 2012
How to determine your platform in C#
View Platform.cs
using System;
namespace Supercoder.Tools
{
public class Platform
{
public static string PlatformString()
{
const string msg1 = "This is a Windows operating system.";
const string msg2 = "This is a Unix operating system.";
@jongillies
jongillies / pauseifinide.cs
Created Sep 22, 2012
C# example of how to pause the process befor exist if you are in the IDE (VisualStudio)
View pauseifinide.cs
public static void PauseIfInIDE()
{
if (System.Diagnostics.Debugger.IsAttached )
{
Console.WriteLine("Press <ENTER> to continue.");
Console.Read();
}
}
@jongillies
jongillies / find-svn-folders.rb
Created Sep 22, 2012
Example of how to find the top level SVN folder in a hierarchy of SVN repositories
View find-svn-folders.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'popen4'
require 'find'
def usage(message = "")
unless message.empty?
puts
You can’t perform that action at this time.