Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 | |
"""Send files to MacOS trash bin via applescript.""" | |
import os | |
from pathlib import Path | |
import sys | |
import subprocess | |
from typing import Iterable, Union | |
def trash(paths: Iterable[Union[str, Path]]) -> int: |
This file contains 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 | |
set -Eeuf -o pipefail | |
if [ ! "$(whoami)" = root ]; then | |
echo "Please run as root" | |
exit 1 | |
fi | |
TMP="$(mktemp -d)" |
This file contains 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 | |
# http://tonylawrence.com/post/unix/fixing-corrupted-time-machine-backups/ | |
set -euf -o pipefail | |
set -x | |
if [[ $(whoami) != 'root' ]]; then | |
echo "Please run as root" > /dev/stderr | |
exit 1 | |
fi |
This file contains 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 | |
echo '# Begin n8henrie settings' >> "${HOME}"/.inputrc | |
echo '" Begin n8henrie settings' >> "${HOME}"/.vimrc | |
echo '# Begin n8henrie settings' >> "${HOME}"/.bash_aliases | |
echo '# Begin n8henrie settings' >> "${HOME}"/.bashrc | |
curl 'https://gist.githubusercontent.com/n8henrie/c69de3e3c9d99668965473d1d315c855/raw' >> "${HOME}"/.inputrc | |
curl 'https://gist.githubusercontent.com/n8henrie/3e251bfe9ac9d5ce7421/raw' >> "${HOME}"/.vimrc | |
curl 'https://gist.githubusercontent.com/n8henrie/6cf7785d0ae025e706522e6e64c3fba2/raw' >> "${HOME}"/.bash_aliases |
This file contains 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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# Reset path (or else it gets longer each time this is sourced) | |
export PATH=$(getconf PATH) | |
# http://unix.stackexchange.com/questions/40678/can-i-make-there-are-stopped-jobs-harder-to-kill | |
prompt_command() { | |
job_count=$(jobs | wc -l | tr -d ' ') | |
if [ $job_count -gt 0 ] ; then | |
prompt_job="[$job_count]" |
This file contains 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
aur_download() { | |
aur_url="https://aur.archlinux.org$(curl -s "https://aur.archlinux.org/packages/$1" | ack -o "(?<=href=\").*?tar.gz(?=\">)")" | |
echo "$aur_url" | |
read -p "Download the above url? [yn] " response | |
case $response in | |
[Yy]) | |
wget "$aur_url" | |
echo "You still need to do the usual: tar -xvf; cd; makepkg -s; pacman -U;" | |
;; | |
*) |
This file contains 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 | |
set -euf -o pipefail | |
function cleanup { | |
for pid in "${opencv_download_pid:-''}" "${contrib_download_pid:-''}" "${pip_install_pid:-''}"; do | |
if [ -z "${pid}" ]; then | |
kill "${pid}" | |
fi | |
done |
This file contains 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
Desired=Unknown/Install/Remove/Purge/Hold | |
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend | |
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) | |
||/ Name Version Architecture Description | |
+++-=====================================-==================================-============-================================================================================================== | |
ii adduser 3.115 all add and remove users and groups | |
ii adwaita-icon-theme 3.22.0-1+deb9u1 all default icon theme of GNOME | |
ii alacarte 3.11.91-2+rpi5 all easy GNOME menu editing tool | |
ii alsa-base 1.0.27+1 all dummy package to ease purging of obsolete conffiles | |
ii alsa-utils 1.1.3-1 |
This file contains 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
Desired=Unknown/Install/Remove/Purge/Hold | |
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend | |
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) | |
||/ Name Version Architecture Description | |
+++-===============================-============================-============-=============================================================================== | |
ii adduser 3.115 all add and remove users and groups | |
ii alsa-utils 1.1.3-1 armhf Utilities for configuring and using ALSA | |
ii apt 1.4.7 armhf commandline package manager | |
ii apt-listchanges 3.10 all package change history notification tool | |
ii apt-transport-https 1.4.7 armhf https download transport for APT |