Skip to content

Instantly share code, notes, and snippets.

---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
def add_x_y(x, y)
z = x + y
yield z
return z
end
add_x_y(2,3) do |z| puts z end
var add_x_y = function(x, y, cb) {
var z = x + y;
if (cb && typeof(cb)=="function") cb(z);
return z;
}
add_x_y(2, 3, function(n) { console.log(n); })
#!/bin/sh
# Use socat to proxy git through an HTTP CONNECT firewall.
# Useful if you are trying to clone git:// from inside a company.
# Requires that the proxy allows CONNECT to port 9418.
#
# Save this file as gitproxy somewhere in your path (e.g., ~/bin) and then run
# chmod +x gitproxy
# git config --global core.gitproxy gitproxy
#
# More details at http://tinyurl.com/8xvpny
#!/bin/sh
# Use socat to proxy git through an HTTP CONNECT firewall.
# Useful if you are trying to clone git:// from inside a company.
# Requires that the proxy allows CONNECT to port 9418.
#
# Save this file as gitproxy somewhere in your path (e.g., ~/bin) and then run
# chmod +x gitproxy
# git config --global core.gitproxy gitproxy
#
# More details at http://tinyurl.com/8xvpny
# Colorized Git Prompt
# by Nap Ramirez <napramirez@gmail.com>
#
export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[36m\]\u@\h:\[\033[32m\]\w\[\033[33m\]\$(__git_ps1)\[\033[0m\]$ "
Dec 11, 2015 5:57:31 PM org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme
INFO: ntlm authentication scheme selected
Dec 11, 2015 5:57:31 PM org.apache.commons.httpclient.HttpMethodDirector authenticate
SEVERE: Credentials cannot be used for NTLM authentication: org.apache.commons.httpclient.UsernamePasswordCredentials
org.apache.commons.httpclient.auth.InvalidCredentialsException: Credentials cannot be used for NTLM authentication: org.apache.commons.httpclient.UsernamePasswordCredentials
at org.apache.commons.httpclient.auth.NTLMScheme.authenticate(NTLMScheme.java:332)
at org.apache.commons.httpclient.HttpMethodDirector.authenticateProxy(HttpMethodDirector.java:320)
at org.apache.commons.httpclient.HttpMethodDirector.authenticate(HttpMethodDirector.java:232)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
@napramirez
napramirez / centos7-vagrant_up.log
Created July 21, 2016 17:01
Logs when spinning up a CentOS 7 Vagrant box
user@localhost:~/centos7$ vagrant init centos/7 2>&1 > /dev/null; vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'centos/7'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'centos/7' is up to date...
==> default: Setting the name of the VM: centos7_default_1469115339526_17226
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
@napramirez
napramirez / centos7-secure.log
Created July 21, 2016 17:07
tail -f /var/log/secure # Inside a CentOS 7 Vagrant box
user@localhost:~$ ssh vagrant@localhost -p 2222
vagrant@localhost's password:
[vagrant@localhost ~]$ sudo tail -f /var/log/secure
localhost sshd[11456]: Authentication refused: bad ownership or modes for file /home/vagrant/.ssh/authorized_keys
localhost sshd[11456]: Connection closed by 10.0.2.2 [preauth]
localhost sshd[11458]: Authentication refused: bad ownership or modes for file /home/vagrant/.ssh/authorized_keys
localhost sshd[11458]: Connection closed by 10.0.2.2 [preauth]
localhost sshd[11460]: Authentication refused: bad ownership or modes for file /home/vagrant/.ssh/authorized_keys
localhost sshd[11460]: Connection closed by 10.0.2.2 [preauth]
version: "2"
settings:
conductor_base: centos:7
services:
app:
from: centos:7
entrypoint: ['/usr/bin/entrypoint.sh']
privileged: true