Skip to content

Instantly share code, notes, and snippets.

View rsrchboy's full-sized avatar

Chris Weyl rsrchboy

View GitHub Profile
@twolfson
twolfson / .gitconfig
Last active May 3, 2023 14:48
Proof of concept to explore merge conflict resolution with SOPS encoded files for https://github.com/mozilla/sops/issues/52
[mergetool "sops-mergetool"]
cmd = ./sops-mergetool.sh "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
@dayreiner
dayreiner / log-all-zsh-bash-commands-syslog.md
Last active January 14, 2024 23:40
Log all users zsh / bash commands via syslog without 3rd-party tools or auditd

Sending Bash and ZSH Commands to Syslog

Also posted here: http://18pct.com/sending-bash-and-zsh-commands-to-syslog/

Your bash/zsh history is great if its complete, but it doesn't capture commands across all users, sudo's, root commands etc. In particular with test environments, someone may perform a "one-off" procedure and then months later it needs to be repeated. It would be nice to be able to look up what the user did at the time, and searching through multiple, possibly truncated history files is a pain.

Tools like typescript are great if you're actively documenting, but not something you would use all the time in practice and capture more than just a history of your commands. There are third-party tools like rootsh and Snoopy that can accomplish this, but third-party tools can be overkill if all you want is a quick reference in a re

@xavier83
xavier83 / afuse.service
Created January 9, 2016 09:45
Afuse Systemd Unitfile
[Unit]
Description=Afuse daemon
After=network.target
[Service]
ExecStart=/usr/bin/afuse -f -o mount_template='sshfs -o ServerAliveInterval=10 -o reconnect %%r:/ %%m' -o unmount_template='fusermount -u -z %%m' %h/.mnt/ssh
[Install]
WantedBy=default.target
@jhass
jhass / 1-Yubikey_session_lock.md
Last active January 28, 2024 13:54
Lock (Gnome) session when removing Yubico U2F key

Setup

  1. Copy 99-u2f_lock_screen.rules to /etc/udev/rules.d.
  2. Copy gnome_lock_all_sessions to /usr/local/bin.
  3. Mark gnome_lock_all_sessions as executable: chmod +x /usr/local/bin/gnome_lock_all_sessions
  4. Reload udev: udevadm control -R
:map <F9> :w<cr>:! PERL5LIB="" /usr/bin/prove -v -Ilib -I/home/cgranum/ndn/perl %<CR>
:imap <F9> <ESC>:w<cr>:! PERL5LIB="" /usr/bin/prove -v -Ilib -I/home/cgranum/ndn/perl %<CR>
:map <F10> :w<cr>:! PERL5LIB="" /opt/plack/perl/bin/prove -v -Ilib -I/home/cgranum/ndn/perl %<CR>
:imap <F10> <ESC>:w<cr>:! PERL5LIB="" /opt/plack/perl/bin/prove -v -Ilib -I/home/cgranum/ndn/perl %<CR>
function! RunFennecLine()
let cur_line = line(".")
exe "!FENNEC_TEST='" . cur_line . "' prove -v -Ilib -I. -I/home/cgranum/ndn/perl %"
endfunction
@xqms
xqms / System configuration
Created October 2, 2014 10:27
Linux configuration for Intel Graphics and NVIDIA CUDA on Lenovo T440p
This is my current system configuration. I use the intel graphics for graphics, and just keep the NVidia card running for CUDA applications. Note that this setup does not give you 3D acceleration on the NVidia card!
Sometimes (only after suspend) I have to use the attached reload_nvidia.sh script because my CUDA applications complain about a "invalid device ordinal".
BIOS version: 1.17
Linux: Ubuntu 14.04 with kernel 3.17.0-031700rc4-generic
kernel cmdline: "acpi_osi=!Windows 2012"
nvidia driver 340 manually installed from the xorg-edgers PPA:
https://launchpad.net/~xorg-edgers/+archive/ubuntu/ppa
@audionerd
audionerd / Forwarding ports from a docker container with Vagrant 1.6.md
Last active June 25, 2019 20:45
Forwarding ports from a docker container with Vagrant 1.6

Forwarding ports from a docker container with Vagrant 1.6

Vagrant 1.6 has a really nice feature which allows you to run a docker environment from any machine that can run Vagrant (even a Mac)

Behind the scenes, Vagrant creates a host VM which runs the docker containers.

The "gotcha" is: Vagrant won't automatically forward ports all the way back from the container->vagrant host VM->your mac. You have to do that step manually, by configuring your own host VM for Vagrant to use for hosting docker containers with. That host VM is told what ports to open.

Here's how I set up a local Wordpress development testing container.

@mannih
mannih / hl-var.vim
Last active August 29, 2015 14:01
Automatic variable highlighting in vim the easy way
" Vim plugin to highlight variables in Perl.
" I now created a repository from this: https://github.com/mannih/vim-perl-variable-highlighter
function! s:hlvar()
if ( exists( "w:current_match" ) )
call matchdelete( w:current_match )
unlet w:current_match
endif
let l:old_iskeyword = &iskeyword
@Ovid
Ovid / vawa.vim
Created May 16, 2014 15:30
Perl Vim Variable highlighting
" Drop this into .vim/plugin.vawa.vim
" if you already have vawa.vim, rename appropriately
" automatically highlights variables under cursor, allowing you to easily see the data flow.
" Vawa Plugin for VIM > 7.3 version 1.00
" Maintainer: Sandeep.c.r<sandeepcr2@gmail.com>
" Hacked for Perl by Curtis "Ovid" Poe <ovid@allaroundtheworld.fr>
function! s:vawa()
call clearmatches()