Skip to content

Instantly share code, notes, and snippets.

View artyom-poptsov's full-sized avatar

Artyom V. Poptsov artyom-poptsov

View GitHub Profile
#!/usr/bin/guile \
-e main -s
!#
(define (main args)
(display "Locale is not set: ♥\n")
(setlocale LC_ALL "en_US.UTF-8")
(display "Locale is set: ♥\n"))
@artyom-poptsov
artyom-poptsov / dist-map.scm
Last active August 29, 2015 14:22
guile-ssh-dist-map
#!/usr/bin/guile \
-e main
!#
;; See <https://github.com/artyom-poptsov/guile-ssh/tree/wip-distributed-forms>
(use-modules (ssh session)
(ssh auth)
(ssh dist))
@artyom-poptsov
artyom-poptsov / make-tunnel.scm
Created May 23, 2015 11:16
guile-ssh-tunnel-example
#!/usr/bin/guile \
-e main
!#
(use-modules (ssh session)
(ssh auth)
(ssh key)
(ssh tunnel))
(define (main args)
;; define*-like macro that allows to use keywords with GOOPS'
;; define-method.
(define-syntax define-method*
(syntax-rules ()
((_ (m (o <class>) (var defval) ...) body ...)
(define-method (m (o <class>) . args)
(let-keywords args #t ((var defval) ...)
body ...)))))
@artyom-poptsov
artyom-poptsov / client.scm
Created August 17, 2014 19:50
guile-ssh-file-transfer-example
#!/usr/bin/guile \
--debug -e main
# aside from this initial boilerplate, this is actually -*- scheme -*- code
!#
;;; client.scm -- Echo client example.
;; Copyright (C) 2014 Artyom V. Poptsov <poptsov.artyom@gmail.com>
;;
;; This program is free software: you can redistribute it and/or
@artyom-poptsov
artyom-poptsov / sssh.scm
Last active December 17, 2015 18:09
Scheme Secure Shell
#!/usr/bin/guile \
--debug -e main
!#
;;; sssh.scm -- Scheme Secure Shell.
;; Copyright (C) 2013 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 / .screenrc
Last active December 14, 2015 17:39
A simply script that calculates bandwidth usage for a given interface. It is written for using with GNU Screen.
backtick 1 1 1 /home/$USER/bin/bwstat.sh eth0
hardstatus alwayslastline '%{= G}[%= %{= w}%?%-Lw%?%{= R}%n*%f %t%?%{= R}(%u)%?%{= w}%+Lw%?%= %{= g}][ %{y}%1`%{g} ][ %{y}L: %l %{g}]'