Skip to content

Instantly share code, notes, and snippets.

View usametov's full-sized avatar

Ulan Sametov usametov

  • Asta Nova Enterprise Solutions
View GitHub Profile
@usametov
usametov / ubuntu-post-install.md
Created July 9, 2021 00:26 — forked from practicalli-johnny/ubuntu-post-install.md
Ubuntu post install - including Raid setup
@usametov
usametov / ubuntu-install-backup
Created July 9, 2021 00:22 — forked from practicalli-johnny/ubuntu-install-backup
a version that I was editing and lost track of what I changed.
# Ubuntu install
Also see earlier install guide https://gist.github.com/jr0cket/7655cf6f0dcd889ca0dbb0edb2b544c2
## X1 Extreme installation
Download Ubuntu server iso image
burn image to usb
Enter and f1 to open bios config
- remove secure boot
@usametov
usametov / string.clj
Created June 30, 2021 03:40 — forked from punit-naik/string.clj
Levenshtein Distance function implemented in Clojure
(defn levenshtein-distance
"Finds the percentage of match (reversed levenshtein distance & normalised)
between two strings"
[s1 s2]
(let [similarity (atom 0)
edit-map (atom {})]
(doseq [i (range (count s1))]
(let [edit (atom (if (zero? i) 0 i))]
(doseq [j (range (count s2))]
(let [e (if (= (.charAt s1 i) (.charAt s2 j)) 0 1)]
@usametov
usametov / rotate-video.sh
Created June 13, 2021 01:45 — forked from ViktorNova/rotate-video.sh
Rotate a video with FFmpeg (100% lossless, and quick)
$INPUTVIDEO='input.mp4'
$OUTPUTVIDEO='output.mp4'
ffmpeg -i $INPUTVIDEO -metadata:s:v rotate="-90" -codec copy $OUTPUTVIDEO
@usametov
usametov / readability.js
Created June 1, 2021 04:00 — forked from jakedahn/readability.js
Readability.js
/*jslint undef: true, nomen: true, eqeqeq: true, plusplus: true, newcap: true, immed: true, browser: true, devel: true, passfail: false */
/*global window: false, readConvertLinksToFootnotes: false, readStyle: false, readSize: false, readMargin: false, Typekit: false, ActiveXObject: false */
var dbg = (typeof console !== 'undefined') ? function(s) {
console.log("Readability: " + s);
} : function() {};
/*
* Readability. An Arc90 Lab Experiment.
* Website: http://lab.arc90.com/experiments/readability
@usametov
usametov / merkle.tree.clj
Created May 14, 2021 21:24 — forked from maxcountryman/merkle.tree.clj
A Clojure Merkle tree utilizing SHA-256.
(ns merkle.tree
(:import [java.security MessageDigest]))
(defn sha-256-digest [bs]
(.digest
(doto (MessageDigest/getInstance "SHA-256")
(.update bs))))
(def double-sha-256 (comp sha-256-digest sha-256-digest))
;; # Maria for Experts
;; This is a short tour of abstractions we've made in the process of building Maria,
;; which are also available while using the system. It is meant for people with experience using
;; functional programming languages who already know how to evaluate forms in Maria.
;; If you're a beginner to Maria or to programming in general, I recommend starting [here](https://www.maria.cloud/intro).
;; (For the impatient, Command-Enter — Control-Enter on a PC — within a code block with evaluate the code before the cursor.)
;; ## Notebook interface
@usametov
usametov / Docker
Last active April 16, 2021 21:26 — forked from mitchwongho/Docker
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
# without the /bin/ part
docker run -it ubuntu bash
# nothing else but bash...
docker run -it bash
#if image has a defined ENTRYPOINT. For these cases use:
docker run -it --entrypoint /bin/bash <image>
@usametov
usametov / instaparse.clj
Created April 4, 2021 01:35 — forked from taylorwood/instaparse.clj
Clojure Instaparse examples
;; "human" date/time format parsing
(def human-time-parser
(insta/parser
"S = H (':' M)? ' '? P? (' ' Z)?
H = #'[1-9]' | #'1[0-2]'
M = #'0[0-9]' | #'[1-5][0-9]'
P = AM | PM
AM = 'A' 'M'?
PM = 'P' 'M'?
(ns talk
(:require [overtone.core :refer :all]
[clojure.java.io :as io]
[clj-http.client :as http]
[clojure.test :as test]))
(def talk
{:title "Sequencing dance music with Clojure"
:author "Piotr Jagielski"
:company {:name "TouK" :what "Software house" :from "Warsaw, Poland"}