Skip to content

Instantly share code, notes, and snippets.

@aderchox
Last active November 29, 2021 18:42
Show Gist options
  • Save aderchox/488e3877c0afa130b394a37b7f0c1be9 to your computer and use it in GitHub Desktop.
Save aderchox/488e3877c0afa130b394a37b7f0c1be9 to your computer and use it in GitHub Desktop.
IRC Quick Guide (with Irssi terminal client)
====== IRC Intro: ======
An IRC Cheat Sheet: https://gist.github.com/xero/2d6e4b061b4ecbeb9f99
Terminology:
In IRC, there are "Networks", and then each network is available on a "server" (usually on
multiple servers, but one of them is used more often, so we can simplify things by thinking of
networks and servers as one-to-one mappings), and then each network(server) has several "Channels".
"Users" connect to networks first, using "IRC clients"(e.g. Irssi, mIRC, etc.), and then join channels.
How to search for IRC networks and channels?
Use online search engines such as this: https://netsplit.de/channels/. Also sometimes
projects have a "community" section which introduces the project channels,
e.g.: https://docs.ansible.com/ansible/latest/community/communication.html
There are also usually bots exclusive to certain networks that can list the channels in that
network, e.g., on Libera.Chat network: /msg alis LIST *search term*, or on Freenode network: /msg ChanServ LIST *search term*
====== How to Setup IRC: ======
There are multiple ways of connecting to an IRC network.
- Simple non-auto-login method:
1. To connect to a network, e.g. LiberaChat, use "/connect irc.libera.chat" Also port number
can be specified, i.e.: "/connect irc.libera.chat <port>".
2. Then specify your username in the network: "/nick <username>".
3. The used nick is ephemeral, in order to "own" it in the network for a long time (so that
no one else can use it while you own it), you must "register" it. Nicks can be registered by
messaging the bot NickServ. It's done just the way everyone else can be messaged on an IRC network:
/msg <username> <msg>
In case of registering a username with NickServ:
/msg NickServ REGISTER <password> <email>
This will register the nick you chose on step #2, in that network. Usually a confirmation link is
sent to the specified email address containing another command for confirmation. e.g.:
/msg NickServ VERIFY REGISTER aderchox <confirmation-code-sent-to-you>
4. Next time, to "connect and login", one can either connect just the way we did in step #1, and then log in using:
/msg NickServ IDENTIFY <nick> <password>
Or use this command to both "connect and login" in one step:
/connect <network> <port> <nick>:<password>
- SASL method (auto-login):
With SASL, the identification (login) of the username (nick) to the username-server (NickServ) will be automatically
done whenever connecting to a network. However, how to set it up is client-dependent (but usually following similar steps).
For example, to setup SASL for LiberaChat on Irssi (a terminal client of IRC):
1. /network add -auto -sasl_username <nick> -sasl_password <password> -sasl_mechanism PLAIN LiberaChat
2. /server add -net LiberaChat -tls -tls_verify irc.libera.chat 6697
3. /save
(NOTICE 1: The option "-auto" in step #2 could be passed in order to make a server autoconnect
whenever the IRC client is opened. It might not sound like a good idea at first, you might think,
I may need to connect to another server each time! But you should know that you're not forced to
be connected to only a single network at the same time. So it can be a good idea to mark all the
networks you may use more often as autoconnect. If you're using Irssi as the client, you can then
use the hotkey "Ctrl+x" to switch networks).
(NOTICE 2: Autoconnecting to channels is possible too and has been explained in Irssi tips section)
====== Irssi Tips: ======
The configuration file is `/home/<username>/.irssi/config`.
For example, if you used the option "-auto" above, you must see "autoconnect" somewhere like this:
```
{
address = "irc.libera.chat";
chatnet = "liberachat";
port = "6697";
use_tls = "yes";
tls_verify = "yes";
autoconnect = "yes";
},
```
To make channels autoconnect on a certain network, use this command:
1. /channel add -auto <channel-name> <network-name>
2. /layout save # <--- This step is optional, e.g., if you have re-ordered channel windows using the /move command
3. /save
E.g.:
/channel add -auto #irssi liberachat
To list autoconnect channels use this command:
/channel list
To list added networks:
/network list
To switch between the connected networks:
Ctrl + x
To list all channels in a network:
/list -y
To search a certain term in the names of channels in a network:
In addition to the online search engines, there's also some kind of bot user in some networks
that can be "/msg"ed to do such a search. For example, on Libera.Chat, "alis" could be used for that like this:
/msg alis list searchterm
e.g. 1: /msg alis list znc
e.g. 2: /msg alis list ansible
To learn more about it:
/msg alis help list
To join a channel:
join <ChannelName>
scroll up / down:
pgup / pgdn ("fn + uparrow / downarrow" on keyboards without pgup/pgdn)
OR
/scrollback goto -1000
/scrollback goto +1000
change window:
alt + <number>
OR
alt + leftArrow / rightArrow
move(re-order a window), e.g., to move the current window to the second position
/win move 2
close a window:
/window close
NOTICE: The status window (alt + 1) cannot be closed by default.
If you really want to close it use disable its immortality.
How to clear a window?
/clear
How to turn off (disable) IRC join and quit messages?
1. /ignore -channels <channel-name> * JOINS PARTS QUITS NICKS MODES TOPIC
2. /save
How do I install scripts?
Irssi scripts are like vim extensions.
First install the package (on Debian) "libwww-perl" (on RHEL) "perl-libwww-perl".
Then in Irssi, run:
/run scriptassist` # <--- only applied per session
Then run:
/script install scriptname
How to find Irssi script names?
Here: https://scripts.irssi.org
How do I load already installed scripts once again when I close and re-open Irsii?
Just do `/script load scriptname`
How do I unload a loaded script?
Just do `/script unload scriptname`
How do I run a script at startup automatically (autoload)?
Just do `/script autorun scriptname`
How to get help about Irssi?
/join #irssi
How to make Irssi beep on new messages?
/run scriptassist
/script install ding
/script autorun ding
/script load ding
How to see all window numbers and names at the bottom of the Irssi?
/run scriptassist
/script install adv_windowlist
/script autorun adv_windowlist
/script load adv_windowlist
How to see the N previous messages before the time we've logged in?
It's not possible by default, IRC works by communicating the messages in real-time. However,
it can be achieved using "bouncers". ZNC is a good one because it doesn't store messages
online and works locally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment