Skip to content

Instantly share code, notes, and snippets.

View GSchutz's full-sized avatar

Guilherme Schutz GSchutz

View GitHub Profile
@GSchutz
GSchutz / one_volume_multiple_drives.md
Last active November 19, 2017 03:57
One volume with multiple drives

One Volume (with multiple drives)

This steps are based on this answer https://askubuntu.com/a/7841/153797.

We want to join more SSDs to make appear as one single volume, at were we keep the home folder of the server.

  • Samsung (sda 931.5G)
  • ScanDisk (sdc 447.1G)

Make an LVM volume with both

/**
* Method for create recursively (tree) structure in self referenced mongoose
* Model
*
* @param {constructor} model A mongoose.model instance for schema
* validation
* @param {Object} obj The plain object to be inserted
* @param {String} field The field of the obj/Model
*
* @return {model} An instance of the Model 'model'
@GSchutz
GSchutz / ca-ufsc.R
Last active November 11, 2016 18:27
X <- c(1:1000000)
rand <- function(i=0,s=10)
{
return(as.integer(runif(1,i,s)))
}
# cenário
cenario <- function()
{
@GSchutz
GSchutz / NueForm.improve.js
Last active August 29, 2015 14:22
An idea for a form generator for angularJS that uses HTML and JavaScript, but not removing HTML code, just reducing (for free styling), and absctracting JS events, and angular validation.
$NueFormProvider.config({
messages: {
myOwnValidation2: function(ret) {
// ret is the returned value from the validation method 'myOwnValidation2'
if (ret > 50)
return "A senha é muito forte.";
if (ret > 40)
return "A senha é forte.";
if (ret > 30)
return "A senha é fraca.";