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 perl | |
use warnings; | |
use strict; | |
opendir my $dir, "/var/run/screen/S-$ENV{USER}/"; | |
foreach my $file (readdir $dir) { | |
my ($pid) = ($file =~ /^(\d+)\./); | |
next unless $pid; | |
print `pstree -p $pid`; |
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 | |
# This file goes in /lib/udev/storage.sh | |
# Based on http://superuser.com/a/630937 | |
# A matching /etc/udev/rules.d/85-storage-automount.rules should contain: | |
# ENV{DEVTYPE}=="partition", ENV{DEVNAME}!="/dev/mmcblk0p?", PROGRAM="/lib/udev/storage.sh mountpoint", ENV{MOUNTPOINT}="$result" | |
# ENV{MOUNTPOINT}!="", ACTION=="add", RUN+="/lib/udev/storage.sh add $env{MOUNTPOINT}" | |
# ENV{MOUNTPOINT}!="", ACTION=="remove", RUN+="/lib/udev/storage.sh remove $env{MOUNTPOINT}" |
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 | |
FILE=$1 | |
TARGET_SIZE=$2 | |
SIZES=() | |
INTERVAL=5 | |
CURRENT_SIZE=($(wc -c "$FILE")) | |
while [[ $CURRENT_SIZE -lt $TARGET_SIZE ]]; do | |
SIZES=("${SIZES[@]}" $CURRENT_SIZE) |
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
function install_prompt { | |
local DEFAULT="\[\e[0m\]" | |
local RED="\[\e[31m\]" | |
local GREEN="\[\e[32m\]" | |
local YELLOW_BOLD="\[\e[1;33m\]" | |
local BLUE="\[\e[34m\]" | |
local WHITE="\[\e[37m\]" | |
local WHITE_BOLD="\[\e[1;37m\]" | |
local MAGENTA_BOLD="\[\e[1;35m\]" | |