Skip to content

Instantly share code, notes, and snippets.

View rkujawa's full-sized avatar

Radosław Kujawa rkujawa

View GitHub Profile
@baryluk
baryluk / plan9-run.sh
Last active April 10, 2024 19:56
Plan 9 in qemu / 9front in qemu
#!/bin/bash
wget -c https://9front.org/iso/9front-9442.0e66f87316e571f7edf5274369ec69a5905507aa.amd64.iso.gz
gunzip -k 9front-9442.0e66f87316e571f7edf5274369ec69a5905507aa.amd64.iso.gz
if ! [ -f plan9.raw ]; then
qemu-img create plan9.raw 10G
fi
exec qemu-system-x86_64 -enable-kvm \
-smp $(nproc) \
-m $((8*1024)) \
@tsungtwu
tsungtwu / nginx_reverse_proxy.md
Created November 27, 2019 04:51 — forked from KavenTheriault/nginx_reverse_proxy.md
Configure Nginx Reverse Proxy as failover

Configure Nginx Reverse Proxy as failover

In this exemple of configuration, if the first server fail (proxy_connect_timeout) one time (max_fails), the second server will be used for 60s (fail_timeout).

The SSL certificate need to be configure on the ReverseProxy server AND the proxyied servers. You can use the same certificate and configurations on all servers.

To test the configuration you can change your host file to simulate the correct domain name.

Use the following tool to configure SSL with optimal configuration.

@tnn2
tnn2 / transpose.c
Created March 1, 2019 08:55
transpose.c
#include <stdio.h>
/*
* transpose8x8(p, q):
*
* Transpose an 8x8 matrix of boolean values.
* The transpose operation switches rows into columns and vice versa.
* The booleans are represented with 1 bit each and packed into 8 bytes
* for a total of 64 bits.
*
@indigolemon
indigolemon / StartPPC
Last active August 31, 2018 17:14
Small script to enable the PowerPC processor in my Amiga 1200
In S:Startup-Sequence I added the line:
SETENV PPCStarted 0
The below is contained in S:StartPPC, which I added to the tools menu via THE
IF `GETENV PPCStarted` NOT EQ 1
IF `RequestChoice "StartPPC?" "Are you sure you want to start*nthe PowerPC?" "_Yes" "_No"` NOT EQ 0
C:PoolMem REMOVE >NIL:
Assign LIBS: SYS:libs/powerpc ADD
@sshimko
sshimko / otp.txt
Last active January 9, 2024 23:25
Yubikey + FreeIPA Manual Setup
In Yubikey tool:
1. Click OATH+HOTP tab
2. Click Advanced
3. Deselect token identifier.
4. Press Generate to create a new random seed.
@Aethylred
Aethylred / gist:0ea0d2899eca1da790aa078f9f2a885a
Last active October 31, 2023 20:52
freeipa-api-ansible-inventory
#!/usr/bin/env python
# This script uses the FreeIPA API to create an Ansible dynamic directory
# This is a shell script version of freeipa-api-inv.py
#
# DEPENDENCIES: before this script will work with AWX or Tower
# the python_freeipa module has to be installed
#
# Add this to your Docker image
# RUN pip install python_freeipa
#
@rpherrera
rpherrera / interacting-with-vici.py
Created February 21, 2018 18:38
Example on how you can interact with StrongSwan be means of Vici API
import vici
import json
s = vici.Session()
for i in s.list_sas():
print json.dumps(i, indent=2)
# sample output:
# {
# "rw": {
@stecman
stecman / _readme.md
Last active April 25, 2024 00:10
Brother P-Touch PT-P300BT bluetooth driver python

Controlling the Brother P-Touch Cube label maker from a computer

The Brother PTP300BT label maker is intended to be controlled using the official Brother P-Touch Design & Print iOS/Android app. The app has arbitrary limits on what you can print (1 text object and up to 3 preset icons), so I thought it would be a fun challenge to reverse engineer the protocol to print whatever I wanted.

Python code at the bottom if you want to skip the fine details.

Process

Intitially I had a quick peek at the Android APK to see if there was any useful information inside. The code that handles the communication with the printer in Print&Design turned out to be a native library, but the app clearly prepares a bitmap image and passes it to this native library for printing. Bitmaps are definitely something we can work with.

@Aethylred
Aethylred / freeipa_auth_suse.md
Last active February 26, 2022 23:54
Setting up FreeIPA authentication onf SUSE/SLE 12 SP2

This is the manual process for enrolling a host running SUSE/SLE 12 SP2 with FreeIPA.

The following reference documentation was used to create this process:

I do not recommend using yast to set this up, however it is useful to check if the configuration is valid. SUSE/SLE has all the required packages to use FreeIPA but does not have the conveinent ipa-client tools, such as ipa-client-install.

Pre-Requisites