- stop your vm & backup your disk
cp hdd.img hdd-backup.img
- resize the disk image
hdiutil resize -size [size]g hdd.img
- boot into linux and run
sudo parted /dev/[disk]
- if your swap partition is in the way (located immediately following your primary parition), delete & recreate it
rm [disk id of swap partition]
mkpartfs primary linux-swap
- start should be 1 gb away from end of disk
- end should be end of disk
- save and quit, reboot
- verify that the new swap is active
swapon -s
-- if not thenmkswap /dev/[disk][partition id]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var genius = /genius/i | |
// prevent genius.it/[your site] | |
if (genius.test(document.referrer) || genius.test(window.location.href)) { | |
document.location = 'https://stopitgenius.xyz' | |
} | |
// prevent the bookmarklet | |
var setAttribute = window.HTMLElement.prototype.setAttribute | |
window.HTMLElement.prototype.setAttribute = function (attr, val) { | |
if ((attr === 'src' || attr === 'href') && genius.test(val)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
09:19:14 ~/src/test | |
↳ cat package.json | |
{ | |
"name": "src", | |
"scripts": { | |
"test": "which tap" | |
}, | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var fs = require('fs'); | |
var path = require('path'); | |
var readdirp = require('readdirp') | |
module.exports = function(baseDir, outFile) { | |
var files = []; | |
var output = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while true; do | |
trap "exit 0" SIGINT | |
CEIL=10 | |
timeout=0 | |
ip link show eth0 | grep UP > /dev/null | |
ISUP=$? | |
let "timeout = $RANDOM % $CEIL + 1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
express:router:route new /ep/settings | |
express:router:layer new /ep/settings | |
express:router:route get /ep/settings | |
express:router:layer new / | |
express:router:route post /ep/settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var http = require('http'); | |
var socketio = require('socket.io'); | |
var app = express(); | |
var server = http.Server(app); | |
var io = socketio(server); | |
server.listen(3001); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var socketio = require('socket.io'); | |
var express = require('express'); | |
var http = require('http') | |
var app = express(); | |
var server = http.Server(app); | |
var io = socketio(server); | |
app.listen(3000); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var queue = [], | |
running = false; | |
function addToQueue(job){ | |
queue.push(job); | |
processJob(); | |
} | |
function processJob(){ | |
var job; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var running = false; | |
var myfunction = function(){ | |
if(running) return; | |
running = true; | |
doSomethingForAWhile(function(){ | |
running = false;' | |
}); | |
// OR | |
for(var i = 0; i < 100000000; i++){ |