15 May, 2014

MonoDevelop and MVC3, I should be content... for now

MonoDevelopLogo
MonoDevelopLogo (Photo credit: Wikipedia)
14-May-2014

You would notice that I would always date my posts. I should. When I do searching on the web, and I find articles, I would be very happy. Only to find that the articles I initially thought to be the answer to my questions are... well... outdated.

Thus, I always date my posts. For me, and for the one who would find them.

I would have to say again, like the scientist Mr Blue in Hulk movie, that I am usually 'more curious than cautious', and this is where most of my problems in my computer life are coming from, and mostly, for the good. I learn by making (unintentional) mistakes.

It is the same thing when I would say, to answer the question, what is the difference between a fresh graduate and a veteran (let's restrict to software developers), since both of them know how to program?

Debugging. Error prevention. Quick rebound. Composure and calm demeanour.

The veteran has been there, and knows what it is like to have issues and problems, even in the middle of the night, and seeks to resolve them based on knowledge learned from previous encounters.

And this is the years gone past, but for the fresh graduate, are the years before him.

And as for me, I should have been contented with what MonoDevelop has to offer: MVC3. I was forcing MVC4, and trying and following and trying and messing up, until finally, what I (unintentionally) broke was my Windows 8.1 OS.

I was curious. About 4 times already on installing and re-installing Ubuntu Linux, and always picking the option of 'Something else', but I got so curious as to what would happen if I pick 'Reinstall Ubuntu...', and boom!

Anyway, I'm back. I found that HP's recovery discs doesn't work (yap, I ordered them from HP since I haven't burned/created my own recovery discs from the preinstalled data), and even when I was able to download Windows 8.1 ISO images, the OEM Key as extracted from the BIOS info using RWEverything (that is the only tool that can do the BIOS data reading), well, it is not accepted to activate Windows. Crap! I have a valid key, but it is not accepted?!

You know what's the solution? Buy a retail version. Another crap! That would be about USD100+, whereas the recovery discs were a fraction, but also useless!

Pardon my disappointment, but anyway, I found a way to get back my Windows 8.1,and being given a chance to see which files, software and applications are important, I saved what's necessary (TestDisk - the only tool that helped me do the recovery) and discarded the rest. I wish I had everything back, but then again...

For now, I should be content with that MonoDevelop has to offer: MVC3. I will do my learning, and who knows, just one day, MVC4, or even MVC5, will come?

Till then!



Enhanced by Zemanta

03 May, 2014

Colors and more... in the Terminal

Screenshot of a sample Bash session, taken on ...
Screenshot of a sample Bash session, taken on an old release of Gentoo Linux. (Photo credit: Wikipedia)
03-May-2014


I am one who is comfortable using the Terminal, having used the computer since the DOS days, and while Windows with all its graphical interfaces is very much welcome, as it brings with its GUI tons of changes, I would find myself still at ease doing command lines.

And I would consider sprucing up the Terminal the pinnacle of a die hard's declaration... finding comfort in typing text and cryptic commands, also find comfort at least in seeing different colors in the texts and backgrounds. That's it!

So, I am one like that. I have worked on PROMIS since 1996, and DOS since time immemorial, all command-line systems, and I was very much satisfied just seeing the colors come alive on prompts and errors(!) and all.

And now that I am doing Linux, I craved for the same thing, and fortunately, there was help - from the Community.

I would just put a reference to the article, so I don't duplicate anything.

Here's the link: Customizing Bash Prompt

I hope you enjoy tweaking your prompt, to your own liking, etc., etc.

Till then!

Enhanced by Zemanta

02 May, 2014

And to indicate in terminal prompt if I am a root user

Sample of BASH through a shell in GNOME. Scree...
Sample of BASH through a shell in GNOME. Screenshot taken in Arch Linux (Photo credit: Wikipedia)
02-May-2014


I would have to say that knowing that I am a root user, or that I activated my being a root user, at least in the prompt, to be a big help. Fortunately, somebody has already thought of this, and has also done it, and has shared it.

So either you are the root user, or you can switch between a normal user and a root user, it would be very beneficial to know when a user mode or privelege is active and available.

That being said, I searched the web, and I found one that worked.

It is editing .bashrc and appending these:

# Turn the prompt symbol red if the user is root
if [ $(id -u) -eq 0 ];
then # you are root, make the prompt red
    PS1="[\e[01;34m\u @ \h\e[00m]----[\e[01;34m$(pwd)\e[00m]\n\e[01;31m#\e[00m "
else
    PS1="[\e[01;34m\u @ \h\e[00m]----[\e[01;34m$(pwd)\e[00m]\n$ "
fi

So the .bashrc could be in your /home/username directory.

Or when you invoke superuser by sudo -i (or sudo su), it would be in /root directory.

By employing this, I am able to know when I am a normal user, and when I am a super user. It may be what you need, for all I know. Try it!

Here's the reference: Changing behavior of bash prompt when functioning as root

Till then!


Enhanced by Zemanta

Making terminal(s) remember commands

English: Sample of Bash in GNOME Terminal. Scr...
English: Sample of Bash in GNOME Terminal. Screenshot taken in Fedora Linux. Results of ping, pwd, cd, yum and ls command. فارسی: نمونه‌ای از محیط متنی لینوکس (بش) در نرم‌افزار گنوم ترمینال، توزیع فدورا. خروجی دستورهای ping، pwd، cd، ls، و yum. (Photo credit: Wikipedia)
02-May-2014


Here is another trick that I did, and now I had to re-do, so I am recording it, so I can go back to it anytime.

Edit bashrc: gedit/vi ~/.bashrc
Add at last line: export PROMPT_COMMAND="history -a; history -n; $PROMPT_COMMAND"

-a switch is to make terminal record the commands
-n is to record the command history from all terminals (so this is an option)

Save and exit, and voila!

To look at command history, just type history and press [Enter]
To run (again) a command, type !number (on the left of the command) and press [Enter]

Here's the reference: [SOLVED] Terminal doesn't remember last commands

Till then!
Enhanced by Zemanta

And... shortening my command line bash prompt

English: Sample of Bash in GNOME Terminal. Scr...
English: Sample of Bash in GNOME Terminal. Screenshot taken in Fedora Linux. Results of ping, pwd, cd, yum and ls command. فارسی: نمونه‌ای از محیط متنی لینوکس (بش) در نرم‌افزار گنوم ترمینال، توزیع فدورا. خروجی دستورهای ping، pwd، cd، ls، و yum. (Photo credit: Wikipedia)
02-May-2014


This may be considered insignificant, but if you are one who sticks to the terminal, or the command line, it would be one sensible action.

Originally, the prompt would show the username and the box manufacturer and model, etc., etc. And this is what I consider 'unsightly'... ugh!

Well, no offense to others, I am just speaking for myself.

But I needed to shorten it, as it tend to fill up the line, without even typing anything.

I just followed what is indicated here, and it worked like a charm. So again, I am keeping a record, so I can go back to it when the need arises.

Edit .bashrc file and make some changes:
1. gedit/vi ~/.bashrc
2. Remove @\h
3. Replace \w with \W (lower case w to capital W)
4. Save and exit terminal.

Upon opening a new terminal window, the change should be effected already.

Reference is here: How can I shorten my command line (bash) prompt?

Till then!

Enhanced by Zemanta