Skip to content

Instantly share code, notes, and snippets.

View alienzj's full-sized avatar
🦀
MAGs lives matter

alienzj

🦀
MAGs lives matter
View GitHub Profile
{config, pkgs, ...}: let
domain = "hauleth.dev";
mail-domain = "mail.${domain}";
sieve-data = let
stalwart-mail = config.services.stalwart-mail.package;
in pkgs.stdenvNoCC.mkDerivation {
pname = "stalwart-mail-sieve-data";
inherit (stalwart-mail) version src;
dontBuild = true;
@bobhenkel
bobhenkel / configuration-issue-fixed.nix
Last active May 28, 2024 03:54
NixOS vmware fushion config that non-root user can't move mouse cursor or click mouse buttons, but keyboard does work. With root mouse works fine.
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, lib, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
pigz -d -c in.fastq.gz |
| awk 'BEGIN {LN=0; } { if (LN == 1 || LN == 3) { print substr($0, 0, 26) } else { print $0 } ; if (LN == 3) { LN = 0 } else { LN++ } }' \
| pigz -c - > out.fastq.gz
@PhilipSchmid
PhilipSchmid / kvm-windows-10-guest-ultrawide-resolution.md
Last active November 16, 2024 07:09
3440x1440 resolution for Windows 10 KVM VM

Configure a Windows 10 KVM Guest to use an ultrawide display resolution (3440x1440)

  1. virsh edit Windows10
  2. Navigate to the <video> section and change it to the following one:
    <video>
      <model type='qxl' ram='131072' vram='131072' vgamem='32768' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
@vy-let
vy-let / configuration.nix
Created July 4, 2020 04:16
Setting up NixOS for typical home SMB file sharing
...
{
services.samba = {
enable = true;
syncPasswordsByPam = true;
# You will still need to set up the user accounts to begin with:
# $ sudo smbpasswd -a yourusername
@lilydjwg
lilydjwg / colors.py
Last active November 15, 2024 15:30
colors.py: show all kinds of terminal colors at a glance
#!/usr/bin/python3
from functools import partial
def colors16():
for bold in [0, 1]:
for i in range(30, 38):
for j in range(40, 48):
print(f'\x1b[{bold};{i};{j}m {bold};{i};{j} |\x1b[0m', end='')
print()
@SJShaw
SJShaw / combiner.py
Created July 9, 2019 13:07
Combine antiSMASH 5 result JSON files
#!/usr/bin/env python3
import json
import sys
def merge(inputs):
""" Merges the data in the given input handles and returns the result """
assert len(inputs) > 1
record_ids = set()
@MBetters
MBetters / set_kits_env_vars.sh
Last active April 24, 2021 13:46
Script to manually set the environmentVariables of all the kits in VSCode's CMake Tools' .vscode/cmake-kits.json
#!/bin/bash
# Usage: source ./set_kits_env_vars.sh /path/to/your/environment/setup/script
# Prerequisites: jq (sudo apt-get install -y jq)
# This script sources the environment script provided by the given argument
# and sets all the "environmentVariables" fields in .vscode/cmake-kits.json accordingly.
# TODO:
@andy-thomason
andy-thomason / Genomics_A_Programmers_Guide.md
Created May 14, 2019 13:32
Genomics a programmers introduction

Genomics - A programmer's guide.

Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.

https://www.genomicsplc.com

#pragma once
#include <boost/noncopyable.hpp>
#include <boost/beast/websocket.hpp>
#include <boost/beast/websocket/ssl.hpp>
struct websocket_stream : boost::noncopyable