Skip to content

Instantly share code, notes, and snippets.

View ruyadorno's full-sized avatar

Ruy Adorno ruyadorno

View GitHub Profile
@ruyadorno
ruyadorno / yeoman_grunt_run
Created June 10, 2014 14:51
Running grunt inside a yeoman generator test
var getGrunt = function () {
var grunt = require(path.join(__dirname, 'temp/node_modules/grunt'));
grunt.option('gruntfile', path.join(__dirname, 'temp/Gruntfile.js'));
return grunt;
};
// Running the test task inside a describe/it block:
getGrunt().tasks(['test'], {}, callback_fn);
@ruyadorno
ruyadorno / gist:9f1ecb0aa48f1e1ec404
Last active August 29, 2015 14:05
Get yeoman option from command-line
var yeoman = require('yeoman-generator');
var argv = require('minimist')(process.argv.slice(2));
module.exports = yeoman.generators.Base.extend({
constructor: function (args, options) {
if (options['module-name']) {
// don't really remember why getting from argv with an options fallback
this.moduleName = argv['module-name'] || options['module-name'];
} else {
// Get a reference to origin func
var _exit = process.exit;
// Monkey patch it to a local func
process.exit = function () {
assertStuff();
};
// Release monkey patching
process.exit = _exit;
@ruyadorno
ruyadorno / osx_setup.md
Last active March 12, 2024 03:23 — forked from millermedeiros/osx_setup.md
Guide for setting up a new osx

Setup Mac OS X

This is just a personal script to help me remember all the steps required to setup a new osx machine in their correct order. I do not advise you to follow this guide if you don't know what you're doing.

Setup

0. Setup iCloud

// everyone's better of using a proper solution: https://github.com/Automattic/util-inspect
export function traceme(obj, depth) {
if (depth===0) return;
for (var key in obj) {
if (obj[key] && obj[key].constructor.prototype === Array.prototype) obj[key] = obj[key].toString();
var value = typeof obj[key] === 'object' && obj[key] !== null ? traceme(obj[key], depth-1) : obj[key];
console.log(key + ': ' + value);
}
}
@ruyadorno
ruyadorno / setup.md
Last active July 17, 2017 18:48 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX

How to set up Git GPG signed commits

1. Generate GPG key

https://help.github.com/articles/generating-a-new-gpg-key/

  • PS: During latest setup homebrew ended up installing gpg as gpg2, that requires some very minor tweaks and of course making sure the commands use gpg2 instead of gpg
  • PS2: Make sure to save key to 1 Password or equivalent

2. Add key to Github account

@ruyadorno
ruyadorno / install-arch-linux-on-a-raspberrypi.md
Last active May 17, 2021 12:11
Install Arch Linux on a RaspberryPi
@ruyadorno
ruyadorno / Secure Linux Server.md
Last active July 23, 2023 00:16
Tips on how to secure a linux server

SSH:

  • Disable root login
  • Disable password authentication
  • Use sudo-based privilege separation
  • Use public key authentication (ECDSA, Ed25519, etc...)
  • (Optional) Store key on smartcard
  • (Optional) Use a two-factor system such as Duo
  • (Optional) Change port of SSH to non-default (this is security by obscurity, but it deters most automated attacks, although this shouldn't matter if you're using key-based auth).

Firewall:

[{"ts":1.6284000000005108,"k":"S"},{"ts":2.0466000000005806,"k":"h"},{"ts":2.1275000000005093,"k":"e"},{"ts":2.2127000000000407,"k":" "},{"ts":2.396600000000035,"k":"c"},{"ts":2.482600000000275,"k":"a"},{"ts":2.5471999999999753,"k":"m"},{"ts":2.701799999999821,"k":"e"},{"ts":2.7775000000001455,"k":" "},{"ts":2.896099999999933,"k":"a"},{"ts":3.0354999999999563,"k":"c"},{"ts":3.2236000000002605,"k":"r"},{"ts":3.4023999999999432,"k":"o"},{"ts":3.578400000000329,"k":"s"},{"ts":3.7169000000003507,"k":"s"},{"ts":3.876100000000406,"k":" "},{"ts":4.024600000000646,"k":"t"},{"ts":4.090900000000147,"k":"o"},{"ts":4.151300000000447,"k":" "},{"ts":4.2984000000005835,"k":"h"},{"ts":4.370700000000397,"k":"i"},{"ts":4.49369999999999,"k":"m"},{"ts":4.704400000000533,"k":","},{"ts":4.766500000000633,"k":" "},{"ts":4.899300000000039,"k":"a"},{"ts":4.966400000000249,"k":"d"},{"ts":5.014299999999821,"k":"n"},{"ts":5.9265000000004875,"k":"n"},{"ts":5.975300000000061,"k":"d"},{"ts":6.023299999999836,"k":" "},{"ts":6.19830000000001
@ruyadorno
ruyadorno / v14.x-diff.md
Last active November 24, 2020 21:47
branch-diff v14.x-staging upstream/v15.x --exclude-label semver-major,semver-minor,dont-land-on-v14.x,backport-requested-v14.x,backported-to-v14.x,backport-blocked-v14.x,backport-open-v14.x,baking-for-lts --filter-release