Skip to content

Instantly share code, notes, and snippets.

View tchap's full-sized avatar

Ondřej Kupka tchap

View GitHub Profile
#!/bin/bash
mkdir -p /dev/net
mknod /dev/net/tun c 10 200
chmod 600 /dev/net/tun
@tchap
tchap / org.pure-ftpd.ftp.plist
Last active March 2, 2016 13:02
Launchd plist for Pure-FTPd
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.pure-ftpd.ftp.plist</string>
<key>Program</key>
<string>/usr/local/sbin/pure-ftpd</string>
<key>ProgramArguments</key>
<array>
#!/usr/bin/python
#
# Requires libevent, greenlet, gevent and pyzmq.
#
# Exemplar run:
#
# $ ./poblano_backend.py
# GitHub handled by worker 1: OK
# Jenkins handled by worker 2: OK
# Review Board handled by worker 1: OK
@tchap
tchap / passportjs-github-returnto.js
Last active September 30, 2022 06:16
Set the path to return to after a successful authentication in Passport.js GitHub strategy (Express.js).
/**
* Part 1: Set up the authentication endpoints.
*/
// Point 1: Notice the checkReturnTo middleware, is defined at the bottom.
app.get('/auth/github', checkReturnTo, passport.authenticate('github', {state: 'Bublifuk'}));
// Point 2: Use 'successReturnToOrRedirect', otherwise the middleware will not work.
app.get('/auth/github/callback',
passport.authenticate('github', { successReturnToOrRedirect: '/', // IMPORTANT!
@tchap
tchap / ReviewBoard_Dockerfile
Last active December 19, 2015 11:29
Run Review Board inside of a Docker container.
# Run Review Board in a Docker container.
FROM ubuntu:latest
MAINTAINER Ondrej Kupka "[email protected]"
# Get all packages we need
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
# Install Python
@tchap
tchap / NodeJS_MongoDB_Dockerfile
Last active December 19, 2015 18:59
Dockerfile to run a Node.js server backed by MongoDB.
FROM tchap/centos-epel
MAINTAINER Ondrej Kupka "[email protected]"
# Update packages
RUN yum update -y --exclude=upstart
# Install Node.js
RUN yum install -y nodejs npm
// Explain the following benchmark results:
//
// Benchmark____SingleThread 10 155639126 ns/op
// Benchmark_MultipleThreads 5 885528027 ns/op
//
// Run on a Core i7 processor (4 cores).
package benchmarks
import (
import (
"http"
"code.google.com/p/go.net/websocket"
)
mux := http.NewServeMux()
mux.Handle("/", r)
mux.Handle("/ws", websocket.Server{
Handshake: s.handleWSHandshake,
Handler: s.handleWSConnection,
Blessing angels come be with me,
heal my spirit, mind and body.
Blessing angels come be with me,
heal my spirit, mind and body.
Blessing angels of green and gold,
heal my heart and heal my soul.
Blessing angels of violet and blue,
open my eyes to the visions of truth.
Soy un niño salvaje, inocente, libre, silvestre
Tengo todas las edades, mis abuelos viven en míii (vyslovnost: toda das edades)
Soy hermano de las nubes, solo sé compartir (vyslovnost: de las nuves)
Sé que todo es de todos y que todo está vivo en míii (vyslovnost: todo e de todos)
Mi corazón es una estrella y soy hijo de la tierra (vyslovnost: es unestreja, iho)
Viajo a bordo de mi espíritu y camino a la eternidad
-----