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 / 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 / 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')]
function Get-Uptime
{
[CmdletBinding()]
param
(
[Parameter(ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)]
[Alias('hostname')]
[Alias('cn')]
[string[]]$ComputerName = $env:COMPUTERNAME
@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
@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 / 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 / remove_ruby_gems.md
Last active January 23, 2018 03:52
Ubuntu: Prune ruby gems

Remove all ruby gems installed system-wide

What

Remove all gems

Why

Prepare to move away from system-installs of gems to vendor/bundle "packages"

@deoren
deoren / using_git-svn.md
Last active August 13, 2023 01:01 — forked from rickyah/using_git-svn.md
A simple guide to git-svn

Getting started with git-svn

git-svn is a git command that allows using git to interact with Subversion repositories. git-svn is part of git, meaning that is NOT a plugin but actually bundled with your git installation. SourceTree also happens to support this command so you can use it with your usual workflow.

Reference: http://git-scm.com/book/en/v1/Git-and-Other-Systems-Git-and-Subversion

Cloning the SVN repository

You need to create a new local copy of the repository with the command

@deoren
deoren / mk_mnt_img.sh
Created January 18, 2018 03:47
Create image file, format it and then mount it
#!/bin/bash
# Untested shell script to create and mount an image file. Pretty much a copy/paste
# from this site:
#
# http://ubuntuhak.blogspot.com/2012/10/how-to-create-format-and-mount-img-files.html
img_file="/tmp/bucket.img"
img_size_in_mb="1024"
mount_point="/tmp/bucket"
@deoren
deoren / git_log_options.md
Created January 14, 2018 09:04
Git log visualization tips

Git log visualization tips

Graph alongside the normal/detailed log output

This version lists a graph alongside the normal/detailed log output

git log --graph --abbrev-commit --decorate --date=relative --all

One liner with graph

git log --all --decorate --graph --oneline