MEWBIES@: Facebook Twitter G+ YouTube DeviantArt Forum Wall
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██ ██
█▌ - FUN ON THE TERMINAL PART 5 - █▌
█▌ TEXT / OUTPUT MANIPULATION █▌
█ ▐▌
█ LOLSPEAK - TRANSLATE ENGLISH TO LOLSPEAK - ACME::LOLCAT ▐▌
█ LOLCODE INTERPRETER - LCI ▐▌
█ ▐▌
█ CONVERT ENGLISH TO HUMOROUS LANGUAGES - FILTERS ▐▌
█ ENCODE YOUR TEXT - CONVERT TEXT (ASCII) TO BINARY CODE AND VISA VERSA ▐▌
█ REVERSE (LINUX & MAC) ▐▌
█ REVERSE ORDER (LINUX & MAC) ▐▌
█ OUTPUT TEXT SLOWLY - SLOWCAT & THROTTLE ▐▌
█ ▐▌
█ HANDY TEXT FILE COMMANDS ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ LOLSPEAK - TRANSLATE ENGLISH TO LOLSPEAK - ACME::LOLCAT: ▐▌
█ ```````````````````````````````````````````````````````` ▐▌
█ Perl's module Acme::LOLCAT translates English into lolspeak language. ▐▌
█ LOLcat is a meme originating at 4chan.org. ▐▌
█ ▐▌
█ PREREQUISITES: ▐▌
█ su ▐▌
█ aptitude install libsub-exporter-perl -y ▐▌
█ Then install the perl module: ▐▌
█ cpan -i Acme::LOLCAT ▐▌
█ IF the reply is: ▐▌
█ -bash: cpan: command not found ▐▌
█ Then do first: ▐▌
█ aptitude install perl-CPAN ▐▌
█ The first time running cpan you will be prompted with many questions. Hit ▐▌
█ Enter key to all questions to select its default, then when you come to: ▐▌
█ Select your continent (or several nearby continents) [] ▐▌
█ You need to enter a number from the list presented and a few more location ▐▌
█ selections. ▐▌
█ IF you run into some cpan problems view HERE, your problem might be ▐▌
█ listed. ▐▌
█ exit ▐▌
█ ▐▌
█ SCRIPT TO TRANSLATE GIVEN TEXT: ▐▌
█ HERE is a script to use with it; lolcat.pl: ▐▌
█ pico lolcat.pl ▐▌
█ Copy / paste in everything and save: ▐▌
#!/usr/bin/perl
use strict;
use warnings;
use Acme::LOLCAT;
my $echo = undef;
while(<>) {
## header
$echo = 1 if $_ =~ /Project-Id-Version/;
if ($echo) {
print;
} else {
# TODO: preserve --options and quoted strings?
print lc (translate $_);
}
}
█ ▐▌
█ If you want the original lolcat uppercase text remove 'lc ': ▐▌
█ print (translate $_); ▐▌
█ chmod 0755 lolcat.pl ▐▌
█ ▐▌
█ INTERACTIVE: ▐▌
█ Run the script then type in text and press Enter after each input for the ▐▌
█ translation (the translation for the same text will varies): ▐▌
█ ./lolcat.pl ▐▌
█ what are you doing now ▐▌
█ WUT IS YOUS DOIN NOW ▐▌
█ I love mewbies ▐▌
█ I LUBS MEWBIES ▐▌
█ help me with the yarn ▐▌
█ HELP ME WITH TEH YARN ▐▌
█ . KTHXBYE! ▐▌
█ ▐▌
█ INPUT FILE: ▐▌
█ Input any text based file for a translated reply, for example: ▐▌
█ ./lolcat.pl < lolcat.pl ▐▌
█ ▐▌
█ ACME::LOLCAT COMBO: ▐▌
█ fortune | ./lolcat.pl | cowsay -f hellokitty | lolcat ▐▌
█ ▐▌
█ ▐▌
█ MOAR: ▐▌
█ - HERE is an Acme::LOLCAT script for IRSSI and HERE for XChat. ▐▌
█ - 'poe-filter-lolcat' translates lines of text into lolspeak using ▐▌
█ Acme::LOLCAT also. ▐▌
█ - At speaklolcat.com you can translate online. ▐▌
█ - For Mac - Adium Xtras 'Speak Lolcat' "It actually makes a http request ▐▌
█ to the speaklolcat.com website and sends the results from the online ▐▌
█ "translation service."" ▐▌
█ - HERE in an online LOLcat generator to impose text on a photo. ▐▌
█ - Twitter also offers lolcat language: ▐▌
█ Settings / Language select: Lolcat - LOLCATZ (beta). Output: ▐▌
█ "YORE LANGUUJ SETTINGS HAZ A BEEN SAVED. PLEEZ NOTE THAT TEH LANGUUJ ▐▌
█ YOUS CHOZE AR STILL IN BETA TESTINS. T REPORT ANY ERRORS OR BUGS, ▐▌
█ VISIT OUR TRANSLASHUN CENTR." ▐▌
█ - For other English to humourous languages try Filters below. ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ LOLCODE INTERPRETER - LCI: ▐▌
█ `````````````````````````` ▐▌
█ "lci is a LOLCODE interpreter written in C and is designed to be correct, ▐▌
█ portable, fast, and precisely documented." ▐▌
█ ▐▌
█ This is a quickie write-up for those that had trouble compiling. ▐▌
█ ▐▌
█ PREREQUISITES: ▐▌
█ cmake, doxygen, python 2.7+ or Python 2.x with the argparse module ▐▌
█ installed. ▐▌
█ ▐▌
█ python --version ▐▌
█ Python 2.6.6 ▐▌
█ Install those you need for example: ▐▌
█ su ▐▌
█ aptitude install cmake doxygen python-argparse -y ▐▌
█ exit ▐▌
█ ▐▌
█ wget --content-disposition https://github.com/justinmeza/lci/archive/v0.10.4.tar.gz
█ (Note: wget '--content-disposition' reads the header to acquire the ▐▌
█ correct filename. Otherwise the filename would have been saved as ▐▌
█ 'v0.10.4.tar.gz'.) ▐▌
█ tar -xf lci-0.10.4.tar.gz && cd lci-0.10.4 ▐▌
█ cmake . ▐▌
█ make ▐▌
█ su ▐▌
█ make install ▐▌
█ make doc ▐▌
█ My output was: make: *** No rule to make target `doc'. Stop. ▐▌
█ exit ▐▌
█ ctest ▐▌
█ lci -h ▐▌
█ ▐▌
█ HERE online, HERE for python and HERE is lolcode 1337. ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ CONVERT ENGLISH TO HUMOROUS LANGUAGES - FILTERS: ▐▌
█ ```````````````````````````````````````````````` ▐▌
█ Filters alter your text in a humorous way. There are 25 filters. ▐▌
█ For example the text "lets test the filters" becomes - ▐▌
█ eleet filter: "l3t5 t35t th3 f1lt3r5" ▐▌
█ spammer filter: ▐▌
█ DEAR FRIEND, LETS TEST THE FILTERS. LIMITED TIME OFFER! This is a 1 time ▐▌
█ offer. ▐▌
█ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ▐▌
█ To receive no further notices on these mails write back with a subject of ▐▌
█ "remove"! ▐▌
█ {%RAND%} ▐▌
█ ▐▌
█ INSTALL: ▐▌
█ Either compile yourself: ▐▌
█ wget http://ftp.debian.org/debian/pool/main/f/filters/filters_2.46.tar.gz ▐▌
█ Or: ▐▌
█ su ▐▌
█ aptitude install filters ▐▌
█ Or: ▐▌
█ git clone git://git.kitenet.net/filters ▐▌
█ ▐▌
█ How to use git Notes: ▐▌
█ Since I don't think I have written about git yet a few notes: ▐▌
█ which git ▐▌
█ Output should be similar to: /usr/bin/git ▐▌
█ If you don't have it, then install it: ▐▌
█ su ▐▌
█ aptitude install git ▐▌
█ For other OSes view here. ▐▌
█ git requires: libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev▐▌
█ View if those were installed also, if not install those missing. ▐▌
█ To update git: ▐▌
█ git clone git://git.kernel.org/pub/scm/git/git.git ▐▌
█ For more information about setting up git read here. ▐▌
█ ▐▌
█ exit ▐▌
█ ▐▌
█ PLAY TIME: ▐▌
█ Type into terminal: ▐▌
█ fudd ▐▌
█ i love to play with filters ▐▌
█ Reply: i wove to pway wif fiwtews ▐▌
█ Ctrl+c to quit ▐▌
█ newspeak ▐▌
█ The hundreds of dead faded brown leaves were rather dim. ▐▌
█ Reply: ▐▌
█ The plusmany of unlifeful plusunbrown leaves were plusunlight. ▐▌
█ Ctrl+c to quit ▐▌
█ ▐▌
█ COMBINE WITH A CMD: ▐▌
█ ls | ky00te ▐▌
█ Example of file in ~ is project-zs-ng_r2500-v1.2.0.tar.gz ▐▌
█ Output states: purroject-zs-ng_rr2500-v1.2.0.tarr.gz ▐▌
█ man cd | jethro ▐▌
█ ▐▌
█ INPUT A FILE: ▐▌
█ Input a text file, for example: ▐▌
█ ky00te < test_filters.txt | more ▐▌
█ ▐▌
█ Input a text file, then output to a new file, for example: ▐▌
█ kraut < test_filters.txt > test_filters_results.txt ▐▌
█ cat test_filters_results.txt ▐▌
█ ▐▌
█ COMBO: ▐▌
█ If you have figlet and cowsay installed: ▐▌
█ echo "mewbies" | pig | figlet -f smslant -k | cowsay -f small -n ▐▌
█ ____________________________________________________ ▐▌
█ / __ _ \ ▐▌
█ | ___ _ __ / / (_)___ ___ __ _ ___ _ __ __ | ▐▌
█ | / -_)| |/|/ // _ \ / // -_)(_-< / ' \/ _ `// // / | ▐▌
█ | \__/ |__,__//_.__//_/ \__//___//_/_/_/\_,_/ \_, / | ▐▌
█ \ /___/ / ▐▌
█ ---------------------------------------------------- ▐▌
█ \ ,__, ▐▌
█ \ (oo)____ ▐▌
█ (__) )\ ▐▌
█ ||--|| * ▐▌
█ ▐▌
█ 25 AVAILABLE FILTERS: ▐▌
█ b1ff fanboy ken newspeak scottish ▐▌
█ censor fudd kenny nyc spammer ▐▌
█ chef jethro kraut pig Studly ▐▌
█ cockney jibberish ky00te pirate uniencode ▐▌
█ eleet jive nethackify rasterman upside-down ▐▌
█ ▐▌
█ Click HERE for a sample of each filter. ▐▌
█ ▐▌
█ man filters or HERE to refer to while playing. ▐▌
█ ▐▌
█ SOME FILTER NOTES: ▐▌
█ fanboy: Only affects certain words ▐▌
█ For example; git cherry-pick linus and linux with a pull ▐▌
█ censor: Censors out certain words, like butt ▐▌
█ jibberish: Use with a text file ▐▌
█ Each time it will have a different result. ▐▌
█ spammer: Use with a text file ▐▌
█ ▐▌
█ Docs are here: ▐▌
█ ls /usr/share/doc/filters/ -al ▐▌
█ Filters are here: ▐▌
█ ls /usr/games/ -al ▐▌
█ According to the 'fitlers_README': ▐▌
█ 1. SAMPLES should show each a sample of each; it doesn't, so I made a ▐▌
█ SAMPLES list HERE. ▐▌
█ 2. dog --oog filter should be included, it isn't included. ▐▌
█ ▐▌
█ By the way you can change your local settings for Google's search engine ▐▌
█ language to a few of those Filters listed above. View my Easter Eggs page ▐▌
█ HERE. ▐▌
█ And if you've never played FurryMUCK you could use the Filter Ky00te to ▐▌
█ help you to speak. ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ ENCODE YOUR TEXT - CONVERT TEXT (ASCII) TO BINARY CODE AND VISA VERSA: ▐▌
█ `````````````````````````````````````````````````````````````````````` ▐▌
█ Transform any text to binary code, like this: ▐▌
█ 01101101011001010111011101100010011010010110010101110011 ▐▌
█ Go HERE and paste the string above of 0 and 1s into their 'Binary' box ▐▌
█ and push the button 'CONVERT'. ▐▌
█ We'll make the same word a tad tougher to decode, try this: ▐▌
█ 011001110101001101001011001000110111011101010011010110110 ▐▌
█ We'll cover that below. ▐▌
█ ▐▌
█ A silly way to use this is to send encoded messages, not that it is safe ▐▌
█ by any means but not everyone is going to know how to convert it back or ▐▌
█ even think to. There are plenty of on-line converters to do this, but ▐▌
█ nothing beats getting the job done in the privacy of our own box. I found ▐▌
█ a sweet perl script to do just this effortlessly thanks to Ivo at ▐▌
█ coolcommands.com here. ▐▌
█ ▐▌
█ To use it: ▐▌
█ You'll need to have perl installed: ▐▌
█ perl -v ▐▌
█ If reply is version etc, you are good. ▐▌
█ If reply is "-bash: perl command not found" you need to install it: ▐▌
█ su ▐▌
█ aptitude update && aptitude install perl ▐▌
█ exit ▐▌
█ Then you need to know the location of your perl: ▐▌
█ which perl ▐▌
█ My reply: /usr/bin/perl ▐▌
█ If your reply is different you'll have to edit only the top line of the ▐▌
█ conv.pl to properly state the location of perl on your box: ▐▌
█ wget http://mewbies.com/geek_fun_files/convert_binary_text/conv.tar.gz ▐▌
█ tar xvzf conv.tar.gz ▐▌
█ chmod 0755 conv.pl ▐▌
█ ▐▌
█ Test it, convert from binary to text: ▐▌
█ ./conv.pl -t 01101101011001010111011101100010011010010110010101110011 ▐▌
█ Convert from text to binary: ▐▌
█ ./conv.pl -b "mewbies" ▐▌
█ ▐▌
█ You can also feed it a file using the -f switch: ▐▌
█ ./conv.pl -t -f binfile ▐▌
█ ./conv.pl -b -f myfile ▐▌
█ Output the result to another file instead of your terminal for example: ▐▌
█ ./conv.pl -t -f binfile > textoutput.txt ▐▌
█ ▐▌
█ To print out the help: ▐▌
█ ./conv.pl -h ▐▌
█ Can't leave the cow out: ▐▌
█ ./conv.pl -h | cowsay -W 65 ▐▌
█ ▐▌
█ Combine it with reverse to make it even tougher to decode: ▐▌
█ ./conv.pl -b "mewbies" | rev > output1.txt ▐▌
█ Now converting it back to text will not work. ▐▌
█ Try it: ▐▌
█ ./conv.pl -t -f output1.txt ▐▌
█ Reply is a few unreadable characters. ▐▌
█ The binary code must first be reversed back then converted to text. ▐▌
█ rev < output1.txt > output2.txt | ./conv.pl -t -f output2.txt ▐▌
█ ▐▌
█ Note: To make it more believable put 0 or 00 in front of a reversed binary ▐▌
█ string if it begins with a 1. Of course the receiver must know to remove ▐▌
█ the 0/s. For example mewbies to binary code, reversed would be: ▐▌
█ 11001110101001101001011001000110111011101010011010110110 ▐▌
█ Pass your encoded msg as: ▐▌
█ 011001110101001101001011001000110111011101010011010110110 ▐▌
█ ▐▌
█ Finished, can clean up: rm output1.txt output2.txt ▐▌
█ ▐▌
█ SYSTEM WIDE USAGE: ▐▌
█ If you want all users to be able to access it: ▐▌
█ 1. Edit the shebang line and save changes: ▐▌
█ pico conv.pl ▐▌
█ Has this: ▐▌
█ #!/usr/bin/perl -W ▐▌
█ ▐▌
█ Change to: ▐▌
█ #!/usr/bin/env perl ▐▌
█ ▐▌
█ Optional: I would rename it something unique without the extension, for ▐▌
█ example: ▐▌
█ cp conv.pl txt2binary ▐▌
█ 2. su ▐▌
█ cp txt2binary /usr/local/bin/txt2binary ▐▌
█ chmod +x /usr/local/bin/txt2binary ▐▌
█ exit ▐▌
█ ▐▌
█ Test it: ▐▌
█ txt2binary -t 01101101011001010111011101100010011010010110010101110011 ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ REVERSE TEXT (LINUX & MAC): ▐▌
█ ``````````````````````````` ▐▌
█ You can reverse any text that you type or the text in a file using 'rev'. ▐▌
█ For example try this, hit Enter after typing each in: ▐▌
█ rev ▐▌
█ god ▐▌
█ maps lived live ▐▌
█ Ctrl + c to exit ▐▌
█ ▐▌
█ Input text from a file, for example, create a file: ▐▌
█ pico rev-test.txt ▐▌
█ Paste in anything, like this sentence, save it. ▐▌
█ Then feed the file to rev: ▐▌
█ rev rev-test.txt ▐▌
█ Reply: ▐▌
█ :neht ,ti evas ,ecnetnes siht ekil ,gnihtyna ni etsaP ▐▌
█ Lets reverse it back: ▐▌
█ rev ▐▌
█ Copy/paste in: ▐▌
█ :neht ,ti evas ,ecnetnes siht ekil ,gnihtyna ni etsaP ▐▌
█ ▐▌
█ Mac users to paste the contents of their clipboard into the terminal, ▐▌
█ reverse and copy the output to their clipboard: ▐▌
█ pbpaste | rev | pbcopy ▐▌
█ ▐▌
█ You could even reverse the cow, but why would you, poor cow: ▐▌
█ fortune -a | cowsay -f apt | rev ▐▌
█ ________________________________________ ▐▌
█ \ tuo tup t'nseod htaed tub ,skcus efiL" / ▐▌
█ | "....lla ta | ▐▌
█ | | ▐▌
█ / ppoK .J samohT -- \ ▐▌
█ ---------------------------------------- ▐▌
█ )__( \ ▐▌
█ )oo( ▐▌
█ /\------/ ▐▌
█ || | / ▐▌
█ \/---\/ * ▐▌
█ ~~ ~~ ▐▌
█ To reverse only the Fortune output and not the cow: ▐▌
█ fortune -a | rev | cowsay -f apt ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ REVERSE ORDER (LINUX & MAC): ▐▌
█ ```````````````````````````` ▐▌
█ You can reverse the order in which lines are read out on a file using ▐▌
█ 'tac'. tac is the reverse function of 'cat'. Mac use 'tail -r'. ▐▌
█ For example try this, hit Enter after typing each in: ▐▌
█ pico rev-test.txt ▐▌
█ Paste this in, save file, exit pico: ▐▌
█ 1. I am line one. ▐▌
█ 2. I am line two. ▐▌
█ 3. I am line three. ▐▌
█ Then feed the file to tac: ▐▌
█ tac rev-test.txt ▐▌
█ Mac users: tail -r rev-test.txt ▐▌
█ Reply: ▐▌
█ 3. I am line three. ▐▌
█ 2. I am line two. ▐▌
█ 1. I am line one. ▐▌
█ ▐▌
█ Combine tac and rev for a fine mess: ▐▌
█ tac rev-test.txt | rev ▐▌
█ Mac users: tail -r rev-test.txt | rev ▐▌
█ Reply: ▐▌
█ .eerht enil ma I .3 ▐▌
█ .owt enil ma I .2 ▐▌
█ .eno enil ma I .1 ▐▌
█ ▐▌
█ Should we?: ▐▌
█ fortune -a | cowsay -f apt | tac ▐▌
█ ~~ ~~ ▐▌
█ * /\---/\ ▐▌
█ / | || ▐▌
█ /------\/ ▐▌
█ (oo) ▐▌
█ \ (__) ▐▌
█ -------------------------------------- ▐▌
█ \ -- Henry Spencer / ▐▌
█ | | ▐▌
█ | condemned to reinvent it, poorly. | ▐▌
█ / Those who do not understand Unix are \ ▐▌
█ ______________________________________ ▐▌
█ ▐▌
█ And yes you could: ▐▌
█ fortune -a | cowsay -f apt | tac | rev ▐▌
█ ~~ ~~ ▐▌
█ \/---\/ * ▐▌
█ || | / ▐▌
█ /\------/ ▐▌
█ )oo( ▐▌
█ )__( \ ▐▌
█ --------------------------------------- ▐▌
█ / .noos emitemos \ ▐▌
█ \ gnivil trats ot dnetni yletinifed uoY / ▐▌
█ _______________________________________ ▐▌
█ ▐▌
█ Finished playing, can delete: rm rev-test.txt ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ ▐▌
█ OUTPUT TEXT SLOWLY - SLOWCAT & THROTTLE: ▐▌
█ ```````````````````````````````````````` ▐▌
█ The output of text slowly is great to use with ASCII art animation files ▐▌
█ and can be useful for whatever purpose you can think of. I've tried many ▐▌
█ and will list all seven that I like in two groups; 'output line by line' ▐▌
█ and 'output character by character'. ▐▌
█ ▐▌
█ ▐▌
█ Credits: Music (a snippet embeded after) by Kilowatts, Feat Synesthesia - ▐▌
█ Reflective Deceptor, released on Retork by Enough Records. ▐▌
█ ▐▌
█ SLOWCAT - LINE BY LINE: ▐▌
█ ``````````````````````` ▐▌
█ SLOWCAT, SLOWCAT.C, SLOWCAT.PY: ▐▌
█ All three by Dave at grox.net. To output slowly I find slowcat.py works ▐▌
█ best. ▐▌
█ 1. slowcat (precompiled C++ binary, worked fine for me) ▐▌
█ 2. slowcat.c (compile yourself the binary; silly easy) ▐▌
█ 3. slowcat.py (run the script) ▐▌
█ ▐▌
█ 1. slowcat ▐▌
█ wget http://grox.net/software/mine/slowcat/slowcat ▐▌
█ chmod 755 slowcat ▐▌
█ ./slowcat -h ▐▌
█ (delay in microseconds 1 second = 1,000,000 microseconds) ▐▌
█ ▐▌
█ 2. slowcat.c - gcc required: ▐▌
█ wget http://grox.net/software/mine/slowcat/slowcat.c ▐▌
█ gcc slowcat.c -o slowcatc ▐▌
█ ./slowcatc -h ▐▌
█ ▐▌
█ 3. slowcat.py - python required: ▐▌
█ wget http://grox.net/software/mine/slowcat/slowcat.py ▐▌
█ chmod 755 slowcat.py ▐▌
█ ./slowcat.py -h ▐▌
█ ▐▌
█ EXAMPLES: ▐▌
█ ./slowcat -d 500000 slowcat.py ▐▌
█ ./slowcatc -d 500000 slowcat.py ▐▌
█ ./slowcat.py -d .4 <slowcat.py ▐▌
█ ▐▌
█ SLOWCAT - CHARACTER BY CHARACTER: ▐▌
█ ````````````````````````````````` ▐▌
█ SLOWCAT - PERL: ▐▌
█ 4. slowcat(.pl) v 2.3 by Noah Friedman "write output slowly, emulating ▐▌
█ physical serial terminal". ▐▌
█ Since we already have the file name 'slowcat' (if you tried the one above) ▐▌
█ we'll 'save as'; -O slowcat.pl (since it's Perl): ▐▌
█ wget http://www.splode.com/~friedman/software/scripts/src/share/slowcat -O slowcat.pl
█ chmod 755 slowcat.pl ▐▌
█ ./slowcat.pl -h ▐▌
█ ▐▌
█ EXAMPLES: ▐▌
█ ./slowcat.pl -b 1920 slowcat.pl ▐▌
█ ./slowcat.pl -b 1920 -i 500000 slowcat.pl ▐▌
█ View multiple files: ▐▌
█ ./slowcat.pl -b 1920 file1 file2 file3 ▐▌
█ To view all in current directory with the extension for example .txt: ▐▌
█ ./slowcat.pl -b 2920 *'.txt' ▐▌
█ To stop slowcat: Ctrl+c ▐▌
█ Pipe a command through it: ▐▌
█ ps x | ./slowcat.pl -b 192 ▐▌
█ ▐▌
█ SLOWCAT - PERL: ▐▌
█ 5. slowcat(2.pl) - by Andy Fingerhut a tiny perl script to "emulate a s ▐▌
█ l o w line printer". ▐▌
█ Since we already have the file name 'slowcat' & 'slowcat.pl' (if you tried ▐▌
█ the ones above) we 'save as'; -O slowcat2.pl: ▐▌
█ wget http://pleac.sourceforge.net/include/perl/ch01/slowcat -O slowcat2.pl ▐▌
█ chmod 755 slowcat2.pl ▐▌
█ ▐▌
█ EXAMPLES: ▐▌
█ ./slowcat2.pl -4.2 slowcat2.pl ▐▌
█ View multiple files: ▐▌
█ ./slowcat2.pl -4.2 file1 file2 file3 ▐▌
█ To view all in current directory with the extension for example .txt: ▐▌
█ ./slowcat2.pl -4.2 *'.txt' ▐▌
█ To stop slowcat: Ctrl+c ▐▌
█ Pipe a command through it: ▐▌
█ ps x | ./slowcat2.pl -4.2 ▐▌
█ ▐▌
█ SLOWCAT - RUBY: ▐▌
█ 6. slowcat.rb - by yyr, just like the above, but in Ruby to "emulate a s ▐▌
█ l o w line printer". ▐▌
█ wget https://raw.github.com/pleac/pleac/master/include/ruby/slowcat.rb ▐▌
█ chmod 755 slowcat.rb ▐▌
█ ▐▌
█ EXAMPLES: ▐▌
█ ./slowcat.rb -4.2 slowcat.rb ▐▌
█ ./slowcat.rb -4.2 file1 file2 file3 ▐▌
█ ./slowcat.rb -4.2 *'.txt' ▐▌
█ ps x | ./slowcat.rb -4.2 ▐▌
█ ▐▌
█ COMPARISON - LINE BY LINE TO CHARACTER BY CHARACTER: ▐▌
█ ./slowcat.py -d 1.1 <slowcat.py ▐▌
█ ./slowcat.pl -b 192 slowcat.pl ▐▌
█ ./slowcat.rb -9.5 slowcat.rb ▐▌
█ ▐▌
█ EXAMPLES IN COLOR: ▐▌
█ The character by character types could be very nice to to use on, for ▐▌
█ example, an MOTD to print the server tagline. ▐▌
█ An example in green: ▐▌
█ tput setaf 2;./slowcat2.pl -6.0 slowcat2.pl;tput sgr0 ▐▌
█ Bright green and then return to tput's default (if tput is set in ▐▌
█ something else that runs): ▐▌
█ tput setaf 2;tput bold;./slowcat2.pl -6.0 slowcat2.pl;tput setaf default ▐▌
█ If your prompt isn't showing the correct color after running that, then ▐▌
█ run: ▐▌
█ tput sgr0 ▐▌
█ ▐▌
█ For other tput colors and controls click HERE. ▐▌
█ ▐▌
█ 7. throttle - "copies the standard input to the standard output while ▐▌
█ limiting bandwidth to the specified maximum". ▐▌
█ wget http://tinyurl.com/pcm2mkp/throttle-1.2.tar.gz ▐▌
█ (original URL: http://pkgs.fedoraproject.org/repo/pkgs/throttle/throttle ▐▌
█ -1.2.tar.gz/bb8abf5a9a63ed7d80951f056543a88c/throttle-1.2.tar.gz ) ▐▌
█ tar xvzf throttle-1.2.tar.gz && cd throttle-1.2 ▐▌
█ ./configure ▐▌
█ make ▐▌
█ If you want to install to system: ▐▌
█ su ▐▌
█ make install ▐▌
█ exit ▐▌
█ ▐▌
█ EXAMPLE: ▐▌
█ throttle -s 1 -b 560 <myfile ▐▌
█ Throttle has many other uses than just using like a slowcat: ▐▌
█ throttle -h ▐▌
█ man throttle | throttle -s 1 -b 960 ▐▌
█ ▐▌
█ COMPARISON OF SLOWCATS USING A VT100 ASCII / ANSI ART ANIMATION FILE: ▐▌
█ wget wget http://mewbies.com/geek_fun_files/vt100/cow.vt ▐▌
█ ./slowcat.py -d .02 <cow.vt (just right) ▐▌
█ ./slowcat.pl -b 19200 cow.vt (just right) ▐▌
█ ./slowcat2.pl -0.0001999 cow.vt (too fast, -0.0002 too slow) ▐▌
█ ./slowcat.rb -0.99999 cow.vt (too fast, 1.0 too slow) ▐▌
█ throttle -s 1 -b 12600 <cow.vt (just right) ▐▌
█ ▐▌
█ The movglobe.vt timing needs to be faster, on my server this works well: ▐▌
█ wget wget http://mewbies.com/geek_fun_files/vt100/movglobe.vt ▐▌
█ ./slowcat.py -d .004 <movglobe.vt ▐▌
█ throttle -s 1 -b 96000 <movglobe.vt ▐▌
█ ▐▌
█ SLOWCAT AVAILABLE SYSTEM WIDE: ▐▌
█ View your environment paths and adjust path as needed below: ▐▌
█ $PATH ▐▌
█ 1. & 2. slowcat (or slowcatc): ▐▌
█ su ▐▌
█ mv slowcat /usr/local/bin/slowcat ▐▌
█ exit ▐▌
█ ▐▌
█ 3. slowcat.py: pico slowcat.py ▐▌
█ Change top line and save changes: ▐▌
█ #! /usr/bin/python ▐▌
█ To: ▐▌
█ #! /usr/bin/env python ▐▌
█ ▐▌
█ su ▐▌
█ cp slowcat.py /usr/bin/ ▐▌
█ Rename it if you don't want to type '.py' ▐▌
█ mv /usr/bin/slowcat.py /usr/bin/slowcat ▐▌
█ exit ▐▌
█ ▐▌
█ 4. slowcat.pl: su ▐▌
█ cp slowcat.pl /usr/bin/ ▐▌
█ Rename it if you don't want to type '.pl' ▐▌
█ mv /usr/bin/slowcat.pl /usr/bin/slowcat ▐▌
█ exit ▐▌
█ ▐▌
█ 5. slowcat2.pl: pico slowcat2.pl ▐▌
█ Change top line and save changes: ▐▌
█ #! /usr/bin/perl ▐▌
█ To: ▐▌
█ #! /usr/bin/env perl ▐▌
█ ▐▌
█ su ▐▌
█ cp slowcat2.pl /usr/bin/ ▐▌
█ Rename it if you don't want to type '2.pl' ▐▌
█ mv /usr/bin/slowcat2.pl /usr/bin/slowcat ▐▌
█ exit ▐▌
█ ▐▌
█ 6. slowcat.rb: pico slowcat.rb ▐▌
█ Change top line and save changes: ▐▌
█ #! /usr/bin/ruby ▐▌
█ To: ▐▌
█ #! /usr/bin/env ruby ▐▌
█ ▐▌
█ su ▐▌
█ cp slowcat.rb /usr/bin/ ▐▌
█ Rename it if you don't want to type '.rb' ▐▌
█ mv /usr/bin/slowcat.rb /usr/bin/slowcat ▐▌
█ exit ▐▌
█ ▐▌
█ HERE is in Clojure is another slowcat.clj ▐▌
█ View HERE to use slowcat on ASCII art animated .vt files. ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ ▐▌
█ HANDY TEXT FILE COMMANDS: ▐▌
█ ````````````````````````` ▐▌
█ While we are on manipulating text I thought I would mention a few handy ▐▌
█ commands that I use on text based files with working examples. There are ▐▌
█ plenty more and many of these are on Mac as well. ▐▌
█ ▐▌
█ FMT: ▐▌
█ fmt - "simple optimal text formatter" ▐▌
█ For many options: man fmt & info coreutils 'fmt invocation' ▐▌
█ ▐▌
█ SORT: ▐▌
█ sort - "sort lines of text files". ▐▌
█ Standard without any switches will sort each line alphabetically: ▐▌
█ sort < myfile.txt ▐▌
█ For many more options: man sort & info coreutils 'sort invocation' ▐▌
█ ▐▌
█ TR: ▐▌
█ tr - translate or delete characters ▐▌
█ For example change upper case to lower case: ▐▌
█ tr '[[:upper:]]' '[[:lower:]]' ▐▌
█ Now type in anything with uppercase into terminal. Ctrl+C to stop. ▐▌
█ And to change lower case to upper case: ▐▌
█ tr '[[:lower:]]' '[[:upper:]]' ▐▌
█ Or you could: ▐▌
█ echo "MewBieS" | tr "[a-z]" "[A-Z]" ▐▌
█ echo "MewBieS" | tr "[A-Z]" "[a-z]" ▐▌
█ ▐▌
█ Replace characters: ▐▌
█ For example enter into terminal: ▐▌
█ tr '<>' '[]' ▐▌
█ Then type in: ▐▌
█ <mewbies> ▐▌
█ Reply: [mewbies] ▐▌
█ Replace space with tab: ▐▌
█ echo "I dont want white-spaces" | tr [:space:] '\t' ▐▌
█ Reply: I dont want white-spaces ▐▌
█ Replace all two or more successive blank spaces: ▐▌
█ echo "No more than one white space" | tr -s [:space:] ' ' ▐▌
█ Reply: No more than one white space ▐▌
█ Remove all characters leaving digits only: ▐▌
█ echo "mewbies 12345 678 9" | tr -cd [:digit:] ▐▌
█ Reply: 123456789 ▐▌
█ Remove only a selected character, for example 'x': ▐▌
█ echo "mexwbies" | tr -d 'x' ▐▌
█ Reply: mewbies ▐▌
█ ▐▌
█ Example inputting a file: ▐▌
█ tr '[[:lower:]]' '[[:upper:]]' < myfile.txt ▐▌
█ Remove a string from a file, for example remove ever instance of 'hate': ▐▌
█ tr -d 'hate' < myfile.txt > mycleanedfile.txt ▐▌
█ Remove all two or more successive blank spaces: ▐▌
█ tr -s ' ' ' ' < myfile.txt > mycleanedfile.txt ▐▌
█ Remove non-printable characters from a file: ▐▌
█ tr -cd "[:print:]" < myfile.txt ▐▌
█ ▐▌
█ Oops this is becoming too long ;): ▐▌
█ For many more options: man tr & info coreutils 'tr invocation' ▐▌
█ ▐▌
█ UNIQ: ▐▌
█ uniq - "remove duplicate lines from a sorted file" ▐▌
█ Lets try, create a file with some duplicate lines. ▐▌
█ uniq myfile.txt ▐▌
█ Results will output to screen without any duplicate lines (your file will ▐▌
█ remain unchanged). ▐▌
█ Output will be to a new file: ▐▌
█ uniq myfile.txt > myfilecleaned.txt ▐▌
█ For many more options: man uniq & info coreutils 'uniq invocation' ▐▌
█ ▐▌
█ WC: ▐▌
█ wc - "counts the number of bytes, characters, whitespace-separated words, ▐▌
█ and newlines in each given FILE, or standard input if none are given or ▐▌
█ for a FILE of `-'" ▐▌
█ The standard reply using wc only is; ▐▌
█ | lines | words | bytes ▐▌
█ For example, using wc on a text based file: ▐▌
█ wc conv.pl ▐▌
█ Reply: ▐▌
█ 95 281 1920 conv2.pl ▐▌
█ That means there are 95 lines, 281 words and the file size is 1920 bytes. ▐▌
█ ▐▌
█ Lets view the wc for wc's help file: ▐▌
█ man wc | wc ▐▌
█ 66 251 2206 ▐▌
█ For many more options: man wc & info coreutils 'wc invocation' ▐▌
█ ▐▌
█ Also view my AMUSEMENTS & GAMES under Emacs for other text manipulation. ▐▌
█ ▐▌
█ //---------------------------------------------------------------------- ▐▌
█ ▐▌
█ If you find mistakes, have suggestions, and or questions please post at ▐▌
█ mewbies forum HERE - thank you. ▐▌
█ ▐▌
█ Last update on 24 Jun '13 ▐▌
█ ▐▌
█▌ █▌
█▌ - mewbies.com - █▌
█▌ █▌
██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄██