Skip to content

Instantly share code, notes, and snippets.

View ruyadorno's full-sized avatar

Ruy Adorno ruyadorno

View GitHub Profile
@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:

@ruyadorno
ruyadorno / install-arch-linux-on-a-raspberrypi.md
Last active May 17, 2021 12:11
Install Arch Linux on a RaspberryPi
@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

// 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 / 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

// 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 / 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 {
@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);