Harry's List Architect the future

IRC FTW!

What is IRC? A chat protocol.

Why would you want to use it?

  • it is free!
  • supports file transfer
  • has clients for every platform
  • is super efficient
  • many networks, public and private

IRC is amazing for learning and asking questions. Say, for instance, you are learning the Ruby programming language. The official ruby language IRC channel exists on irc.freenode.net

I’ve spent years fiddling around with IRC, have settled on a wonderful commandline client, and am happy to share my configuration with the world.

On a mac with homebrew installed, this guide should be easy to follow. If you’re using linux, the instructions should make sense and you can still use my config.

If this command-line stuff feels scary.. I feel bad for you, son. I got 99 problems, but IRC aint one. You might want to take a look at Colloquy, it’s self explanatory.

Let’s get started

If you don’t have homebrew installed, follow the official instructions

Open up your terminal and type in brew install irssi Congratulations! You now have the best irc client!!

You can totally use it, as is, but I recommend tweaking the settings a bit.

Load irssi for the first time by typing in irssi. This will create the default configuration files that we will be editing. /quit to exit.

Themes make things pretty!

  1. find a theme you like
  2. copy the .theme link
  3. in terminal run wget -P ~/.irssi copied_link to install theme (if wget doesn’t work, simply run brew install wget)
  4. load up irssi and run /set theme theme_name
  5. /save

Scripts make life easier!

Lets set up a highlight window, this will log every time someone mentions your name:

  1. in terminal run wget -P ~/.irssi/scripts/autorun/ http://static.quadpoint.org/irssi/hilightwin.pl
  2. load up irssi
  3. we’re going to set up a split window to view the hilights
  4. /window new split
  5. /window name hilight this name is important so the script knows where to send the info
  6. /window size 4
  7. /hilight -word yournick
  8. /help hilight for advanced features.
  9. /layout save to save this configuration

Advanced Windowlist! install the same way as hilight:

  1. wget -P ~/.irssi/scripts/autorun/ http://anti.teamidiot.de/static/nei/*/Code/Irssi/adv_windowlist.pl
  2. load up irssi
  3. to see all available settings for type /set awl

Usercount displays the number of users in the channel

  1. I think you know the drill by now
  2. http://scripts.irssi.org/scripts/usercount.pl

Configuration is unlimited

I’ll make it easy for the world by sharing my config file.

Exit out of irssi by typing it /quit

Lets open the config file open ~/.irssi/config

Copy what you like. Be careful with formatting…

  1. find YOURNAME and replace with your own nickname
  2. find THEMENAME and replace with your installed theme
  servers = (
    {
      address = "irc.freenode.net";
      chatnet = "freenode";
      port = "7000";
      use_ssl = "yes";
      ssl_verify = "no";
      autoconnect = "yes";
    }
  );

  chatnets = {
    freenode = { type = "IRC"; };
  };

  channels = (
    { name = "#ruby"; chatnet = "freenode"; autojoin = "yes"; },
    { name = "#ruby-lang"; chatnet = "freenode"; autojoin = "yes"; },
    { name = "#kickhash"; chatnet = "freenode"; autojoin = "yes"; }
  );

  aliases = {
    J = "join";
    WJOIN = "join -window";
    WQUERY = "query -window";
    LEAVE = "part";
    BYE = "quit";
    EXIT = "quit";
    SIGNOFF = "quit";
    DESCRIBE = "action";
    DATE = "time";
    HOST = "userhost";
    LAST = "lastlog";
    SAY = "msg *";
    WI = "whois";
    WII = "whois $0 $0";
    WW = "whowas";
    W = "who";
    N = "names";
    M = "msg";
    T = "topic";
    C = "clear";
    CL = "clear";
    K = "kick";
    KB = "kickban";
    KN = "knockout";
    BANS = "ban";
    B = "ban";
    MUB = "unban *";
    UB = "unban";
    IG = "ignore";
    UNIG = "unignore";
    SB = "scrollback";
    UMODE = "mode $N";
    WC = "window close";
    WN = "window new hide";
    SV = "say Irssi $J ($V) - http://irssi.org/";
    GOTO = "sb goto";
    CHAT = "dcc chat";
    RUN = "SCRIPT LOAD";
    CALC = "exec - if command -v bc >/dev/null 2>&1\\; then printf '%s=' '$*'\\; echo '$*' | bc -l\\; else echo bc was not found\\; fi";
    SBAR = "STATUSBAR";
    INVITELIST = "mode $C +I";
    Q = "QUERY";
    "MANUAL-WINDOWS" = "set use_status_window off;set autocreate_windows off;set autocreate_query_level none;set autoclose_windows off;set reuse_unused_windows on;save";
    EXEMPTLIST = "mode $C +e";
    ATAG = "WINDOW SERVER";
    UNSET = "set -clear";
    RESET = "set -default";
  };

  statusbar = {
    # formats:
    # when using {templates}, the template is shown only if it's argument isn't
    # empty unless no argument is given. for example {sb} is printed always,
    # but {sb $T} is printed only if $T isn't empty.

    items = {
      # start/end text in statusbars
      barstart = "{sbstart}";
      barend = "{sbend}";

      topicbarstart = "{topicsbstart}";
      topicbarend = "{topicsbend}";

      # treated "normally", you could change the time/user name to whatever
      time = "{sb $Z}";
      user = "{sb {sbnickmode $cumode}$N{sbmode $usermode}{sbaway $A}}";

      # treated specially .. window is printed with non-empty windows,
      # window_empty is printed with empty windows
      window = "{sb $winref:$tag/$itemname{sbmode $M}}";
      window_empty = "{sb $winref{sbservertag $tag}}";
      prompt = "{prompt $[.15]itemname}";
      prompt_empty = "{prompt $winname}";
      topic = " $topic";
      topic_empty = " where the cool kids hang out ";

      # all of these treated specially, they're only displayed when needed
      lag = "{sb Lag: $0-}";
      act = "{sb Act: $0-}";
      more = "-- more --";
    };

    # there's two type of statusbars. root statusbars are either at the top
    # of the screen or at the bottom of the screen. window statusbars are at
    # the top/bottom of each split window in screen.
    default = {
      # the "default statusbar" to be displayed at the bottom of the window.
      # contains all the normal items.
      window = {
        disabled = "no";

        # window, root
        type = "window";
        # top, bottom
        placement = "bottom";
        # number
        position = "1";
        # active, inactive, always
        visible = "active";

        # list of items in statusbar in the display order
        items = {
          barstart = { priority = "100"; };
          time = { };
          user = { };
          window = { };
          window_empty = { };
          lag = { priority = "-1"; };
          more = { priority = "-1"; alignment = "right"; };
          barend = { priority = "100"; alignment = "right"; };
          usercount = { };
        };
      };

      # statusbar to use in inactive split windows
      window_inact = {
        type = "window";
        placement = "bottom";
        position = "1";
        visible = "inactive";
        items = {
          barstart = { priority = "100"; };
          window = { };
          window_empty = { };
          more = { priority = "-1"; alignment = "right"; };
          barend = { priority = "100"; alignment = "right"; };
        };
        disabled = "yes";
      };

      # we treat input line as yet another statusbar :) It's possible to
      # add other items before or after the input line item.
      prompt = {
        type = "root";
        placement = "bottom";
        # we want to be at the bottom always
        position = "100";
        visible = "always";
        items = {
          prompt = { priority = "-1"; };
          prompt_empty = { priority = "-1"; };
          # treated specially, this is the real input line.
          input = { priority = "10"; };
        };
      };

      # topicbar
      topic = {
        type = "root";
        placement = "top";
        position = "1";
        visible = "always";
        items = {
          topicbarstart = { priority = "100"; };
          topic = { };
          topic_empty = { };
          topicbarend = { priority = "100"; alignment = "right"; };
        };
      };
      awl_0 = {
        items = {
          barstart = { priority = "100"; };
          awl_0 = { };
          barend = { priority = "100"; alignment = "right"; };
        };
      };
      awl_1 = {
        items = {
          barstart = { priority = "100"; };
          awl_1 = { };
          barend = { priority = "100"; alignment = "right"; };
        };
      };
      awl_2 = {
        items = {
          barstart = { priority = "100"; };
          awl_2 = { };
          barend = { priority = "100"; alignment = "right"; };
        };
      };
    };
  };
  settings = {
    core = {
      real_name = "YOURNAME";
      user_name = "YOURNAME";
      nick = "YOURNAME";
    };
    "fe-text" = { actlist_sort = "refnum"; };
    "fe-common/core" = { theme = "THEMENAME"; };
    "perl/core/scripts" = {
      awl_block = "0";
      awl_display_key = "$Q%K|$H$C$S";
      awl_display_key_active = "$Q%K|$H%U$C%n$S";
      awl_display_nokey = "[$N]$H$C$S";
      awl_height_adjust = "2";
    };
  };
  ignores = (
    {
      level = "JOINS PARTS QUITS NICKS";
      channels = (
        "#ruby",
        "#ruby-lang",
        "#kickhash"
      );
    }
  );

How to Navigate

  • /s server.address to connect to a server
  • /j #channel to join a channel
  • /msg nick to send a private message
  • escape [channel number] to switch channels
  • in the status window ctrl x changes the server you are interacting with
  • /quit exits irssi

double-u double-u double-u

To WWW or not to WWW?

That is the question.

It is a question that will inevitably come up at some point in a web developer’s life. If you’re reding this blog, you surely have noticed that sometimes a website fails to include a www-prefix. Is this a problem? The experts on the subject say no.

https://blog.codinghorror.com/the-great-dub-dub-dub-debate/

http://blog.stackoverflow.com/2008/06/dropping-the-www-prefix/

http://www.sitepoint.com/www-or-no-www/

http://wordpress.org/support/topic/difference-between-www-and-without-www

http://www.mattcutts.com/blog/bacon-polenta/

As a reader named Neil aptly put it: How many acronyms are three times longer than what they stand for?

Attn: Users of the internet

WWW has been depreciated. The www-prefix changes nothing of their experience, except perhaps a cleaner looking address bar.

Attn: Web Developers

Have to make the decision whether or not to use the prefix. This is key. If there is any incosistency, links may break and search engine rankings will suffer.

That is all. End of discussion. It is your decision as a web developer whether or not you want the www.



Update 2023-05-25 – Browsers now hide the WWW :D

CLI - Variations on ls

We use ls to list the directory. Here are some operators you use to extend the functionality of ls.

ls -1 # sort by name
ls -1r # sort by name in reverse order
ls -1r --group-directories-first # display folders before filez
ls -t # sort by modified date
ls -tr # oldest first
ls -S # sort by filesize
ls -Sr # smallest first
ls -X # sort by extension
ls -l # long listing (file attributes)
ls -l | sort -k 3 # pipes the listing through sort (by column 3 - owner name)
ls -l | sort -k 3, 3 -k 9 # sort by owner and filename
ls -lisa | awk '{print $5, $7, $11}' | sort # pipes the detailed listing through awk, which prunes the output, and then piped through sort

CSS Pseudo Classes and Elements

I’m not about to explain how to use these, or what they are. This is simply a handy dandy list of CSS pseudo classes and elements that you can use.

:hover
:focus
:target
:active
:visited

:enabled
:disabled
:checked
:indeterminate

:root
:first-child
:last-child
:only-child
:nth-child(n)
	:nth-child(even)
	:nth-child(odd)
	:nth-child(2n) /* Even */
	:nth-child(2n+1) /* Odd */
	:nth-child(3n) /* Every 3rd element */
	:nth-child(4n+1) /* Every 4th element starting with the 1st */
:nth-of-type(n) /* Like :nth-child, but used where elements at the same level are of different types */
:first-of-type
:last-of-type
:nth-last-of-type(n) /* like nth-of-type, but counts up from the bottom */
:nth-last-child(n) /* like nth-child, but counts up from the bottom */
:only-of-type /* selects only if the element is the only one of its kind within the parent */
:not(s) /* selects all except the parameter */
:empty /* selects elements which contain no text and no child elements */

:first-letter
:first-line
:lang

::selection
::-moz-selection

:before
:after

what the body does

(fitness != “working out at the gym”)

While working out is definitely a part of fitness, the inverse is not completely true. Fitness is being physically fit and also being healthy. The latter part of that statement is key to life.

Recently I have fallen in love with fitness of the body and mind. Let me clue you in some stuff I discovered and hopefully you will take away something insightful.


Prana

Many people work out in the morning to get their mind going. For some, it’s a replacement for coffee while others drink coffee with their exercise. Caffeine and exercise dilate blood vessels and allow the pirate ships of oxygen to flow through the brain, muscles, and organs.

When blood flows easier, our minds tend to work better, moods are elevated… life simply flows.

Calisthenics

That is what most yoga classes preach. Yoga has become popular because it is a good form of exercise. In the yogic tradition, the poses that are commonly taught are asanas. These positions enhance the function of muscles and allow the body to function properly. The most important benefit of asanas is something that is rarely talked about, but may be something you have noticed.

The yoga postures were designed to open up the pranic pathways in the body. Working out actually is a pre-requisite to meditation.

Thinking Clearly

When our body is happy with the way we treat it (how we use it, what we put into it) then our mind can work properly. Undistracted.

The more nonsense in our lives and in our bodies, the less sense our mind will make of it all.

Eating Right

Diet is simple. You know what is healthy and what is not. Eat well.

Sleeping Right

Food can weigh down not only your body, but also your mind. Do you know the ‘itis? That’s the feeling after eating a big meal where all you want to do is sleep. That is probably the best thing you can do in such a situation. Hopefully you’ve exerted your body before that big meal, because that ‘itis is your body’s way of telling you it wants you to rest so it can turn that meal into body mass.


This is the first in an on-going series about self-learning. I fear that I am boring my friends to death with my obsessions, so I need a place to write down my thoughts.

Please share your wisdom in comments.