Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@silvercircle
silvercircle / dbus_mail_notify.py
Created November 6, 2022 09:40
Python script to create desktop notifications for new mail that can be used by procmail
#!/usr/bin/python
# simple procmail filter to display a desktop notification
# usage: mailnotify username. Excepts the mail on stdin
# this is meant to live in a procmail recipe, for example:
# pipe the msg to this script to send a notification and deliver via
# dovecot-lda
#:0
#{
# :0c
@silvercircle
silvercircle / CMakeLists.txt
Created January 18, 2020 08:48
Sample CMake Qt Project for CLion
#
# sample CMakeLists.txt for a simple Qt project using CLion IDE
# shows how to use AUTOMOC, AUTOUIC
#
# sources are expected in source/
# includes in include/
#
cmake_minimum_required(VERSION 3.0)
set(TARGET_NAME Qttest)
@silvercircle
silvercircle / cinnamon_compile.md
Last active December 7, 2019 22:04
Compile cinnamon from git repo on Ubuntu 19.10

Compile cinnamon from GIT on Ubuntu 19.10 (or later)

Basically, it's straightforward, but one can run into minor issue. First, you need all the prerequisites for building debian packages like dpkg-dev, C compilers, the full set of autotools and more. While building, dpkg-buildpackage is verbose enough to indicate missing dependencies. Should that happen, apt install them and restart the build process.

Official instructions:

http://developer.linuxmint.com/reference/git/cinnamon-tutorials/building.html

Follow them step-by-step.

@silvercircle
silvercircle / tlb.sh
Last active December 8, 2019 22:59
revert the BIOS fix that disables L3 caching on AMD processors with the TLB cache coherency bug (early Phenoms of B1 and B2 stepping, long obsolete, kept for historical reasons)
#!/bin/bash
MSR1=0xC0010015
MSR2=0xC0011023
# revert the BIOS fix that disables L3 caching on AMD processors
# with the TLB cache coherency bug (early Phenoms before the B3 stepping)
# needs msr-tools package
@silvercircle
silvercircle / componentwhacker.d
Last active August 23, 2019 22:12
remove all components for an installer package from the registry.
module main;
/++
+ whack all compontents for an installed package
+ quick and dirty
+
+ dub build --build=release --compiler=dmd --arch=x86_64
+/
import std.stdio, std.string: indexOf;
"
This is my emacs configuration file. It's optimized to be used with emacs in
daemon mode, but should work without.
Tested and compatible with Emacs 25.3 and Emacs 26 on FreeBSD and several Linux
flavors. Note that display-line-numbers-mode REQUIRES Emacs 26+.
required elpa modules:
treemacs
@silvercircle
silvercircle / e.sh
Created April 10, 2018 06:00
Start emacsclient and only create a new frame if none exists. Otherwise reuse frame. Pass -nw to force console-emacs
#!/bin/bash -e
if [[ "$DISPLAY" ]]; then
frame=`emacsclient -a '' -e "(member \"$DISPLAY\" (mapcar 'terminal-name (frames-on-display-list)))" 2>/dev/null`
[[ "$frame" == "nil" ]] && opts='-c' # if there is no frame open create one
[[ "${@/#-nw/}" == "$@" ]] && opts="$opts -n" # don't wait unless we've asked to run in a terminal
else
opts='-nw'
fi
@silvercircle
silvercircle / arcdark.conf
Created April 4, 2018 09:55
Geany theme to match Arc-Dark
# No explicit license available
#
# Based on Monokai
# Indicated author and assumed copyright holder is:
# Wimer Hazenberg <monokai.nl>
#
# Originally ported to Geany and tweaked by Thanh Tran
# <trongthanh(at)gmail(dot)com>
#
# Slightly modified to match the Arc color scheme by
@silvercircle
silvercircle / tmux-cheatsheet.markdown
Last active October 31, 2017 14:31 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

Tmux shortcuts & cheatsheet

Start new:

    tmux

Start a new session and name it:

    tmux new -s myname
@silvercircle
silvercircle / vsconfig.json
Last active September 2, 2017 11:07
My Visual Studio Code config
{
"editor.fontFamily": "'Iosevka', Consolas, 'Courier New', monospace",
"editor.fontSize": 16,
"editor.minimap.renderCharacters": false,
"editor.cursorStyle": "block",
"editor.cursorBlinking": "phase",
"editor.showFoldingControls": "always",
"editor.minimap.showSlider": "always",
"window.restoreWindows": "all",
"explorer.openEditors.visible": 0,