Put flip
somewhere in your $PATH
and chmod a+x
it.
Copy fuck
into ~/.bashrc
.
•_•)
( •_•)>⌐■-■
(⌐■_■)
Look at some other equally silly/occasionally useful things I've made.
Check out this superior node-based solution by @robotlolita.
#!/usr/bin/env perl | |
# Script by Lars Noodén | |
use strict; | |
use warnings; | |
use utf8; | |
binmode(STDOUT, ":utf8"); | |
my %flipTable = ( | |
"a" => "\x{0250}", | |
"b" => "q", | |
"c" => "\x{0254}", | |
"d" => "p", | |
"e" => "\x{01DD}", | |
"f" => "\x{025F}", | |
"g" => "\x{0183}", | |
"h" => "\x{0265}", | |
"i" => "\x{0131}", | |
"j" => "\x{027E}", | |
"k" => "\x{029E}", | |
"l" => "|", | |
"m" => "\x{026F}", | |
"n" => "u", | |
"o" => "o", | |
"p" => "d", | |
"q" => "b", | |
"r" => "\x{0279}", | |
"s" => "s", | |
"t" => "\x{0287}", | |
"u" => "n", | |
"v" => "\x{028C}", | |
"w" => "\x{028D}", | |
"x" => "x", | |
"y" => "\x{028E}", | |
"z" => "z", | |
"A" => "\x{0250}", | |
"B" => "q", | |
"C" => "\x{0254}", | |
"D" => "p", | |
"E" => "\x{01DD}", | |
"F" => "\x{025F}", | |
"G" => "\x{0183}", | |
"H" => "\x{0265}", | |
"I" => "\x{0131}", | |
"J" => "\x{027E}", | |
"K" => "\x{029E}", | |
"L" => "|", | |
"M" => "\x{026F}", | |
"N" => "u", | |
"O" => "o", | |
"P" => "d", | |
"Q" => "b", | |
"R" => "\x{0279}", | |
"S" => "s", | |
"T" => "\x{0287}", | |
"U" => "n", | |
"V" => "\x{028C}", | |
"W" => "\x{028D}", | |
"X" => "x", | |
"Y" => "\x{028E}", | |
"Z" => "z", | |
"." => "\x{02D9}", | |
"[" => "]", | |
"'" => ",", | |
"," => "'", | |
"(" => ")", | |
"{" => "}", | |
"?" => "\x{00BF}", | |
"!" => "\x{00A1}", | |
"\"" => ",", | |
"<" => ">", | |
"_" => "\x{203E}", | |
";" => "\x{061B}", | |
"\x{203F}" => "\x{2040}", | |
"\x{2045}" => "\x{2046}", | |
"\x{2234}" => "\x{2235}", | |
"\r" => "\n", | |
" " => " " | |
); | |
while ( <> ) { | |
my $string = reverse( $_ ); | |
while ($string =~ /(.)/g) { | |
print $flipTable{$1}; | |
} | |
print qq(\n); | |
} |
function fuck() { | |
killall -9 $2; | |
if [ $? == 0 ] | |
then | |
echo | |
echo " (╯°□°)╯︵$(echo $2|flip &2>/dev/null)" | |
echo | |
fi | |
} |
Put flip
somewhere in your $PATH
and chmod a+x
it.
Copy fuck
into ~/.bashrc
.
•_•)
( •_•)>⌐■-■
(⌐■_■)
Look at some other equally silly/occasionally useful things I've made.
Check out this superior node-based solution by @robotlolita.
Great Stuff!, working like a charm on my Mac, I just added killall -m, so it can use Regular Expressions :D
Thanks Sam, using toilet seems like a smarter way to do it.
And thanks to @namuol too. :)
Toilet works a charm here :)
@samhocevar -- thanks for the tip! But I'm keeping the old perl script since toilet is a somewhat-exotic dependency for OS X users.
Converted the "fuck" function to fish shell at http://danhulton.com/2014/02/rage-quit-support-for-fish-shell/.
Just the function:
function fuck
killall -9 $argv[2]
if test $status = 0
echo
echo " (╯°□°)╯︵" (echo $argv[2]|flip ^/dev/null)
echo
end
end
Here is a variant for oh-my-zsh with autocomplete support for quick rage:
This is awesome.
This is a better version:
(ノಠ益ಠ)ノ彡
guys, remember, do not run this on solaris
Awesome. This is my take, with support for with or without -9
function fuck() {
action=$1
program=$2
case $action in
you )
killall "$program" && (echo ; echo "(ノಠ-ಠ)ノ彡$(echo "$program"|flip)"; echo);;
off )
killall -9 "$program" && (echo ; echo "(ノಠ-ಠ)ノ彡$(echo "$program"|flip) ------ -- -- ╾━╤デ╦︻"; echo);;
esac
}
Brevity edition (for it pains my soul to see a Perl one-liner written in 88 lines):
function flip() {
perl -C3 -Mutf8 -lpe '$_=reverse;y/a-zA-Z.['\'',({?!\"<_;‿⁅∴\r/ɐqɔpǝɟƃɥıɾʞ|ɯuodbɹsʇnʌʍxʎzɐqɔpǝɟƃɥıɾʞ|ɯuodbɹsʇnʌʍxʎz˙],'\'')}¿¡,>‾؛⁀⁆∵\n/' <<< "$1"
}
function fuck() {
killall -9 "$2" && echo -e "\n (╯°□°)╯︵$(flip "$2")\n"
}
A Perl variation relying on modules (Proc::KillAll and Text::UpsideDown):
#!/usr/bin/env perl
use 5.10.0;
use strict;
use warnings;
use utf8;
use Text::UpsideDown;
use Proc::Killall;
binmode STDOUT, ":utf8";
my @flippant = ( ' (╯°□°)╯︵', ' (ノಥ益ಥ)ノ ', ' ヽ(`Д´)ノ︵', ' (ノಠ益ಠ)ノ彡', );
my %actions = ( you => -9, off => -15 );
my $sig = $actions{ shift @ARGV };
say killall( $sig => $_ )
? ( $flippant[rand @flippant], upside_down($_) )
: qq{ (¬_¬").oO( $_: $! )} for @ARGV;
fuck
without bachism and with pkill instead of killall (never use killall on Solaris, it kills everything) :
function fuck() {
pkill -9 $2;
if [ $? = 0 ]
then
echo
echo " (╯°□°)╯︵$(echo $2|flip &2>/dev/null)"
echo
fi
}
My version combining most of the above and some extra stuff.
function flip() {
perl -C3 -Mutf8 -lpe '$_=reverse;y/a-zA-Z.['\'',({?!\"<_;‿⁅∴\r/ɐqɔpǝɟƃɥıɾʞ|ɯuodbɹsʇnʌʍxʎzɐqɔpǝɟƃɥıɾʞ|ɯuodbɹsʇnʌʍxʎz˙],'\'')}¿¡,>‾؛⁀⁆∵\n/' <<< "$1"
}
function fuck() {
CMD="pkill"
which $CMD >/dev/null || CMD="killall"
echo
if [ "$1" == "off" ]; then
shift
FLIP=(' (ノಠ益ಠ)ノ彡' '(ノಠ-ಠ)ノ彡')
SIG="-9"
else
[ "$1" == "you" ] && shift
FLIP=(' (╯°□°)╯︵' '(ノ ゜Д゜)ノ ︵' '(ノಥДಥ)ノ︵' ' ヽ(`Д´)ノ︵' ' (ノಥ益ಥ)ノ ')
SIG=""
fi
[ -z "$1" ] && { echo "┬─┬ ノ( ゜-゜ノ) patience young grasshopper"; echo; return; }
F=${FLIP[$RANDOM % ${#FLIP[@]} ]}
if $CMD $SIG "$1"; then
echo "$F$(flip $1)"; echo
else
echo "┬─┬ ︵ /(.□. \)"; echo
fi
}
Love your version vidarsk, but as I work with zsh it needs some quotation marks for the string evaluation. So you would get:
function flip() {
perl -C3 -Mutf8 -lpe '$_=reverse;y/a-zA-Z.['\'',({?!\"<_;‿⁅∴\r/ɐqɔpǝɟƃɥıɾʞ|ɯuodbɹsʇnʌʍxʎzɐqɔpǝɟƃɥıɾʞ|ɯuodbɹsʇnʌʍxʎz˙],'\'')}¿¡,>‾؛⁀⁆∵\n/' <<< "$1"
}
function fuck() {
CMD="pkill"
which $CMD >/dev/null || CMD="killall"
echo
if [ "$1" "==" "off" ]; then
shift
FLIP=(' (ノಠ益ಠ)ノ彡' '(ノಠ-ಠ)ノ彡')
SIG="-9"
else
[ "$1" "==" "you" ] && shift
FLIP=(' (╯°□°)╯︵' '(ノ ゜Д゜)ノ ︵' '(ノಥДಥ)ノ︵' ' ヽ(`Д´)ノ︵' ' (ノಥ益ಥ)ノ ')
SIG=""
fi
[ -z "$1" ] && { echo "┬─┬ ノ( ゜-゜ノ) patience young grasshopper"; echo; return; }
F=${FLIP[$RANDOM % ${#FLIP[@]} ]}
if $CMD $SIG "$1"; then
echo "$F$(flip $1)"; echo
else
echo "┬─┬ ︵ /(.□. \)"; echo
fi
}
A write-only coded works-for-me Bash function with some colours:
ragequit() {
R=$(tput sgr0)
echo -ne "\n $(tput bold; tput setaf 1)(╯°□°)╯$R ︵ $(tput setaf 3)"
echo $1 | rev | \
sed 's/\([acfhjmr]\)/\xc9\1/g;s/\([ktvwy]\)/\xca\1/g;s/e/\xc7\x9d/g;s/g/\xc6\x83/g;s/i/\xc4\xb1/g' | \
tr 'abcdfhjklmnpqrtuvwy' '\220q\224p\237\245\276\236|\257udb\271\207n\214\215\216'
echo "$R"
pkill $1
}
Love this. I do a similar thing (though much simpler) on my work laptop (Windows):
[fuck.bat]
@echo off
if [%1]==[] goto usage
set "ExecutableName=%1"
set "Extension=%ExecutableName:~-4%"
echo Ext: %Extension%
if NOT "%Ext%"==".exe" set "ExecutableName=%ExecutableName%.exe"
taskkill /f /im %ExecutableName%
goto :eof
:usage
@echo Error: %ExecutableName% not found.
@echo Usage: %0 ^<ExecutableName^>
exit /B 1