Skip to content

Instantly share code, notes, and snippets.

View varjagg's full-sized avatar
🎯
Focusing

Eugene Zaikonnikov varjagg

🎯
Focusing
View GitHub Profile
(define-method-combination machine ()
((start (:start))
(rest *))
(let ((qualifiers (mapcar #'method-qualifiers rest))
(tags (mapcar (lambda (m) (declare (ignore m)) (gensym)) rest)))
`(prog (switch)
(setf switch
(lambda (state)
(cond ((equal state nil) (go nil))
,@(loop for qualifier in qualifiers
@dentechy
dentechy / WSL-ssh-server.md
Last active April 23, 2025 15:00
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
(with-open-file (stream "LOCAL:>Desktop.jpeg" :element-type '(unsigned-byte 8))
(sys.int::gc)
(mezzano.profiler:with-profiling (:path "profile.log" :thread t :buffer-size (* 1024 1024) :repeat 10)
(file-position stream 0)
(jpeg:decode-stream stream :cached-source-p t))
nil)
@ghedo
ghedo / sound_playback.c
Last active February 19, 2025 06:12
Simple sound playback using ALSA API and libasound
/*
* Simple sound playback using ALSA API and libasound.
*
* Compile:
* $ cc -o play sound_playback.c -lasound
*
* Usage:
* $ ./play <sample_rate> <channels> <seconds> < <file>
*
* Examples:
/*
A Minimal Capture Program
This program opens an audio interface for capture, configures it for
stereo, 16 bit, 44.1kHz, interleaved conventional read/write
access. Then its reads a chunk of random data from it, and exits. It
isn't meant to be a real program.
From on Paul David's tutorial : http://equalarea.com/paul/alsa-audio.html