Skip to content

Instantly share code, notes, and snippets.

View darklow's full-sized avatar

Kaspars Sprogis darklow

View GitHub Profile
@darklow
darklow / 00-readme.md
Created July 27, 2023 09:22 — forked from JanJakes/00-readme.md
Ubuntu server with Nginx, uWSGI and Node.js installation & deployment setup

Ubuntu with Nginx, uWSGI & Node.js and it's deployment

This Gist contains instructions to setup Ubuntu server with Nginx, uWSGI & Node.js with that can serve for any Python apps (Django for instance) and will allow it's automatized deployment.

The content is as follows:

  • 01-ubuntu.md – A basic Ubuntu server setup.
  • 02-nginx-uwsgi-nodejs.md – Nginx, uWSGI and Node.js installation and setup.
  • 03-deployment.md – A server setup for automatized deployment.
  • 04-mariadb.md – Mariadb installation and setup.
Facebook*:
https://api.facebook.com/method/links.getStats?urls=%%URL%%&format=json
+ works, returns shares, likes, comments and total
Twitter:
http://urls.api.twitter.com/1/urls/count.json?url=%%URL%%&callback=twttr.receiveCount
+ v1 API but still works
Reddit:
http://buttons.reddit.com/button_info.json?url=%%URL%%
SYSTEM_MODE(MANUAL);
//Disables connection to Spark Cloud without additional API query
// UDP Port used for two way communication
unsigned int localPort = 8888;
const char *message = "A";
unsigned int ssdpport = 1900;
IPAddress ip( 239, 255, 255, 250 );
SYSTEM_MODE(MANUAL);
// UDP Port used for two way communication
unsigned int localPort = 1900;
unsigned int trigger = D0;
//Creates buffer variable and gives it a size
#define MAX_SIZE 1024
char buffer[MAX_SIZE];
//Creates UDP manipulation variable
@darklow
darklow / SSDP Code
Last active August 29, 2015 14:12 — forked from anonymous/SSDP Code
SYSTEM_MODE(MANUAL);
//Disables connection to Spark Cloud without additional API query
// UDP Port used for two way communication
unsigned int localPort = 8888;
const char *message = "A";
unsigned int once = 0;
unsigned int ssdpport = 1900;
IPAddress ip( 239, 255, 255, 250 );
var selector = 'img' // Replace this with the selector for the element you want to make transformable
jQuery.getScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', function() {
jQuery.getScript('//cdnjs.cloudflare.com/ajax/libs/numeric/1.2.6/numeric.min.js', function() {
(function() {
var $, applyTransform, getTransform, makeTransformable;
$ = jQuery;
ROOT_DIR="$1"
mkdir "$ROOT_DIR"
cd "$ROOT_DIR"
#setup venv
virtualenv env --distribute
source env/bin/activate
#install django so we can start up an app
curl -XGET "http://localhost:9200/movies/_search" -d'
{
"query": {
"nested": {
"path": "credits",
"query": {
"match": {
"credits.person_id": 1
}
}