Skip to content

Instantly share code, notes, and snippets.

View MvRens's full-sized avatar

Mark van Renswoude MvRens

View GitHub Profile
@MvRens
MvRens / .xsessionrc
Last active March 4, 2022 10:36 — forked from saper-2/.xsessionrc
Kiosk mode in Rasberry Pi (raspbian/raspberry pi os)
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
#Disable DPMS. (power save/blanking mode for display)
xset -dpms
xset s off
xset s noblank
@MvRens
MvRens / serversetup.sh
Last active June 26, 2023 06:22
Debian server basic setup
#!/bin/bash
#
# Make sure you review the contents of this file and all linked URLs before executing!
#
# To run:
# bash <(wget -qO - https://gist.githubusercontent.com/MvRens/c1d6fc7f81f109847c0cb79841d11113/raw/serversetup.sh)
#
# To skip certain steps:
# bash <(wget -qO - https://gist.githubusercontent.com/MvRens/c1d6fc7f81f109847c0cb79841d11113/raw/serversetup.sh) -s noupdate
# bash <(wget -qO - https://gist.githubusercontent.com/MvRens/c1d6fc7f81f109847c0cb79841d11113/raw/serversetup.sh) -s noupdate noinstall
@MvRens
MvRens / .bashrc
Created January 17, 2022 09:14
TMux auto-start
# Auto-attach tmux
if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then
exec tmux a
else
export TERM=xterm-256color
fi
@MvRens
MvRens / .vimrc
Last active January 23, 2022 09:38
.vimrc
syntax on
set number
set cursorline
set number relativenumber
set shiftwidth=4
set tabstop=4
set nobackup
set ignorecase
@MvRens
MvRens / .tmux.conf
Created November 19, 2021 10:52
TMux configuration
# start a new session if none exist
new-session
# make tmux display things in 256 colors
set -g default-terminal "screen-256color"
# set scrollback history to 10000 (10k)
set -g history-limit 10000
@MvRens
MvRens / KeePassXC.ahk
Last active December 3, 2018 12:34
KeePassXC Ctrl-Alt-K global shortcut to open
/*
Ctrl-Alt-K - open KeePassXC
- Assumes single instance mode (it simply starts up KeePassXC).
- Waits for up to 5 seconds until the window is visible.
- Brings it to the foreground. As of KeePassXC 2.3.3 it does not always do this
itself when launched again. Haven't tested 2.3.4 since it has an issue with
URL scheme matching disabled.
- If succesful, presses Ctrl-F to focus the search box.
*/
@MvRens
MvRens / slackpost.py
Last active February 25, 2019 08:19
Python wrapper script for Slack chat.postMessage API
#!/usr/bin/python
import sys
import argparse
import requests
parser = argparse.ArgumentParser(description = 'Slack chat.postMessage wrapper')
parser.add_argument('token', help = 'The OAuth token for your app with chat:write:bot permission.')
parser.add_argument('channel', help = 'The channel name to post to, without the pound sign.')
parser.add_argument('-m', '--message', help = 'The message to send. Either this or the file parameter is required.')