Skip to content

Instantly share code, notes, and snippets.

View artyom-poptsov's full-sized avatar

Artyom V. Poptsov artyom-poptsov

View GitHub Profile
(define-syntax M#!
(syntax-rules (=>)
((_ type command)
(list (quote type) command))
((_ => type command)
`(,(list (quote type) command)))
((_ => type command rest ...)
`(,(list (quote type) command) ,@(M#! rest ...)))
((_ type command => rest ...)
(apply plumb `(,(list (quote type) command) ,@(M#! => rest ...))))))
@artyom-poptsov
artyom-poptsov / Dockerfile
Last active August 17, 2018 13:25
GNU Mediagoblin docker image
#
# Dockerized http://mediagoblin.org/
# Copyright (C) Loic Dachary <[email protected]>
# Copyright (C) 2018 Artyom V. Poptsov <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
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 <[email protected]>
;;
;; 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 <[email protected]>
;;
;; 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 <[email protected]>
;;
;; 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 <[email protected]>
;;
;; 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 <[email protected]>
;;
;; 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 <[email protected]>
#
# 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/>