Skip to content

Instantly share code, notes, and snippets.

#! /usr/bin/python
import sys
import signal
from json import dumps, loads
from platform import platform
from urlparse import urlparse
from socket import gethostbyaddr
from SocketServer import TCPServer, ForkingTCPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
# stop Vagrant from trying to insert a secure key (makes authentication fail for me)
Vagrant.configure("2") do |config|
config.ssh.insert_key = false
end
<UserLang name="Puppet" ext="pp">
<Settings>
<Global caseIgnored="no" escapeChar="\" />
<TreatAsSymbol comment="no" commentLine="no" />
<Prefix words1="no" words2="no" words3="no" words4="yes" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">&apos;&quot;0&apos;&quot;0</Keywords>
<Keywords name="Folder+">{</Keywords>
<Keywords name="Folder-">}</Keywords>
2017-03-09 11:34:28,980 ERROR [clojure-agent-send-off-pool-162] [p.e.file-sync-errors] Failed to sync repo :puppet-code: Error while sync'ing live code directory
org.eclipse.jgit.api.errors.JGitInternalException: Error while cleaning repo at /opt/puppetlabs/server/data/puppetserver/filesync/client/puppet-code.git. This may be due to a permissions problem or due to another repository existing in the repo. Could not delete file /etc/puppetlabs/code/modules/wsus_client/README.md
at puppetlabs.enterprise.services.file_sync_client.file_sync_client_core$eval33775$clean_BANG___33780$fn__33781.invoke(file_sync_client_core.clj:1129)
at puppetlabs.enterprise.services.file_sync_client.file_sync_client_core$eval33775$clean_BANG___33780.invoke(file_sync_client_core.clj:1116)
at puppetlabs.enterprise.services.file_sync_client.file_sync_client_core$eval33879$do_forced_sync_BANG___33884$fn__33885.invoke(file_sync_client_core.clj:1225)
at puppetlabs.enterprise.services.file_sync_client.file_syn

Troubleshooting Git

Assumptions: You are operating from the root directory of your git repository. You do not have permissions to push to production. In this documentation, when you see something in tags (< >), it means to replace it with your actual value.

Reverting changes

git reflog
# you will see a list of everything you've done in git, across all branches
# each one has an index HEAD@{<index>}

find the one where things still worked

@dnase
dnase / log
Last active March 13, 2017 15:06
drew:puppetize drew.nase$ rake present --trace
** Invoke present (first_time)
** Execute present
Would you like to see the release notes? [Y/n]: N
What is the address of the Classroom server? [services-uswest.skytap.com]
What is the SSH port of the Classroom server? [29629]
rake aborted!
Resolv::ResolvError: no address for services-uswest.skytap.com
/Users/drew.nase/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:93:in `getaddress'
/Users/drew.nase/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:43:in `getaddress'
Facter.add(:cloud) do
setcode do
ip = Facter.value(:ipaddress)
octets = ip.split('.')
case octets[2]
when '5'
'Oracle'
when '9'
'Azure'
else
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Diff Overview</title><meta name="keywords" content="puppet, diff, preview"/><style type="text/css">
body { font: 20px/120% "Helvetica Neue",Helvetica,Arial, sans-serif }
.tooltip{
display: inline;
position: relative;
}
.tooltip:hover:after{
background: #333;
background: rgba(0,0,0,.8);
border-radius: 5px;