Skip to content

Instantly share code, notes, and snippets.

Oleg Mitrofanov reider-roque

Block or report user

Report or block reider-roque

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
cuibonobo /
Last active Nov 8, 2019
VGA Passthrough on virtual machines in CentOS 7

Mainline kernel

After your fresh CentOS 7 setup (make sure you install the QEMU/KVM virtualization tools and virt-manager), install the mainline kernel:

sudo rpm --import
sudo rpm -Uvh
sudo yum --enablerepo=elrepo-kernel install kernel-ml
sudo yum -y update
jtdowney /
Last active Feb 14, 2019
Create ECB pattern images

This gist describes how to use the ImageMagick and OpenSSL command line tools to encrypt an image using ECB mode.

First we need to gather some information about the original image. This will tell us what size to use in our final step.

$ identify Braintree.png
Braintree.png PNG 898x229 898x229+0+0 8-bit sRGB 65KB 0.000u 0:00.000

Looks like the image is 898x229.

Next we need to convert the image into the RGBA format. This is a simple binary format that only contains uncompressed pixel data and no meta information, like image dimensions.

willurd /
Last active Jan 18, 2020
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
View hw5.rkt
;; Programming Languages, Homework 5
#lang racket
(provide (all-defined-out)) ;; so we can put tests in a second file
;; definition of structures for MUPL programs - Do NOT change
(struct var (string) #:transparent) ;; a variable, e.g., (var "foo")
(struct int (num) #:transparent) ;; a constant number, e.g., (int 17)
(struct add (e1 e2) #:transparent) ;; add two expressions
(struct ifgreater (e1 e2 e3 e4) #:transparent) ;; if e1 > e2 then e3 else e4
clintel / gist:1155906
Created Aug 19, 2011
Fenced code in bullet lists with GitHub-flavoured MarkDown??
View gist:1155906

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    More Code
pklaus /
Created Jan 29, 2010
Python: List all Network Interfaces On Computer
# Use those functions to enumerate all interfaces available on the system using Python.
# found on <>
import socket
import fcntl
import struct
import array
def all_interfaces():
max_possible = 128 # arbitrary. raise if needed.
You can’t perform that action at this time.