Skip to content

Instantly share code, notes, and snippets.

@nathandarnell
nathandarnell / Backup RPi2 SD Card.sh
Last active August 29, 2015 14:00
Backup of some of my more important scripts and configs
#!/bin/bash
# Setting up backup directories
SUBDIR=RaspberryPi2_backups
DIR=/media/1TB/$SUBDIR
# Setting up echo fonts
red='\e[0;31m'
green='\e[0;32m'
cyan='\e[0;36m'
#!/bin/bash
#Copied from wintermute at http://forum.subsonic.org/forum/viewtopic.php?t=1546
#and adjusted to be more genaric and capable of being quickly adapted for multiple programs
#Haven't actually tested this yet though... 5/1/2014
PROGRAM=
PID=""
PATH=
function get_pid {
PID=`ps ax |grep java |grep $PROGRAM |cut -d " " -f 1`
#!/bin/bash
## Author: RonB123123
## Created: Sept 24, 2008
## Description:
## Checks if the MySQL + Apache services are running, if not
## not then start each service.
##From http://ubuntuforums.org/showthread.php?t=928475
echo "Options"
#!/bin/bash
## Author: RonB123123
## Created: Sept 24, 2008
## Description:
## Checks if the MySQL + Apache services are running, if not
## not then start each service.
##From http://ubuntuforums.org/showthread.php?t=928475
echo "Options"
echo "1 - Start"
@nathandarnell
nathandarnell / RPiBackup.sh
Last active August 29, 2015 14:00
My take on a script to make full DD backups of my SD Card to an external drive
#!/bin/bash
## Original Author: RonB123123
## Created: Sept 24, 2008
## From http://ubuntuforums.org/showthread.php?t=928475
## Also includes some code from various other sources
## Changed by Nathan Darnell
## Adapted by me to work on my RPi systems and be more flexible
## Comments welcome as I am more of a Google-r than a programmer
## TODO: save to a logfile, change to all functions,
while :
do
# show menu
echo -e "${green}${bold}Do you want to delete these failed backups? [y/n?]${NC}${normal}"
read yno
case $yno in
[yY] | [yY][Ee][Ss] )
echo "Agreed, which is to bad since it doesn't do anything yet.";
#Uncomment this to actually delete those bad backups sudo find $DIR/ -maxdepth 1 -mindepth 1 ! -name "*.img" -exec md5sum {} \;
exit 0
CROSS COMPILING FFMPEG FOR THE RASPBERRY PI
This is how to cross compile ffmpeg with x264 support for the Raspberry Pi on a Debian 6 64bit host.
Build environment
First set up your build environment by installing the build-essential and git packages from the Debian repo and cloning the debian cross compiling toolchain from GitHub:
$ sudo apt-get install build-essential git-core
$ sudo git clone https://github.com/raspberrypi/tools.git /opt/tools

Capybara

save_and_open_page

Matchers

have_button(locator)
@nathandarnell
nathandarnell / Proxmox-Backup-to-Google-Drive
Last active March 24, 2024 15:43
A script to backup Proxmox backups to Google Drive and delete any over a certain limit
#All backups go to here automatically:
#/var/lib/vz/dump
#install rclone if uninstalled or update available
#downloads page is http://rclone.org/downloads/
wget http://downloads.rclone.org/rclone-current-linux-amd64.zip
# version on webpage is http://downloads.rclone.org/rclone-v1.33-linux-amd64.zip
# from: http://blog.mattwynne.net/2008/04/26/fetch-and-parse-html-web-page-content-from-bash-wow/
# Download ZIP, keep zip in working folder, check future runs against HTML piped through w3c for newer versions
# from: http://tips.webdesign10.com/scrape-web-pages-gnu-linux-shell:
@nathandarnell
nathandarnell / rsa.py
Created January 13, 2017 19:42 — forked from tylerl/rsa.py
RSA Explained in Python
#!/usr/bin/env python
# This example demonstrates RSA public-key cryptography in an
# easy-to-follow manner. It works on integers alone, and uses much smaller numbers
# for the sake of clarity.
#####################################################################
# First we pick our primes. These will determine our keys.
#####################################################################