Skip to content

Instantly share code, notes, and snippets.

View winny-'s full-sized avatar
๐Ÿ‘‹
***status goes here***

Winston (Winny) Weinert winny-

๐Ÿ‘‹
***status goes here***
View GitHub Profile
@DinoChiesa
DinoChiesa / dired-additions.el
Created May 8, 2025 04:35
Copy or move files or directories from one dired buffer to another
(defun mode-for-buffer (&optional buffer-or-string)
"Returns the major mode associated with a buffer."
(with-current-buffer (or buffer-or-string (current-buffer))
major-mode))
(defun my-dired-copy-or-move-other-window (operation)
"Copy or move the marked files to another directory.
OPERATION is a symbol, either `COPY' or `MOVE' .
This works with files or directories."
(unless (eq major-mode 'dired-mode)
@Inc0n
Inc0n / ob-gdb.el
Last active June 9, 2025 19:34
ob-gdb.el -- org babel support for interacting with gdb in org-mode
;;; ob-gdb.el --- Babel Functions for Gdb Evaluation -*- lexical-binding: t; -*-
;;; Commentary:
;; Org-Babel support for running gdb
;;; Code:
(require 'org-macs)
(org-assert-version)
@azubkokshe
azubkokshe / gist:e26cb34e3e836356106a470ce9fcf674
Last active June 3, 2025 13:45
Write all tmux scrollback to a file
  1. Use prefix + :, then type in capture-pane -S -3000 + Return. (Replace -3000 with however many lines you'd like to save, or with - for all lines.) This copies those lines into a buffer.
  2. Then, to save the buffer to a file, just use prefix + : again, and type in save-buffer /home/{user}/filename.txt + return.

(By default Prefix is Ctrl+B.)

Managing firewalld

firewall-cmd --state     # Display whether service is running
firewall-cmd --reload    # To reload the permanent rules without interrupting existing persistent connections

list details of default and active zones

firewall-cmd --get-default-zone
#lang racket/base
(define (signed-var-int val)
(cond
[(bitwise-bit-set? val 31)
(bitwise-ior val (bitwise-not #xffffffff))]
[else
val]))
(define (read-var-int in)
@HappyCodingRobot
HappyCodingRobot / 61-hp-mic-mute-hotkey.hwdb
Created January 8, 2019 14:22
Activate mic mute function key, ubuntu 18.04, HP Elitebook 820
# see also: /lib/udev/hwdb.d/60-keyboard.hwdb
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pn*EliteBook*:pvr*
KEYBOARD_KEY_81=f20 # Fn+F8 on Elitebook, map to F20
# KEYBOARD_KEY_81=fn_esc # org entry
@krisleech
krisleech / renew-gpgkey.md
Last active June 1, 2025 14:40
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@JBlond
JBlond / bash-colors.md
Last active June 13, 2025 09:33 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active June 11, 2025 03:12
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@cryzed
cryzed / fix-infinality.md
Last active June 1, 2025 17:12
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08: