Skip to content

Instantly share code, notes, and snippets.

Working from home

Istvan l1x

Working from home
View GitHub Profile
l1x / ntp.erl
Last active Apr 28, 2020
NTP client in Erlang
View ntp.erl
-export([get_time/1, get_time/0]).
-define(NTP_PORT, 123). % udp
-define(SERVER_TIMEOUT, 5000). % ms
-define(EPOCH, 2208988800). % offset yr 1900 to unix epoch
ntp_servers() ->
[ "",
l1x /
Last active Apr 25, 2020
Converting MKV or AVI to MP4 (h264, aac)
# with handbrake cli
for i in *.mkv; do
handbrake --preset-import-file fast.json --ab 192 -i "$i" -o "${i%.mkv}".mp4;
# or with ffmpeg
for f in *.avi; do
ffmpeg -i "$f" -c:v libx264 -c:a aac "${f%.avi}".mp4;
l1x / Spiral.hs
Last active May 10, 2020
Spiral print in Haskell
View Spiral.hs
module Main where
transpose :: [[Int]] -> [[Int]]
transpose m =
case m of
[] -> []
([]:_) -> []
x -> (map head x) : transpose (map (drop 1) x)
spiralPrintShort :: [[Int]] -> [Int]
l1x / DateTime.elm
Last active Apr 8, 2020
Displaying Date and Time (zero padded values)
View DateTime.elm
-- Show the current time in your time zone.
-- Read how it works:
import Browser
import Html exposing (..)
import Task
import Time exposing (..)
l1x /
Last active Apr 5, 2020
Some provisioning for a default installation Raspbian
sudo apt update -y && sudo apt upgrade -y
sudo systemctl enable ssh
sudo systemctl start ssh
l1x /
Last active Mar 31, 2020
CentOS 7 build script for RocksDB
set -ex
echo "This script configures CentOS with everything needed to build and run RocksDB"
yum update -y && yum install epel-release -y
l1x /
Last active Jan 25, 2020
SQL structure of Safari's history tables
sqlite3 ~/Library/Safari/History.db
sqlite> .tables
history_client_versions  history_items            history_tombstones
history_event_listeners  history_items_to_tags    history_visits
history_events           history_tags             metadata
View presto.mem.issue
Query failed (#20200116_080226_04202_txkag) in Presto:
Query exceeded per-node user memory limit of 20GB
[ Allocated: 20.00GB,
Delta: 688.14kB,
Top Consumers:
{ OrderByOperator=20.00GB,
ExchangeOperator=5.71MB } ]
l1x /
Last active Dec 2, 2019
Installing the environment for AWS Lambda and F# (Fsharp)

Installing .NET SDK

brew tap isen-ng/dotnet-sdk-versions
brew cask install dotnet-sdk-2.2.400

Creating Serverless Service

I think it is a good option to have separate dev and prod services in separate folders so we cannot accidentally deploy to prod, that is a problem when relying on environment variables.


Keybase proof

I hereby claim:

  • I am l1x on github.
  • I am l1x ( on keybase.
  • I have a public key ASCW3LuhleISdHbcI77ZHqThTbH0BUfhK58fm9eBuf9zxwo

To claim this, I am signing this object:

You can’t perform that action at this time.