Skip to content

Instantly share code, notes, and snippets.

@petrsnd
petrsnd / download-bible-videos.sh
Last active Feb 19, 2018
Download all LDS Bible Videos chronologically
View download-bible-videos.sh
#!/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 Apr 28, 2017
Linux .bash_profile and .bashrc
View .bash_profile
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 Oct 6, 2017
tmux.conf based on spiceycode's
View .tmux.conf
# 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 Sep 17, 2016
iTerm2 Dark-Pastels Console Colors
View Xfce4-DarkPastels.itermcolors
<?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 Sep 14, 2016
VIM resource file
View vimrc
" 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 Aug 19, 2016
Dark-Pastels Console Colors
View pastels-dark.reg
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
; -- ------- ----------- ------------ ------- --------
View keybase.md

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:

View Microsoft.PowerShell_profile.ps1
<#
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 Jul 29, 2014
SetOwner demonstrating that I cannot change the file owner on disk.
View SetOwner.cpp
#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;