This tutorial uses the "Sample hapi.js REST API" project.
Take a look at: https://github.com/agendor/sample-hapi-rest-api/
##Topics
- Introduction
- Installing Node.js
- Installing MySQL
- Setting-up the project
/* Merge overlapping intervals | |
* | |
* Example: | |
* [[1,4],[3,5],[2,4],[7,10]] -> [[1,5],[7,10]] | |
*/ | |
function mergeIntervals(intervals) { | |
// test if there are at least 2 intervals | |
if(intervals.length <= 1) | |
return intervals; |
# Basic Strongswan ikev2 server setup | |
* paltform: atlantic.net ubuntu 14.04 x64 | |
* the commands below are run with root account | |
## Strongswan | |
``` | |
apt-get install strongswan | |
apt-get install iptables iptables-persistent | |
``` |
int aprintf(char *str, ...) { | |
int i, j, count = 0; | |
va_list argv; | |
va_start(argv, str); | |
for(i = 0, j = 0; str[i] != '\0'; i++) { | |
if (str[i] == '%') { | |
count++; | |
Serial.write(reinterpret_cast<const uint8_t*>(str+j), i-j); |
#!/bin/bash | |
set -e | |
set -x | |
### IF we dont have archive url prefix | |
if [ -z "$_PARAMS_NODEJS_SOURCE_ARCHIVE_URL" ]; then | |
_PARAMS_NODEJS_SOURCE_ARCHIVE_URL=$(wget -qO- http://nodejs.org/dist/latest/ | egrep -o 'node-v[0-9\.]+.tar.gz' | tail -1); | |
_PARAMS_NODEJS_SOURCE_ARCHIVE_URL="http://nodejs.org/dist/latest/"$_PARAMS_NODEJS_SOURCE_ARCHIVE_URL | |
fi |
#!/bin/bash | |
# Sends a Boxcar push notification through the Boxcar HTTP API | |
# Usage examples | |
# $ bc # Just sends a notification with title 'bc' | |
# $ bc "Done" # Sends a notification with title 'Done' | |
# $ echo foobar | bc # Sends a notification with title 'bc' and message body 'foobar' | |
# $ echo foobar | bc "Done" # Sends a notification with title 'Done' and message body 'foobar' | |
# | |
# Expects a file ~/.boxcar to exist with content like |
This tutorial uses the "Sample hapi.js REST API" project.
Take a look at: https://github.com/agendor/sample-hapi-rest-api/
##Topics
#!/bin/bash | |
set -e | |
# Use this script to copy shared (libs) files to nginx chrooted | |
# jail server. This is tested on 64 bit Linux (Redhat and Friends only) | |
# ---------------------------------------------------------------------------- | |
# Original Written by Vivek Gite <http://www.cyberciti.biz/> | |
# (c) 2006 nixCraft under GNU GPL v2.0+ | |
# ---------------------------------------------------------------------------- | |
# See url for usage: |
#!/bin/bash | |
echo "Recording, press ctrl+c to stop..." | |
arecord -D "plughw:1,0" -q -f cd -t wav | ffmpeg -loglevel panic -y -i - -ar 16000 -acodec flac speech.flac > /dev/null 2>&1 | |
echo "Processing..." | |
wget -q -U "Mozilla/5.0" --post-file speech.flac --header "Content-Type: audio/x-flac; rate=16000" -O - "http://www.google.com/speech-api/v1/recognize?lang=en-us&client=chromium" | cut -d\" -f12 > speech.txt | |
echo -n "You said: " | |
cat speech.txt |
<!DOCTYPE html> | |
<html ng-app> | |
<head> | |
<title>Example</title> | |
</head> | |
<body> | |
<nav class="main-nav" data-main-menu data-root="index"></nav> | |
<script type="text/javascript" src="angular.js"></script> |
Title: Настройка сервера VPN L2TP/IPSec на Mikrotik RoutersOS Date: 2013-05-31 17:25 Category: Mikrotik Tags: mikrotik, vpn Slug: mikrotik-lt2p-vpn Summary: Краткое описание настройки сервера VPN L2TP/IPSec на Mikrotik RoutersOS c возможностью подключения с помощью встроенных VPN клиентов Windows 7, Mac OS X и IOS.
Замечение: Если несколько клиентов находятся за NAT, то только одно L2TP/IPSec соединение может быть установлено.