Skip to content

Instantly share code, notes, and snippets.

@blotta
blotta / dk-spotify.sh
Created September 9, 2017 01:34
Spotify running on Docker. Tested on Arch Linux with X and Pulseaudio
#!/bin/bash
KEY=$(xauth list | grep $(hostname) | awk '{ print $3 }' | head -n 1)
DCK_HOST=docker-spotify
xauth add $DCK_HOST/unix:0 . $KEY
docker run -it --rm \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/.X11-unix:/tmp/.X11-unix \
#!/bin/bash
# Stops and removes docker containers, along with its related
# volumes and custom networks. If no custom networks are being used,
# might be better to use "docker rm -v <cont>" instead
usage(){
echo -e "\n Usage: $(basename $0) CONTAINER [CONTAINER...]\n"
echo -e " Remove one or more containers, along with its assigned volumes and network interfaces\n"
exit 1
@blotta
blotta / Makefile
Last active April 22, 2017 21:30
glibc wmemchr aarch64 optimization test
BIN=wchar-tst
SRC=${BIN}.c
all: no o1 o2 o3
no: ${SRC}
gcc -o no-${BIN} ${SRC}
o1: ${SRC}
gcc -O1 -o o1-${BIN} ${SRC}
#include <sys/time.h>
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#define INPUT_NUM 500000000
struct timeval t1, t2, rate1, rate2;
void* thread_func(void* parameter){
.text
.globl _start
start = 0
max = 31
_start:
mov x28,start /* loop index */
loop:
.text
.globl _start
start = 0 /* starting value for the loop index; note that this is a symbol (constant), not a variable */
max = 10 /* loop exits when the index hits this number (loop condition is i<max) */
_start:
mov $start,%r15 /* loop index */
loop:
@blotta
blotta / loop-gas.s
Last active January 30, 2017 02:46
.text
.globl _start
start = 0 /* starting value for the loop index; note that this is a symbol (constant), not a variable */
max = 31 /* loop exits when the index hits this number (loop condition is i<max) */
_start:
mov $start,%r15 /* loop index */
loop: