Skip to content

Instantly share code, notes, and snippets.

View artyom-poptsov's full-sized avatar

Artyom V. Poptsov artyom-poptsov

View GitHub Profile
var express = require ('express');
var app = express ();
function main() {
app.post ('/data/3.0/measurements', function (req, res) {
console.log (req.headers);
req.on("data", function (data) {
console.log(data);
});
@artyom-poptsov
artyom-poptsov / fosdem-schedule-to-org-mode.scm
Last active January 6, 2017 01:17
Example of Guile-ICS (https://github.com/artyom-poptsov/guile-ics) usage: Convert iCalendar data to Emacs org-mode
#!/usr/bin/guile \
-e main
!#
(use-modules (ice-9 popen)
(srfi srfi-41) ; streams
;; Guile-ICS
(ics)
(ics conv))
@artyom-poptsov
artyom-poptsov / uptop.scm
Last active February 22, 2016 13:53
Run 'top' command on a remote side using Guile-SSH remote pipes, show the output of 'top' in uppercase letters.
#!/usr/bin/guile \
-e main -s
!#
;;; uptop.scm -- Uppercase top.
;; Copyright (C) 2016 Artyom V. Poptsov <poptsov.artyom@gmail.com>
;;
;; This program is free software: you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
@artyom-poptsov
artyom-poptsov / sftp-stream.scm
Created February 21, 2016 22:14
SFTP file streams
#!/usr/bin/guile \
-e main -s
!#
;; Copyright (C) 2016 Artyom V. Poptsov <poptsov.artyom@gmail.com>
;;
;; This program is free software: you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation, either version 3 of the
;; License, or (at your option) any later version.
@artyom-poptsov
artyom-poptsov / open-remote-pipe.scm
Created December 4, 2015 18:58
Remote pipes example.
#!/usr/bin/guile \
-e main -s
!#
;;; open-remote-pipe.scm
;; Copyright (C) 2015 Artyom V. Poptsov <poptsov.artyom@gmail.com>
;;
;; This program is free software: you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
@artyom-poptsov
artyom-poptsov / forwarding-to-unix-socket.scm
Created December 3, 2015 21:25
Forwarding of data to a remote Unix socket using 'with-ssh' from (ssh dist) module.
#!/usr/bin/guile \
-e main -s
!#
;;; forwarding-to-unix-socket.scm
;; Copyright (C) 2015 Artyom V. Poptsov <poptsov.artyom@gmail.com>
;;
;; This program is free software: you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
@artyom-poptsov
artyom-poptsov / pg-tunnel.scm
Created December 1, 2015 21:24
Connect to a PostgreSQL instance through an SSH tunnel.
#!/usr/bin/guile \
-e main -s
!#
;;; pg-tunnel.scm -- Connect to a PostgreSQL instance through an SSH tunnel.
;; Copyright (C) 2015 Artyom V. Poptsov <poptsov.artyom@gmail.com>
;;
;; This program is free software: you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
@artyom-poptsov
artyom-poptsov / summary.sh
Created October 30, 2015 08:33
A Bash script that summarises up the data from a DSV file.
#!/bin/bash
### summary.sh -- Summarize the data.
# Copyright (C) 2015 Artyom V. Poptsov <poptsov.artyom@gmail.com>
#
# To the extent possible under law, the person who associated CC0 with
# this work has waived all copyright and related or neighboring rights
# to this work. See
# <https://creativecommons.org/publicdomain/zero/1.0/>
@artyom-poptsov
artyom-poptsov / rcat.scm
Last active October 28, 2015 07:50
rcat -- Remote 'cat'
#!/usr/bin/guile \
-e main -s
!#
;;; rcat.scm -- Remote 'cat'
;; Copyright (C) 2015 Artyom V. Poptsov <poptsov.artyom@gmail.com>
;;
;; This program is free software: you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
@artyom-poptsov
artyom-poptsov / sscp.scm
Created October 5, 2015 07:20
Implementation of scp in Scheme upon the new (ssh sftp) module from Guile-SSH.
#!/usr/bin/guile \
-e main -s
!#
;;; sscp.scm -- Scheme Secure Copy implementation.
;; Copyright (C) 2015 Artyom V. Poptsov <poptsov.artyom@gmail.com>
;;
;; This program is free software: you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as