Skip to content

Instantly share code, notes, and snippets.

View hackrole's full-sized avatar

hackrole hackrole

View GitHub Profile
@hackrole
hackrole / flycheck-ruff.el
Created November 22, 2023 02:03 — forked from abo-abo/flycheck-ruff.el
Emacs ruff flycheck config
(require 'flycheck)
;; From https://github.com/flycheck/flycheck/issues/1974#issuecomment-1343495202
(flycheck-define-checker python-ruff
"A Python syntax and style checker using the ruff utility.
To override the path to the ruff executable, set
`flycheck-python-ruff-executable'.
See URL `http://pypi.python.org/pypi/ruff'."
:command ("ruff"
"--format=text"
@hackrole
hackrole / codesign_gdb.md
Created February 18, 2022 05:38 — forked from gravitylow/codesign_gdb.md
Codesign gdb on macOS

If you are getting this in gdb on macOS while trying to run a program:

Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
  1. Open Keychain Access
  2. In menu, open Keychain Access > Certificate Assistant > Create a certificate
  3. Give it a name (e.g. gdbc)

There's a couple of ways, one way is

  • Get search results
    • Do SPC / and type in your search string
    • or SPC x S and search string - where x is your scope indicator (p for project, d for directory, etc..)
  • Once you have the occurences you want, hit C-c C-e inside the helm buffer to put all your match occurences and puts them into a special buffer called the edit buffer or something like that
  • in that buffer you can use any commands you'd normally use on a buffer
  • the C-c C-c to commit your changes.

Application

Google Keep

zoom

temviewer

Dingtalk

calibre

pycharm CE

Authy

Keybase

Chrome

@hackrole
hackrole / pexpect_jumpserver.py
Created January 15, 2020 02:54
use pexpect to auto login in gist and catch win size signal
import pexpect
import pyotp
import signal
import struct
import sys
import fcntl
import termios
import json
from pathlib import Path
@hackrole
hackrole / loading.org
Created October 30, 2018 02:12 — forked from TheBB/loading.org
Loading in Spacemacs

Emacs packages, features, files, layers, extensions, auto-loading, require, provide, use-package… All these terms getting you confused? Let’s clear up a few things.

Files

Emacs files contains code that can be evaluated. When evaluated, the functions, macros and modes defined in that file become available to the current Emacs session. Henceforth, this will be termed as loading a file.

One major problem is to ensure that all the correct files are loaded, and in the

@hackrole
hackrole / docker.yml
Created October 25, 2018 09:02 — forked from rbq/docker.yaml
Install Docker CE on Ubuntu using Ansible
---
- hosts: all
tasks:
- name: Install prerequisites
apt: name={{item}} update_cache=yes
with_items:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
@hackrole
hackrole / docstrings.py
Created October 24, 2018 09:43 — forked from redlotus/docstrings.py
Google Style Python Docstrings
# -*- coding: utf-8 -*-
"""Example Google style docstrings.
This module demonstrates documentation as specified by the `Google Python
Style Guide`_. Docstrings may extend over multiple lines. Sections are created
with a section header and a colon followed by a block of indented text.
Example:
Examples can be given using either the ``Example`` or ``Examples``
sections. Sections support any reStructuredText formatting, including
@hackrole
hackrole / pass.md
Created July 19, 2018 12:25 — forked from abtrout/pass.md
Using password-store with git repository synching

Password-store keeps your passwords (or any other sensitive information) saved in GnuPG encrypted files organized in ~/.password-store. For more information about GPG, consult the GNU Privacy Handbook.

Getting started

To get started, install pass and generate a keypair.

$ brew install pass
$ gpg --gen-key
$ gpg --list-keys
@hackrole
hackrole / vimdiff.md
Created May 31, 2018 02:57 — forked from mattratleph/vimdiff.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)