Skip to content

Instantly share code, notes, and snippets.

View milabs's full-sized avatar
💭
CMake is SHIT

Ilya V. Matveychikov milabs

💭
CMake is SHIT
  • Russia, Moscow
View GitHub Profile
@milabs
milabs / kernel_user_space_howto.html
Created May 30, 2012 18:32
kernel-user space howto
http://people.ee.ethz.ch/~arkeller/linux/kernel_user_space_howto.html
@milabs
milabs / arch-linux-install
Created October 16, 2016 08:50 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@milabs
milabs / gist:754d02416ca74e6958c8b7a2b251bf1b
Created August 6, 2016 01:06
Create self-signed certificate
#!/bin/bash
out="out"
[[ $1 ]] && out="$1"
mkdir -p $out
echo "## Creating self-signed certificate -> {$out}"
openssl req -nodes -new -x509-keyout ${out}/server.key -out ${out}/server.crt
@milabs
milabs / gist:8020928
Created December 18, 2013 11:35
GCC function __attribute__ section usage example
int __attribute__((section(".khook_origin,\"awx\",@progbits#"))) function(void) { ... }
@milabs
milabs / gist:029edc8116664d9f659a
Created December 31, 2015 01:04
NGINX + RTMP + ffmpeg
1) source
ffmpeg -fflags nobuffer -re -f alsa -i hw:0,0 -c:a nellymoser -ar 11025 -ab 8k -ac 1 -f flv rtmp://${SERVER}/1
2) listen
ffplay -probesize 32 rtmp://127.0.0.1/live/1
3) server
@milabs
milabs / gist:7820818
Created December 6, 2013 09:11
CPU usage statistics with SAR
sar -u 1 | grep --line-buffered all | awk -W interactive '{printf("%s %s\n", $1, $5);}'
@milabs
milabs / gist:6467676
Created September 6, 2013 18:12
git - rename branch (local and remote)
#rename local branch
git branch -m old-branch-name new-branch-name
#delete remote branch with old name
git push origin :old-branch-name
#create remote renamed branch
git push origin new-branch-name
@milabs
milabs / gist:84224927368dd751205e
Created December 6, 2015 16:33
Wrapper for ffplay to watch RTSP disconnection without TEARDOWN
#!/usr/bin/perl -w
use strict;
no warnings 'once';
my $cmd = "ffplay -nodisp -loglevel info rtsp://SERVER/live";
pipe( READER, WRITER ) ;
my $child = open READER, '-|';
@milabs
milabs / TRObject.cpp
Created December 2, 2015 11:46
TRObject - QVariant-based property tree
#include "TRObject.h"
TRObject& TRObject::operator[](const QString& key)
{
if (type() == QVariant::Map)
return keyValue<QVariantMap>(this, key);
else if (type() == QVariant::Hash)
return keyValue<QVariantHash>(this, key);
setValue(QVariantMap());
@milabs
milabs / gist:c2c71b410bb725ea7a5a
Created November 17, 2015 13:06
Using URI::Fetch cached
use URI::Fetch;
use Cache::File;
use HTTP::Status qw(:constants);
$url = 'http://127.0.0.1:8080/media/snapshot.json.gz';
$cache = Cache::File->new(cache_root => '/tmp/cache');
$response = URI::Fetch->fetch($url, ForceResponse => 1, Cache => $cache);
if ($response->http_status == HTTP_OK) {