Archive for the ‘ Administration ’ Category

Preseed apt_get for unattended_installs

Installation of some packages require user input, which breaks the entire concept of “unattended” installs. Here’s a quick fix to get around that.

First, on a setup computer, install the following:

sudo apt-get install debconf-utils

Now, install whatever packages you wish to later install in an unattended mode. Answer the questions for installation appropriately when prompted. Next we will export those answers into a “seed” file that we can use when installing the package on a new machine. For instance, I’ve installed several ldap authentication packages, so I might want to grab all of the settings those packages ask for.

sudo debconf-get-selections | grep ldap > ldap.seed

If you remember from yesterday, we created an archive that included a setup script and several config files. Place the ldap.seed file inside that archive along with the other scripts, and just before doing the apt-get install add the following line to the add2network.sh file:

debconf-set-selections ./ldap.seed

And there you have it – your apt-get won’t ask for details anymore.

Source: ossramblings

MySql JSON support!

JSON support. Beginning with MySQL 5.7.8, MySQL supports a native JSON type. JSON values are not stored as strings, instead using an internal binary format that permits quick read access to document elements. JSON documents stored inJSON columns are automatically validated whenever they are inserted or updated, with an invalid document producing an error. JSON documents are normalized on creation, and can be compared using most comparison operators such as =,<, <=, >, >=, <>, !=, and <=>; for information about supported operators as well as precedence and other rules that MySQL follows when comparing JSON values, see Comparison and Ordering of JSON Values.

Image result for mysql

MySQL 5.7.8 also introduces a number of functions for working with JSON values. These functions include those listed here:

Image result for json

In MySQL 5.7.9 and later, you can use column->path as shorthand for JSON_EXTRACT(column, path). This works as an alias for a column wherever a column identifier can occur in an SQL statement, including WHERE, ORDER BY, and GROUP BY clauses. This includes SELECT, UPDATE, DELETE, CREATE TABLE, and other SQL statements. The left hand side must be a JSON column identifier (and not an alias). The right hand side is a quoted JSON path expression which is evaluated against the JSON document returned as the column value.

See Section 12.16.3, “Functions That Search JSON Values”, for more information about -> and JSON_EXTRACT(). For information about JSON path support in MySQL 5.7, see Searching and Modifying JSON Values. See also Secondary Indexes and Virtual Generated Columns.

NodeJS Loopback

Looks very promising, I think I will give it a try these days.

Wonderful new world of nodejs!

About LoopBack.IO

  • Use the CLI to generate REST APIs
  • Connect devices and browsers to data and services
  • Open Source and extensible

Set up models and create REST APIs in minutes

  • Easy-to-use CLI wizard
  • Create models based on your schema if you have one
  • Create dynamic models if you don’t
  • Built-in API Explorer

Model relation support

  • Define hasMany, belongsTo, hasAndBelongsToMany relationships
  • Automatically generates corresponding REST endpoints

Easy authentication and authorization setup

  • Built-in role-based access controls
  • oAuth user and registration models baked in
  • Add custom policies using CLI or JSON
  • Browser support (JSONP and CORS)

MIT open-source license

Client SDKs

Native Mobile and Browser SDKs

  • Easily persist data with a database API on the client
  • Store files, send push notifications, and call custom server-side code
  • Android / Java
  • iOS
  • Browser JavaScript (Angular)

Juggler

Connect to backend data stores

  • MySQL, Oracle, MongoDB, and others
  • Other REST services
  • Discovery APIs for Oracle and MySQL

Run ad-hoc queries

  • Run dynamic queries on devices, browsers and the server
  • Support for NoSQL-style queries against relational databases

Mobile Services

Send push notifications

  • Backend push system with simple API calls
  • Supports both Android and iOS

Geolocation

  • Validate and store geolocations
  • Find nearby results with geo filters