Skip to content

Instantly share code, notes, and snippets.

View jesusprubio's full-sized avatar
🏴‍☠️

Jesús Rubio jesusprubio

🏴‍☠️
View GitHub Profile
@johnjeffers
johnjeffers / ubuntu-20.04-macbook-pro.md
Created May 31, 2020 00:21
Ubuntu 20.04 on a 15" Retina MacBook Pro (Mid-2014)

Ubuntu 20.04 on a 15" Retina MacBook Pro (Mid-2014)

These are notes from my efforts to get Ubuntu 20.04 installed on my older MacBook Pro. I'm making this gist public in the hopes that it's helpful to others.

I did a Minimal install, but selected the option to install additional 3rd-party drivers.

Wifi doesn't work during the install (because it requires a 3rd-party driver), so you won't be able to choose to download updates while installing. No big deal, run a software update after the install.

The installer takes about 25 minutes to complete. Post-install, most things work. The only driver I had to manually install was for the FaceTime camera. More on that below.

@julianxhokaxhiu
julianxhokaxhiu / create-iso.sh
Created September 24, 2016 21:46
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
#!/bin/bash
#
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
# Adapted to work with the official image available into Mac App Store
#
# Enjoy!
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
@nixpulvis
nixpulvis / proxy.rs
Last active November 29, 2018 13:09
// extern crate take5;
// extern crate remote;
use std::io::{Read, Write};
use std::net::{SocketAddr, TcpStream, TcpListener, Shutdown};
use std::thread;
use std::time::Duration;
use std::sync::{Arc, Mutex};
// use take5::player::AiPlayer;
// use remote::Client;
Security - the elephant in the room. Everyone agrees that it is very important but few takes it seriously. We at RisingStack want you to do it right - this is why we have put together this checklist to help you guide through the must have security checks before your application is enabled to thousands of users/customers.
Most of these items are general and applies to all languages and frameworks not just Node.js - however some of the tools presented are Node.js specific. You should also check our introductory Node.js security blogpost.
Configuration Management
Security HTTP Headers
There are some security-related HTTP headers that your site should set. These headers are:
@cef62
cef62 / gist:97323b13bf4a1fdbe650
Created November 7, 2015 20:12 — forked from whisher/gist:d6e3db7c11d632720133
Hapijs brute force mitigation
'use strict';
/**
* Module dependencies.
*/
const Hoek = require('hoek');
const Limiter = require('ratelimiter');
const RedisClient = require('../utils/redis');
const ReplyUtil = require('../utils/reply');
@transitive-bullshit
transitive-bullshit / logger.js
Last active February 18, 2024 21:32
winston logger with filename:linenumber
// NOTE: this adds a filename and line number to winston's output
// Example output: 'info (routes/index.js:34) GET 200 /index'
var winston = require('winston')
var path = require('path')
var PROJECT_ROOT = path.join(__dirname, '..')
var logger = new winston.logger({ ... })
// this allows winston to handle output from express' morgan middleware
@Yimiprod
Yimiprod / difference.js
Last active April 5, 2024 13:17
Deep diff between two object, using lodash
/**
* This code is licensed under the terms of the MIT license
*
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
@nstarke
nstarke / nodejs-security-vulnerability-grep.sh
Last active January 25, 2023 05:44
Node.js Security Vulnerability Grep
# this command will return instances where the child_process module is loaded.
# that module is generally a good signal that the application is shelling out
egrep -r --exclude-dir "node_modules" --include "*.js" --exclude "*.min.*" -e "require(\s*)\((\s*)'child_process'(\s*))" .
# this command will return instances where code is dynamically executed.
egrep -r --exclude-dir "node_modules" --include "*.js" --exclude "*.min.*" -e "eval(\s*)\(" .
# this command will check common dangerous functions and report when strings are arguments
egrep -r --exclude-dir "node_modules" --include "*.js" --exclude "*.min.*" -e "(setInterval|setTimeout|new(\s*)Function)(\s*)\((\s*)\".*\"" .
@boboldehampsink
boboldehampsink / ios_disable_push_notifications.js
Created March 17, 2015 15:11
Cordova - after_platform_add hook to disable push notifications code
#!/usr/bin/env node
var GCC_PREPROCESSOR_DEFINITIONS = '"$(inherited) DISABLE_PUSH_NOTIFICATIONS=1"';
var fs = require("fs");
var path = require("path");
var xcode = require('xcode');
var projectRoot = process.argv[2];
function getProjectName(protoPath) {
@ericelliott
ericelliott / essential-javascript-links.md
Last active April 22, 2024 10:15
Essential JavaScript Links