This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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, '-|'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* memset_volatile is a volatile pointer to the memset function. | |
* You can call (*memset_volatile)(buf, val, len) or even | |
* memset_volatile(buf, val, len) just as you would call | |
* memset(buf, val, len), but the use of a volatile pointer | |
* guarantees that the compiler will not optimise the call away. | |
*/ | |
void * (* volatile memset_volatile)(void *, int, size_t) = memset; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Q: Where to get debug symbols for kernel X? | |
A: http://ddebs.ubuntu.com/pool/main/l/linux/ | |
codename=$(lsb_release -c | awk '{print $2}') | |
sudo tee /etc/apt/sources.list.d/ddebs.list << EOF | |
deb http://ddebs.ubuntu.com/ ${codename} main restricted universe multiverse | |
deb http://ddebs.ubuntu.com/ ${codename}-security main restricted universe multiverse | |
deb http://ddebs.ubuntu.com/ ${codename}-updates main restricted universe multiverse | |
deb http://ddebs.ubuntu.com/ ${codename}-proposed main restricted universe multiverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# echo "chromium-browser hold" | sudo dpkg --set-selections | |
# dpkg --get-selections | grep chromium... | |
# echo "chromium-browser install" | sudo dpkg --set-selections |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git format-patch --cover-letter --attach --stdout -2 --subject-prefix="..." --to=<...> | formail -ds >> $HOME/.thunderbird/k350j4w1.default/Mail/Local\ Folders/Drafts |
NewerOlder