Skip to content

Instantly share code, notes, and snippets.

View christian-korneck's full-sized avatar
💭
I may be slow to respond.

Christian Korneck christian-korneck

💭
I may be slow to respond.
View GitHub Profile
@bnoordhuis
bnoordhuis / uml-notes.md
Last active February 12, 2025 13:42
Setting up User Mode Linux on Fedora 20

user mode linux: build and run

Generate default .config.

$ make defconfig ARCH=um SUBARCH=x86_64

Build the linux ELF binary.

$ make -j8 linux ARCH=um SUBARCH=x86_64
@nacx
nacx / inverse-cidr.py
Created October 10, 2014 08:12
Compute the inverse list of CIDR blocks
"""Use it like this: main('192.168.1.0/24')"""
IPV4_MIN = 0
IPV4_MAX = 0xFFFFFFFF
def not_network(ipv4_address, ipv4_netmask):
assert IPV4_MIN <= ipv4_address <= IPV4_MAX
assert IPV4_MIN <= ipv4_netmask <= IPV4_MAX
def hostmask_netmask(m):
anonymous
anonymous / nye.py
Created December 31, 2014 20:27
Happy New Year!
import time
import os
def plopp():
time.sleep(0.5)
print("\033[0;0H ")
print( " ")
print( " # ")
print( " ")
print( " ")
anonymous
anonymous / stunts_passwd
Created January 6, 2015 19:51
Stunts (DOS Game) - Game Start Passwords
QUESTIONS AND ANSWERS
For Stunts, version 1.1 (2/12/91)
Page Line Word Question
1 12 2 ...and *destructive* stunts that can smash your car...
3 2 1 *track* selection screen. Your goal is to be on it.
3 13 4 In addition, *previewing* might give you a better...
4 4 4 ...time than missing *three* pieces of regular...
4 8 1 *proper* direction. If you get on the track...
5 12 3 hit the *cables* and crash...
@mattfahrner
mattfahrner / python-paged-ldap-snippet-2.4.py
Last active January 16, 2024 12:39
This snippet allows you to do a Python LDAP search with paged controls. The latest version now supports Python "ldap" 2.4. Many thanks to Ilya Rumyantsev for doing the 2.4 legwork.
#! /usr/bin/python
import sys
import ldap
from ldap.controls import SimplePagedResultsControl
from distutils.version import LooseVersion
# Check if we're using the Python "ldap" 2.4 or greater API
LDAP24API = LooseVersion(ldap.__version__) >= LooseVersion('2.4')
@ochinchina
ochinchina / pipe_demo.go
Created May 28, 2015 08:13
golang: connect two commands with pipe
package main
import (
"bytes"
"io"
"os"
"os/exec"
)
func main() {
@husobee
husobee / scanval.go
Last active December 16, 2022 18:44
scanner valuer example
package main
import (
"database/sql"
"database/sql/driver"
"errors"
"fmt"
_ "github.com/mattn/go-sqlite3"
)
@kizbitz
kizbitz / dockerhub-v2-api-user.sh
Last active April 17, 2023 23:30
Get the list of images and tags for a Docker Hub user account.
#!/bin/bash
# Example for the Docker Hub V2 API
# Returns all imagas and tags associated with a Docker Hub user account.
# Requires 'jq': https://stedolan.github.io/jq/
# set username and password
UNAME=""
UPASS=""
$ ssh <user>@<mac-without-screen>
$ sudo defaults write /var/db/launchd.db/com.apple.launchd/overrides.plist com.apple.screensharing -dict Disabled -bool false
$ sudo launchctl load /System/Library/LaunchDaemons/com.apple.screensharing.plist
/System/Library/LaunchDaemons/com.apple.screensharing.plist: Service is disabled
$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist
@ivan3bx
ivan3bx / ws_example.go
Created January 9, 2016 17:24
Simple 'echo' server with golang.org/x/net/websocket
package main
import (
"fmt"
"io"
"net/http"
"reflect"
"golang.org/x/net/websocket"
)