Skip to content

Instantly share code, notes, and snippets.

View deoren's full-sized avatar
💭
I may be slow to respond.

Deoren Moor deoren

💭
I may be slow to respond.
View GitHub Profile
@deoren
deoren / rename_git_branches.txt
Last active January 23, 2018 03:52
Rename Git branches
git branch --move old_branch new_branch
git checkout new_branch
git push --set-upstream origin new_branch
git push origin --delete old_branch
@deoren
deoren / movies2audio.sh
Created January 22, 2018 03:46
Convert video files to MP3, OGG format
# Bash script that uses mplayer and oggenc to rip and encode the audio from
# various movie formats to Ogg Vorbis and MP3. I assume I wrote it based
# off of the poor quality. ;)
# Remove movie file after rip/encode (1=YES, 0=NO)
REMOVE_MOVIE="0"
# Remove wav file after encode (1=YES, 0=NO)
REMOVE_WAV="1"
@deoren
deoren / get_headers.py
Created January 22, 2018 03:47
Small Python script to fetch/display HTTP response headers from web server
#!/usr/bin/env python2.7
# Purpose: Look at HTTP Response headers from requested server.
# Credit: http://stackoverflow.com/questions/843392/python-get-http-headers-from-urllib-call
import httplib
from pprint import pprint as ppr
import sys
function Get-Uptime
{
[CmdletBinding()]
param
(
[Parameter(ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)]
[Alias('hostname')]
[Alias('cn')]
[string[]]$ComputerName = $env:COMPUTERNAME
@deoren
deoren / Get-DiskFree.ps1
Created January 22, 2018 16:38 — forked from mweisel/Get-DiskFree.ps1
PowerShell advanced function (script cmdlet) to query, retrieve, and display local drive/disk information. (http://binarynature.blogspot.com/2010/04/powershell-version-of-df-command.html)
function Get-DiskFree
{
[CmdletBinding()]
param
(
[Parameter(Position=0,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)]
[Alias('hostname')]
[Alias('cn')]
@deoren
deoren / git_config.md
Last active February 4, 2018 04:07
Standard git config options

Standard git config options

Tips:

  • Use --global to set options globally (for all repos) for the current user.
  • Use --system (via sudo or su) to set options for all users.

TL;DR

  • git config --global core.editor "nano"
@deoren
deoren / git-prompt.sh
Created January 23, 2018 06:23
Shell script to override Git Bash's bash prompt on Windows (Git 2.0+)
# Create at $HOME/.config/git/git-prompt.sh
# The same content as the '%ProgramFiles%\Git\etc\profile.d\git-prompt.sh'
# file, but with the parts I don't like commented out.
# Many thanks to the great overview here:
# https://alanbarber.com/2015/12/30/how-to-customize-the-git-for-windows-bash-shell-prompt/
# and the original file for making it easy enough to see how to override
# the existing settings.
@deoren
deoren / generate_test_syslog_messages.md
Created January 24, 2018 00:16
Generate test syslog messages

How to generate test syslog messages

logger command

  • TODO

echo + netcat

  • TODO
@deoren
deoren / gist_first_comment.md
Created January 24, 2018 00:18
Standard Gist "first comment"

This is intended for copying/pasting as the first comment to all Gist entries I create. It's unfortunate that GitHub doesn't support notifying creators and participants in the feedback process for Gists, but this is at least something I can do to let potential viewers know that I'm not intentionally ignoring them.

As of the time this Gist entry was created, GitHub does not support notifications for comments for mentions to Gist entries (see isaacs/github#21 for details). Please contact me via Twitter or file an issue in the deoren/leave-feedback repo (created for that very purpose) if you wish to receive a response for your feedback. Thank you in advance!

@deoren
deoren / Ubuntu_on_Hyper-V.md
Last active May 8, 2023 11:01
Ubuntu on Hyper-V

Enabling full Hyper-V support for Ubuntu

Install packages

Short version: See docs.microsoft.com link below.

Ubuntu 17.04 and later

  1. sudo apt-get update
  2. sudo apt-get install linux-image-virtual linux-tools-virtual linux-cloud-tools-virtual