Skip to content

Instantly share code, notes, and snippets.

View bitmagier's full-sized avatar

Roman Krüger bitmagier

View GitHub Profile
@bitmagier
bitmagier / hdd_smart_overview.sh
Last active October 1, 2025 11:05
Hard drive health overview - one line per disk
#!/usr/bin/zsh
# version 2.3.0 by bitmagier
echo " Device | Model Family | Capacity | Serial Number | Firmware | ❤ Check | ⏻ days | Retired ▆ | Reallocated ▆ | Defect ▆ | Temp. | °C Limits | °C Lifetime | ↓/↑ limit count"
echo "--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
for dev in $(sudo smartctl --scan|awk '{print $1}'); do
report=$(sudo smartctl -x $dev)
model_family=$(echo "$report"|grep "Model Family"|cut -d ':' -f 2-|sed 's/^ *//g')
capacity_line=$(echo "$report"| grep "User Capacity")

Keybase proof

I hereby claim:

  • I am bitmagier on github.
  • I am bitmagier (https://keybase.io/bitmagier) on keybase.
  • I have a public key ASCHYmYLbBl6U8cAoexHo9b0fu2UzIspKxovtXFIsnyGzQo

To claim this, I am signing this object:

echo "cleaning unused libs (> 3 days)" &&
find ~/.gradle/ -name "*.jar" -type f -atime +1 -print -delete &&
echo "cleaning old libs (> 90 days)" &&
find ~/.gradle/ -name "*.jar" -type f -mtime +90 -print -delete &&
echo "cleaning empty folders" &&
find ~/.gradle/ -mindepth 1 -type d -empty -print -delete
@bitmagier
bitmagier / git-show-big-files.sh
Last active April 8, 2019 09:26 — forked from debreczeni/git-show-big-files.sh
Find large files in git repository
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
#
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# original @author Antony Stubbs
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output
@bitmagier
bitmagier / gist:3b8c98a18055c13fb5510b76e23a9beb
Created August 2, 2018 08:52 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@bitmagier
bitmagier / git-cherry-pick-my-changes.txt
Last active June 23, 2016 10:54
git cherry-pick all my changes from master to another (release-) branch (as a single new commit)
git rev-list --reverse --cherry-pick --author=... master ^release-X | git cherry-pick -n --stdin