Skip to content

Instantly share code, notes, and snippets.

@vfreex
vfreex / namespaces_netlink_test.c
Created September 5, 2016 10:22
namespaces_netlink_test.c
import signal, sys, threading, time
THREADS = []
def handler(signal, frame):
global THREADS
print "Ctrl-C.... Exiting"
for t in THREADS:
t.alive = False
sys.exit(0)
@vfreex
vfreex / list.h
Created November 17, 2016 10:49
simple doubly linked list that is similar to the linux kernel
#ifndef _LT_DOUBLY_LINKED_LIST_H
#define _LT_DOUBLY_LINKED_LIST_H
#ifndef offsetof
#define offsetof(type, member) \
((size_t) &((type*) 0)->member)
#endif
#ifndef container_of
#define container_of(ptr, type, member) \
@vfreex
vfreex / README.md
Created December 6, 2016 07:42 — forked from datagrok/README.md
What happens when you cancel a Jenkins job

When you cancel a Jenkins job

Unfinished draft; do not use until this notice is removed.

We were seeing some unexpected behavior in the processes that Jenkins launches when the Jenkins user clicks "cancel" on their job. Unexpected behaviors like:

  • apparently stale lockfiles and pidfiles
  • overlapping processes
  • jobs apparently ending without performing cleanup tasks
  • jobs continuing to run after being reported "aborted"
@vfreex
vfreex / list.h
Created December 13, 2016 08:09 — forked from evanslai/list.h
Linux kernel linked list, modified for userspace
#ifndef _LINUX_LIST_H
#define _LINUX_LIST_H
#include <stdio.h>
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.
apiVersion: apps/v1beta2
#apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: nginx
spec:
selector:
matchLabels:
name: nginx
template:
@vfreex
vfreex / hotels
Last active January 12, 2018 08:47
package main
import (
"fmt"
"sort"
)
type Rating struct {
score int
count int
@vfreex
vfreex / scan_isp_blocklist.sh
Created November 20, 2018 09:58
Test which TCP ports are blocked by my ISP
#!/bin/bash
for port in {1..9999}; do
echo -n "TCP $port: "
result=$(nc "$1" "$port" -w 1 2>&1 < /dev/null)
if [ "$?" -eq 0 ]; then
echo "Open"
continue
fi
if [[ "$result" == *refused* ]]; then
@vfreex
vfreex / demo-pipeline.yaml
Created January 25, 2019 21:01
demo-pipeline
kind: "BuildConfig"
apiVersion: "v1"
metadata:
name: "demo-pipeline"
spec:
strategy:
jenkinsPipelineStrategy:
jenkinsfile: |-
pipeline {
agent {
@vfreex
vfreex / Jenkinsfile
Created February 12, 2019 09:57
Jenkins jobs to receive and send a VirtualTopic.eng.repotracker.container.tag.updated CI message
node('master') {
// Wait for message and store message content in variable
def msgContent = waitForCIMessage \
providerName: 'Red Hat UMB (test)', \
overrides: [topic: 'VirtualTopic.eng.repotracker.container.tag.updated'], \
selector: "repo='quay.io/factory2/waiverdb'"
echo "msgContent = " + msgContent
}