Skip to content

Instantly share code, notes, and snippets.

View ianhenrysmith's full-sized avatar
🆒

Ian Smith ianhenrysmith

🆒
View GitHub Profile
@rdump
rdump / Technicolor C2100T DSL modem real DNS.md
Last active April 30, 2024 16:42
Configuring the Centurylink-sold Technicolor C2100T DSL modem to use real DNS

Configuring the Centurylink-sold Technicolor C2100T DSL modem to use real DNS

Here's how to get real DNS set up on a Technicolor C2100T modem. This works at minimum when you're doing PPPoE (the usual method) on a C2100T modem sold or rented to you by Centurylink.

Motivation

When you look up a nonexistent domain name, proper DNS service tells you it doesn't exist by returning Nonexistent Domain (NXDOMAIN).

In contrast, even on business lines, Centurylink's DNS service will snipe NXDOMAIN. Centurylink's servers (nameservers at 205.171.2.25 & 205.171.3.25 at least) return a Centurylink web server IP addresses when you should be getting NXDOMAIN.

@ianhenrysmith
ianhenrysmith / salesforce_data_generator.rb
Last active July 6, 2017 18:46
generate leads or contact data for salesforce testing purposes. defaults to 100 contacts. to run, just do a `ruby ./salesforce_data_generator.rb lead 10`, or with whatever args you want. make sure to do a `gem install faker` first. works in ruby 2.4
require "faker"
require "csv"
def contact_row
[
first_name,
last_name,
email,
title,
birthday
# bundle exec rake wikiseed:star_wars SUBDOMAIN=jammies COUNT=1
require 'open-uri'
require 'nokogiri'
namespace :wikiseed do
TYPE_MAPPINGS = {
wikipedia: {
category: 'Wikipedia',
url: 'https://en.wikipedia.org/wiki/Special:Random',
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@djaiss
djaiss / gist:85a0ada83e6bca68e41e
Last active September 30, 2025 06:54
Block Twitter/Facebook in your /etc/hosts
# Block Facebook IPv4
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 login.facebook.com
127.0.0.1 www.login.facebook.com
127.0.0.1 fbcdn.net
127.0.0.1 www.fbcdn.net
127.0.0.1 fbcdn.com
127.0.0.1 www.fbcdn.com
127.0.0.1 static.ak.fbcdn.net
@ianhenrysmith
ianhenrysmith / ivona.rb
Created April 4, 2014 19:08
Ivona Api Interaction
module Service
class IvonaCookie
require 'digest/md5'
require 'json'
require 'faraday'
EMAIL = '<email>'
REST_API_PATH = 'api/saas/rest'
API_KEY = '<api key>' # for ivona
@ianhenrysmith
ianhenrysmith / autoupdating_form.coffee
Created February 8, 2013 16:46
Autosaving form in Coffeescript
# form should have class 'autoupdate' and should have data-remote set to true
$(".autoupdate input").live("paste keyup change blur", () ->
@$this = @$this || $(this)
@$form = @$form || @$this.closest("form")
@val = @$this.val()
unless @val == @old_val
@old_val = @val
queue_save(@$form)
)
@ianhenrysmith
ianhenrysmith / ruby_refactor.rb
Created January 21, 2013 16:20
Ruby refactoring
# from szaby (https://github.com/icebreaker)
# "Sometimes it's nice and cleaner to just use a block instead of having an explicit if statement
# when caching an operation that has multiple statements in a member variable."
# original
def client
if @client.blank?
@client = Client.new
@client.turn_on_x()
end
@ianhenrysmith
ianhenrysmith / dropdown.jst.hamlc
Created January 21, 2013 16:10
Bootstrap hamlc dropdown helper
.dropdown{ class: @options.class }
%input.dropdown_target{ type: "text", name: @field, id: @field, value:"#{@value}"}
%span.dropdown-toggle= @value
%ul.dropdown-menu{ role:"menu"}
- for opt in @values
%li.dropdown_item{v: opt}= opt
@ianhenrysmith
ianhenrysmith / meyer_reset_sass
Last active December 10, 2015 18:38
Meyer CSS reset in Sass
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td
margin: 0
padding: 0
border: 0
outline: 0
font-weight: inherit
font-style: inherit
font-size: 100%
font-family: inherit
vertical-align: baseline