Ever wanted to squash the first two commits with a “git rebase -i”? No? Me neither. Until today.
git rebase -i --root
Done.
Ever wanted to squash the first two commits with a “git rebase -i”? No? Me neither. Until today.
git rebase -i --root
Done.
That’s how you specify branches in puppetlabs’ spec_helper fixtures.yml:
fixtures:
forge_modules:
stdlib:
repo: "puppetlabs/stdlib"
ref: "4.6.0"
symlinks:
mapr_helpers: "#{source_dir}"
repositories:
mapr:
repo: "http://myurl/puppet-mapr.git"
# this is a branch. stolen from: don't remember.
ref: 'remotes/origin/ab/devel'
Today seems to be “annoyme-day”.
This error message with docker:
$ docker push myrepo.com:5000/name/image
Post http:///var/run/docker.sock/v1.19/images/myrepo.com:5000 \
/name/image/push?tag=: read unix /var/run/docker.sock: \
connection reset by peer. Are you trying to connect to \
a TLS-enabled daemon without TLS?
… does not necessarily mean that we use http:// instead of https://.
It can also mean that the docker service is not running:
$ systemctl status docker.service
β docker.service - Docker Application Container Engine
Loaded: loaded (/etc/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Wed 2015-07-15 17:16:48 CEST; 15s ago
Docs: https://docs.docker.com
Process: 48587 ExecStart=/usr/bin/docker td -H fd:// $DOCKER_OPTS (code=exited, status=1/FAILURE)
Main PID: 48587 (code=exited, status=1/FAILURE)
Took me 15 minutes.
If you want to download and save it so
Here’s a quick way. Shamelessly stolen from here: http://is.gd/A11rNR
openssl s_client -host google.com -port 443 -prexit -showcerts
… so I don’t forget.
“docker pull” will not use the HTTPPROXY variable. Why? Because “docker” is just the cli program which tells the _daemon what to do. And the daemon probably does not know about the variable if just set in the terminal.
So, what to do to make docker use it described pretty well here: https://docs.docker.com/articles/systemd/#http-proxy
Next thing: Don’t forget to go “systemctl daemon-reload”, because otherwise this will not be effective, even with “systemctl restart docker”.
Done.
The error is: Dependency cycle.
The code is:
class my::own::docker {
include ::docker
file { '/var/lib/docker':
ensure => directory,
before => Class['docker'],
}
}
Why? π
It’s rather simple here, in the real class it really took me a while to find it.
Just a short one. Now that I can list IPs (see last post), it might be nice to associate them on the command line, too. First I wanted to extend the little script, but then I remembered there must already be a CLI way for this.
And there is.
$ openstack server list
$ nova floating-ip-associate <server-uuid> <floating-IP>
(Note: The floating-ip is the actual IP, not the UUID of the OpenStack floating IP)
Groovy.
Filed my first LibreOffice bugs. And I must say: A free and open source word processor with an open doucment format is desperately needed, but one that actually works. LibreOffice is really … well, bad looking and playing catch-up with “the other”, and crashing really way too often for my taste.
And while working with a lot of tables (which is a pain in the ass with LO) I found three bugs. And on one bug even the LO team agrees that it’s a major one π .
To be honest, I think the autoformat was never really used by anyone, it’s that crappy.
Custom table autoformat ignores background colors under certain circumstances Font STYLES for Table Headers are not copied when defining auto table format Table Autoformat: Allow to select if “SUM” line is present for auto format
Problem: I am working in a tenant which has a couple of hosts with floating IPs assigned. I always have to look them up either manually using the command line clients (and dealing with all those UUIDs), or manually in the web GUI. Didn’t like.
Solution: Python script, which outputs FLOATING_IP -> HOST_NAME.
Here it is.
#!/usr/bin/env python
from novaclient import client
import novaclient.v2.floating_ips as os_fips
import novaclient.v2.servers as os_servers
import novaclient.v2.networks as os_networks
#from pprint import pprint as pp
import os
from sys import exit
def error(printme):
print("ERROR: {}".format(printme))
exit(-1)
def check_env():
for a in ("OS_TENANT_ID", "OS_TENANT_NAME", "OS_AUTH_URL", "OS_USERNAME", "OS_PASSWORD"):
if not os.environ.get(a): error("Please set ${}".format(a))
def get_client():
check_env()
return client.Client(2,
os.environ["OS_USERNAME"],
os.environ["OS_PASSWORD"],
os.environ["OS_TENANT_NAME"],
os.environ["OS_AUTH_URL"])
if __name__=="__main__":
nova = get_client()
fipman = os_fips.FloatingIPManager(nova)
servman = os_servers.ServerManager(nova)
netman = os_networks.NetworkManager(nova)
ips = fipman.list()
srs = servman.list()
id2server = {}
for a in srs:
id2server[a.id] = a
ips = [(ip.ip, ip.instance_id) for ip in ips]
# filter out unused floating ips (which have as instance id)
ips = filter(lambda x: x[1], ips)
# create (IP, SERVER_NAME pairs)
ips = map(lambda x: (x[0], id2server[x[1]].name), ips)
# sort for convenience by host instance name
ips = sorted(ips, key=lambda x: x[1].lower())
for a in ips:
print("{:18s} {}".format(a[0], a[1]))
Sample output:
$ tools/list_ips
10.64.108.163 ab_1695_1_dml
10.64.108.199 ab_1695_1_jump
10.64.108.160 media0
10.64.109.97 RJD1_CouchbaseA1
10.64.109.99 RJD1_JumpServer
10.64.109.98 RJD1_OpenshiftMaster
10.64.109.148 tla-centos66
Groovy.
Main sources:
So being on the enterJS conference I wanted to get started with JavaScript. And TypeScript seems really promising. And once again I stumbled over the DIW pattern – Download, Install, Weird error messages.
So, here’s my take on how to get started.
I wanted …
So here’s how to get it to work:
$ mkdir my_project_dir
$ cd my_project_dir
$ brew install node # I'm on Mac ;)
$ npm install -g typescript # install globally
$ npm install node-hid # install locally
Fire up Code, and “open” the project directory “my_project_dir”.
Press “CMD-SHIFT-P” (probably CTRL-SHIFT on non-OSX machines) and search for “Configure task runner”. Here you use this configuration:
{
"version": "0.1.0",
"command": "tsc",
"isShellCommand": true,
"showOutput": "silent",
"args": [],
"problemMatcher": "$tsc"
}
Then create a new file called “test.ts”, with the following content:
// typescript does not know "require".
// you have to convince it it "will exist at runtime".
// http://stackoverflow.com/a/12742371/902327
declare function require(name: string);
var HID = require("node-hid");
var devices = HID.devices();
console.log(devices);
Now if you press “CMD-SHIFT-B” this should compile and create a file called “test.js”.
I don’t know (yet) how to run it from within Code, so on the command line I can test it by doing …
// command: node test.js
{ vendorId: 1452,
productId: 589,
path: 'USB_05ac_024d_fa120000',
serialNumber: '',
manufacturer: 'Apple Inc.',
product: 'Apple Internal Keyboard / Trackpad',
release: 521,
interface: -1 },
{ vendorId: 0,
productId: 0,
path: '',
serialNumber: '',
manufacturer: '',
product: 'Apple Mikey HID Driver',
release: 0,
interface: -1 },
{ vendorId: 1452,
productId: 589,
path: 'USB_05ac_024d_fa120000',
serialNumber: '',
manufacturer: 'Apple Inc.',
product: 'Apple Internal Keyboard / Trackpad',
release: 521,
interface: -1 },
{ vendorId: 1452,
productId: 589,
path: 'USB_05ac_024d_fa120000',
serialNumber: '',
manufacturer: 'Apple Inc.',
product: 'Apple Internal Keyboard / Trackpad',
release: 521,
interface: -1 },
{ vendorId: 1452,
productId: 589,
path: 'USB_05ac_024d_fa120000',
serialNumber: '',
manufacturer: 'Apple Inc.',
product: 'Apple Internal Keyboard / Trackpad',
release: 521,
interface: -1 } ]
Article Sources: