Latest Updates: Linux RSS

  • Articles

    Red Hat Europe still powered by PHP4

    Stii 10:44 pm on October 15, 2009 | Comments: 0 Permalink | Reply
    Tags: Linux, , php4, redhat, redhat europe

    redhat-logo

    I find this very hard to believe, but it seems that Red Hat Europe‘s site is still powered by PHP 4. PHP 4.3.2 to top it all off. This after PHP 4 reached it’s end of life more than a year ago. I guess the old saying applies:

    If it’s not broken, don’t fix it!

    Right…? It is just a little bizarre, I guess. Here is a screenshot of the headers.

    Redhat PHP4 headers

    Welcome back! You should subscribe to my RSS feed here.
    You should follow me on Twitter here
    You should follow me on Gatorpeeps here.

    Save Cape Town City Ballet
     
  • Articles

    Google Chrome OS hype

    Stii 1:06 pm on July 8, 2009 | Comments: 6 Permalink | Reply
    Tags: , , Linux, , operating system

    googlechromelogoGoogle announced today their new Google Chrome OS. As they put it:

    “It’s our attempt to re-think what operating systems should be,”
    and
    “However, the operating systems that browsers run on were designed in an era where there was no web.”

    If one thinks about it, it makes a lot of sense what Google is trying to do. It would (should?) be a far less complex system. The apps you’re used to use will live online and will be rendered and displayed using HTML5. It can be done. It is, IMHO, a good idea. Yes, connectivity and bandwidth issues plays a big role, but we all know thats the two things that is growing and not declining. I can see the potential and the practicality of it. I’m not convinced that it would be adopted on Enterprise level, but it would be something that could work for me and what I would use it for.

    There are two things that bothers me:

    1. Google Drops A Nuclear Bomb On Microsoft. And It’s Made of Chrome. – Techcrunch
    Why would this be seen as a Nuclear Bomb on Microsoft? C’mon Techcrunch, thats a bit sensational wouldn’t you agree? It would be YEARS before big corporates and Windows users would ditch their Microsoft investments for Chrome OS, so I do not think they are sweating yet. In fact, they have more than enough time to build a competitive product IF they are clever. I’m not so sure they are as clever as they are arrogant. Be a bit more realistic and less sensational, please!

    2. Why is Google riding this Open Source wave with so much enthusiasm?
    Don’t get me wrong, I think it is absolutely fabulous, I’m just wondering “why”? Surely they have or at least can get the best of the best, no? So why make such a big deal about it? I’m not sure. I guess I should be thanking Google instead of questioning their motives, right? If they are so passionate about OSS then why not release everything? Why not Gmail, Google Search, Adsense/Adwords, Google Docs, etc? Maybe I’m just not thinking this strategy of theirs through properly. Maybe they simply don’t pay enough to rope in and retain the badass ninja coders. I cannot really say with conviction, but would love to know.

    Kudos to André van Rooyen who saw this coming when the Chrome browser was released when I did not. I’m starting to see the light and catch his drift.

    Save Cape Town City Ballet
     
  • Articles

    Blasphemy! There is some seriously wrong with this picture...

    Stii 9:22 am on April 17, 2009 | Comments: 16 Permalink | Reply
    Tags: blasphemy, Linux, tux

    Can you spot the blasphemy in this image below? I’m thinking of starting an email petition. Old skool style! ;)

    n509484421_1636956_829867

    Lets hear it.

    Save Cape Town City Ballet
     
  • Articles

    5 simple Bash tips

    Stii 10:31 am on March 17, 2009 | Comments: 0 Permalink | Reply
    Tags: , command line, Linux, , tips and tricks

    If you work in the command line on Bash a lot you’ll probably find that you often repeat commands. Often you need to run similar commands, but change something like a path, for example. Below are 5 very basic and simple things you should get into the habit of using as they just might make your life simpler. They work wonders for me :)

    1. Search the command history:

    $ ctrl+r
    (reverse-i-search)`ls': ls - l /opt/local/var/db/mysql5
    

    This is by far the handiest tip. On the command line, press the Control button and R. This will activate a reverse interactive search. start typing something that was in the command and it will return the last command with the text in it. If it is not this particular command you were looking for, press Control+R again and it will return the next command. Keep hitting Control+R until you find the command you were looking for and hit enter to run the command. It beats retyping commands or pressing the up arrow until you get the command. :)

    2. Edit the previous command

    $ fc
    

    Running the fc command opens your default system editor (VIM in most cases) and allow you to edit the command. After your changes when you exit VIM your edited command will execute. This is handy if you were running a complex long command but made a mistake and need to edit some things somewhere in the middle of the complex command. Handy if you remember you can do that.

    3. Run the last command of a certain type

    $ !ssh
    ssh -l stii stii.co.za
    

    If you’ve ran a bunch of commands and cannot remember exactly when last you ran a certain command, but you know you want to run the last ssh command, use the !ssh to run the last ssh command you’ve executed. This will save you time again on paging up through your history to find that command.

    4. Run the last command of a certain type, replacing some values

    $ !ssh:s/stii.co.za/afrigator.com
    ssh -l stii afrigator.com
    

    Same as the previous command except it will replace the domain name stii.co.za with the domain afrigator.com. Very, very handy one for running repetitive commands with different arguments. It sure as hell beats finding the command, backspacing the argument you want to change and typing in the correct value!

    5. Swop two characters quickly

    If you have twiddle fingers or cronic dyslexia like some of us, then this one’s a gem. ;) Lets say you typed a command and swapped two characters around:

    $ cd /home/afrigtaor
    

    Instead on moving your cursor to the a, backspacing twice and retyping the a and t in the correct order, all you need to do is to move your cursor to the a and press Control+t and it will swop the t and the a around fixing your typo. Although this one is a bit of a useless one, if you do swap characters often, it might be handy to know of this trick ;)

    These tips are very basic and would probably not be news for most experienced Bash aficionados. I find these very handy and use them often on a daily basis, so maybe it could be handy to someone else. If you have a set of your own favorite tricks, please do let me know as I love learning and improving! Happy Bashing!

    Save Cape Town City Ballet
     
  • Articles

    An age old debate laid to rest. How to pronounce Linux

    Stii 10:19 am on January 30, 2009 | Comments: 2 Permalink | Reply
    Tags: linus torvalds, Linux

    Found this little gem over on dmiessler.com. I could not agree more with his statement:

    When an authority for a particular product or movement explicitly states how that thing is pronounced, that pronunciation does in fact become the correct one.

    So in case you are still say Linux in every imaginable way except the right way, here is the definitive answer. Here is the right and only way to pronounce Linux as dictated by the legend Linus Torvalds himself:

    As Daniel says:

    End of debate.

    Save Cape Town City Ballet
     
  • Articles

    Bash script or command to get a process id

    Stii 7:00 am on January 23, 2009 | Comments: 4 Permalink | Reply
    Tags: , Linux, , shell-scripts

    bash logoBash (a.k.a. Bourne Again SHell) is one of the best tools you’ll ever come across on Linux, Unix or OSX. You can do virtually anything with it! It is said that bash even cures cancer! Now, let me make this very, very clear… I’m not an expert. I haven’t written much bash scripts for the past 5 years, so it would be fair to say I’m a n00b. At the very least, I’m not a l33t bash afiçionado.

    I had a specific need. I needed a way to find out if a process was running and to obtain its process id (pid). Well, in all honesty, I didn’t REALLY needed the pid, but thought it could maybe be handy for some, so I included it anyway. In my case, all I wanted to know was whether a process was running and if not, to start it. I digress.

    First what I needed was to find the process I’m looking for:

    #!/bin/bash
    
    pid=`ps -eo pid,args | grep myprocess | \
    grep -v grep | cut -c1-6`
    #do what I need with the pid
    

    What we did here:

    First we get the process with the ps command. the -e option tells it to find processes in the entire environment. Without -e it will return only the processes owned by the user who runs the command. The -o option lets you specify which fields you want. That is exactly what the pid,args are. It is the fields we want, and the only fields we want in this instance.

    Next we pipe the ps command through the grep command. grep extracts all the lines the ps command return that contains the string you specify, in this case “myprocess”.

    Since the grep command will also return the grep process, we need to pipe it to another grep command to remove the grep proccess itself. The -v option tells grep to do an invert match, i.o.w. exclude the line containing the word “grep”. Lets look at an example:

    If we only use:

    $ ps -eo pid,args | grep myprocess
    1234    /path/to/myprocess.sh
    34761  grep myprocess
    

    It returns two lines. We’re not interested in the second line and need to exclude it so the command:

    $ ps -eo pid,args | grep myprocess | grep -v grep
    1234   /path/to/myprocess.sh
    

    grep -v grep excludes the line that contains “grep”. Nifty. Just what we need.

    The next step is to get the pid (process id) piping the results to the cut command. The -c1-6 simply says “cut the characters from the first character up to and including the 6th character”.

    ... cut -c1-6
    

    There you have it! You can now do what you need to with that process id. Crush it, Kill it, Destroy it, whatever tickles your fancy!

    I’d like to know from the real experts, what would be an easier way to do it? More important, what would be a better way to do it? I have to be honest, I didn’t really googled much for an answer since I was busy doing the Afrigator language files and was looking for anything to procrastinate on and this seemed like great fun! My solution might not be very good. For example, it does not allow for more than one process. It assumes that there would always only be one process running. It should be easy enough to allow for more than one process, but I’ll leave that up to you! You would need to split the lines… argh, just figure it out!

    PS: Justin & Lester, next time you give me grief, I will replace the two of you with bash scripts!

    Update:

    Here is a simpler command by Donald Jackson via Twitter utilizing awk:

    $ ps aux | grep processname | grep -v grep | awk '{print $2}'
    

    Thanx @donaldza

    Save Cape Town City Ballet
     

About Me

Software developer at Afrigator.com Love Python, do PHP.
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
esc
cancel