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
/* Link with -lXRes -lX11 */ | |
#include <X11/Xlib.h> | |
#include <X11/extensions/XRes.h> | |
#include <stdio.h> | |
int main() { | |
Display *display = NULL; | |
XResClient *clients = NULL; |
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
egrep -c '\.(cpp|cc|c) ' $(fgrep -l 'ProtocolUtils.h' **/.deps/*.o.pp) | cut -d: -f2 | awk '$1>=1{t+=$1-1}END{print t}' |
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
jitter[] := | |
RandomReal[{500, 2500}]* | |
RotationTransform[RandomReal[{0, 2*Pi}]][{1, 0}] | |
Table[With[{points = Table[jitter[], 20]}, | |
With[{annuli = Annulus[#, {500, 2500}] & /@ points}, | |
Show[Graphics[{Opacity[0.05], annuli}], | |
Graphics[{Yellow, Point /@ points, Circle[{0, 0}, 500], | |
Circle[{0, 0}, 2500]}], | |
RegionPlot[RegionIntersection @@ Region /@ annuli, |
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
(define (m5 x y) | |
(cons (+ (* (car x) (car y)) (* 5 (cdr x) (cdr y))) | |
(+ (* (car x) (cdr y)) (* (cdr x) (car y))))) | |
(define (q5 x) (m5 x x)) | |
(define (p5 x n) | |
(cond ((zero? n) '(1 . 0)) | |
((even? n) (q5 (p5 x (/ n 2)))) | |
(#t (m5 x (q5 (p5 x (/ (- n 1) 2))))))) |
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
name: firefox | |
version: 65.0a1-20181114194420 | |
summary: Mozilla Firefox web browser | |
description: Firefox is a powerful, extensible web browser with support for modern web application technologies. | |
confinement: strict | |
grade: stable | |
apps: | |
firefox: | |
command: desktop-launch $SNAP/firefox |
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/env python | |
import os, sys, ctypes | |
CLONE_NEWNS = 0x00020000 | |
CLONE_NEWUSER = 0x10000000 | |
CLONE_NEWPID = 0x20000000 | |
c = ctypes.CDLL("libc.so.6", use_errno=True) | |
def errwrap(f): | |
def wrapped(*args): |
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 <sys/socket.h> | |
#include <sys/types.h> | |
#include <sys/un.h> | |
#include <stdio.h> | |
#include <string.h> | |
#define LEN_B 15 | |
#define LEN_C 16 | |
int main() { |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define LARGENUM 0x80000001 | |
int main() | |
{ | |
char* buf = malloc(LARGENUM + 1); | |
memset(buf, 'X', LARGENUM); |
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
extern "C" MOZ_EXPORT int | |
connect(int sockfd, const struct sockaddr* addr, socklen_t addrlen) | |
{ | |
static auto sRealFunc = | |
(int (*)(int, const struct sockaddr*, socklen_t)) | |
dlsym(RTLD_NEXT, "connect"); | |
auto pid = getpid(); | |
if (addr == nullptr) { | |
SANDBOX_LOG_ERROR("connect[%d]: %d to nullptr", pid, sockfd); |
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/sh | |
exec qemu-system-x86_64 -enable-kvm \ | |
-monitor stdio \ | |
-hda vidyo.qcow2 \ | |
-m 4096 -smp 4 \ | |
-balloon virtio \ | |
-vga qxl \ | |
-usb \ | |
-device usb-ehci,id=ehci \ | |
-device usb-host,bus=ehci.0,vendorid=0x046d,productid=0x082d \ |
NewerOlder