A few zsh tricks

Computers, Linux, Ubuntu 1 Comment »

I’ve started playing around with the zsh shell, and I like it a lot more than bash. A few weeks ago I participated in the “history meme” where I used this command in zsh:

cat ~/.histfile|awk '{a[$1]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head

to print out my top 10 used commands.

A slightly shorter command in zsh is:

history 1|awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head

which works for anyone, even if they have their history file in a different location. The command “history 1″ prints all commands in the history from the 1st one.

Everyone, whether they are new to Linux or a guru forgets to put “sudo” in front of system commands once in a while. I often forget when I want to edit a file in /etc or need to use apt-get. Typing out the command again can be long-winded, as can pressing up to get the command again, and then reverse tabbing to the beginning of the line to type “sudo “. zsh gives an easier way:

sudo !!

Adding “!!” after anything will simply put whatever you type before the !! at the beginning of the last used command, and then execute it. It’s much faster. Additionally, just executing “!!” on the command line will execute the last command, without any prefix. You can use !! to prefix any command you want.

Finally, if you use a lot of terminals at once (like myself) it will be useful to share the history across them. Usually only the most recently opened terminal saves history. Adding these to your .zshrc file will enable all instances of zsh to store history, and update their history every time a command is executed.

setopt EXTENDED_HISTORY
setopt SHARE_HISTORY
setopt APPEND_HISTORY
setopt INC_APPEND_HISTORY

Popularity: 3% [?]

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • NewsVine
  • Slashdot
  • Netscape
  • Technorati
  • blogmarks
  • Spurl
  • YahooMyWeb
  • BlinkList
  • Reddit
  • TailRank
  • feedmelinks
  • Furl

Shell History

Computers, Linux, Ubuntu No Comments »

Seems like a lot of Linux bloggers have been doing this recently so I thought I’d follow suit! The following command (in bash) will print the top ten commands in your shell history:

history|awk ‘{a[$2]++ } END{for(i in a){print a[i] ” ” i}}’|sort -rn|head

Of course, since I use zsh instead of bash, I had to make a few changes:

cat ~/.histfile|awk '{a[$1]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head

And my results:

88 ls
70 cd
64 sudo
64 petris
36 plato
30 vim
29 cat
26 echo
20 wine
20 make

ls, cd, and sudo are pretty standard commands that are used so it’s not surprising they come first. I clearly play petris (a tetris clone) way too often. “plato” is a custom command to connect me to my university servers. vim, cat, and echo are also pretty standard commands. I have recently begun using wine a lot to play PC games, and make to compile a load of programs :D

Popularity: 3% [?]

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • NewsVine
  • Slashdot
  • Netscape
  • Technorati
  • blogmarks
  • Spurl
  • YahooMyWeb
  • BlinkList
  • Reddit
  • TailRank
  • feedmelinks
  • Furl

Thoughts for 2008

Atheism, Facebook, Linux, MyBB, Student, Ubuntu, University No Comments »

Well, this is my last blog post for 2007, and it has been a really great year for me. I’ve completed my first term at university, converted to Ubuntu Linux, and played Portal, BioShock, and Halo 3 for hours on end. However, instead of commenting on the year that has past, I thought I’d comment on my hopes for 2008, in reference to things that will affect me.

facebook

For a student, facebook is a very important tool. It’s a linking point between everyone you know, whether they are at university or not. You can plan events, share photos, send messages (either publicly on the wall or privately), and do hundreds of other things thanks to the growing number of applications. However, there are still drastic improvements to be made:

  • Generate news feeds in real time. When one of my friends changes their name, I want to know immediately, not several hours later. There is no reason why they can’t do this already, and it would certainly keep everyone up to date with things.
  • More control over notifications, especially those concerning applications. I’ve really had enough people inviting me to “become a werewolf” or “see what kind of eyes you have”. Either ditch the invitations, or include an option to turn all application invitations off. I know they have an “application blocker” feature, but I don’t want to have to go through every single application I don’t want to be invited to and block it…
  • Remove the 60 photo limit on albums. This is the 21st century facebook, people have digital cameras now. They can take more than 60 photos at a time. Again, there is no reason for the limit. You can create unlimited albums, but only have 60 photos in each one? It’s absurd.
  • Remove the limit on the number of groups you can join. Honestly, if they think people can only have a maximum of 200 beliefs/ideas/viewpoints/favourite (actor/tv show/film) in their lifetime then they have led some very sad lives. I’m already a member of 169 groups, and at the rate I join / create them I’ll probably be at 200 in a few weeks. I don’t want to go through them all and decide which ones I “don’t really agree with that much anymore”.

On a final note for facebook, thanks for removing the “is” from statuses. It gave me quite a few laughs over the next few days when I saw people who hadn’t realised it had gone. Stuff like “John going to the cinema” and “Jane tired” were great for a grammar Nazi like myself.

Linux

Not much I can say about Linux, seeing as it is already a fantastic operating system. I look forward to Ubuntu 8.04 in April, which has an awesome new default theme, and better compiz support. One thing I would like to see on it is the BBC iPlayer, which they have been forced to make available to Linux and Mac thanks to a nice lawsuit. I’m also be trying out Linux Mint in the new year, because apparently it is better than Ubuntu.

MyBB

Hopefully we will see the release of 1.4 in 2008, as well as a complete release of the MyBB Merge system. There are a lot of other plans for MyBB, both official and unofficial, but for obvious reasons they cannot be revealed just yet.

Atheism

After creating a group on facebook for “Atheists at Royal Holloway”, I’ve got a few more members for a possible Atheist Union / Society at Royal Holloway. Nothing is official yet, but we are definitely on our way. We’ve been invited to a debate by the Christian Union in February on the subject of belief, which should be fun.

I’m gonna end it there, I’m sure there will be far more to look forward to in 2008, but I must get things ready for the New Year party tonight!

So, farewell 2007, roll on 2008!

Popularity: 6% [?]

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • NewsVine
  • Slashdot
  • Netscape
  • Technorati
  • blogmarks
  • Spurl
  • YahooMyWeb
  • BlinkList
  • Reddit
  • TailRank
  • feedmelinks
  • Furl

Why Linux is better than Windows

Linux, MyBB, Ubuntu 4 Comments »

The MyBB IRC channel (#mybb) is prone to a lot of idle banter between it’s members when we are not helping people solve their MyBB problems.

Today was one such day. It all started with a simple argument between MiNT, georgia_tech_swagger, Snake, and myself against Matt. Matt is a Windows Vista user who is basically Microsoft in annoying boy form. He thinks Microsoft is invincible and the best thing since sliced bread. He has little experience with Linux, and the one time he did use it he complained non stop about not being able to use it properly.

So the argument was essentially a load of Linux users (with the exception of Snake, however he does know a lot about it) trying to put the point across that Linux was a better system, and that Microsoft were evil. At one point Matt tried to convince us that the Zune was invincible and that Linux couldn’t be installed on it, but a few quick searches found that to be false as well.

Eventually, he left, and Snake posed an interesting challenge:

(17:31:45) Snake: we should make a list of why linux is better then windows

…and so it began.

1) Linux is free.
2) Linux is faster (another IRC user, tmhai, was astounded earlier today at how his laptop booted in under 30 seconds with Ubuntu, compared to the 30 minutes it took Windows to boot on it).
3) Linux is Open Source (which means bugs and security holes are found and fixed quicker).
4) With Linux, you own your Operating System. With Microsoft Windows, you don’t actually “own” the Operating System, you simply have a license that says you can use it. Every installation of Windows is owned by Microsoft.
5) Linux has better support. This is debatable, but there are a lot of community forums out there, and usually errors in Linux are much more readable than Windows errors, which leads to quicker solutions.
6) Most Linux distros come with some form of package manager, a utility that installs safe and secure programs, and then updates them automatically.
7) Most Linux distros release daily updates of core files, as well as updates for programs.
8) Most Linux distros release their next version every 6 months without fail. So instead of waiting an uncertain amount of time for the next Windows release, you know exactly when the next version of your OS will be out.
9) Linux has a better command line interface. Using the command line can be a bit daunting if coming from a Windows environment, but you will soon learn how to use it, and about the advantages of this way of doing things.
10) Linux has a better interface. It doesn’t matter if you are using Gnome, KDE, or some other desktop environment, it is way better than what Windows has to offer.
11) Linux has programs that can access practically every file type ever invented.
12) With a bit of configuring, it can run programs made intended for Windows. Today I managed to get Max Payne 2 running in wine after I earlier managed to get Direct X running).
13) The only viruses / spyware you get are by installing them yourself.

The only things we came up with that Windows has over Linux is the Driver support, and the support for third party applications.

Hopefully though, these will improve for Linux as it takes a more active role in today’s computing.

Popularity: 17% [?]

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • NewsVine
  • Slashdot
  • Netscape
  • Technorati
  • blogmarks
  • Spurl
  • YahooMyWeb
  • BlinkList
  • Reddit
  • TailRank
  • feedmelinks
  • Furl

Microsoft Ubuntu

Internet, Linux, Ubuntu 1 Comment »

So one of my acquaintances, Matt has “launched” a new parody website of Microsoft and Ubuntu, called msubuntu.com. It’s pretty poorly designed at this stage, and contains a numerous amount of spelling errors (”Sponcers” for example), but apparently he’s going to get a nice template for it.

The idea is to get it like the hugely popular MSFirefox.com, slap a load of adverts on it, and then get paid by all the traffic visiting it. Of course he forgot completely about checking the illegality of the whole thing!

Microsoft’s annoyance at being paired with a Linux product aside, it seems that Ubuntu itself probably won’t take the site likely. From their policy:

Commentary and parody. The Ubuntu trademarks are designed to cover use of a mark to imply origin or endorsement by the project. When a user downloads something called Ubuntu, they should know it comes from the Ubuntu project. This helps Ubuntu build a reputation that will not be damaged by confusion around what is, and isn’t, Ubuntu. Using the trademarks in your discussion, commentary, criticism or parody, in ways that unequivocally do not imply endorsement, is permissible. Anyone is free to write articles, create websites, blog about, or talk about Ubuntu — as long as it’s clear to everyone — including people completely unfamiliar with Ubuntu — that they are simply referring to Ubuntu and in no way speaking for Canonical, or the Ubuntu project.

So, I’m assuming that mentioning a collaboration between Ubuntu and Microsoft isn’t going to do their reputation much good. The site doesn’t just “reference” Ubuntu either, it implies that there was an actual bond between the Ubuntu project and Microsoft. Good luck getting both companies to ignore that…

Popularity: 3% [?]

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • NewsVine
  • Slashdot
  • Netscape
  • Technorati
  • blogmarks
  • Spurl
  • YahooMyWeb
  • BlinkList
  • Reddit
  • TailRank
  • feedmelinks
  • Furl
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Login