Darren Kitchen Posted August 5, 2008 Posted August 5, 2008 Hey guys, this is the code I whipped together to make the Hak5 Graffiti wall. Toss in a projector and a webcam and it's fun for the whole Internet. Now lets make it even better! :) Write.php <?php if (isset($_POST['name']) && !empty($_POST['name'])) { $nam = stripslashes($_POST['name']); $msg = stripslashes($_POST["message"]); $nam = htmlspecialchars($nam, ENT_QUOTES); $msg = htmlspecialchars($msg, ENT_QUOTES); $content = $nam . ": " . $msg; //filtering $blocked = array("fuck", "shit"); $replacewith = array("frak", "shazbot"); $content = str_replace($blocked, $replacewith, $content); //write to file to display on wall $filed = @fopen("data.txt", "w"); @fwrite($filed, "$content"); fclose($filed); //write to log $filed = @fopen("data.log", "a+"); @fwrite($filed, "$REMOTE_ADDR $content\n"); fclose($filed); echo "<b>Message Posted $REMOTE_ADDR</b><br /><br />"; } ?> <center> <form name="Graffiti Wall" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="application/x-www-form-urlencoded"> Name: <br /> <input type="text" name="name" size="14"><br><br> Message: <br /> <textarea rows="3" cols="15" name="message"></textarea> <br /><br /> <input type="submit" value="Write on the Hak5 Wall" name="submit"> </form></center> show.php <?php $filename = "data.txt"; $whattoread = @fopen($filename, "r"); $file_cnt = fread($whattoread, filesize($filename)); $msg = "$file_cnt"; fclose($whattoread); ?> <html> <head> <meta http-equiv="refresh" content="7"> </head> <body bgcolor="#000000" text="#ffffff"> <div style="font-size:1000%; font-family:courier new; font-weight:bold;"> <?php echo $msg; ?> </div> </body> </html> Suggestions? Quote
RogueHart Posted August 5, 2008 Posted August 5, 2008 i already suggested a username and account thing. but that would take a long time and you could use something sooner. so (if this thing is a more perm setup) then why not setup a password system. where you apply via the forums for a password. the you can use the password for each post on the wall. log each post by the password instead of just the name and you could find and ban people from the program by deleting their passwords from the php. though that might take longer depending on how it would be setup. i dont know for sure since i dont know php (its next on my list after c++) of course something like that would be a precursor to a login system. or if you could link the forums logins to the wall it might make things easier. but idk if thats even possible. just throwing in my suggestions. hopefully i sparked a few light bulbs. edit and maybe if you can try a code to automatically reduce font based on the size of the message. Quote
Pizza Posted August 5, 2008 Posted August 5, 2008 i have error with "<?php echo $_SERVER['PHP_SELF']; ?>" Quote
Tenzer Posted August 5, 2008 Posted August 5, 2008 I would suggest that you base this on a database instead (eg. sqlite), and then check that every post is displayed on the wall, because with the current script, two people could post something almost at the same time, and then one of the posts won't be displayed. But maybe that is wanted, with the benefit of having some updated posts that could comment what was happening on the set, instead of having a 10 minute queue for getting a post shown. If you want this I could try to put something together... Edit: Oh btw, it would also be easy to add a validation system to the above solution, so a person has to approve each post before they get into the queue, in order to limit spam and ads. Edit 2: I just saw the 3x11 episode, and if you want people to post ascii art on the wall, you probably need to enclose the text in <pre> tags, or at least make newlines (\n) into HTML newlines (<br />). Quote
iisonly Posted August 5, 2008 Posted August 5, 2008 tried to something similar It would display inserted text for 10 seconds and then next and next until all are displayed. Source : http://iisonly.planet.ee/wall/?source or http://iisonly.planet.ee/wall/wall.zip Quote
crazyren Posted August 5, 2008 Posted August 5, 2008 lil' update...to write.php * Smileys * BBCode //text to smileys =) $content = str_replace(":(","<img src=\"smileys/sad.gif\" alt=\":(\"/>", $content); $content = str_replace(":(","<img src=\"smileys/sad.gif\" alt=\":(\"/>", $content); $content = str_replace(";(","<img src=\"smileys/cry.gif\" alt=\";(\"/>", $content); $content = str_replace(":@","<img src=\"smileys/mad.gif\" alt=\":@\"/>", $content); $content = ereg_replace(":)","<img src=\"smileys/smile.gif\" alt=\":)\"/>", $content); $content = ereg_replace("=)","<img src=\"smileys/smile.gif\" alt=\"=)\"/>", $content); $content = ereg_replace(":D","<img src=\"smileys/laugh.gif\" alt=\":D\"/>", $content); $content = ereg_replace(":d","<img src=\"smileys/laugh.gif\" alt=\":d\"/>", $content); $content = ereg_replace(":p","<img src=\"smileys/tongue.gif\" alt=\":p\"/>", $content); $content = ereg_replace(":P","<img src=\"smileys/tongue.gif\" alt=\":P\"/>", $content); $content = ereg_replace(":O","<img src=\"smileys/shocked.gif\" alt=\":O\"/>", $content); $content = ereg_replace(":o","<img src=\"smileys/shocked.gif\" alt=\":o\"/>", $content); $content = ereg_replace(";)","<img src=\"smileys/wink.gif\" alt=\";)\"/>", $content); $content = ereg_replace(":S","<img src=\"smileys/sick.gif\" alt=\":S\"/>", $content); $content = ereg_replace(":s","<img src=\"smileys/sick.gif\" alt=\":s\"/>", $content); $content = ereg_replace(":roll:","<img src=\"smileys/roll.gif\" alt=\":roll:\"/>", $content); //bbcode $content = str_replace("[B]", "<strong>", $content); $content = str_replace("[/B]", "</strong>", $content); $content = str_replace("[I]", "<em>", $content); $content = str_replace("[/I]", "</em>", $content); $content = str_replace("[U]", "<u>", $content); $content = str_replace("[/U]", "</u>", $content); $content = str_replace("[LI]", "<li>", $content); $content = str_replace("[/LI]", "</li>", $content); Quote
RogueHart Posted August 5, 2008 Posted August 5, 2008 I would suggest that you base this on a database instead (eg. sqlite), and then check that every post is displayed on the wall, because with the current script, two people could post something almost at the same time, and then one of the posts won't be displayed. But maybe that is wanted, with the benefit of having some updated posts that could comment what was happening on the set, instead of having a 10 minute queue for getting a post shown. If you want this I could try to put something together... Edit: Oh btw, it would also be easy to add a validation system to the above solution, so a person has to approve each post before they get into the queue, in order to limit spam and ads. Edit 2: I just saw the 3x11 episode, and if you want people to post ascii art on the wall, you probably need to enclose the text in <pre> tags, or at least make newlines (\n) into HTML newlines (<br />). i dont think setting up a que would be a good idea. im on here with aroujnd 40 osmething people and it takes no more than 2 tries to get my message shown. usually i only have to post once Quote
Rab Posted August 5, 2008 Posted August 5, 2008 Darren you may steal a copy of my accessible Ajax/PHP chat if you want. http://mike-whitehurst.co.uk/stuff/permanent/ Quote
Strife25 Posted August 5, 2008 Posted August 5, 2008 It would be cool to integrate this hack with the Emergency Party button: http://www.plasma2002.com/epb/ Quote
RogueHart Posted August 5, 2008 Posted August 5, 2008 i would love to see what someone breaking into your house would do if suddenly the wall said "i'm watching you put down the damn tv" ummmm think you could link the wall to maybe an irc log? at any rate this would be great for the live show. here. found a problem with the bbcode you had setup. heres a fix $content = str_replace("[b]", "<strong>", $content); $content = str_replace("[/b]", "</strong>", $content); $content = str_replace("[i]", "<em>", $content); $content = str_replace("[/i]", "</em>", $content); $content = str_replace("[u]", "<u>", $content); $content = str_replace("[/u]", "</u>", $content); $content = str_replace("[li]", "<li>", $content); $content = str_replace("[/li]", "</li>", $content); it wasn't taking lower case letters. i dont know php but i have enough reasoning skills to alter some code Quote
Fruitpastles Posted August 6, 2008 Posted August 6, 2008 You could use str_ireplace(). It's the same but case in-sensitive, only available in PHP5 though. i would love to see what someone breaking into your house would do if suddenly the wall said "i'm watching you put down the damn tv" LOL! I almlost want it to happen now :D. Quote
darthneo Posted August 6, 2008 Posted August 6, 2008 Might i suggest this for the name input tag in write.php: <input type="text" name="name" size="14" value="<?php echo $nam; ?>"> that way it 'saves' your name after you 'write on the hak5 wall', you might be able to do it this way "<?=$nam?>" but it doesn't work on my webserver... edit- you should probably add some more words to the "blocked" list.... Quote
RogueHart Posted August 6, 2008 Posted August 6, 2008 the "please wait" thing when your the last person to post could be timed. which would make it easier to mess with when there aren't many people typing for those that want to mess with it heres a bit of fun info 20 periods will make a new line. although because of the lack of a word wrap on single words you could type 300 unspaced periods and it would only do 1 line. then 2 periods to reach the window. dont forget to account for your name. ill keep messing with it and maybe we can have some cool stuff. for me(because i only accounted for my name) this will print the text over the window. although 1 letter on last line is off of it. and one more line will be off of it. ......... ..................... ..check...................... ..the........................ ..forums............................... ..4details................. this will print on the window without overlap ......... ........................ ..iR...................... ..window................. ..iR....................... ..ruler!................ Quote
Fruitpastles Posted August 6, 2008 Posted August 6, 2008 Here's a few functions I threw together that might improve it a little. <?php //LENGTHANDWRAP - cuts length, wraps and builds content function LengthAndWrap( $name, $message ) {     //SETTINGS     define("MESSAGE_MAX_LENGTH", 150);     define("MAX_WRAP_LENGTH", 18);         //BUILD STRING     $string = $name . ": " . $message;         //TRIM LENGTH     $string = substr( $string, 0, MESSAGE_MAX_LENGTH );         //WRAP     $string = wordwrap($string, MAX_WRAP_LENGTH, "<br />", true);         //RETURN     return $string; } //CENSOR INPUT - removes bad parts of string function CensorInput( $input ) {     //======================================================//     // Reads text file in the format: FIND:REPLACEWITH;     // Example:     // fuck:sunshinedust;     // dick:willy;     // pussy:lady area;     // balls:face;     //======================================================//             //SETTINGS     define("WORD_FILE", "words.txt"); //bad word file         //GET LIST OF WORDS     $handle = fopen( WORD_FILE, "r" );     $string = fread($handle, filesize( WORD_FILE ));     fclose($handle);     //REMOVE WHIE SPACE     $string = str_replace("\r\n", "", $string);//remove CRLF     $string = trim( $string ); //trim other whitespace         //PREP FOR LOOP     $total = substr_count( $string, "="); //count number of word replacements     $curr = 0;     $end = 0;         //PARSE CENSOR FILE     while ($curr != $total)//while the current divider is not the same as the total dividers     {             //GRAB WORD TO REPLACE         $start = ($end!=0?$end+1:0); //set to 0 if its the start of the file else +1         $end = strpos($string, "=", $start);         $bad = substr( $string, $start, $end-$start );             //GRAB REPLACEMENT         $start = $end + 1;         $end = strpos($string, ";", $start);         $good = substr( $string, $start, $end-$start);             //UPDATE ARRAYS         $replacements[] = $good;         $WordsOfTheDevil[] = $bad;             //MOVE ALONG STRING         $curr++;     }         //CENSOR     $input = str_ireplace( $WordsOfTheDevil, $replacements, $input ); //replace, with, in     return $input; } ?> Quote
natural_orange Posted August 7, 2008 Posted August 7, 2008 I Think it would be better if it just showed the last 2-5 lines from like #wall in mintirc.net Im sure the php-irc framework could handle it, and there are a few people in the community that are pretty good with that (cough the_php_jedi cough). Though some AJAX would probably be better... Quote
Darren Kitchen Posted August 7, 2008 Author Posted August 7, 2008 Hey guys thanks for all the feedback. I'm wanting to add more features faster than I can keep up. I'd really like to add your code into the mix as well as toss in some fun stuff like maybe simple multiplayer games but I'm leaving for Toronto tonight and won't return until Monday. I'll check in to make sure everything is running smoothly periodically. I want to first bring attention to the awesome Adobe Air Setcam app, it totally rocks my socks. http://hak5.org/forums/index.php?showtopic=9526 Also, thanks to SomeoneE1se the code has been much improved so I'm pasting the latest version here. Feel free to run your own local copy to test features. I built this initially using recycled code from a project I used to run called "6" with WAMP, which I like a lot better than XAMPP on Win. At first I wanted the wall to support spaces and linebreaks which would make ASCII art easier but at the same time I want it to be friendly to newcomers who are probably expecting it to wordwrap. Anyway, the code: Write.php <?php if (isset($_POST['name']) && !empty($_POST['name'])) { $imploder = 'sdf93jdfe873ifjaj489fb397fgdkw38372brlksuc8934uf8ws6gfk34hv7wbt394ap'; $blocked = array( "fuck", "Fuck", "FUCK", "shit", "Shit", "SHIT", "cunt", "Cunt", "CUNT", "gonna give you up" ); $replacewith = array( "frak", "frak", "frak", "shazbot", "shazbot", "shazbot", "cookie", "cookie", "cookie", "gonna rickroll the hakwall. That would be lame." ); $name = str_replace($blocked, $replacewith, stripslashes(htmlentities($_POST['name']))); $msg = str_replace($blocked, $replacewith, stripslashes(htmlentities($_POST['message']))); $check = file_get_contents('ip.ip'); //Check ban list if ($_SERVER['REMOTE_ADDR'] == "REMOVED FOR OBVIOUS REASONS" || $_SERVER['REMOTE_ADDR'] == "REMOVED FOR OBVIOUS REASONS" || $_SERVER['REMOTE_ADDR'] == "REMOVED FOR OBVIOUS REASONS" || $_SERVER['REMOTE_ADDR'] == "REMOVED FOR OBVIOUS REASONS" || $_SERVER['REMOTE_ADDR'] == "REMOVED FOR OBVIOUS REASONS" || $_SERVER['REMOTE_ADDR'] == "REMOVED FOR OBVIOUS REASONS") { die('You have been banned for being lame. Come back when you grow up.'); } //Check spam user if($check && $check != $_SERVER['REMOTE_ADDR']){ //text to smileys =) $msg = str_replace(":(","<img src=\"smileys/sad.gif\" width=\"120\" height=\"120\" alt=\":(\"/>", $msg); $msg = str_replace(":(","<img src=\"smileys/sad.gif\" width=\"120\" height=\"120\" alt=\":(\"/>", $msg); $msg = str_replace(";(","<img src=\"smileys/cry.gif\" width=\"120\" height=\"120\" alt=\";(\"/>", $msg); $msg = str_replace(":@","<img src=\"smileys/mad.gif\" width=\"120\" height=\"120\" alt=\":@\"/>", $msg); $msg = ereg_replace(":)","<img src=\"smileys/smile.gif\" width=\"120\" height=\"120\" alt=\":)\"/>", $msg); $msg = ereg_replace("=)","<img src=\"smileys/smile.gif\" width=\"120\" height=\"120\" alt=\"=)\"/>", $msg); $msg = ereg_replace(":D","<img src=\"smileys/laugh.gif\" width=\"120\" height=\"120\" alt=\":D\"/>", $msg); $msg = ereg_replace(":d","<img src=\"smileys/laugh.gif\" width=\"120\" height=\"120\" alt=\":d\"/>", $msg); $msg = ereg_replace(":p","<img src=\"smileys/tongue.gif\" width=\"120\" height=\"120\" alt=\":p\"/>", $msg); $msg = ereg_replace(":P","<img src=\"smileys/tongue.gif\" width=\"120\" height=\"120\" alt=\":P\"/>", $msg); $msg = ereg_replace(":O","<img src=\"smileys/shocked.gif\" width=\"120\" height=\"120\" alt=\":O\"/>", $msg); $msg = ereg_replace(":o","<img src=\"smileys/shocked.gif\" width=\"120\" height=\"120\" alt=\":o\"/>", $msg); $msg = ereg_replace(";)","<img src=\"smileys/wink.gif\" width=\"120\" height=\"120\" alt=\";)\"/>", $msg); $msg = ereg_replace(":S","<img src=\"smileys/sick.gif\" width=\"120\" height=\"120\" alt=\":S\"/>", $msg); $msg = ereg_replace(":s","<img src=\"smileys/sick.gif\" width=\"120\" height=\"120\" alt=\":s\"/>", $msg); $msg = ereg_replace(":roll:","<img src=\"smileys/roll.gif\" width=\"120\" height=\"120\" alt=\":roll:\"/>", $msg); //BB Code $msg = str_replace("", "<strong>", $msg); $msg = str_replace("", "</strong>", $msg); $msg = str_replace("", "<em>", $msg); $msg = str_replace("", "</em>", $msg); $msg = str_replace("", "<u>", $msg); $msg = str_replace("", "</u>", $msg); $msg = str_replace("[LI]", "<li>", $msg); $msg = str_replace("[/LI]", "</li>", $msg); $msg = str_replace("", "<strong>", $msg ); $msg = str_replace("", "</strong>", $msg ); $msg = str_replace("", "<em>", $msg ); $msg = str_replace("", "</em>", $msg ); $msg = str_replace("", "<u>", $msg ); $msg = str_replace("", "</u>", $msg ); $msg = str_replace("[li]", "<li>", $msg ); $msg = str_replace("[/li]", "</li>", $msg ); $file = @fopen("UNIQUE TEXT FILE.TXT", "w") or die('Write Error!'); @fwrite($file, $_SERVER['REMOTE_ADDR'].$imploder.$name.$imploder.$msg); fclose($file); $fileIP = @fopen("ip.ip", "w") or die('Write Error!!'); @fwrite($fileIP, $_SERVER['REMOTE_ADDR']); fclose($fileIP); $filed = @fopen("UNIQUE LOG FILE.LOG", "a+") or die('Write Error!!!'); @fwrite($filed, $_SERVER['REMOTE_ADDR'] . ' ' . $name . ' ' . $msg . "\n"); fclose($filed); echo "<b>Message Posted ". $_SERVER['REMOTE_ADDR'] . "</b><br /><br />"; } else { echo "<b>Please Wait!</b><br /><br />"; } } ?> <center> <form name="Graffiti Wall" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="application/x-www-form-urlencoded"> Name: <br /> <input type="text" name="name" size="14"><br><br> Message: <br /> <textarea rows="3" cols="15" name="message"></textarea> <br /><br /> <input type="submit" value="Write on the Hak5 Wall" name="submit"> </form></center> show.php <html> <head> <meta http-equiv="refresh" content="4"> </head> <body bgcolor="#000000" text="#ffffff"> <div style="font-size:700%; font-family:courier new; font-weight:bold;"><?php $file = file_get_contents('UNIQUE TEXT FILE'); if($file){ $data = explode('sdf93jdfe873ifjaj489fb397fgdkw38372brlksuc8934uf8ws6gfk34hv7wbt394ap', $file, 3); if($_SESSION['ip'] != $data[0]){ echo $data[1] . ": \n" . $data[2]; $_SESSION['ip'] = $data[0]; $_SESSION['name'] = $data[1]; $_SESSION['msg'] = $data[2]; } else { echo $_SESSION['name'] . ': \n' . $_SESSION['msg']; } } else { die('File Access Error!'); } ?></div> </body> </html> I've replaced sensitive data in the code above. Kinda forgot to last time and, well, some of you found the log file ;) Okies I'll check in when I can over the weekend. Have fun guys and I'll post pics from PurePwnage in Toronto when I get back. Cheers! PS: links on the setcam page to this thread, the adobe air app, and the privacy policy were added. Quote
Tenzer Posted August 7, 2008 Posted August 7, 2008 I'd really like to add your code into the mix as well as toss in some fun stuff like maybe simple multiplayer games but I'm leaving for Toronto tonight and won't return until Monday. A hangman game would be cool :D Quote
digip Posted August 7, 2008 Posted August 7, 2008 Is there going to be an offline archive of the wall? Not video, but just the text saved somewhere to go back and read funny comments from, etc. Quote
psydT0ne Posted August 13, 2008 Posted August 13, 2008 Hey Darren why not a project similar this in the future for around certain restricted areas of the hak5 house...possibilities are endless. http://www.bpexplorer.com.au/ essentially drive around a robot equipped with a web cam remotely from a web page...people register and queue up for a go. maybe just a pipe dream but it could be cool. Quote
Conor_M Posted August 14, 2008 Posted August 14, 2008 Yeah, I suggested that to Matt the other night.. :) Quote
IceCold Posted August 15, 2008 Posted August 15, 2008 Is there going to be an offline archive of the wall? Not video, but just the text saved somewhere to go back and read funny comments from, etc. a log is definitely a great idea Quote
UberTaco Posted August 15, 2008 Posted August 15, 2008 Hey guys, I'm lovin' the graffiti wall (even though it's more like the Graffitivision now.) I went ahead and hacked together a script in python to let folks run something similar on their own machines. You need: Python PyGame #import and initialize import pygame pygame.init() class Message(pygame.sprite.Sprite):   def __init__(self, filename):     pygame.sprite.Sprite.__init__(self)     self.font = pygame.font.SysFont("Verdana", 36)     self.filename = filename        in_file = open(self.filename, "r")     filetext = in_file.read()     in_file.close()             self.text = filetext     self.image = self.font.render(self.text, 1, (255, 255, 255))     self.rect = self.image.get_rect()   def rendertext(self, font, text, pos=(0,0), color=(255,255,255), bg=(0,0,0)):       lines = text.splitlines()       #first we need to find image size...       width = height = 0       for l in lines:           width = max(width, font.size(l)[0])           height += font.get_linesize()       #create 8bit image for non-aa text..       img = pygame.Surface((width, height), 0, 8)       img.set_palette([(0,0,0), (255,255,255)])       #render each line       height = 0       for l in lines:       t = font.render(l, 1, (255,255,255), (0,0,0))       img.blit(t, (0, height))       height += font.get_linesize()       return img   def update(self):     #-----Read text from text.txt----#     in_file = open(self.filename, "r")     filetext = in_file.read()     in_file.close()                 self.text = filetext     #self.image = self.font.render(self.text, 1, (255, 255, 255))      self.image = self.rendertext(self.font, self.text)     self.rect = self.image.get_rect()     label.rect.centerx = background.get_rect().centerx     label.rect.centery = background.get_rect().centery #display screen = pygame.display.set_mode((800, 600), pygame.FULLSCREEN | pygame.DOUBLEBUF | pygame.SWSURFACE) FULLSCREEN = True #Entities background = pygame.Surface(screen.get_size()) background = background.convert() background.fill((0, 0, 0)) label = Message("test.txt") labelSprite = pygame.sprite.Group(label) #Action #  Assign vals to vars clock = pygame.time.Clock() keepGoing = True #  Loop while keepGoing:     #T - Timer for framerate   clock.tick(30)   #E - Events   for event in pygame.event.get():     if event.type == pygame.QUIT:       keepGoing = False     elif event.type == pygame.KEYDOWN:       if event.key == pygame.K_ESCAPE:         keepGoing = False       elif event.key == pygame.K_f:         if FULLSCREEN:           screen = pygame.display.set_mode((800, 600), pygame.DOUBLEBUF | pygame.SWSURFACE)           background = pygame.Surface(screen.get_size())           background = background.convert()           background.fill((0, 0, 0))           label = Message("test.txt")           labelSprite = pygame.sprite.Group(label)         else:           screen = pygame.display.set_mode((800, 600), pygame.FULLSCREEN | pygame.DOUBLEBUF | pygame.SWSURFACE)           background = pygame.Surface(screen.get_size())           background = background.convert()           background.fill((0, 0, 0))           label = Message("test.txt")           labelSprite = pygame.sprite.Group(label)         FULLSCREEN = not FULLSCREEN         screen = pygame.display.get_surface()   #R - Refresh display   screen.blit(background, (0, 0))   labelSprite.update()   labelSprite.draw(screen)   pygame.display.flip() Can't take credit for quite everything, as I had to creatively Google to find that rendertext function that I dropped in the Message class (Why the heck doesn't pygame.font.Font.render support newline chars?) but the rest is mine. :) Note that this reads from a file "test.txt" in the same directory as the script itself...still working on checking for existence and creating if non-existent file. EDIT: Had to update a few things: the Python was erroring out on Windows (I have to reinitialize each surface each time I reinitialize the screen...) Also set the font to "Verdana" because I know every Windows user will have it, and (almost) every Linux user will default to the much prettier FreeSans if they don't have it.... I can zip up a py2exe, if anyone wants it for "drop-in-and-go" Quote
UberTaco Posted August 15, 2008 Posted August 15, 2008 And a pair of bash functions for dropping in your .bashrc (assuming you're running on Linux) function writeScreen() { echo "$@" > ~/test.txt } function writeScreenln() { echo "$@" >> ~/test.txt } These again assume a file (this time in the home dir) called test.txt. You may need to change this path as necessary. :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.