Skip to content

Instantly share code, notes, and snippets.

My preferred code style is 2-space K&R. This is intended to provide a justification for this style.

Why K&R?

K&R style has the following properties:

  1. Provides symmetric size (in terms of screen space consumed) between the opening and closing syntax of a clode block.
  2. Forces no empty or meaningless lines, thereby avoiding artificial distance between related things that should be together.
  3. Consumes the minimum vertical space while keeping the opening and closing syntax of a block on separate lines from the content.
@mygoare
mygoare / dns
Created April 15, 2015 04:11
public dns list
#公共DNS
##国外
- Google DNS: `8.8.8.8` `8.8.4.4`
- OpenDNS: `208.67.222.222` `208.67.220.220`
- OpenNIC: `106.186.17.181`(Japan) `128.199.248.105`(Singapore) `203.248.252.2`(Korea)
- Comodo Secure DNS: `8.26.56.26` `8.20.247.20`
- Norton DNS: `198.153.192.1` `198.153.194.1`
- Norton ConnectSafe DNS: `199.85.126.20` `199.85.127.20`
---
@rail01
rail01 / Public_Polish_NTP_Servers.md
Last active April 25, 2024 14:45
List of publickly accessible NTP time servers in Poland

Below is the list of publickly accessible NTP time servers located in Poland, along with their hostnames, IP addresses, Stratum levels, AS numbers and contact information.

List consists of trustworthy sources such as government agencies, scientific organizations, ISPs or major infrastructure providers. STRATUM 1 and 2.

If you're looking to use any of those NTP servers in business-critical production environment, please consider obtaining time from a time source directly, e.g. via GPS receiver or caesium atomic clock.

List

Host organization Hostname(s) IPv4 IPv6 STRATUM ASN Contact information
Główny Urząd Miar (Central Office of Measures) tempus1.gum.gov.pl tempus2.gum.gov.pl 194.146.251.100 194.146.251.101 N/A 1 AS50606 time@gum.gov.pl
@leosaa
leosaa / chronycfreebsd.md
Last active April 22, 2024 16:57
Chronyc in FreeBSD

Install chrony in FreeBSD

chrony is a versatile implementation of the Network Time Protocol (NTP). It can synchronise the system clock with NTP servers. Chrony is an accurate network time daemon and an alternate implementation of the Network Time Protocol (NTP) compared to ntp.org's NTPd.

Chrony has quite a few advantages over the other NTP implementations, check the chrony ntp comparison page for more details.

Installing

FreeBSD 12 supports Chrony v3.5 which allows privilege separation. The installer will create the user chronyd. So the Chrony daemon will running as the the unprivileged user chronyd

@mschep
mschep / bird2.conf
Last active January 30, 2024 19:55
BIRD 2 configuration including RPKI
# Very minimal BIRD2 configuration with RPKI enabled
log syslog { info, remote, warning, error, auth, fatal, bug };
log "/var/log/bird.debug.log" { debug, remote, trace };
router id 193.0.31.28;
protocol device {
}
@mortonfox
mortonfox / publicdns.md
Last active August 28, 2023 03:43
[Public DNS servers] #dns #net

OpenDNS

208.67.222.222
208.67.220.220

2620:0:ccc::2
2620:0:ccd::2

Google DNS

@roge
roge / dns.md
Last active August 6, 2023 07:32
Public DNS Servers

DNS.md

A list of reasonably reliable DNS servers that I've personally tested to ensure that they fully support DNSSEC and do not hijack NXDOMAIN responses.

IPv4

Address Organization Location Service
8.8.8.8 Google Worldwide (Anycast) Google Public DNS
8.8.4.4 Google Worldwide (Anycast) Google Public DNS
@dynax60
dynax60 / subnets.pl
Created February 3, 2023 09:15
Script to get subnets in CIDR notation for the selected countries
#!/usr/bin/perl
# dnf install perl-Net
# wget ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.inetnum.gz
# wget https://ftp.apnic.net/apnic/whois/apnic.db.inetnum.gz
# zcat ripe.db.inetnum.gz | ./subnets.pl RU BY
# zcat apnic.db.inetnum.gz | ./subnets.pl MN
use Net::CIDR qw(range2cidr);
use Symbol;
use strict;
@binarykore
binarykore / whois.php
Created September 16, 2022 04:48
WhoIS Servers
private $_servers = [
"ac" => "whois.nic.ac",
"ae" => "whois.aeda.net.ae",
"aero" => "whois.aero",
"af" => "whois.nic.af",
"ag" => "whois.nic.ag",
"al" => "whois.ripe.net",
"am" => "whois.amnic.net",
"as" => "whois.nic.as",
"asia" => "whois.nic.asia",
@bencevans
bencevans / tld2whois.json
Created November 3, 2012 01:08
TLD -> WHOIS Server in JSON (Originally from http://www.nirsoft.net/whois_servers_list.html)
{
"ac":"whois.nic.ac",
"ae":"whois.nic.ae",
"af":"whois.nic.af",
"ag":"whois.nic.ag",
"al":"whois.ripe.net",
"am":"whois.amnic.net",
"as":"whois.nic.as",
"at":"whois.nic.at",
"au":"whois.aunic.net",