Skip to content

Instantly share code, notes, and snippets.

@gabcoh
gabcoh / cmdline_converter.py
Last active December 17, 2019 20:57 — forked from haakov/cmdline_converter.py
Standalone GNU Radio XML -> YAML block converter script
#
# Short script for converting GNU Radio XML blocks to YAML blocks
# without having to start GRC
#
# Please note that this program _WILL_ overwrite files.
#
# How to use:
# 1. Save this file to grc/converter/cmdline_converter.py
# 2. Navigate back to the GNU Radio project root
# 3. Run: python3 -m grc.converter.cmdline_converter [name.xml]
@sam0737
sam0737 / clock.html
Last active April 25, 2024 12:24
OBS Studio: A HTML page for showing current date and time in the video
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>A simple clock</title>
</head>
<body translate="no" >
@ZimbiX
ZimbiX / fix_pacman_duplicated_database_entry_errors.py
Created April 13, 2017 00:29
Fix Pacman "error: duplicated database entry '<package>'" for Arch Linux
#!/usr/bin/env python
import os,re, datetime
d = '/var/lib/pacman/local'
packages = os.listdir(d)
packages.sort()
packages.remove('ALPM_DB_VERSION')
pkgname_search = re.compile('^(.*?)-[0-9]')
@elieux
elieux / msys2-mirror.sh
Last active April 2, 2017 14:45
MSYS2 pacman repos mirroring script
#!/usr/bin/bash
ROOT="$(pwd)"
dl() {
local cookie="/tmp/pacman-mirror-cookie.txt"
touch "${cookie}"
local file
@ccbrown
ccbrown / DumpHex.c
Last active March 27, 2024 17:32
Compact C Hex Dump Function w/ASCII
#include <stdio.h>
void DumpHex(const void* data, size_t size) {
char ascii[17];
size_t i, j;
ascii[16] = '\0';
for (i = 0; i < size; ++i) {
printf("%02X ", ((unsigned char*)data)[i]);
if (((unsigned char*)data)[i] >= ' ' && ((unsigned char*)data)[i] <= '~') {
ascii[i % 16] = ((unsigned char*)data)[i];