Skip to content

Instantly share code, notes, and snippets.

shared secret encryption with pass file named "pass"
openssl aes-256-cbc -a -salt -in secrets.txt -out secrets.txt.enc -kfile pass
openssl aes-256-cbc -d -a -in secrets.txt.enc -kfile pass
dockerssh() {
ssh -i chef/secret/id_rsa -p $(docker port $1 22 | cut -d: -f2) -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@localhost
}
@saltlakeryan
saltlakeryan / dual_boot_setup.md
Last active December 28, 2020 10:28
Family PC Windows / Linux Dual Boot Setup

Poor Man's SteadyState (or DeepFreeze or ReturnNil or ...)

This is the configuration I have used to set up home PCs to be resistant to the kinds of bugs and malware and spyware that seem to get installed over time on a windows PC. This is in combination with using limited accounts for everyone who uses the PC.

The quick overview is:

  • Partition hard disk into 3 partitions:
@saltlakeryan
saltlakeryan / gist:9ea9d7ff961d007fc182
Created August 24, 2014 16:47
Dragon options for sidebar
ryant@ubu:~/.wine32/drive_c/users/ryant/Desktop/dns prof$ diff ryantprofile/current/options.ini ryantprofile.backup2/current/options.ini
26,27d25
< Tracking Disabled App List={}
< Sample commands launch on open=0
ryant@ubu:~/.wine32/drive_c/users/ryant/Desktop/dns prof$ diff ryantprofile/current/soptions.ini ryantprofile.backup2/current/soptions.ini
7d6
< UseBackupDictInWords=1
## On ubuntu 14 i386
#audio stuff
sudo apt-get install alsa-oss alsa-utils alsaplayer libgnome2-bin alsaplayer-text
sudo adduser myusername audio
alsamixer #unmute channels (Ctrl+C to exit)
wget http://upload.wikimedia.org/wikipedia/en/4/45/ACDC_-_Back_In_Black-sample.ogg
alsaplayer -i text ACDC_-_Back_In_Black-sample.ogg
#dependencies
@saltlakeryan
saltlakeryan / gist:09ab64dbf2ff53d504ad
Created September 27, 2014 16:23
Install node on ubuntu
wget http://nodejs.org/dist/v0.10.32/node-v0.10.32-linux-x64.tar.gz
tar xvzf node-v0.10.32-linux-x64.tar.gz
sudo mv node-v0.10.32-linux-x64 /usr/local/
sudo ln -s /usr/local/node-v0.10.32-linux-x64/ /usr/local/node
sudo ln -s /usr/local/node/bin/node /usr/local/bin
sudo ln -s /usr/local/node/bin/npm /usr/local/bin
@saltlakeryan
saltlakeryan / gist:4aa49f19a40b83a1a7d2
Last active February 22, 2024 03:03
Redo Backup Notes
The following are command line commands for backing up /dev/sda1 in the same manner
that "redo backup and restore" uses. Note that the MD5 of the partition files will
not be the same because gzip stores info about the current time
(http://superuser.com/questions/617934/):
#mount network drive
mount.cifs '//host.example.com/fab/temp' /mnt/backup -o username=myuser,password=mypass
#save backup list (sda1 in our case)
echo sda1 > /mnt/backup/20141009.backup
@saltlakeryan
saltlakeryan / setup-snapstates.sh
Last active August 29, 2015 14:07
Helper to Set Up Backup/Restore Solution for Windows
#!/bin/bash
WINDOWS_MENU_NAME="Microsoft Windows XP Professional (on /dev/sda1)"
VMLINUZ=/boot/vmlinuz-3.13.0-32-generic
INITRD=/boot/initrd.img-3.13.0-32-generic
UBUNTU_PARTITION=/dev/sda5
set -e
echo "Writing 'Restore Windows' Menu Item to GRUB config"
cat <<EOF > /etc/grub.d/40_custom
// //////////////////////////////////////
//
// send()
//
// //////////////////////////////////////
public boolean send() {
String empty_line = "\r\n";
String html_mime_header = "MIME-Version: 1.0" + empty_line;
String html_content_type = "Content-type: text/html; charset=iso-8859-1" + empty_line;
#!/bin/bash
#
#From this command (http://www.commandlinefu.com/commands/view/3555/find-duplicate-files-based-on-size-first-then-md5-hash):
#find -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate
main() {
setSizeFilter
echo Running check for: `pwd`
echo Starting at `date +%Y-%m-%d-%H-%M-%S`
echo "Logging to $LOGDIR. SIZEFILTER = $SIZEFILTER $SIZEFILTERARGS"