Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <stdlib.h>
int main()
{
int j;
char buf[1];
FILE* f;
f = fopen("write.bin", "w+");
#include <stdlib.h>
#include <fcntl.h>
int main()
{
int j;
char buf[1];
int fd;
fd = open("write.bin", O_CREAT | O_WRONLY);
#include <stdio.h>
#include <stdlib.h>
int main()
{
int j;
char* buf = (char*)malloc(5000 * 1000);
FILE* f;
f = fopen("write.bin", "w+");
#include <stdlib.h>
#include <fcntl.h>
int main()
{
int j;
char* buf = (char*)malloc(5000 * 1000);
int fd;
fd = open("write.bin", O_CREAT | O_WRONLY);
apiVersion: v1
kind: Pod
metadata:
name: ceph-mysql
spec:
containers:
- name: ceph-mysql
image: tutum/mysql
ports:
- name: mysql-db
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: ceph-claim
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
apiVersion: v1
kind: PersistentVolume
metadata:
name: ceph-pv
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteMany
rbd:
apiVersion: v1
kind: Secret
metadata:
name: ceph-secret
data:
key: QVFDS3pJaFlWdTBwTWhBQXJESmFWQXVOZTc5ZEZieTJ1bDBMSGc9PQo=
@bencer
bencer / sysdig_tracers_example.py
Created December 20, 2016 15:58
sysdig_tracers usage example
from sysdig_tracers import Tracer, Args, ReturnValue
[...]
@Tracer(enter_args={"n": Args(1)}, exit_args={"ret": ReturnValue})
def do_download_write(self, filename):
with open(filename, 'r') as f:
self.wfile.write(f.read())
# randomly download a file between a collection of 4
@bencer
bencer / k8s-skydns-sysdig.log
Created December 5, 2016 15:06
Sysdig output on Kubernetes Service DNS resolution
15085 15:04:02.227045418 0 client (99a1f06089bb) curl (5451:12) < socket fd=3(<6>)
15086 15:04:02.227046442 0 client (99a1f06089bb) curl (5451:12) > close fd=3(<6>)
15087 15:04:02.227047179 0 client (99a1f06089bb) curl (5451:12) < close res=0
15267 15:04:02.227930016 1 client (99a1f06089bb) curl (5452:13) < socket fd=3(<4>)
15268 15:04:02.227936726 1 client (99a1f06089bb) curl (5452:13) > connect fd=3(<4>)
15269 15:04:02.227948559 1 client (99a1f06089bb) curl (5452:13) < connect res=0 tuple=172.17.0.7:33209->10.0.2.15:53
15277 15:04:02.228136090 1 <NA> (28c677fc8628) skydns (2682:8) > recvmsg fd=6(<3t>:::53)
15284 15:04:02.228174895 1 <NA> (28c677fc8628) skydns (2682:8) < recvmsg res=56 size=56 data=
(backendcritical-appsvcclusterlocal tuple=::ffff:172.17.0.7:33209->:::53
15288 15:04:02.228181972 1 <NA> (28c677fc8628) skydns (2682:8) > recvmsg fd=6(<3t>:::53)