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
#!/usr/bin/env ruby | |
require 'teamcymru' | |
require 'ipaddr' | |
c = TeamCymru::ASNClient.new | |
ips = Array.new | |
ARGF.each do |line| | |
ip = IPAddr.new(line.split()[0]) |
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
#include <stdio.h> | |
#include <pcap.h> | |
#include <arpa/inet.h> | |
#include <linux/if_ether.h> | |
#include <netinet/ip6.h> | |
#define SNAP_LEN 1500 | |
int main(int argc, char *argv[]) { |
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
[Unit] | |
Description=Brightd brightness daemon | |
Wants=display-manager.service | |
[Service] | |
Type=forking | |
ExecStart=/usr/sbin/brightd -d -x -w 6 | |
Restart=on-abort | |
[Install] |
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
# Localization file for Dutch. | |
# Translated from the English locale by Luuk Hendriks (DRiKE on github), used the date and datetime | |
# from https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/nl.yml | |
# credits for those sections to Ariejan de Vroom and Floris Huetink | |
nl: | |
admin: | |
home: | |
name: Home | |
pagination: |
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
# Copyright 1999-2017 Gentoo Foundation | |
# Distributed under the terms of the GNU General Public License v2 | |
EAPI=6 | |
inherit qmake-utils | |
inherit versionator | |
MY_PN="GoldenCheetah" | |
MY_PV=$(replace_version_separator 2 '-DEV') |
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
SEC("xdp-dns-says-no-v1") | |
int xdp_dns_says_no(struct xdp_md *ctx) | |
{ | |
struct cursor c; | |
struct ethhdr *eth; | |
uint16_t eth_proto; | |
struct iphdr *ipv4; | |
struct ipv6hdr *ipv6; | |
cursor_init(&c, ctx); |
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
struct dns_qrr { | |
uint16_t qtype; | |
uint16_t qclass; | |
}; | |
struct dns_rr { | |
uint16_t type; | |
uint16_t class; | |
uint32_t ttl; | |
uint16_t rdata_len; |
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
static __always_inline | |
int udp_dns_reply(struct cursor *c) | |
{ | |
struct udphdr *udp; | |
struct dnshdr *dns; | |
if (!(udp = parse_udphdr(c))|| udp->dest != __bpf_htons(DNS_PORT) | |
|| !(dns = parse_dnshdr(c))) | |
return -1; | |
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
// continuing: | |
if (dns->arcount) { | |
struct dns_rr *opt_rr; | |
uint8_t *opt_owner = c->pos; | |
opt_owner = c->pos; | |
if (++c->pos > c->end || *opt_owner | |
|| !(opt_rr = parse_dns_rr(c)) | |
|| opt_rr->type != __bpf_htons(RR_TYPE_OPT)) |
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
static __always_inline | |
uint8_t *parse_dname(struct cursor *c, uint8_t *pkt) | |
{ | |
uint8_t *dname = c->pos; | |
int i; | |
for (i = 0; i < 128; i++) { /* Maximum 128 labels */ | |
uint8_t o; | |
if (c->pos + 1 > c->end) |
OlderNewer