Skip to content

Instantly share code, notes, and snippets.

path=$1
user=$2
host=$3
cat $1 | ssh $2@$3 'cat>> ~/.ssh/authorized_keys'
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d;/^linux-\(headers\|image\)/!d'
after this command remove the listed packages with:
sudo apt-get -y purge <package>
function parseUrl(uri) {
// @source http://jsperf.com/url-parsing/34
var matches = /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/.exec(uri);
return {
href: uri || '',
host: matches[10] || '',
hash: matches[17] || '',
port: matches[12] || '',
origin: (matches[4] || '') + (matches[5] || '') + (matches[10] || ''),
search: matches[16] || '',
function forEach(list, callback) {
var keys = Object.keys(list);
var index = -1;
var length = keys.length >>> 0;
while (++index < length) {
callback(list[keys[index]], keys[index], list);
}
}
function forEach(list, callback) {
var index = -1;
var length = list.length >>> 0;
while (++index < length) {
callback(list[index], index, list);
}
}
function functionArguments(fn) {
if (fn.length > 0) {
var fnString = Function.prototype.toString.call(fn);
var firstIndex = fnString.indexOf('(');
var lastIndex = fnString.indexOf(')');
if (firstIndex > -1 && lastIndex > firstIndex) {
firstIndex++;
return fnString.substr(firstIndex, lastIndex - firstIndex).replace(/\s+/g, '').split(',');
function stacktrace() {
var stack;
function trace(fn) {
return (typeof fn !== 'function')
? []
: trace(fn.caller).concat([fn.toString().split('(')[0].substring(9)]);
}
try {
function bind(fn, context) {
var givenArguments = [];
for (var _i = 2; _i < arguments.length; _i++) {
givenArguments[_i - 2] = arguments[_i];
}
if (typeof Function.prototype.bind == "function") {
return Function.prototype.bind.apply(fn, Array.prototype.concat.apply([context], givenArguments));
}
function stacktrace() {
var stack;
function trace(fn) {
return (typeof fn !== 'function')
? []
: trace(fn.caller).concat([fn.toString().split('(')[0].substring(9)]);
}
try {
function getFunctionName(fn) {
if (typeof fn.name === 'string') {
return fn.name;
}
var fnString = fn.toString();
var firstBracket = fnString.indexOf('(');
return fnString.substr(9, (firstBracket - 9));
}