Skip to content

Instantly share code, notes, and snippets.

View nagas's full-sized avatar

Mirosław Nagaś nagas

View GitHub Profile
@nagas
nagas / copy-stdin2stdout
Last active May 15, 2018 16:09
non blocking and without roundtrip to userspace
#define _GNU_SOURCE
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <limits.h>
int
main(int argc, char *argv[])
{
Three node cluster
* ip-10-105-2-176
* ip-10-105-14-231
* ip-10-105-9-122
All traffic blocked between node ip-10-105-2-176 and node ip-10-105-14-231.
I did that using iptables on node ip-10-105-2-176 (DROP in INPUT/OUTPUT chains for traffic from/to ip-10-105-14-231).
########################
# RabbitMQ config file #
# runs linkerd in a daemonset, in linker-to-linker mode
---
apiVersion: v1
kind: ConfigMap
metadata:
name: l5d-config
data:
config.yaml: |-
admin:
port: 9990
---
#apiVersion: v1
#kind: ReplicationController
#metadata:
# name: hello
#spec:
# replicas: 3
# selector:
# app: hello
# template:
(gdb) t a a bt
Thread 2 (Thread 0x2b6702686700 (LWP 17974)):
#0 0x00002b66fd81b6b3 in select () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00002b66fd0893fd in time_sleep.53117 () from /usr/lib/libpython2.7.so.1.0
#2 0x00002b66fd0955d5 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#3 0x00002b66fd0556b5 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#4 0x00002b66fd095650 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#5 0x00002b66fd0556b5 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#6 0x00002b66fd095650 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
---
apiVersion: v1
kind: Service
metadata:
name: gateway
spec:
ports:
- port: 6379
targetPort: 6379
nodePort: 32000
---
##################################################################################################
# Redis datastore backend for Amalgam8 Controller
##################################################################################################
apiVersion: v1
kind: Service
metadata:
name: redis
labels:
name: redis
<?xml version='1.0'?>
<job_info xmlns:xsd="http://gridscheduler.svn.sourceforge.net/viewvc/gridscheduler/trunk/source/dist/util/resources/schemas/qstat/qstat.xsd?revision=11">
<queue_info>
</queue_info>
<job_info>
<job_list state="pending">
<JB_job_number>1</JB_job_number>
<JAT_prio>0.55500</JAT_prio>
<JB_name>sleep.sh</JB_name>
<JB_owner>ubuntu</JB_owner>
$ sudo rabbitmqctl list_connections && sudo rabbitmqctl list_channels name prefetch_count && sudo rabbitmqctl list_queues name messages messages_unacknowledged consumers
Listing connections ...
guest 192.168.3.14 40452 running
...done.
Listing channels ...
192.168.3.14:40452 -> 192.168.3.10:5672 (1) 10
...done.
Listing queues ...
test42.topic.queue 18330 15 1
...done.
#!/bin/sh
NORMAL=$(tput sgr0)
GREEN=$(tput setaf 2; tput bold)
# for development usage
#set -e # bail on first error
#set -u # bail on unbound variable reference
#set -x # print command before executing