forked from ebpf-io/ebpf.io-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
676 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,53 @@ | ||
module.exports = post => { | ||
const nhp = require('node-html-parser') | ||
const { html } = post; | ||
const normalizedHtml = html.trim(); | ||
const regex = /<p>{{\s*preview\s*}}<\/p>([\s\S]*)<p>{{\s*\/\s*preview\s*}}<\/p>([\s\S]*)/gi; | ||
const matches = regex.exec(normalizedHtml); | ||
|
||
const parsedToPreviewImageHtml = (parsed) => { | ||
const firstImageHtml = parsed.querySelector('.gatsby-resp-image-link'); | ||
const firstManualLinkImageHtml = parsed.querySelector('a img.gatsby-resp-image-image'); | ||
const firstManualOgLinkImageHtml = parsed.querySelector('a.ogpreview img.gatsby-resp-image-image'); | ||
|
||
if (firstManualOgLinkImageHtml) { | ||
return firstManualOgLinkImageHtml.parentNode.parentNode.outerHTML; | ||
} else if(firstManualLinkImageHtml) { | ||
return firstManualLinkImageHtml.parentNode.parentNode.outerHTML; | ||
} | ||
|
||
return firstImageHtml ? firstImageHtml.outerHTML : null; | ||
} | ||
|
||
const parsedToPreviewDescription = (parsed) => { | ||
const textNode = Array | ||
.from(parsed.querySelectorAll('p')) | ||
.find((elem) => (elem.textContent || elem.text).trim().length > 0); | ||
|
||
return (textNode.textContent || textNode.text).slice(0, 133) + '...'; | ||
} | ||
|
||
if (!matches || matches.index > 0) { | ||
const parsed = nhp.parse(normalizedHtml); | ||
|
||
return { | ||
hasPreview: false, | ||
previewHtml: normalizedHtml, | ||
mainHtml: normalizedHtml | ||
mainHtml: normalizedHtml, | ||
previewImageHtml: parsedToPreviewImageHtml(parsed), | ||
previewDescription: parsedToPreviewDescription(parsed), | ||
}; | ||
} | ||
|
||
const previewHtmlMatch = matches[1]; | ||
const mainHtmlMatch = matches[2]; | ||
const parsed = nhp.parse(previewHtmlMatch); | ||
|
||
return { | ||
hasPreview: true, | ||
previewHtml: previewHtmlMatch, | ||
mainHtml: mainHtmlMatch | ||
mainHtml: mainHtmlMatch, | ||
previewImageHtml: parsedToPreviewImageHtml(parsed), | ||
previewDescription: parsedToPreviewDescription(parsed), | ||
}; | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+15.4 KB
src/posts/2020-10-09-cilium-in-alibaba-cloud/ebpf_service_performance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
path: "/blog/2020/10/09/cilium-in-alibaba-cloud" | ||
date: "2020-10-09T09:00:00.000Z" | ||
isPopular: true | ||
title: "The very first blog post" | ||
categories: | ||
- Blog post | ||
tags: | ||
- Kubernetes | ||
- eBPF | ||
- BPF | ||
--- | ||
|
||
{{preview}} | ||
|
||
 | ||
|
||
We will not attempt to close the gap with the former series, the eBPF community | ||
has been way too active. We will instead focus on the latest news over October, | ||
November 2020, there is plenty to list. From new tutorials to academic research | ||
and kernel discussions, everyone should find a good read or two! | ||
|
||
{{/preview}} | ||
|
||
[_Fuzzing for eBPF JIT bugs in the Linux kernel_](https://scannell.me/fuzzing-for-ebpf-jit-bugs-in-the-linux-kernel/), | ||
from Simon Scannell. | ||
Fuzzing tools are very helpful to discover bugs in software, and the eBPF | ||
subsystem is no exception. This write-up details the architecture and the | ||
generator used to build such a fuzzer, and explains how it let to the | ||
discovery of a kernel vulnerability. The kernel has been patched since then. |
Oops, something went wrong.