This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# Script to print out outdated Linux kernel packages, and print them to stdout. | |
# Can be used as: | |
# | |
# sudo -v | |
# python3 cleanup_linux_pkg.py | xargs sudo apt-get remove -y | |
# | |
# But please do confirm the output packages are correct by inspecting the | |
# printed list first! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# One file name is expected as arguent, which is assumed to be a file in | |
# conflict, after a merge or cherry-pick. This script opens the file that | |
# belongs to the common ancestor, our (the target branch's) copy, their | |
# (incoming commit), and the current copy (conflicted) in a layout below | |
# | |
# +---------------------+ | |
# | common | | |
# +---------+-----------+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Script for hands-free use of 'git show-branch', with the option of specifying | |
# unwanted refs by prefixing with ^ at the command line (syntax elsewhere | |
# permitted). Refs to be ignored permanently can be added to $sed_script below | |
# Main upstream branch | |
upstream="${upstream:-origin/master}" | |
# Refs pattern to always ignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# For each branch in the repository, get the branch description from | |
# Git config, and print in a neat fashion | |
[ -d .git ] || exit 1 | |
git for-each-ref refs/heads --format='%(refname:short)' | grep -v '\.stgit' | | |
xargs bash -c ' | |
head="$(git symbolic-ref --short HEAD)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Find SQLite data base in a directory and print those that were locked | |
# | |
find -type f -print0 | | |
xargs -0 file | | |
# Filter sqlite data base files | |
awk -F: -vIGNORECASE=1 '/sqlite/{printf "%s\0", $1}' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Receive a list of revisions from rev-list. For each revision, generate a file | |
# name from a commit subject, prefixed with a 4-digit count | |
# | |
# All this acrobatics only becuase format-patch refuses to generate a single | |
# patch witout a numbered suffix | |
git rev-list --reverse --left-only --no-merges --cherry-pick mainline/v3.17...github/juno-beta -- arch/arm64/{kernel,boot,mm} mm | | |
xargs bash -c ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Find in $kindle/document directory, directories without a corresponding .mobi | |
# or .azw files | |
set -e | |
kindle="${kindle:?}" | |
cd "$kindle/documents" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2011-10-04 | |
# | |
# _______________| noise : ambient Brown noise generator (cf. white noise). | |
# | |
# Usage: noise [minutes=59] [band-pass freq center=1786] [wave] | |
# ^minutes can be any positive integer. | |
# Command "noise 1" will display peak-level meter. | |
# | |
# Dependencies: play (from sox package) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to remove old kernel image and header packages. The script only picks | |
# up packages that are older than the current kernel (so as to not to remove the | |
# current or any recently-installed kernels | |
current_version="$(uname -a | awk '{print $3}')" # 3.2.0-69-generic | |
cv_1="$(echo "$current_version" | awk -F- '{print $1}')" # 3.2.0 | |
cv_2="$(echo "$current_version" | awk -F- '{print $2}')" # 69 | |
pkg_list="$(mktemp)" |