Skip to content

Instantly share code, notes, and snippets.

View spinolacastro's full-sized avatar

Diego Castro (dscastro) spinolacastro

  • Buenos Aires - Argentina
View GitHub Profile
db.tweet.aggregate([{
$unwind: "$entities.hashtags"
}, {
$group: {
_id: {
_id: {
$toLower: "$entities.hashtags.text"
}
},
total: {
export LD_PRELOAD=libnss_wrapper.so:libuid_wrapper.so:$LD_PRELOAD
export NSS_WRAPPER_PASSWD=/tmp/passwd
export NSS_WRAPPER_GROUP=/etc/group
export UID_WRAPPER=${UID_WRAPPER:-1}
export UID_WRAPPER_ROOT=${UID_WRAPPER_ROOT:-1}
crontab -u cron -l
crontab -u root -l
{
"container": "nodejs",
"end": 1470841199,
"metric": "memory/limit",
"name": "nodemongotest-13-4mael",
"namespace_uid": "791f312f-500f-11e6-b3ea-000d3ac01d22",
"ref_date": "2016-08-10 14:00:00.226712",
"start": 1470837600,
"type": "pod_container",
"value": 536870912
{
"id": {
"S": "763407562129731585"
},
"text": {
"S": "testntest10 #testntFOLP01"
},
"user": {
"M": {
"id": {
@spinolacastro
spinolacastro / client.py
Created August 3, 2016 17:34
Remove Ceph lock from images on kubelet
#!/usr/bin/env python
import rados, rbd, sys
try:
conffile, keyring, host = sys.argv[1:]
except ValueError:
print "Use: {} [config-file] [keyring] [host]".format(argv[0])
sys.exit(0)
[
{
"container": "memcached",
"name": "memcached-1-201mt",
"metric": "cpu/limit",
"value": 366,
"start": 1468856644252,
"ref_date": "2016-07-20 19:20:42.543459",
"end": 1469042761080,
"namespace_uid": "4413052a-f77d-11e5-86e4-000d3ac0312b",
constructor(props) {
super(props);
this.messageBuffer = []
};
var update = _.debounce(function() {
messageBuffer.push(data.message)
}, 100, {maxWait: 300});
Apr 05 17:53:40 nodebr3 origin-node[60553]: I0405 17:53:40.163343 60553 config.go:99] Calling handler.OnEndpointsUpdate()
Apr 05 17:53:40 nodebr3 origin-node[60553]: W0405 17:53:40.163482 60553 registry.go:638] Service 'wordpress' in namespace 'mybff' has an Endpoint pointing to pod 10.1.6.5 in namespace 'vander-project'
Apr 05 17:53:40 nodebr3 origin-node[60553]: W0405 17:53:40.163505 60553 registry.go:638] Service 'console' in namespace 'getup' has an Endpoint pointing to pod 10.1.6.3 in namespace 'questtono'
Apr 05 17:53:40 nodebr3 origin-node[60553]: W0405 17:53:40.163521 60553 registry.go:638] Service 'api' in namespace 'mateus' has an Endpoint pointing to pod 10.1.3.26 in namespace 'mybff'
Apr 05 17:53:40 nodebr3 origin-node[60553]: W0405 17:53:40.163554 60553 registry.go:638] Service 'elasticsearch' in namespace 'pensatica' has an Endpoint pointing to pod 10.1.6.9 in namespace 'vander-project'
Apr 05 17:53:40 nodebr3 origin-node[60553]: W0405 17:53:40.163567 60553 registry.go:638] Service '
[root@nodebr1 ~]# iptables -nv -L
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
4037K 6930M ACCEPT all -- tun0 * 0.0.0.0/0 0.0.0.0/0 /* traffic from docker for internet */
32M 8443M ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dports 4789 /* 001 vxlan incoming */
1 389 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:68
23M 15G ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
5 420 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
121 7260 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
11 660 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
@spinolacastro
spinolacastro / gist:4f43093725d5e4e1caf95d539652f4c0
Created March 29, 2016 21:03
Kubernetes Ceph Volume Recycler
#!/bin/bash
AVAILABLE_VOLUMES=30
VOLUME_SIZE="1Gi 2Gi 5Gi 10Gi"
OSM="osmbr1:6789"
KEYRING="/etc/ceph/ceph.client.openshift.keyring"
POOL=rbd
USER=openshift