Sin categoría

Modify Mazda infotainment system, screen mirror

Posted on Actualizado enn

Go to hidden menu:

  1. press and hold: music+fav+mute
  2. Press and hold: del until you see “JCI-    test mode”
  3. Write 11 until you see “JCI_TESTID1-Not started”
  4. “Choose a script would like to run”, be careful to avoid pressing “display toggle” or you can get a black screen.
  5. If you get black screen you need to create this script, put it on a usb 32 fat device#! /bin/sh
    echo 1 > /sys/class/gpio/Watchdog\ Disable/value
    mount -o rw,remount //jci/scripts/set_display_config.sh visteon

    reboot

  6. Press next and the press “WIFI AP TOGGLE”, you will get “wifi has been toggled:ON”
  7. Then exit

On a pc, connect to CMU:XX.XX.XX

    1. Using winscp or similar connect to 192.168.53.1 / root / jci
    2. After that you are connect to infotainment
    3. Open a terminal
    4. run this script to modify files:            mount -o rw,remount /
    5. if you want to disable speed restriction to touch screen run this, you will lose the navigation stuff:

/jci/scripts/set_lvds_speed_restriction_config.sh disable
/jci/scripts/set_speed_restriction_config.sh disable

  1. Now unblock the wife
  2. Edit this file:             jci/gui/apps/syssettings/js/syssettingsApp.js
  3. and modify the if stuff to go inside the condition with something like this
  4.  //if((region != (framework.localize.REGIONS[‘NorthAmerica’]) && (region != (framework.localize.REGIONS[‘Japan’]))))
    {//wi-fi is not avaiable in Japan and NorthAmerica region
    items.push({
  5. reboot the system with: mute+nav+back, after that you can see “wifi” on “menu devices”, “settings”

Download this app MMP: https://drive.google.com/file/d/0BzYrm7MuzjGRM0lpYmpfNVVyQkU/view?usp=sharing

  1. Only works on android 5+, enable unkwoun source, debbuging usb, enable share internet, go to your mazda and connect to your phone, watch for the ip of your mazda you will need it soon
  2. In the mazda pair your phone by bluetooth, then in your phone open the MMP app connect it by usb to the mazda  plug, write the ip, leave root, ***, 5000, connect and screen mirror. That is it.

*version 55

You also can enable the speed restriction on the hidden menu pressing

 

 

http://mazdateammexico.com/index.php?topic=17253.0

Anuncios

Seguridad General en BD, Seguridad Específica en MongoDB

Posted on Actualizado enn

La conferencia se divide en:

  • Seguridad general.
  • BD NoSql (documentales, clave valor, columna y de grafos).
  • Seguridad General en BD.
  • Seguridad Específica en BD NoSql (MongoDB)
  • Demo
    • MongoDB
      • Instalación
      • Usar MongoDB la autentificación
      • Crear Usuarios
      • Asignar Roles y Privilegios para usuarios
    • AWS
      • EC2
      • Security group
    • RoboMongo

En mi canal (por si en algún momento borran el oficial)

En el canal de Campus Party

Add channels to Roku

Posted on Actualizado enn

Create an app for Roku
*1. Download the https://sdkdocs.roku.com/display/sdkdoc/Playing+Videos#PlayingVideos-BroadcastVideo “VideoList.zip”
*2. Modify the videocontent.xml
*3. url = “http://xxx.xx.x.x/series/games/thrones.tp2x04.mp4″/>
*4. Create again the zip with the manifest at root
5. In my Roku I did this
To enable development mode, enter the special remote control sequence: Home 3x, Up 2x, Right, Left, Right, Left, Right. The entire sequence must be entered within 10 seconds.
*6. Go to my ip 192.168.0.x  [rokudeve / pass ****] and uploaded the zip file, like developer

https://sdkdocs.roku.com/display/sdkdoc/Loading+and+Running+Your+Application

1. Open a putty console and 192.168.0.x / 8080 / telnet, and wrote that, genkey twice, it generates a password and developerid
https://sdkdocs.roku.com/display/sdkdoc/Roku+Billing+and+In-Channel+Purchasing

2Lxxx344 (Roku T)
>genkey
Command not recognized
>genkey
……………………..+++
……………………………………………………………………………….+++
Password: w7lxxCNw==
DevID: e40axx87b
>

*2. Go to packager at right upper corner, write the password you create before, Download the pkg

https://developer.roku.com/developer-channels/channels/

*1. Sdk / private
*2. Video
*3. Add 504×405 jpg file
*4. Add the pkg you already created
*5. Submit for publishing
*6. Access code add
Another link: http://mkvxstream.blogspot.com/2016/03/how-to-create-roku-channel-part-four.html

*second time

 

SOLID – object oriented design

Posted on Actualizado enn

S.O.L.I.D is an acronym for the first five object-oriented design(OOD) principles by Robert C. Martin. [herencia, composición, abstracción, encapsulamiento o polimorfismo].

  • S – Single-responsiblity principle
  • O – Open-closed principle
  • L – Liskov substitution principle
  • I – Interface segregation principle
  • D – Dependency Inversion Principle

Single-responsibility Principle

Single-responsability: Each object must have only one responsability

As an example, consider a module that compiles and prints a report. Imagine such a module can be changed for two reasons. First, the content of the report could change. Second, the format of the report could change. These two things change for very different causes; one substantive, and one cosmetic. The single responsibility principle says that these two aspects of the problem are really two separate responsibilities, and should therefore be in separate classes or modules. It would be a bad design to couple two things that change for different reasons at different tim

Open/Close: Objects open for extension, closed for modification.
La forma más común de seguir el principio OCP es usar interfaces o clases abstractas de las que dependen implementaciones concretas. De esta forma puede cambiarse la implementación de la clase concreta manteniéndose la interfaz intacta.

https://www.adictosaltrabajo.com/tutoriales/solid-2/

Liskov Substitution: subclass/derived class should be like base/parent class.
Shell

class InterfazVehiculo{
function acelerar();
}

class Camion{
function acelerar() extends InterfazVehiculo{
introducirMasCombustible();
}
}

class CocheElectrico extends InterfazVehiculo{
function acelerar(){
incrementarVoltaje();
}
}

class Conductor{
function conducir(InterfazVehiculo vehiculo){
// otras funcionalidades…
v.acelerar();
}
}

https://www.adictosaltrabajo.com/tutoriales/solid-3/

Interface Segregation: lot of interfaces few methods rather than lots of methods few interfaces.

bad

good

https://www.adictosaltrabajo.com/tutoriales/solid-4/

Dependency Inversion: Components with abstractions, not with a specific implementation (concretions).

https://www.adictosaltrabajo.com/tutoriales/solid-5/

“Estos principios están en un nivel más alto que los patrones de diseño. No son un ejemplo concreto que debáis utilizar para resolver un problema. Son una forma de pensar, ideas que hay que tener en la cabeza mientras se programa para intentar mantener un código limpio y mantenible.”

Free certificates / Godaddy SSL

Posted on Actualizado enn

1.-Create free certificates

  • https://www.sslforfree.com/
  • select manual verification (dns)
    • How to add TXT to verify in godaddy.com
    • go to manage, and the key, for example:

2.-Download openssl https://code.google.com/archive/p/openssl-for-windows/downloads I downloaded the openssl-0.9.8k_X64.zip and copied openssl.exe / libeay32.dll / ssleay32.dll to my folder with ca_bundle.crt / certificate.crt / private.key the ran this:

  • c:\something>openssl pkcs12 -export -out aeinmobiliaria.com.mx.pfx -inkey private.key -in certificate.crt
  • And enter a password
  • and in Azure, custom domains http://www.aeinmobiliaria.com.mx and aeinmobiliaria.com.mx / CNAME>

3.-Then go to azure, upload it the pfx y appservice/ssl certificates and add a binding to:

  • hostname: aeinmobiliaria.com.mx
  • certificate: ainmobiliaria.com.mx (51……6E)
  • Ssl type: sni ssl

https://docs.microsoft.com/en-us/azure/app-service-web/app-service-web-tutorial-custom-ssl

  • so I had to include in godaddy
Edit
  • That is it

more useful links

ssl checker

https://www.sslshopper.com/ssl-checker.html#hostname=https://aeinmobiliaria.com.mx

tcp connection / pings

https://check-host.net/check-tcp?host=aeinmobiliaria.com.mx:443

Using cloudflare.com even in the free version you can use their ssl cert, some useful links…

https://www.troyhunt.com/how-to-get-your-ssl-for-free-on-shared/

http://wp.sjkp.dk/use-free-letsencrypt-ssl-certificate-with-azure-web-apps/

https://docs.microsoft.com/da-dk/azure/app-service-web/web-sites-custom-domain-name

Design patterns

Posted on Actualizado enn

Design patterns are solutions to software design problems you find again and again in real-world application development. Patterns are about reusable designs and interactions of objects.

The 23 Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. They are categorized in three groups: Creational, Structural, and Behavioral (for a complete list see below).

  • CREATIONAL PATTERNS
    • Abstract factory *
    • Builder
    • Factory Method *
    • Prototype
    • Singleton
  • STRUCTURAL PATTERNS
    • Adapter *
    • Bridge
    • Composite *
    • Decorator *
    • Facade
    • Flyweight
    • proxy
  • BEHAVIORAL PATTERS
    • Chain of responsibility
    • Command
    • Interpreter
    • Iterator
    • Mediator
    • Memento
    • Observer *
    • State
    • Strategy *
    • Template Method *
    • Visitor

*Commons and easiers patters

Singleton (just one instance):

using System;

public class Singleton
{
   private static Singleton instance;

   private Singleton() {}

   public static Singleton Instance
   {
      get
      {
         if (instance == null)
         {
            instance = new Singleton();
         }
         return instance;
      }
   }
}

Strategy

UML class diagram

using System;
 
namespace DoFactory.GangOfFour.Strategy.Structural
{
  /// 
  /// MainApp startup class for Structural
  /// Strategy Design Pattern.
  ///
  class MainApp
  {
    /// 
    /// Entry point into console application.
    ///
    static void Main()
    {
      Context context;
 
      // Three contexts following different strategies
      context = new Context(new ConcreteStrategyA());
      context.ContextInterface();
 
      context = new Context(new ConcreteStrategyB());
      context.ContextInterface();
 
      context = new Context(new ConcreteStrategyC());
      context.ContextInterface();
 
      // Wait for user
      Console.ReadKey();
    }
  }
 
  /// 
  /// The 'Strategy' abstract class
  ///
  abstract class Strategy
  {
    public abstract void AlgorithmInterface();
  }
 
  /// 
  /// A 'ConcreteStrategy' class
  ///
  class ConcreteStrategyA : Strategy
  {
    public override void AlgorithmInterface()
    {
      Console.WriteLine(
        "Called ConcreteStrategyA.AlgorithmInterface()");
    }
  }
 
  /// 
  /// A 'ConcreteStrategy' class
  ///
  class ConcreteStrategyB : Strategy
  {
    public override void AlgorithmInterface()
    {
      Console.WriteLine(
        "Called ConcreteStrategyB.AlgorithmInterface()");
    }
  }
 
  /// 
  /// A 'ConcreteStrategy' class
  ///
  class ConcreteStrategyC : Strategy
  {
    public override void AlgorithmInterface()
    {
      Console.WriteLine(
        "Called ConcreteStrategyC.AlgorithmInterface()");
    }
  }
 
  /// 
  /// The 'Context' class
  ///
  class Context
  {
    private Strategy _strategy;
 
    // Constructor
    public Context(Strategy strategy)
    {
      this._strategy = strategy;
    }
 
    public void ContextInterface()
    {
      _strategy.AlgorithmInterface();
    }
  }
}

Output

Called ConcreteStrategyA.AlgorithmInterface()
Called ConcreteStrategyB.AlgorithmInterface()
Called ConcreteStrategyC.AlgorithmInterface()
Real World

using System;
using System.Collections.Generic;

namespace DoFactory.GangOfFour.Strategy.RealWorld
{
  ///
  /// MainApp startup class for Real-World
  /// Strategy Design Pattern.
  ///

  class MainApp
  {
    ///
    /// Entry point into console application.
    ///

    static void Main()
    {
      // Two contexts following different strategies
      SortedList studentRecords = new SortedList();

      studentRecords.Add("Samual");
      studentRecords.Add("Jimmy");
      studentRecords.Add("Sandra");
      studentRecords.Add("Vivek");
      studentRecords.Add("Anna");

      studentRecords.SetSortStrategy(new QuickSort());
      studentRecords.Sort();

      studentRecords.SetSortStrategy(new ShellSort());
      studentRecords.Sort();

      studentRecords.SetSortStrategy(new MergeSort());
      studentRecords.Sort();

      // Wait for user
      Console.ReadKey();
    }
  }

  ///
  /// The 'Strategy' abstract class
  ///

  abstract class SortStrategy
  {
    public abstract void Sort(List<string> list);
  }

  ///
  /// A 'ConcreteStrategy' class
  ///

  class QuickSort : SortStrategy
  {
    public override void Sort(List<string> list)
    {
      list.Sort(); // Default is Quicksort
      Console.WriteLine("QuickSorted list ");
    }
  }

  ///
  /// A 'ConcreteStrategy' class
  ///

  class ShellSort : SortStrategy
  {
    public override void Sort(List<string> list)
    {
      //list.ShellSort(); not-implemented
      Console.WriteLine("ShellSorted list ");
    }
  }

  ///
  /// A 'ConcreteStrategy' class
  ///

  class MergeSort : SortStrategy
  {
    public override void Sort(List<string> list)
    {
      //list.MergeSort(); not-implemented
      Console.WriteLine("MergeSorted list ");
    }
  }

  ///
  /// The 'Context' class
  ///

  class SortedList
  {
    private List<string> _list = new List<string>();
    private SortStrategy _sortstrategy;

    public void SetSortStrategy(SortStrategy sortstrategy)
    {
      this._sortstrategy = sortstrategy;
    }

    public void Add(string name)
    {
      _list.Add(name);
    }

    public void Sort()
    {
      _sortstrategy.Sort(_list);

      // Iterate over list and display results
      foreach (string name in _list)
      {
        Console.WriteLine(" " + name);
      }
      Console.WriteLine();
    }
  }
}
Output
QuickSorted list
Anna
Jimmy
Samual
Sandra
VivekShellSorted list
Anna
Jimmy
Samual
Sandra
VivekMergeSorted list
Anna
Jimmy
Samual
Sandra
Vivek