Can check if you're using swap with sudo swapon --show
and free -h
.
Useful for t2.micro and other instances with no access to instance store. Use this if you prefer not to mess with the root volume.
- Create the EBS volume e.g., 1 GB.
(function (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |
I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.
I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.
Chrome 51 has some pretty wild behaviour related to console.log
in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.
{ | |
// -------------------------------------------------------------------- | |
// JSHint Configuration, Strict Edition | |
// -------------------------------------------------------------------- | |
// == Enforcing Options =============================================== | |
// | |
// These options tell JSHint to be more strict towards your code. Use | |
// them if you want to allow only a safe subset of JavaScript, very |
var str = "The quick brown fox jumped over the box like an ox with a sox in its mouth"; | |
str.match(/\w(ox)/g); // ["fox", "box", "sox"] | |
// match (when used with a 'g' flag) returns an Array with all matches found | |
// if you don't use the 'g' flag then it acts the same as the 'exec' method. | |
str.match(/\w(ox)/); // ["fox", "ox"] | |
/\w(ox)/.exec(str); // ["fox", "ox"] |
$ComputerName = "New Name" | |
Remove-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "Hostname" | |
Remove-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "NV Hostname" | |
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Computername\Computername" -name "Computername" -value $ComputerName | |
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Computername\ActiveComputername" -name "Computername" -value $ComputerName | |
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "Hostname" -value $ComputerName | |
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "NV Hostname" -value $ComputerName | |
Set-ItemProperty -path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -name "AltDefaultDomainName" -value $ComputerName |