Tag: bash
-
ZFS Snapshot alias
Add this to your .bash_aliases for fun and profit: function Snapshot () { local dst=”” local atnam=”” if [ -z “$1″ ]; then dst=`df -l . | tail -1 |awk ‘{print $1}’` else if [[ $1 = *@* ]]; then atnam=”${1##*@}” dst=”${1%%@*}” fi dst=`df -l “$dst” | tail -1 |awk ‘{print $1}’` fi [ -z…
-
Apply ZFS driver settings without reboot
Apply your modprobe.d values without rebooting: egrep -v ‘^#|^\s*$’ zfs.conf \ | while read L; do M=($L) N=${M[2]} P=(${N/=/ }) echo “${P[1]}” > /sys/module/zfs/parameters/${P[0]} done #zfs #linux #bash
-
Applying patches?
You know me, I love using bash. for f in ~/Documents/jbr_patches/*diff ; do \ echo $f; patch -p1 < $f || exit 1; \ sleep 1 ; done Right.
-
Extracting and Organizing with Bash | FreedomPenguin
Doing reports and organizing things doesn’t always need Perl. Bash can do a fine job of organizing things.
-
Shell Scripting Boot Camp | FreedomPenguin
Doing much on the command-line often leads to some repetition. Learn how to roll up a group of commands by making a shell script.
-
Using Command Line Aliases – Frequently | Freedom Penguin
I’ve been using command-line aliases since I was in college (a long time ago). Here’s a list of some of my favourite aliases.
-
My Terminal Prompt
Some of you might wet your pants in fear of this pictures. It is the anti-MAC. You bore me.
-
Keep that Laptop from Racing thru Battery
Linux and Laptops: a long, old story. However, one that with a bit homework, helps get the most out of your battery. Using powertop, you can see your energy usage profile and your device power settings. The downside to powertop is that you cannot “export as shell script.” (Seriously, y u no export?) To get…
-
Checking for your ssh-agent on login – updated
The first thing my .bash_aliases file does on login is to check if I’m running ssh-agent and if so, stick that into my shell environment. If not, kick it up, and update a reminder to it. This morning I found a flaw in that, so I believe this is the fix. 4 export SSH_RECENT=”$HOME/.ssh/recent” 5…
-
ZFS, Bash, and Piped Loops
Fellow Linux Nutjobs! Here is your evening lesson in how to reclaim space from a ZFS partition by destroying snapshots. In my setup, my remote backup has a subset of the snapshots I’m automatically creating from my backup scripts. To reclaim space, I’m deleting those snapshots that have been backed up off-site. Assume alias Zfs=”sudo…