Skip to content

Instantly share code, notes, and snippets.

View n1zyy's full-sized avatar
:octocat:

Matt Wagner n1zyy

:octocat:
View GitHub Profile
@n1zyy
n1zyy / essentials.md
Last active November 11, 2021 04:28
The Essentials on Various Distros

There's a core set of packages I just expect to be present on any *nix box I use.

Debian

apt-get install man wget curl vim traceroute bind9-dnsutils chrony

vim on Debian will turn on visual mode when you highlight text. This drives me bonkers. You can disable it with :set mouse-=a in vim, or without the leading : by putting it in ~/.vimrc. (Source).

Configure Chrony with a few hosts from https://support.ntp.org/bin/view/Servers/StratumOneTimeServers if this will be in the NTP pool. Otherwise the default is usually pretty good.

@n1zyy
n1zyy / comcast_ntp.md
Created May 17, 2021 14:28
Comcast NTP servers

Comcast doesn't know it, but the last comment in this forum post reveals that time.comcast.com and time.xfinity.com are pools of NTP servers that Comcast operates. (time.xfinity.net doesn't work.)

time.comcast.com

% /usr/local/Cellar/ntp/4.2.8p15/sbin/ntpdate -q time.comcast.com
server 2001:558:fee0:833b:96:114:29:7, stratum 2, offset +0.019681, delay 0.11285
server 2001:558:1004:3:68:87:66:59, stratum 2, offset -0.046284, delay 0.23793
server 2001:558:fe14:16:68:87:31:7, stratum 2, offset +0.002472, delay 0.04906
server 2001:558:fe14:65:68:87:102:164, stratum 2, offset -0.060830, delay 0.18040
server 2001:558:fe16:31:68:87:51:132, stratum 2, offset -0.009330, delay 0.31607
@n1zyy
n1zyy / time.apple.com.md
Last active March 28, 2023 01:56
Apple NTP servers

Apple runs a fleet of stratum 1 NTP servers at time.apple.com. In my experience, ntpd/chronyd are very happy with them.

It looks like, instead of doing anycast, they maybe use DNS to steer you to the closest one.

time.apple.com is a CNAME for time-osx.g.aaplimg.com. Querying a handful of DNS servers, I've identified the following locations:

IP Hostname Location
17.253.2.125 usdal4-ntp-001.aaplimg.com. Dallas
@n1zyy
n1zyy / trackers.md
Last active February 6, 2024 22:48
Live Torrent Trackers

I was hacking on a little side-project, and found that most lists of torrent trackers are full of defunct trackers, or lots of dupes. I spent a while going through all the lists on the first few pages of Google, compiling them into a giant list, de-duping it, and then writing some quick code to test all of them.

Also, an aside: "/announce" on the end of a UDP URL doesn't make any sense. It's completely ignored at the protocol level, so I normalized entries by removing it.

I don't endorse any of these trackers, nor suggest you use them for committing copyright infringement.

Straight list

These trackers all respond to at least some scrape queries:

@n1zyy
n1zyy / gist:9cde567fb9d7d0404ac2
Created July 7, 2015 03:03
Variation of if_modified_since WP plugin to updated Last-Modified based on most recent comment
/* Do Not Change Anything here */
add_action('template_redirect', 'ism_add_last_modified_header');
function ism_add_last_modified_header($headers) {
//Check if we are in a single post of any type (archive pages has not modified date)
if( is_singular() ) {
$post_id = get_queried_object_id();
if( $post_id ) {
$comments = get_comments(array(
@n1zyy
n1zyy / gist:fee0a53e60ebf532ba5e
Created December 7, 2014 19:26
Half-assed GeoIP center-finder
geos = {}
places.each do |p|
puts "Geocoding #{p}..."
geo = Geocoder.search(p)
geos[p] = {
:lat => geo.first.latitude,
:long => geo.first.longitude
}
puts " Found #{geos[p].inspect}"
end
@n1zyy
n1zyy / gist:9838658
Created March 28, 2014 17:47
Testing Ironic IPMI serial-over-LAN

Setup

  • Make sure ipmitool and shellinabox are installed. That seems obvious, but I forgot to install ipmitool on the Ironic server I used for testing and it took me a bit to figure out.
  • After applying https://review.openstack.org/#/c/64100/ you'll need to restart ironic-api and ironic-conductor. I didn't see them as system services, so I just kill'ed the process and restarted it each time.
  • Register a node with ironic node-create as usual, but specifying these additional parameters
  • ipmi_terminal_port
  • ipmi_username
  • ipmi_address
  • ipmi_password
  • Do all the other normal setup
  • Check that ironic node-validate $NODE includes console: True
@n1zyy
n1zyy / gist:5044734
Last active December 14, 2015 06:39
Sheraton Mahwah's WTF Internet

Since I couldn't really use the network at my hotel, I spent some time poking around how it was so horribly broken.

Speed

Speedtest Result

Nameservers

$ grep ^nameserver /etc/resolv.conf
nameserver 172.16.2.5
@n1zyy
n1zyy / gist:4957377
Last active December 13, 2015 18:39
3.2.12 habtm breakage; after moving to 3.2-stable

Cucumber failures

Failing Scenarios:
cucumber features/deployment.feature:29 # Scenario: Launch new deployment
cucumber features/deployment.feature:47 # Scenario: Launch new deployment over XHR
cucumber features/deployment.feature:66 # Scenario: Validate Deployment when creating new
cucumber features/deployment.feature:221 # Scenario: Launch a deployment which is not launchable
cucumber features/deployment.feature:234 # Scenario: Verify that the launch parameters are displayed
cucumber features/deployment.feature:252 # Scenario: Verify that the launch parameters are required
@n1zyy
n1zyy / gist:2898237
Created June 8, 2012 21:42
Deltacloud failure on F17
[root@dhcp-187-232 ~]# service deltacloud-core status
deltacloud-core.service - LSB: Deltacloud Core API deamon
Loaded: loaded (/etc/rc.d/init.d/deltacloud-core)
Active: active (exited) since Fri, 08 Jun 2012 17:35:17 -0400; 2min 44s ago
CGroup: name=systemd:/system/deltacloud-core.service
[root@dhcp-187-232 ~]# service deltacloud-core restart
Restarting deltacloud-core (via systemctl): [ OK ]
[root@dhcp-187-232 ~]# service deltacloud-core status
deltacloud-core.service - LSB: Deltacloud Core API deamon