This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; System-type definition | |
(defun system-is-linux() | |
(string-equal system-type "gnu/linux")) | |
(defun system-is-windows() | |
(string-equal system-type "windows-nt")) | |
(defun system-is-osx() | |
(string-equal system-type "darwin")) | |
;; If linux or OSX, start emacs as server | |
(when (or (system-is-linux) (system-is-osx)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test: UDP | |
Client: | |
iperf -c 192.168.{pair}.{client} -B 192.168.{pair}.{server} -f m -n {size}M -u -b1000M -i 10 | tee {report_name} | |
Server | |
iperf -s -B 192.168.{pair}.{server} -n {size}M -u -i 10 | tee {report_name} | |
Test: TCP | |
Client: | |
iperf -c 192.168.{pair}.{client} -B 192.168.{pair}.{server} -f m -n {size}M -i 10 | tee {report_name} | |
Server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $(whoami) != 'root' ]] | |
then | |
echo "You should be a super-user to run this script" | |
exit 1 | |
fi | |
function down() | |
{ | |
echo "Removing existing DNS servers. . ." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int keep_alive_interval_sec = 60; | |
uint32_t azure_message_timeout_msec = 60 * 1000; | |
boolean azure_log_trace = TRUE; | |
assert(platform_init() == 0); | |
/* Initialize a low-level client */ | |
azure_ctx->azct_client = IoTHubClient_LL_CreateFromConnectionString( | |
connection_string, CAT_AZURE_PROTOCOL); | |
assert(NULL != azure_ctx->azct_client); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Info: IoT Hub SDK for C, version 1.1.21 | |
-> 14:41:52 CONNECT | VER: 4 | KEEPALIVE: 60 | FLAGS: 128 | USERNAME: $host_name/$device_id/api-version=2016-11-14&DeviceClientType=iothubclient%2f1.1.21%20(Linux%3b%20mips) | CLEAN: 0 | |
<- 14:41:52 CONNACK | SESSION_PRESENT: true | RETURN_CODE: 0x0 | |
-> 14:41:52 SUBSCRIBE | PACKET_ID: 2 | TOPIC_NAME: devices/$device_id/messages/devicebound/# | QOS: 1 | TOPIC_NAME: $iothub/twin/res/# | QOS: 0 | TOPIC_NAME: $iothub/twin/PATCH/properties/desired/# | QOS: 0 | TOPIC_NAME: $iothub/methods/POST/# | QOS: 0 | |
-> 14:41:52 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/PATCH/properties/reported/?$rid=3 | PAYLOAD_LEN: 288 | |
-> 14:41:52 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_LEAST_ONCE | TOPIC_NAME: devices/$device_id/messages/events/name=common.ping | PACKET_ID: 4 | PAYLOAD_LEN: 2 | |
<- 14:41:52 SUBACK | PACKET_ID: 2 | RETURN_CODE: 1 | RETURN_CODE: 0 | RETURN_CODE: 0 | RETURN_CODE: 0 | |
-> 14:41:52 PUBLISH | IS_DUP: false | RETAIN: 0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void | |
s_azure_client_connection_status_cb( | |
IOTHUB_CLIENT_CONNECTION_STATUS result, | |
IOTHUB_CLIENT_CONNECTION_STATUS_REASON reason, | |
void * ctx) | |
{ | |
const char * connection_results[] = | |
{ | |
"ONLINE", | |
"OFFLINE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ares.h> | |
#include <stdio.h> | |
#include <netdb.h> | |
#include <assert.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/select.h> | |
#define HOST_TO_RESOLVE "yandex.ru" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/gawk -f | |
# Prepare file list | |
$1 ~ /[0-9]+/ { | |
pid = $1 | |
fname = "/proc/" pid "/stack"; | |
stack_level = 0 | |
# Read file and count stack depth | |
getline_ret = getline < fname | |
while (getline_ret == 1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# String with available options (more info: man getopt) | |
# Colon after argument means that value is required for this argumen | |
# h -- help | |
# a -- main args | |
OPTSTRING="ha:" | |
VALUE="" | |
do_work() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Enable package management | |
(require 'package) | |
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos)) | |
(not (gnutls-available-p)))) | |
(url (concat (if no-ssl "http" "https") "://melpa.org/packages/"))) | |
(add-to-list 'package-archives (cons "melpa" url) t)) | |
(when (< emacs-major-version 24) | |
;; For important compatibility libraries like cl-lib | |
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) | |
(package-initialize) |
OlderNewer