Skip to content

Instantly share code, notes, and snippets.

@akihikodaki
akihikodaki / README.md
Last active Apr 11, 2021
Linux Desktop on Apple Silicon/M1 in Practice
View README.md

Linux Desktop on Apple Silicon/M1 in Practice

I bought M1 MacBook Air. It is the fastest computer I have, and I have been a GNOME/GNU/Linux user for long time. It is obvious conclusion that I need practical Linux desktop environment on Apple Silicon/M1.

Fortunately, Linux already works on Apple Silicon/M1. But how practical is it?

View meltdown_redis.md

Meltdown fix impact on Redis performances in virtualized environments

UPDATE: apparently kernel difference may have a serious impact, so I'll redo the test from scratch.

Test performed with AOF enabled, fsync policy 1 second, allowing the rewrites to be triggered.

Command lines used:

@BusFactor1Inc
BusFactor1Inc / scheme-coin.lisp
Created Dec 16, 2017
A Common Lisp Blockchain - Scheme Coin
View scheme-coin.lisp
;;
;; scheme coin - a common lisp blockchain
;;
;; Burton Samograd
;; 2017
(load "~/quicklisp/setup.lisp")
(defconstant *coin-name* "Scheme Coin")
@chrisdone
chrisdone / Printf.idr
Last active Apr 9, 2021
Type-safe dependently-typed printf in Idris
View Printf.idr
module Printf
%default total
-- Formatting AST.
data Format
= FInt Format
| FString Format
| FOther Char Format
| FEnd
@mowings
mowings / readme.md
Last active Apr 2, 2021
ffmpeg stream and save video from Dahua 4300s IP Camera
View readme.md

Use ffmpeg to stream video from a dahua 4300s to a file or files

You can use ffmpeg to directly pull frames off of a dahua 4300s at full resolution. May be a good alternative to pricey dvrs which likely cannot record at full resolution, may not work with the camera, or are prohibitevly expensive

Simple Stream to file

Simple stream to file. Full resolution

ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:admin@198.175.207.61:554/live" \
-c copy -map 0 foo.mp4
@ghl3
ghl3 / _ImmutableDatabase
Last active Jun 13, 2020
Implementation of an immutable database in postgres
We couldn’t find that file to show.
@geraldvillorente
geraldvillorente / sitemap-crawler.php
Last active Mar 10, 2021
Sitemap crawler to test 301 and 404.
View sitemap-crawler.php
/**
* Crawl the sitemap.xml for 301 redirections and 404 errors.
* Source: http://edmondscommerce.github.io/php/crawl-an-xml-sitemap-quality-check-301-and-404.html
*
* To use this script you need to allocate a huge amount of time to maximum_execution_time to
* avoid Fatal error: Maximum execution time...I suggest to run this script on terminal.
* Ex: $ php test-xml.php > ~/Desktop/sitemap-curl-result.txt
*
* For 3000 links the average time the script consumed is around 45 minutes to 1 hour.
*/
@back2dos
back2dos / ClassList.hx
Last active Jan 8, 2020
Store all class names for runtime use.
View ClassList.hx
package ;
#if macro
import haxe.macro.Context.*;
using haxe.macro.Tools;
#end
class ClassList {
static var NAME = 'ClassList';//must be the fully qualified name of this class
macro static function build() {
@maxivak
maxivak / 00. tutorial.md
Last active May 14, 2020
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler
View 00. tutorial.md
@AndrasKovacs
AndrasKovacs / Perm.agda
Last active Apr 5, 2020
Permutation relation in Agda. In the indiuctive definition we have insertions on both sides, as opposed to one side. This makes the transitivity proof *horrible* (or at least I couldn't do better).
View Perm.agda
open import Data.List
open import Data.Nat
open import Relation.Binary.PropositionalEquality
open import Function
open import Data.Product
open import Data.Sum
data _▶_≡_ {A : Set}(x : A) : List A List A Set where
here : {xs} x ▶ xs ≡ (x ∷ xs)