Skip to content

Instantly share code, notes, and snippets.

View hansdg1's full-sized avatar

Hans Guthrie hansdg1

View GitHub Profile
@lisamelton
lisamelton / encode.sh
Last active May 23, 2025 12:46
This is the shell script I use to drive HandBrakeCLI to re-encode video files in a format suitable for playback on Apple TV, Roku 3, iOS, OS X, etc.
#!/bin/bash
# encode.sh
#
# Copyright (c) 2013 Don Melton
#
# This version published on June 7, 2013.
#
# Re-encode video files in a format suitable for playback on Apple TV, Roku 3,
# iOS, OS X, etc.
@terrywang
terrywang / jdk.sh
Last active March 27, 2019 05:33
Oracle JDK Download Script, the magic cookie comes from oab-java6 ;-) It **ONLY** works for latest Oracle JDK 7 and 8 update releases.
#!/bin/bash
# --------------------------------------
#
# Title: Oracle JDK Download Script
# Author: Terry Wang
# Email: i (at) terry (dot) im
# Homepage: http://terry.im
# File: jdk.sh
# Created: 28 August, 2013
#
@hofmannsven
hofmannsven / README.md
Last active July 30, 2025 13:50
Git CLI Cheatsheet
@tommybutler
tommybutler / smartcheck.sh
Last active February 21, 2025 08:28
Script to quickly scan the S.M.A.R.T. health status of all your hard drive devices in Linux (at least all the ones from /dev/sda to /dev/sdzz). You need smartctl installed on your system for this script to work, and your hard drives need to have S.M.A.R.T. capabilities (they probably do).
#!/bin/bash
# install the smartctl package first! (apt-get install smartctl)
if sudo true
then
true
else
echo 'Root privileges required'
@lisamelton
lisamelton / transcode-video.sh
Last active April 29, 2025 20:17
Transcode video file (works best with Blu-ray or DVD rip) into MP4 (or optionally Matroska) format, with configuration and at bitrate similar to popular online downloads.
#!/bin/bash
#
# transcode-video.sh
#
# Copyright (c) 2013-2015 Don Melton
#
about() {
cat <<EOF
$program 5.13 of April 8, 2015
@dotwaffle
dotwaffle / sort.sh
Created December 4, 2013 15:49
I'd done the following in weechat: /set logger.file.mask "%Y/%m/$plugin.$name.weechatlog" I was looking for a way of moving my old logs into this new format -- some of them were huge, and it was a pain backing them up. Having been asked on more than one occasion for a copy of the script I wrote to do this for me, I decided to publish it here. Tada.
#!/bin/bash
# place in .weechat/logs and run it.
for file in *.weechatlog
do
while read line
do
if [[ ! -d ${line:0:4}/${line:5:2} ]]
then
@pascalpoitras
pascalpoitras / 1.md
Last active August 17, 2025 13:22
My WeeChat configuration

This configuration is not maintained anymore. You should think twice before using it, Breaking change and security issue will likely eventually happens as any abandonned project.

#Requires –Version 3
#Requires -PSSnapin VMware.VimAutomation.Core
<#
.SYNOPSIS
Exports VMware host (ESX/ESXi) information to Excel
.DESCRIPTION
Queries one or more ESX/ESXi servers directly and exports all info to an Excel workbook
A new workbook/file will be created for each host
@rwenz3l
rwenz3l / mkvTitleBatch
Last active February 28, 2020 04:57
Sets the MKV Title Attribute to the filename
declare mkvpropedit="/usr/bin/mkvpropedit"
declare movieDir="/path/to/movies"
function mkvTitleEdit {
filename=$(basename "${1}")
filename="${filename%.*}"
echo mkvpropedit --set title "${filename}" "${1}"
}
export -f mkvTitleEdit
@jamischarles
jamischarles / gitmove.sh
Last active February 21, 2019 21:34
Git move - Move file to new repo and preserve history
#!/bin/bash
# $ ./gitmove [destGitRepo] [src_file]
DEST_FOLDER=$1
SOURCE_FILE=$2
# get the earliest hash of a source file to copy
HASH=$(git log --format=%H $SOURCE_FILE | tail -1)
# echo $HASH