Skip to content

Instantly share code, notes, and snippets.

View bluecmd's full-sized avatar

Christian Svensson bluecmd

  • Stockholm, Sweden
View GitHub Profile
@jcbrinfo
jcbrinfo / ttk-themes.md
Last active June 6, 2021 18:46
How to set the Ttk theme

How to set the theme of a Ttk application on Linux

Ttk applications like git-gui and gitk look ugly by default on Linux because the default Ttk tries to emulate Motif. Here is how to make them less ugly.

  1. Choose a Ttk theme. A partial list is provided by the official wiki of TCL.
  2. If the chosen a theme that is not built-in:
    1. If not already done, create a directory dedicated to Ttk themes. Example: mkdir ~/.local/share/tk-themes
    2. Put the theme’s directory (there should be a pkgIndex.tcl file at its root) in it. For example, if we want the Clearlooks theme, we copy the content of the themes/clearlooks directory of the “Ttk themes” project (see the link above) in ~/.local/share/tk-themes/clearlooks
    3. If not already done, add the line export TCLLIBPATH= (where `` is the path to the directory where you put your Ttk themes) to your ~/.profile file (or whatever the script that e
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using VirtualJtag.Constant;
using VirtualJtag.Instruction;
namespace VirtualJtag.Communicate
{
public unsafe class TmsControl
{
@ixs
ixs / intel_x520_patcher.py
Last active March 10, 2025 13:47
Intel x520 EEPROM Patcher allows to unlock the x520 network card to work with non-intel branded SFP modules.
#!/usr/bin/env python3
#
# Simple Intel x520 EEPROM patcher
# Modifies the EEPROM to unlock the card for non-intel branded SFP modules.
#
# Copyright 2020,2021,2022 Andreas Thienemann <[email protected]>
#
# Licensed under the GPLv3
#
# Based on research described at https://forums.servethehome.com/index.php?threads/patching-intel-x520-eeprom-to-unlock-all-sfp-transceivers.24634/
@bluecmd
bluecmd / pcap-docker.sh
Created July 31, 2022 09:54
PCAP a docker container
sudo nsenter --net=$(docker inspect --format='{{.NetworkSettings.SandboxKey}}' $(docker ps | awk '/the-container-name/ {print $1}')) tshark -i eth0 -n -w /tmp/capture.pcap
@bluecmd
bluecmd / tuneable.c
Last active October 13, 2024 12:26
Simple utility to test tuneable SFP modules implementing SFF-8690
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdint.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
int fd = open(argv[1], O_RDWR);
if (fd < 0) {
perror("open");