Skip to content

Instantly share code, notes, and snippets.

View pts's full-sized avatar

Péter Szabó pts

View GitHub Profile
@zserge
zserge / guest.S
Created May 10, 2020 08:41
A tiny KVM host to run a 16-bit real mode "kernel"
# A tiny 16-bit guest "kernel" that infinitely prints an incremented number to the debug port
#
# Build it:
#
# as -32 guest.S -o guest.o
# ld -m elf_i386 --oformat binary -N -e _start -Ttext 0x10000 -o guest guest.o
#
.globl _start
from ctypes import *
from struct import *
winmm = windll.winmm
vol = c_ulong()
print('res', winmm.waveOutGetVolume(0, byref(vol)))
print('left:', vol.value & 0xffff, 'right:',vol.value >> 16)

Transcript of http://www.youtube.com/watch?v=bzkRVzciAZg

p1: And in conclusion we have found apache to be an excellent server for our web applications. Any questions?

p2: Yes, I have a question. Why didn't you use node.js? node.js is an event driven, non-blocking IO server that can be used to build high-performance web applications

p1: That is an excellent queiston. We evaluated several alternative webservers and concluded, that while options like node.js are very interesting, Apache meets our needs and has a solid track record.

p2: But it doesn't have performance. Everybody knows that apache applications are slow because they use blocking IO and have context switches.

@ssp
ssp / git-extract-file.markdown
Created January 23, 2012 13:21
Extract a single file from a git repository

How to extract a single file with its history from a git repository

These steps show two less common interactions with git to extract a single file which is inside a subfolder from a git repository. These steps essentially reduce the repository to just the desired files and should performed on a copy of the original repository (1.).

First the repository is reduced to just the subfolder containing the files in question using git filter-branch --subdirectory-filter (2.) which is a useful step by itself if just a subfolder needs to be extracted. This step moves the desired files to the top level of the repository.

Finally all remaining files are listed using git ls, the files to keep are removed from that using grep -v and the resulting list is passed to git rm which is invoked by git filter-branch --index-filter (3.). A bit convoluted but it does the trick.

1. copy the repository to extract the file from and go to the desired branch