Skip to content

Instantly share code, notes, and snippets.

localhost% for f in prepare run cleanup; do sysbench --test=fileio --file-test-mode=rndrw --max-time=60 --max-requests=0 --file-extra-flags=direct $f; done
sysbench 0.4.12: multi-threaded system evaluation benchmark
128 files, 16384Kb each, 2048Mb total
Creating files for the test...
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
% cat ~/.mpv/config
fullscreen
hwdec=auto
vo=opengl-hq
af-add=scaletempo
af-add=drc
cache=102400
cache-min=1
#define _FILE_OFFSET_BITS 64
#include <string.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#define N 16384
int main() {
ssize_t r, counts[256] = {0};
unsigned char buf[N];
# IPv4 address of eth0, assuming eth0 has only one IPv4 address..
require 'ohai'
sys = ::Ohai::System.new
sys.all_plugins
node = sys.data
node['network']['interfaces']['eth0']['addresses'].find {|k,v| v['family'] == 'inet'}.first
#include <xcb/xcb.h>
#include <stdio.h>
/*
gcc -o xcbtest xcbtest.c -lxcb
*/
int main() {
int i = -1;
xcb_connection_t *c;
import qualified Data.Map as M
import XMonad
import qualified XMonad.StackSet as W
import XMonad.Actions.DynamicWorkspaces
import XMonad.Config.Kde
import XMonad.Hooks.SetWMName
import XMonad.Prompt
package com.example;
class Hello {
// Simple example (unknown field name, namespace "com/example/Hello", id "noop")
@Logged
native void noop(int a);
// Complex example (known field names, namespace "com/example", id "fooed")
@Logged(id="fooed", namespace="com/example", fields=["from", "to"])
void foo(@LogFormat(As.HASHCODE) Bar source, @LogFormat(As.IDENTITY) Baz dest);
}
@pcarrier
pcarrier / _instructions
Last active December 26, 2021 17:23
Chrome Remote Desktop
The remote desktop session has to be headless :(
- Install the deb (can convert with alien & co)
- Patch with modern_distro.diff (cherry-pick what your system needs)
- To support automatic desktop resizing:
- Works with any window manager
- Build Xvfb with xvfb-randr.diff
- Expose as /usr/bin/Xvfb-randr
- If replacing system-wide binary by repackaging, simply
# ln -sf Xvfb /usr/bin/Xvfb-randr
deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse
deb http://ddebs.ubuntu.com precise main restricted universe multiverse
deb http://ddebs.ubuntu.com precise-updates main restricted universe multiverse
#!/usr/bin/env ruby
require 'yaml'
require 'murmurhash3'
require 'bundler'
require 'set'
def node_for name
"n#{MurmurHash3::V32.str_hash(name).to_s(16)}"
end