├── README.md ├── grails-update.groovy ├── node-gorge.js ├── phing-build.php └── search-index.py /README.md: -------------------------------------------------------------------------------- 1 | look-busy 2 | ========= 3 | 4 | `look-busy` is a collection of command line scripts that help make you look busy. 5 | 6 | ### LICENSE 7 | 8 | There is no license associated with the files contained within this repository. Use and edit them any way you please. 9 | 10 | ### AUTHORS/CONTRIBUTORS 11 | 12 | * Bill Israel - [http://github.com/epochblue](http://github.com/epochblue) - [@epochblue](http://twitter.com/epochblue) 13 | * Micah Breedlove - [http://github.com/druid628](http://github.com/druid628) - [@druid628](http://twitter.com/druid628) 14 | * Doug Hurst - [http://github.com/dalanhurst](http://github.com/dalanhurst) - [@dalanhurst](http://twitter.com/dalanhurst) 15 | -------------------------------------------------------------------------------- /grails-update.groovy: -------------------------------------------------------------------------------- 1 | #!/usr/bin/groovy 2 | /** 3 | * Need to look like you're busy? Update grails plugins! 4 | * Still needs to be cleaned up a little. (When I get to it) 5 | * 6 | * @author Micah Breedlove 7 | */ 8 | 9 | import java.util.Random 10 | 11 | def ranDumb = new Random(); 12 | def scriptDir = new File(getClass().protectionDomain.codeSource.location.path).parent; 13 | def displayDir = "/mnt/servers" 14 | def pluginsList = [ 15 | "spring-security-core", 16 | "dojo", 17 | "hibernate", 18 | "tomcat", 19 | "searchable", 20 | "spring-social-core", 21 | "uploadr" 22 | ]; 23 | def grailsHeading = """ 24 | Using Java at: /usr/lib/jvm/java-6-openjdk 25 | Welcome to Grails 1.3.7 - http://grails.org/ 26 | Licensed under Apache Standard License 2.0 27 | Grails home is set to: /usr/share/grails/1.3.7 28 | Base Directory: ${scriptDir} 29 | Resolving dependencies... 30 | Dependencies resolved in ${(ranDumb.nextInt(2222-1+1)+1)}ms. 31 | Running script /usr/share/grails/1.3.7/scripts/InstallPlugin.groovy 32 | Environment set to development 33 | Resolving plugin spring-security-core. Please wait... 34 | """ 35 | 36 | 37 | println grailsHeading; 38 | 39 | while(true) 40 | { 41 | pluginsList.each() { 42 | sleep(5000) 43 | 44 | major = ranDumb.nextInt(5-1+1)+1 45 | minor = ranDumb.nextInt(8-1+1)+1 46 | rev = ranDumb.nextInt(15-1+1)+1 47 | build = ranDumb.nextInt(6-1+1)+1 48 | 49 | def pluginTxt1 = """Downloading: http://svn.codehaus.org/grails-plugins/grails-${it}/tags/RELEASE_${major}_${minor}_${rev}_${build}/grails-${it}-${major}.${minor}.${rev}.${build}.zip ... 50 | Download complete. 51 | Installing zip ~/.ivy2/cache/org.grails.plugins/${it}/zips/${it}-${major}.${minor}.${rev}.${build}.zip... ... 52 | [mkdir] Created dir: ${scriptDir}/.grails/1.3.7/projects/prodweb02/plugins/${it}-${major}.${minor}.${rev}.${build} 53 | [unzip] Expanding: ${scriptDir}/.ivy2/cache/org.grails.plugins/${it}/zips/${it}-${major}.${minor}.${rev}.${build}.zip into ${scriptDir}/.grails/1.3.7/projects/prodweb02/plugins/${it}-${major}.${minor}.${rev}.${build} 54 | Installed plugin ${it}-${major}.${minor}.${rev}.${build} to location ${scriptDir}/.grails/1.3.7/projects/prodweb02/plugins/${it}-${major}.${minor}.${rev}.${build}. ... 55 | Resolving plugin JAR dependencies ... 56 | Executing ${it}-${major}.${minor}.${rev}.${build} plugin post-install script ... 57 | """ 58 | def pluginTxt2 = """Copying ${it}.js file into the application ... 59 | [mkdir] Created dir: ${displayDir}/prodweb02/web-app/js/${it}/${major}.${minor}.${rev}/${it} 60 | [copy] Copying 2 files to ${displayDir}/prodweb02/web-app/js/${it}/${major}.${minor}.${rev}/${it} 61 | Done.'/web-app/js/${it}/${major}.${minor}.${rev}/${it}/${it}.js' has been copied into the application. 62 | 63 | Plugin ${it}-${major}.${minor}.${rev}.${build} installed 64 | Plugin provides the following new scripts: 65 | ------------------------------------------ 66 | grails install-custom-${it} 67 | """ 68 | 69 | def pluginTxt3 = """[delete] Deleting: ${scriptDir}/.grails/1.3.7/projects/prodweb02/resources/web.xml 70 | [delete] Deleting directory ${displayDir}/prodweb02/target/classes 71 | [delete] Deleting directory ${scriptDir}/.grails/1.3.7/projects/prodweb02/plugin-classes 72 | [delete] Deleting directory ${scriptDir}/.grails/1.3.7/projects/prodweb02/resources 73 | """ 74 | 75 | println pluginTxt1; 76 | sleep(ranDumb.nextInt(3000-1000+1)+1000) 77 | println pluginTxt2; 78 | sleep(ranDumb.nextInt(2000-1000+1)+1000) 79 | println pluginTxt3; 80 | } 81 | } 82 | 83 | -------------------------------------------------------------------------------- /node-gorge.js: -------------------------------------------------------------------------------- 1 | /** 2 | * look-busy for JavaScript 3 | * Modified from Taroko Gorge (http://nickm.com/poems/taroko_gorge.html) 4 | * Designed for node.js 5 | * Author: Doug Hurst 6 | * Date: 10/9/12 7 | */ 8 | 9 | var objects = 'authority,person,reference,institution,document,file'.split(','); 10 | var properties = 'timestamp,name,location,email,phone,children,parent'.split(','); 11 | var verbs = 'fetch,update,collect,send,read,write,track,annotate,seal,create,destroy'.split(','); 12 | 13 | function rand(min, max) { 14 | var r = Math.floor(Math.random() * (max + min)); 15 | return min > r ? min : r; 16 | } 17 | 18 | function choose(arr) { 19 | return arr[rand(1, arr.length - 1)]; 20 | } 21 | 22 | function ucfirst(str) { 23 | return str.charAt(0).toUpperCase() + str.slice(1); 24 | } 25 | 26 | function combine() { 27 | var words = choose(objects); 28 | if (words == objects[rand(1, (objects.length - 1))]) { 29 | words = 'new ' + ucfirst(words) + '()'; 30 | } else { 31 | words += '.' + choose(verbs) + '(' + choose(objects) + '.' + choose(properties) + ')'; 32 | } 33 | return words; 34 | } 35 | 36 | function define() { 37 | var o = {}; 38 | do { 39 | o[choose(properties)] = 'ref#' + rand(1001,9999); 40 | } while (rand(1, 2) == 1); 41 | return JSON.stringify(o); 42 | } 43 | 44 | function command() { 45 | return '(function() { ' + choose(verbs) + ucfirst(choose(objects)) + '.with(' 46 | + objects.slice(rand(0, 2), rand(2, (objects.length - 1))) + '); })()'; 47 | } 48 | 49 | function colorln(line, fg) { 50 | console.log('\033[0;' + fg + 'm' + line + '\033[m'); 51 | } 52 | 53 | var n = 0; 54 | var paths = 0; 55 | setInterval( 56 | function() { 57 | if (n === 0) { 58 | colorln('', 37); 59 | } else if (n == 1) { 60 | colorln(combine(), 37); 61 | paths = rand(3, 4); 62 | } else if (n < paths) { 63 | colorln(define(), 37); 64 | } else if (n == paths) { 65 | colorln(combine(), 37); 66 | } else if (n == paths + 1) { 67 | colorln('', 37); 68 | } else if (n == paths + 2) { 69 | colorln(command(), 33); 70 | } else { 71 | colorln('', 37); 72 | n = 0; 73 | } 74 | n += 1; 75 | }, 76 | 1200 77 | ); 78 | 79 | process.on('SIGINT', function() { colorln('', 37); process.exit(0); }); 80 | -------------------------------------------------------------------------------- /phing-build.php: -------------------------------------------------------------------------------- 1 | 11 | * @requires pcntl 12 | */ 13 | 14 | declare(ticks = 1); 15 | date_default_timezone_set('America/Chicago'); 16 | pcntl_signal(SIGINT, 'handleSignal'); 17 | 18 | function walk($directory, Closure $callback) { 19 | foreach (array_filter(scandir($directory), function($f) { return $f != '.' && $f != '..'; }) as $file) { 20 | if (is_dir($directory.DIRECTORY_SEPARATOR.$file)) { 21 | walk($directory.DIRECTORY_SEPARATOR.$file, $callback); 22 | } else { 23 | $callback($file); 24 | } 25 | } 26 | }; 27 | 28 | function makeRenderer(array $renderers) { 29 | return function($file) use ($renderers) { 30 | echo "\033[" 31 | .$renderers[rand(0, count($renderers) - 1)]($file) 32 | ."\033[m"; 33 | }; 34 | } 35 | 36 | function handleSignal($signal) { 37 | echo PHP_EOL."\033[0;31m".'Halting build!'.PHP_EOL."\033[m"; 38 | sleep(1); 39 | echo "\033[0;33m".'Unwinding stack...'.PHP_EOL."\033[m"; 40 | sleep(1); 41 | echo "\033[0;37m".'Build halted at '.rand(1,99).'%.'.PHP_EOL."\033[m".PHP_EOL; 42 | exit(1); 43 | } 44 | 45 | while (true) { 46 | walk( 47 | realpath(__DIR__.DIRECTORY_SEPARATOR.'..'), 48 | makeRenderer(array( 49 | function($filename) { 50 | return "0;37m".'phing> ['.date('r').'] Building include() files for '.$filename.PHP_EOL; 51 | }, 52 | function($filename) { 53 | return "0;31m".'PHP ERROR: parse(): cannot parse '.$filename.PHP_EOL; 54 | }, 55 | function($filename) { 56 | return "0;37m".'phing> ['.date('r').'] Generating collation from '.$filename.PHP_EOL; 57 | }, 58 | function($filename) { 59 | return "0;37m".'phing> ['.date('r').'] Found '.rand(2, 9).' tasks in "'.$filename.'"'.PHP_EOL; 60 | }, 61 | function($filename) { 62 | return "0;33m".'WARNING: file '.$filename.' contains deprecated flags'.PHP_EOL; 63 | }, 64 | function($filename) { 65 | echo "\033[0;37m".'phing> ['.date('r').'] Waiting for response from server (ftp.' 66 | .current(explode('.', $filename)) 67 | .'.com)...' 68 | .PHP_EOL; 69 | sleep(rand(1, 3)); 70 | return ''; 71 | }, 72 | function($filename) { 73 | echo "\033[0;37m".'phing> ['.date('r').'] Collecting entropy...'.PHP_EOL."\033[m"; 74 | do { 75 | sleep(rand(1, 2)); 76 | echo "\033[0;36m" 77 | .array_reduce( 78 | unpack('H*', file_get_contents('/dev/urandom', false, null, 0, 40)), 79 | function($i, $x) { return $i.$x; }, 80 | ' >> ' 81 | ) 82 | .PHP_EOL 83 | ."\033[m"; 84 | } while(rand(1, 3) != 1); 85 | return ''; 86 | } 87 | ) 88 | )); 89 | } 90 | -------------------------------------------------------------------------------- /search-index.py: -------------------------------------------------------------------------------- 1 | import time 2 | import random 3 | 4 | OMGBUSY = """\033[0;32m 5 | >> execute: Splitting up dataset, running from {0} to {1} 6 | >> routingPattern Connect route "taggable_add_tag" (/admin/addTag/:object_class/:object_id) 7 | >> routingPattern Connect route "taggable_remove_tag" (/admin/removeTag/:object_class/:object_id) 8 | >> routingPattern Connect route "prestaSitemap_index" (/sitemap.xml) 9 | >> routingPattern Connect route "prestaSitemap_map" (/sitemap.:mapName.xml) 10 | >> routingPattern Connect route "captcha" (/captcha) 11 | >> routingPattern Connect route "captcha_refresh" (/captcha/:random) 12 | >> routingPattern Connect route "captcha_demo" (/captcha_demo) 13 | >> routingPattern Connect route "appl_signin" (/login) 14 | >> routingPattern Connect route "appl_signout" (/logout) 15 | >> routingPattern Connect route "appl_password" (/request_password) 16 | >> routingPattern Match route "homepage" (/) for / with parameters array ( 'module' => 'page', 'action' => 'show', 'internal_slug' => 'homepage',) 17 | \033[0m""" 18 | 19 | i = 0 20 | split = 25 21 | 22 | while True: 23 | rando = float(random.randint(0,100)/100.0) 24 | now = time.strftime("%Y %d %b %H:%M:%S +0000"); 25 | 26 | if i > 0 and i % split == 0: 27 | print "\nfinished indexing at {0}".format(now) 28 | print OMGBUSY.format(i, i + (split - 1)) 29 | time.sleep( rando ) 30 | print "\nstarting indexing at {0}".format(now) 31 | 32 | if i == 0: 33 | print "\nstarting indexing at {0}".format(now) 34 | print OMGBUSY.format(i, i + (split - 1)) 35 | time.sleep( rando ) 36 | 37 | time.sleep( rando ) 38 | print ">> execute: seeding index {0}".format(i) 39 | i += 1 40 | 41 | --------------------------------------------------------------------------------