Skip to content

Instantly share code, notes, and snippets.

View Reggino's full-sized avatar

Tim de Koning Reggino

View GitHub Profile
@bregenspan
bregenspan / gist:33f7791a78f6e4115af5
Created September 29, 2015 13:41
Sort Webpack analyze tool chunk list (e.g. http://webpack.github.io/analyse/#chunk/31) by size
var table = document.querySelectorAll('tbody')[1];
Array.prototype.slice.apply(table.querySelectorAll('tr')).forEach(function (el) {
var size = el.querySelector('td:nth-of-type(3)').innerHTML;
var num = parseInt(size,0);
if (size.indexOf('KiB') > -1) {
num = num * 1024;
}
el.setAttribute('data-size', num);
})
@royteusink
royteusink / change-sequence.js
Last active October 7, 2020 06:32
immutable.js - Move item in List to a specific location (change sequence, reorder)
if (action.toindex < 0) return state;
var olditem = state.get(action.index);
var newlist = state.delete(action.index).insert(action.toindex, olditem);
return newlist;
@plembo
plembo / add-search-domain-nm-ubuntu.md
Last active November 18, 2024 08:51
Add search domain under Ubuntu 18.04 LTS and later NetworkManager

Add a search domain under NetworkManager on Ubuntu Desktop 18.04 LTS and later (ipv4)

In older versions of the NetworkManager gui there was a field for the search domain to be written into /etc/resolv.conf, but it was dropped by the time Ubuntu 18.04 LTS shipped. You can add it by editing the system-connections file directly, but running the appropriate nmcli commands is the right way to do it. Note that Ubuntu Server 18.04, which use netplan and systemd-networkd by default, is completely different. Ubuntu 20.04 involves even more variation (see comments below). It's enough to drive someone to Debian proper...

Basic wired networking

First, get the name of the interface you want to set a search domain on:

$ nmcli con show