Skip to content

Instantly share code, notes, and snippets.

View gunchev's full-sized avatar

Doncho N. Gunchev gunchev

View GitHub Profile
@nextrevision
nextrevision / pulp_upload.py
Last active September 9, 2023 12:08
Upload RPM to Pulp Repository and Publish
#!/usr/bin/env python
import os
import sys
import requests
import argparse
import json
import time
pulp_user = 'admin'
@smirn0v
smirn0v / gist:b8e6c4bedebed23a0328
Last active January 3, 2025 00:14
Edit gerrit project config
# checkout
git fetch origin refs/meta/config:refs/remotes/origin/meta/config
git checkout meta/config
#directly:
git push origin meta/config:meta/config
#via review:
git push origin meta/config:refs/for/refs/meta/config
@shimarin
shimarin / block_device_sector_size.py
Last active January 11, 2024 13:24
Determining block device's sector size in Linux+Python
#!/usr/bin/python
import fcntl
import os
import struct
import array
import sys
BLKGETSIZE=0x1260
BLKGETSIZE64=0x80081272
BLKSSZGET=0x1268
@moregeek
moregeek / ferm.conf
Created November 26, 2013 08:35
Portknocking with ferm example
domain (ip) {
table filter {
#
# Subchains: Portknocking
# ################################################################################
chain PORT_KNOCKING_1 {
protocol tcp {
mod recent name "port_knock_seq_01" set NOP;
}
@NicolasT
NicolasT / nonblocking.py
Last active May 27, 2024 17:03
Using the 'splice' syscall from Python, in this demonstration to transfer the output of some process to a client through a socket, using zero-copy transfers. See 'splice.py'. Usage: 'python splice.py' in one console, then e.g. 'nc localhost 9009' in another. 'nonblocking.py' is a demonstration of using 'splice' with non-blocking IO.
'''
Demonstration of using `splice` with non-blocking IO
Lots of code is similar to 'splice.py', take a look at that module for more
documentation.
'''
import os
import os.path
import errno