Skip to content

Instantly share code, notes, and snippets.

@petrsnd
petrsnd / get_rfc.sh
Created July 22, 2022 19:15
Fetch and RFC and make it printable as a booklet
#!/bin/bash
# Dan Peterson
# Threw out Matt's old stuff and now I just use pdfbook2 to generate the booklet
if test -t 1; then
YELLOW='\033[1;33m'
RED='\033[1;31m'
NC='\033[0m'
fi
@petrsnd
petrsnd / download-bible-videos.sh
Last active February 19, 2018 02:30
Download all LDS Bible Videos chronologically
#!/bin/bash
# petrsnd
# Download all LDS Bible Videos chronologically
# Be sure to select your desired resolution by changing the variable below:
RES="1080p"
#RES="720p"
# As of 2017-05-08 this script was able to download all of the Bible Videos from the
@petrsnd
petrsnd / .bash_profile
Last active April 28, 2017 20:04
Linux .bash_profile and .bashrc
source $HOME/.bashrc
set -o vi
# setup Lynx
export WWW_HOME=https://google.com
# setup PATH
export PATH=$HOME/scripts:$PATH
@petrsnd
petrsnd / .tmux.conf
Last active January 20, 2024 18:13
tmux.conf based on spiceycode's
# Based on: https://gist.github.com/spicycode/1229612
set-option -g default-shell "/bin/bash"
# 1,2,3 is more natural for fingers than 0,1,2
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
@petrsnd
petrsnd / Xfce4-DarkPastels.itermcolors
Created September 17, 2016 05:20
iTerm2 Dark-Pastels Console Colors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.24705882352941178</real>
<key>Green Component</key>
<real>0.24705882352941178</real>
@petrsnd
petrsnd / vimrc
Created September 14, 2016 21:36
VIM resource file
" Configuration file for vim
set modelines=0 " CVE-2007-2438
" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible " Use Vim defaults instead of 100% vi compatibility
set backspace=2 " more powerful backspacing
syntax on " syntax highlighting
@petrsnd
petrsnd / pastels-dark.reg
Created August 19, 2016 22:00
Dark-Pastels Console Colors
Windows Registry Editor Version 5.00
; Registry file that maps the pastels palette to the 16 avaliable colors
; in a Windows command prompt. Note, hex values in the table are RGB but byte
; ordering of a DWORD is BGR, e.g. "ColorTable<##>"=dword:00<B><G><R>
;
; Pastels color table from xfce4-terminal settings.
;
; NR cmd.exe PowerShell PASTELS HEX DWORD
; -- ------- ----------- ------------ ------- --------

Keybase proof

I hereby claim:

  • I am petrsnd on github.
  • I am petrsnd (https://keybase.io/petrsnd) on keybase.
  • I have a public key whose fingerprint is A3F2 F824 8B3C 885A 5B78 98A5 6981 C173 677D C61B

To claim this, I am signing this object:

@petrsnd
petrsnd / Microsoft.PowerShell_profile.ps1
Last active August 9, 2016 21:17
My Powershell Profile
<#
Prerequisites:
- Sublime Text 3
- VIM 7.4
- GitHub for Windows
I highly recommend ConEmu for use with Powershell.
I install ConEmu using Chocolatey and then change my start screen links to point to
ConEmu, Target="C:\Program Files\ConEmu\ConEmu64.exe" /font "Consolas" /size 16 /bufferheight 9999 /cmd powershell
#>
@petrsnd
petrsnd / SetOwner.cpp
Created July 29, 2014 17:10
SetOwner demonstrating that I cannot change the file owner on disk.
#include <Windows.h>
#include <AclAPI.h>
#include <Sddl.h>
#include <stdio.h>
static
BOOL
SetPrivilege(HANDLE hToken, LPCTSTR lpszPrivilege, BOOL bEnablePrivilege) {
TOKEN_PRIVILEGES newState = { 0 };
LUID luid;