[SOLVED] how do you get ASCII in a terminal?

http://www.youtube.com/watch?v=iJpSQonl … annel_page
Time index: 1:34
That guy has a moose above his hostname. I thought the only way to add anything was manipulating PS1, but that moose is above his hostname?
Anyone know how to add something similar like that, maybe archs logo?
Last edited by greenfish (2009-05-17 16:16:09)

Ok, figured it out. Each of the "[..." actually needs to be prefixed with an (non-printable) ESCAPE character, ASCII code #27.
Since they're non-printable they cannot be displayed in this forum. :-p
I just wrote a little tool that writes a code-27 char in front of every "[" and that works.
//File 'issue-make.c'
//Create a usable 'issue' file (place it at /etc/issue) from various weirdly formatted text files.
//It accepts [... or [[... or ^[... escape sequences.
//By Jindur for bbs.archlinux.org. (Use/modify/hack/distribute/as you wish, just don't sell it.. as if lol).
//Maybe you don't want single [ to be recognized as ESC sequence. Delete the code lines then i guess.
#include <stdio.h>
int main(int argc, char *argv[])
char buf[256], buf2[256];
int n, n2;
FILE *f, *f2;
int just_converted = 0;
if (argc < 2)
printf("This tool converts escape sequences ^[.. [[.. and [.. into real escape sequences.\n");
printf("Enter filename of an ascii art file you wish to convert into a usable 'issue' file.\n");
printf("This will overwrite an existing 'issue' file in the current directory.\n");
printf("Example: issue-make my-cool-art.txt\n");
return 1;
f = fopen(argv[1], "r");
if (!f)
printf("Error: Could not open input file for reading.\n");
return 2;
f2 = fopen("issue", "w");
if (!f2)
printf("Error: Could not open 'issue' file for writing.\n");
return 3;
while (fgets(buf, 256, f))
n = -1;
n2 = -1;
do {
n++;
n2++;
//case 1: sequence ^[...
if (buf[n] == '^' && buf[n + 1] == '[')
n++;
buf2[n2] = 27;
just_converted = -1;
//case 2/3: sequence [ or [[
else if (buf[n] == '[' && !just_converted)
if (buf[n + 1] == '[')
buf2[n2] = 27;
just_converted = -1;
else
buf2[n2] = 27;
n2++;
buf2[n2] = '[';
just_converted = -1;
else
buf2[n2] = buf[n];
just_converted = 0;
} while (buf[n]);
fprintf(f2, "%s", buf2);
fclose (f2);
fclose (f);
return 0;
Use 'gcc' to compile.
Last edited by Jindur (2013-06-10 17:01:44)

Similar Messages

  • How do you get your Excel Solver back? I have already tried going into add-ins. It only recently stopped working.

    How do you get your Excel Solver back? I have already tried going into add-ins. It only recently stopped working.

    dougiedc wrote:
    It boggles the mind.  The Verizon store on L Street downtown Washington, D.C. cannot access my Verizon account.  They can only sell cellphones then it's up to me to contact Verizon on my own to get the hook up. I even asked "Are you Verizon employes?  Is this a vendor store or is it really a Verizon owned and operated store?"  The answer "Yes, we are Verizon employes, yes this is a Verizon owned and operated store" ...
    Yes, it indeed boggles the mind.  I'm of course referring to the fact that your post concerns Verizon Wireless products and services.  This forum is dedicated exclusively to Verizon Communications services.   As you probably know, Verizon Wireless and Verizon Communications operate as separate companies.
    If you need help for a Verizon wireless product or service, it's best to direct questions to the Verizon Wireless forums.  You can reach them by clicking on "Wireless" (either here or at the top of the page).
    Good luck and I sincerely hope you get your issue resolved.

  • How can you get an applet to obey the CSS z-index attribute?

    How can you get an applet to obey the CSS z-index attribute?
    I have a DHMTL page with a panel that I want to slide back and forth. But another part of the requirement is to have the panel look like it is sliding under another panel.
    The problem is that an applet is on the panel that slides. When the sliding panel move under the stationary panel the applet does not go under the stationary panel, but the reset of the sliding panel does render looking like it is sliding under.
    See below.
    - ~~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -
    - ~                      ~ ^                         ^ -
    - ~                      ~ ^                         ^ -
    - ~           #############***************           ^ -
    - ~           #            ^             *           ^ -
    - ~           #            ^             *           ^ -
    - ~           #            ^             *           ^ -
    - ~           #            ^             *           ^ -
    - ~           #            ^             *           ^ -
    - ~           #            ^             *           ^ -
    - ~           #            ^             *           ^ -
    - ~           #            ^             *           ^ -
    - ~           #            ^             *           ^ -
    - ~           #            ^             *           ^ -
    - ~           #            ^             *           ^ -
    - ~           #############^**************           ^ -
    - ~                      ~ ^                         ^ -
    - ~                      ~ ^                         ^ -
    - ~                      ~ ^                         ^ -
    - ~~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -
    ~ has a z-index of 1
    # and * have a z-index 2
    # shows above ~ and below ^
    ^ has a z-index of 3What I am getting with the applet on the panel with a z-index of 2 is the following
    - ~~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -
    - ~                      ~ ^                         ^ -
    - ~                      ~ ^                         ^ -
    - ~           #############***************           ^ -
    - ~           #            ^             *           ^ -
    - ~           #  @@@@@@@@@@@@@@@@@@@@    *           ^ -
    - ~           #  @                  @    *           ^ -
    - ~           #  @                  @    *           ^ -
    - ~           #  @                  @    *           ^ -
    - ~           #  @                  @    *           ^ -
    - ~           #  @                  @    *           ^ -
    - ~           #  @                  @    *           ^ -
    - ~           #  @@@@@@@@@@@@@@@@@@@@    *           ^ -
    - ~           #            ^             *           ^ -
    - ~           #            ^             *           ^ -
    - ~           #############^**************           ^ -
    - ~                      ~ ^                         ^ -
    - ~                      ~ ^                         ^ -
    - ~                      ~ ^                         ^ -
    - ~~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -
    --------------------------------------------------------Where @ is the applet. Notice how the applet is on top of the ^ but the panel under it, ^, is under like it should be. All the panels are 1x1 tables with a border. So how can I get the applet on the drawing shown with # and * to follow the rendering of the z-index of 2?

    Hi,
    I have the same problem, and don't know how to solve it, So, i had tried to put my applet in a div tag wih z-index=0, but it still hide my other Dhtml divs with bigger Z-index (z-index =1000)
    Have you any idea to solve this.
    Thanks
    Hakim

  • Moving controls about on a VI's front panel. How do you get a reference to a 'grouped' set of controls?

    Basic problem (annoying, if not disasterous - but common - at least for me):
    When you are trying to sktick two different VIs together and you copy the block diagram of one to the other, it sticks all the controls in the middle of nowhere.  THen you have to spend about 10 mins dragging the controls screen by screen from one end of the diagram to the other - sometimes over 15 screens.  Surely there has to be a better way?
    ** Incidentally you might think that labview would have these sort of settings in the 'properties' of the control on the right click menu - but no joy.
    I guess the obvious thing is that you can write a VI which will get a reference for a particular control and then say set it's position (x,y) to zero.  Only thing is that generally there will be a selection of controls, and often they will be organised nicely - after getting them to zero you don't want to have to reorganise them again.  I tried grouping the controls, but then the problem is - how do you get a reference to a group of controls.  If you move one of them it doesn't keep the spatial arrangement.  At this point i have got lost - and easily spent more time than it is worth fixing this problem.
    Any thoughts?
    Solved!
    Go to Solution.

    If I understand you correctly, when you copy the block diagram from the second VI to the first, the controls of the second VI end up in far left field on the front panel of the first, correct?  I think these added controls will maintain their relative locations among themselves so you should be able to find them all as a group out in left field. Then it's simply a matter of how to get them to enmasse join the rest of the controls on the front panel. There are a couple of easy ways to do this. There is a button on the toolbar at the top of the front panel window that allows you to reorder/group/ungroup front panel objects. You can select all controls/indicators out in left field and "group" them together. (As an alternative, you can also drop them all onto a tab control which will act as container for them). Then you select this group and with it selected scroll back over to the existing front panel and find and ALSO select (hold down shift key) a control/indicator from the existing group too. Then with BOTH the existing control selected and the new group (or tab control with the new group) selected you use the ALIGN buttons to quickly bring a corner of the new group into alignment with the old control. At that point you can ungroup the new stuff and move it where it needs to be. 

  • How do you get the page count on an old hp 1012 laserjet printer?

    How do you get the page count on an old hp 1012 laserjet printer?

    You should find this information on the configuration page. To print a configuration page, press and hold the green GO button until all of the lights cycle, approximately five seconds, then release the button. The Configuration Page will print.
    You can find more information in this document: Identifying Page Count.
    I am an employee of Hewlett Packard.
    - - Please mark Accept As Solution if it solves your problem so others can more easily find the answer - -
    - - Please click the Kudos star if you would like to say thanks - -

  • What are answer points and how do you get them?

    What are answer points and how do you get them?

    If you read the Help & Terms of Use over there --->
    You will find this and more:
    How do I get points for answering questions?
    "If you submit a reply to another member's question topic, you are eligible to receive points from that member. The originator has the option of marking a reply as either Helpful or Solved, which will add points to the respondent's account. These points will, in turn, increase a member's ranking (status level) in the community over time."
    Regards,
    Colin R.

  • How can you get OS Lion back if you already downloaded Mavericks?  I CANNOT live with the battery life of 2 hours!!  HELP

    How can you get OS Lion back if you already downloaded Mavericks?  I CANNOT live with the battery life of 2 hours!!  HELP

    Kappy wrote:
    Don't downgrade OS X without first erasing the drive. You cannot restore a Time Machine backup of Lion directly on top of a later version of OS X such as Mountain Lion or Mavericks.
    When you "Restore from a Time Machine Backup.", the drive will be erased for you, but yes, won't hurt to:
    Boot into Recovery (hold ⌘R on boot)
    Utility->Disk Utility->Erase Macintosh HD, then Repair Macintosh HD
    Quit Disk Utility
    Then Select: Restore from a Time Machine Backup.

  • How do you get Safari Browser back on your Iphone if your daughter erased it?

    how do you get safari browser back on your iphone if your 4 yr. old daughter deletes it by accident?

    You cannot delete Safari.
    It is either on another page, in a folder, or you have restirctiosn set.
    Check all three of these possibiities.

  • How can you get your photos in the order they are in your computer

    How can you get your photos synced to your phone in the same order as the file on your computer?

    The iPhone Photos app orders photos by date.

  • How can you get your submit buttons to be a single click instead of the default double click?  (The

    How can you get your submit buttons on the quiz template to be a single click instead of the default double click?  (The option to choose double click or not is not showing in properties for this).

    Hmmm... Submit button doesn't need a double click at all. Maybe you are talking about the two-step process? When you click on Submit, the feedback appears with the message to click anywhere or press Y. Is that what you are talking about? If you are talking about a real double-click, something must be wrong in your file. And which version are you using?
    http://blog.lilybiri.com/question-question-slides-in-captivate
    Lilybiri

  • How do you get your purchased items on apple tv to you i tunes on your computer

    How do you get your purchased items on apple tv to you i tunes on your computer

    Download them.
    Store > Check for Available downloads.

  • How can you get your i pod touch screen fixed

    How can you get your screen on an i pod fixed

    Apple will exchange your iPod for a refurbished one for $199 for the 64 GB one and $99 for the others. They do not fix yours.
    Apple - iPod Repair price      
    A third-party place like the following maybe less. Google for more.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens
    Replace the screen yourself if you are up to it
    iPod Touch Repair – iFixit

  • HT4972 after downloading ios5.1.1 how do you get your music back on your ipod?

    after downloading ios5.1.1 how do you get your music back on your ipod

    Sync it from your iTunes library
    Redownload iTunes purchases by
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    If it was not in your iTunes library and you updated via iTunes you will have to get the music again sinve synced media like apps and music are not include din the iPod backup that iTunes makes.

  • How do you get your apps from the i tunes library onto your mac?

    how do you get your apps from i tunes library onto your mac

    You don't.  Apps from iTunes are for iOS devices.  Apps for the Mac come from the Mac app store.  Click the apple >> app store.

  • How do you get your old scores on your games when you transfer the games between devices ive signed into game center and my scores are there but when I open the games Im at 0 again

    how do you get your old scores on your games when you transfer the games between devices ive signed into game center and my scores are there but when I open the games Im at 0 again

    Did you do this?
    iOS: Transferring information from your current iPhone, iPad, or iPod touch to a new device

Maybe you are looking for

  • Help me get my hp 7 1800 working

    please help get my hp 7 1800 tablet running correct thank you ,charlie [edited by Moderator]

  • Flash Player screen turns GREEN (sound is ok)

    PROBLEM #1......... On different websites when I switch to full screen mode of flash player, sometimes the full scrren turns green after a short streaming.  I would have to refresh the page, which starts the video from the beginning. This started abo

  • How much better is the new Graphic Card?

    How much better is the new graphic card compared to the X1600 256mb in the older 2.33 Core 2 duo's? Im a gamer and was wondering if there is gonna be a big difference or just a small difference?

  • How to load svg (vector) image dinamicaly.

    Hallo! I tryed to load dinamicaly an image svg (.ai) into flash but I can't. At my level: 1) I know that flash can't import .svg file but it is possible convert svg in Adobe ilustrator .ai file; 2) I can import .ai file in flash with no problem; 3) I

  • LinkedList and ListIterator

    Hello! I have been working on the following code and can get it to compile with no errors but cannot get the program to return the correct results. When I have the ListIterator as hasPrevious() I get the following exception: Exception in thread "main