Skip to content

Instantly share code, notes, and snippets.

View cmndrsp0ck's full-sized avatar
🖖
Fascinating

Fabian B. cmndrsp0ck

🖖
Fascinating
View GitHub Profile
@VonHeikemen
VonHeikemen / astronvim-setup.lua
Last active October 3, 2023 11:36
Separate astronvim's configuration from Neovim's default.
--- For details of usage and explanation see:
--- https://dev.to/vonheikemen/how-to-install-astronvim-without-overriding-your-existing-neovim-configuration-1nke
local path_sep = vim.loop.os_uname().version:match('Windows') and '\\' or '/'
local join = function(...) return table.concat({...}, path_sep) end
local getpath = function(arg)
local path = vim.fn.stdpath(arg)
return vim.fn.substitute(path, [[\(.*\)\zsnvim]], 'astronvim', '')
end
@peterrus
peterrus / tilix_backup.sh
Created June 17, 2021 20:06
Backs up and restores Tilix settings
#!/usr/bin/env bash
# Backs up and restores tilix settings
set -e
if [[ $1 == 'backup' ]]; then
dconf dump '/com/gexperts/Tilix/' > tilix-settings.dconf
echo "backup done"
exit 0
@andrebrait
andrebrait / keychron_linux.md
Last active May 13, 2024 06:14
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

@mtyurt
mtyurt / ansible-vim-goto-role-tasks.vim
Last active April 20, 2023 01:21
With pearofducs/ansible-vim plugin installed, following mapping behaves like `gf`, navigates to role under cursor's tasks/main.yml file. Ideal to be used in playbooks
" vim-plug example
call plug#begin('~/.vim/plugged')
Plug 'pearofducks/ansible-vim'
call plug#end()
let g:ansible_goto_role_paths = './roles,../_common/roles'
function! FindAnsibleRoleUnderCursor()
if exists("g:ansible_goto_role_paths")
let l:role_paths = g:ansible_goto_role_paths
@pjobson
pjobson / remove_usb_guard.md
Last active March 19, 2024 19:54
Remove USB Guard From Ubuntu

Remove USB Guard From Ubuntu

If you're a sucker like me and installed usbguard on a Ubuntu variant you may find that you will have access to none of your usb devices at all, because F you. The installer automatically sets up the daemon which has no rules so will just block all of your devices. Doing a basic apt remove usbguard may fail at 25%, because also F you.

My kernel is version 4.15.0-47-generic, not sure if this stopped working at some point or what.

Regain Access

sudo echo "allow id *:*" > /etc/usbguard/rules.conf

sudo sed -i 's/PresentDevicePolicy=apply-policy/PresentDevicePolicy=allow/' /etc/usbguard/usbguard-daemon.conf

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 13, 2024 18:55
set -e, -u, -o, -x pipefail explanation
@innovia
innovia / kubernetes_add_service_account_kubeconfig.sh
Last active January 29, 2024 23:00
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@ErisDS
ErisDS / README.md
Last active November 5, 2017 02:19
Ansible tips for Ghost-Cli TODO: make this a proper repo

This assumes that you have already installed:

  • mariadb/mysql (no example provided)
  • node v6 (see node-install.yml)
  • ghost-cli latest (see ghost-cli-install.yml)
  • nginx (see nginx-install-config.yml)

After that, running install-ghost.yml will:

  • create you a db user (ghost cli may take this over in future)
@BrandonPotter
BrandonPotter / restart-kubectl-master-services.md
Last active February 23, 2021 17:25
Restart Kubernetes Master Services
for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler flanneld; do
	systemctl restart $SERVICES
	systemctl enable $SERVICES
	systemctl status $SERVICES
done

restart kubelet/node services

for SERVICES in kube-proxy kubelet flanneld docker; do

systemctl restart $SERVICES

@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of