Skip to content

Instantly share code, notes, and snippets.

Kevin Lyda lyda

Block or report user

Report or block lyda

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View exec-kbd-test.pas
program exec_kbd_test;
uses sysutils;
begin
SysUtils.ExecuteProcess('kbd-test', '', []);
end.
View kbd-test.pas
{$mode TP}
program test;
uses baseunix,strings;
const vcs_device:shortint=-1;
function try_grab_vcsa_in_path(path:Pchar;len:cardinal):boolean;
const grab_vcsa='/grab_vcsa';
grab_vcsa_s:array[1..length(grab_vcsa)] of char=grab_vcsa;
View test.pas
{$mode TP}
program test;
uses keyboard;
begin
writeln('Hello World.');
end.
View create.sh
#!/bin/bash
# Documentation that helped with this:
# https://github.com/luebken/serverless-the-manual-way
# Status:
# https://eu-west-1.console.aws.amazon.com/lambda/home?region=eu-west-1
# See: https://developer.twitter.com/en/apps/16043135
TWITTER_CONSUMER_KEY=secret
TWITTER_CONSUMER_SECRET=secret
@lyda
lyda / jwt-example.go
Created Dec 29, 2017
JsonWebTokens Example with generated key.
View jwt-example.go
/* rewritten example of JsonWebToken example
* from https://gist.github.com/thealexcons/4ecc09d50e6b9b3ff4e2408e910beb22
* Keys are generated and packed to PEM-format at server start
* Plus some fixes and refactors
*
* My respect to thealexcons
*/
package main
import (
@lyda
lyda / cobmd5.cbl
Last active Sep 21, 2017
COBOL implementation of the MD5 algorithm.
View cobmd5.cbl
*> Copyright (C) 2006 Micro Focus (IP) Limited.
*> All rights reserved.
*>
*> Michael Wojcik, Micro Focus International Ltd
*> April 2006
$set ans85 mf sourceformat"free" align"8" notrickle opt"4"
$set noalter comp nocheck nocheckdiv noqualproc noseg notrunc
$set scheduler
@lyda
lyda / Gemfile
Last active Feb 9, 2017
Get mmap working with ruby 2.3.1
View Gemfile
source "https://rubygems.org"
gem 'mmap', git: 'https://github.com/lyda/mmap.git', :branch => 'non-global-version'
@lyda
lyda / latency.txt
Created Jan 31, 2017 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@lyda
lyda / www
Last active Jan 23, 2016 — forked from dg01d/www
View www
#Server declaration for non-encrypted port 80
server {
listen 80;
server_name mysite.com www.mysite.com;
location /.well-known/acme-challenge/ {
root /var/www/challenges/;
try_files $uri =404;
}
@lyda
lyda / metrics.lua
Last active Aug 8, 2019
Prometheus node-exporter in lua for openwrt
View metrics.lua
#!/usr/bin/lua
-- Metrics web server (0.1)
-- Copyright (c) 2015 Kevin Lyda
-- Apache 2.0 License
socket = require("socket")
netsubstat = {"IcmpMsg", "Icmp", "IpExt", "Ip", "TcpExt", "Tcp", "UdpLite", "Udp"}
cpu_mode = {"user", "nice", "system", "idle", "iowait", "irq",
"softirq", "steal", "guest", "guest_nice"}
netdevsubstat = {"receive_bytes", "receive_packets", "receive_errs",
You can’t perform that action at this time.