Let me speak from experience….
make sure you have nick = 'NAME' host = 'irc.offbyone.lan' channels = ['#botchan', '#test' ] owner = 'YOU'
For those unfamiliar, here is a page on wiki editing syntax that can be used here.
This is a space for members of the UNIX/Linux Fundamentals class to create a source of information reflective and assisting to the course.
Aside from assignments that may have you specifically perform operations here, you should contribute when you encounter any of the following:
IRC (Internet Relay Chat) this is a form of real-time Internet text messaging or chat. The most abundant use of this is for communication among groups and group members in discussion forums (channels). Another feature that IRC has is one on one communication for private messages only viewable between the speakers. There is also Direct Client to Client speaking available for use. The final advantage of using IRC is availability it is virtually supported by every computer operating system that supports TCP/IP networking.
IRC is an open protocol that uses TCP. An IRC server is able to connect to other IRC servers to expand the IRC network. Users access IRC networks by connecting a client to a server. There are many clients such as mIRC and EFnet Some IRC servers do not require people to register an account but will ask you to set a nickname before connecting. Although our class IRC (lab46) requires a lab46 username. The standard structure of a network of IRC servers is a tree. Messages are sent along only necessary branches of the tree but network state is sent to every server.
References Internet Relay Chat Wikipedia
Some popular Internet Relay Chat clients for Unix and Linux include Irssi, XChat, Konversation, Pidgin, Kopete and the venerable ircII. In addition to stand-alone IRC clients, there are also browser-based IRC clients. The Opera browser has an IRC client built into it, and the ChatZilla IRC client is available as an add-on for Mozilla Firefox. It is also possible to use web-based clients like Mibbit and WebIRC.
Here are a few of the IRC clients for Unix and Linux:
To see a more comprehensive listing and comparison of IRC clients and their features, see Wikipedia's Comparison of Internet Relay Chat clients.
Since this page is not broken down properly to the appropriate discussion areas, I will use this space to give an overview of IRC Bots in general.
If you are interested in creating your own bot from a skeleton this link is helpful.
This link will give you an overview of the available bots out there to mess with if you don't want to start from scratch.
One last link to get information on what a bot is, along with additional information on how to create bots can be found at this site.
More information can be found by searching various sites, and by checking IRC servers for other people interested in programming IRC bots.
Automated clients are what as known as bots. Bots serve as protection agents and points of contacts for information for all the channels they are connected to. Because of bots superior speeds compared to humans they make the perfect candidate to do this. Bots can be written in a wide variety of languages and also a wide variety of implementations exist. Modern day IRC bots are able to communicate back forth between the user which prompted for their help and they are controlled by the users as well. Then comes to the part where bots can me used for malevolent uses. The bots can take over a channel or flood them, which would oust their owners. If a user can prevent it, try not to let two bots on the system start communicating back and forth between one another. Due to the fact that a bot can respond a lot quicker than a human, so the two bots will talk back and forth at an alarming rate; which is never good.
Phenny is the IRC robot used by the UNIC/Linux class to carry out case study #7, Scheduled Tasks.
Phenny can be downloaded from http://inamidst.com/phenny/ .
Once Phenny has been downloaded, it can then be e-mailed to a student's lab46 e-mail account. Next, the student can save the attachment to their home directory, for example: /home/username .
Either that or the student can right click on the link they find on the internet and then paste it in their shell prompt after typing “wget”.
Next, the student can unarchive the phenny.tar.bz2 file using the command line:
lab46:~$ tar -xvjf phenny.tar.bz2.
Next, the student, can cat README.txt file (/home/username/phenny), and follow the listed directions the student should also run the phenny script by navigating to the phenny sub-directory “/home/username/phenny” (make sure you are not in the .phenny subdirectory) and runny phenny as follows: lab46:~/phenny$ ./phenny
Once the phenny script has been run, the student should navigate to the .phenny directory (/home/username/.phenny) and change the default.py file.
For example, I changed my default.py file as follows (note that the '#' character is a remark):
#nick = 'phenny'
nick = 'RineBot'
#host = 'irc.example.net'
host = 'irc.offbyone.lan'
#channels = ['#example', '#test']
channels = ['#botchan','#botchan'] (note, the second botchan is not neccesary)
#owner = 'yournickname'
owner = 'jr018429'
Simply change the nick and owner fields to reflect your bot's nickname and your username respectively. Next, change the host and channel fields per the instructions given by the instructor on the case study #7 web page http://lab46.corning-cc.edu/haas/fall2010/unix/cs/cs7 .
Bot Nicknames cannot be longer than 8 characters. Attempting to use longer nicknames will prevent the Bot from running properly.
Be certain to replace all double quotes (“”) located in the default script with single quotes ().
After editing the default.py file, navigate back to the phenny (and not.phenny-/home/username/phenny) and run the phenny script again. The student should then a screen full of script that ends with the word “connected”.
Once the connection is established, the student can open another SSH session and get into the irssi environment. At the UNIX/Linux command line, the student should enter the following:
.beats
irssi
The irssi screen should now be displayed. At the [(status)] prompt, enter /server irc .
Next, enter /join botchan .
Begin entering commands…
To test your bot, at the irssi prompt, enter the following: .dict geek .
The student should see something like this:
<nick> .dict geek
<Bot> geek - 1. awkward person, 2. obsessive computer user
To test your bot further, refer to the list of commands below.
Once you verify that your Bot is functioning you can keep it running on the IRC server by opening and executing it in a shell which you can disconnect from. If you would rather keep your number of active shells down you can also use a no hangup command while forcing the Bot to run in the background.
This is accomplished by using the command
nohup phenny 2> ~/.phenny/log.txt &
Try “phenny: help?”, “phenny: help g”, and “/msg phenny .commands” for help.
==== Commands ====
Here are some commands for the Phenny Bot from [http://inamidst.com/phenny/|inamidst.com]:
^ Command ^ Description ^
| | Returns the current internet time |
|
.bytes <str> | Return the byte representation of <str>. |
|
.char <seq> | Get info about a sequence. |
|
.u <regexp> | Search for a particular Unicode codepoint. |
|
.ety <word> | Return a word's etymology. |
|
.g <query> | Google for <query> and return the top result. |
|
.calc <query> | Return the Frink calc for <query>. |
|
.gc <query> | Return the Googlecount for <query>. |
|
.head <URI> | Perform an HTTP HEAD on URI. |
|
phenny: “<phrase>”? | Translate <phrase> |
|
tell <nick> <blargh> | I'll remind nick about blargh. |
|
.seen <nick> | Reports when <nick> was last seen. |
|
.t [ <timezone> ] | Returns the current time |
|
.tock | Return the time from the USNO Master Clock. |
|
.val <URI> | Validate <URI> using validator.w3.org. |
|
.dict <word> | Returns the definition of <word>. |
|
.weather <ICAO> | Show the weather at airport with the code <ICAO>. |
|
.wik <term>'' | Except information about <term> from Wikipedia. |
Careful with the commands
If you use the same one too much, too fast, then you'll get kicked from the channel. Which I thought was kind of funny.
You can make your own modules
Create a text file and give it the extension of .py and save it to the modules section of phenny
A few examples given at https://github.com/myano/jenni/wiki/How-to-create-a-phenny-module
def helloworld(phenny, input):
phenny.say("Hello world!") helloworld.commands = ['hello'] helloworld.priority = 'medium'
Create a rule
def interjection(phenny, input):
phenny.say(input.nick + '!') interjection.rule = r'$nickname!' interjection.priority = 'high' interjection.thread = False
Or, Event
def message_join(phenny, input):
... message_join.event = 'JOIN' message_join.rule = r'.*'
/mode | User/Channel | Description | Set By | |
A | User | Server Administrator. Marks the user as a server administrator. | Administrator Only | |
A | Channel | Administrators Only. | Unknown | |
a | User | Server Administrator. Marks the user as a server administrator. | IRCd | |
a | Channel | Hybrid | Hide Operators. Unknown. | |
a | User | Ultimate | Services Operator. Marks the user as a services operator. | IRCd, Services |
a | User | Unreal | Services Administrator. Marks the user as a services administrator. | IRCd, Services |
a | Channel | Unreal | Channel Administrator. Prevents users except administrators and owners from kicking him or her. | Owner |
B | User | Ultimate | Server Bot. Marks the user as a server bot in /whois. | Unknown |
B | User | Unreal | Bot. Marks the user as a bot in /whois. | Anyone |
b | User | Hybrid | Bots. Unknown. | Unknown |
b | User | Ultimate | Bot. Marks the user as a bot in /whois. | Anyone |
b | Channel | All | Ban. Prevents users matching the hostmask from joining the channel. | ChanOps |
C | User | Ultimate | Chat Operator. Allows the IRC operator to send and receive /chatops commands. | IRCops |
C | User | Unreal | Co-Administrator. Unknown. | IRCd |
C | Channel | Unreal | CTCP Block. Block CTCPs from being sent to the channel. | ChanOps |
c | User | Hybrid, Ultimate, Unreal | Connection Notices. Allows the IRC operator to receive a notice for each client that connects or disconnects from the local server. | IRCops |
c | Channel | Unreal | Colour Block. Rejects any lines that contain colour codes. | ChanOps |
d | User | Hybrid | Debug. Shows debugging messages. | Unknown |
d | User | IRCu, Ultimate, Unreal | Deaf. Prevents the server from sending the user any channel text. | Anyone |
e | User | Ultimate | Edit Configuration. Allows the IRC operator to edit the configuration file from IRC. | Unknown |
e | Channel | Hybrid, IRCnet, Ultimate, Unreal | Exemption. Allows users that match the hostmask to join the channel even if he or she is banned. | ChanOps |
F | User | Ultimate | Global Connection Notices. Allows the IRC operator to receive a notice for each client that connects or disconnects from the network. | IRCops |
f | User | Hybrid | Full. Show full I:line notices. | Unknown |
f | User | Ultimate, Unreal | Flood Notices. Allows the IRC operator to receive a notice every time someone quits the local server due to excess flood. | IRCops |
f | User | Ultimate, Unreal | Flood Notices. Allows the IRC operator to receive a notice every time someone quits the local server due to excess flood. | IRCops |
f | Channel | Ultimate, Unreal | Flood. Specifies that the server should kick users that say more than so many lines in so many seconds from the channel. Using the optional asterisk means that the user should be banned in addition to kicked. | ChanOps |
G | User | Ultimate | Network Globals. Allows the irc operator to see and use /globops. | IRCops |
G | User | Unreal | G-Filter. Censors swear words that are sent to the user in the channel or elsewhere. | Anyone |
G | Channel | Unreal | G-Rated. Censors swear words that are said in the channel. | ChanOps |
g | User | Hybrid | Caller ID. Unknown. | Unknown |
g | User | Ultimate | Global Notices. Allows the user to see global notices. IRC operators see more global notices than regular users. | Anyone |
g | User | Unreal | Network Globals. Allows the irc operator to see and use /globops and /chatops. | IRCops |
H | User | Unreal | Hide IRC Operator Status. Hides the IRC operator line in /whois. | IRCops |
h | User | Ultimate, Unreal | Help Operator. Marks the user as available to help users. Depending on the IRCd, also allows the operator to see /helpop notices. | IRCops |
h | Channel | Hybrid, Ultimate, Unreal | Half Operator. Marks the user as a half channel operator. | ChanOps |
I | User | Ultimate | IRC Administrator. Unknown. | Unknown |
I | Channel | Ultimate | Invitation Block. Prevents users from inviting anyone into the channel. | ChanOps |
I | Channel | Hybrid, IRCnet | Invitation. Allows any user that matches the hostmask to join the channel without an invitation. | ChanOps |
i | User | All | Invisible. Prevents the user from showing up in /names and /who output. | Anyone |
i | Channel | All | Invitation Only. Prevents anyone from joining the channel without an invitation. | ChanOps |
K | Channel | Ultimate, Unreal | Knock Block. Prevents users from using /knock on the channel. | ChanOps |
k | User | Hybrid, Ultimate, Unreal | Kill Notices. Allows the user to see when a user is killed from the local server. | Anyone |
k | Channel | All | Keyed. Prevents everyone who does not know the key (password) from joining the channel. | ChanOps |
L | Channel | Ultimate, Unreal | Overflow. Specifies which channel users should be sent to when the channel reaches its limit (+l). | ChanOps |
l | User | Hybrid | Locops. Unknown. | Unknown |
l | Channel | All | Limit. Restricts the size of the channel. After so many users are in the channel, no more can join until one leaves. | ChanOps |
M | User | Ultimate | See Hiddent Channels. Allows the IRC operator to see all modes, and +p and +s channels, in /list. | IRCops |
M | Channel | Unreal | Moderate Unregistered Users. Doesn't allow unregistered users (-r) to talk in the channel. | ChanOps |
m | User | Ultimate | Whois Notification. Allows the IRC operator to see when users /whois him or her. | IRCop |
m | Channel | All | Moderated. Marks the channel as moderated. Members of the channel who do not have channel privilege (+v, +h, +o, etc) can not speak in the channel. | ChanOps |
N | User | Ultimate, Unreal | Network Administrator. Prevents the user from being killed by anyone except services and protected (+p) users. | Services |
N | Channel | Unreal | Nickname Block. Prevents users in the channel from changing nicknames. | ChanOps |
n | User | Hybrid | Nickname Notice. Shows the user a notice every time a user changes nicknames. | IRCops |
n | Channel | All | No External Messages. Prevents users who have not joined the channel from talking in it without joining, first. | ChanOps |
O | User | Ultimate, Unreal | Local IRC Operator. Marks the user as a local IRC operator. | IRCd |
O | Channel | Ultimate, Unreal | Operators Only. Only allows IRC operators to join the channel. | IRCops |
o | User | All | Global IRC Operator. Marks the user as a global IRCop | IRCd |
o | Channel | All | Operator. Marks the user as a channel operator. | ChanOps |
P | User | Ultimate | Services Administrator. Marks the user as a services administrator. | IRCd, Services |
p | User | Ultimate | Protected. Blocks users from kicking, deoping, dehalfoping, devoicing, and killing the user. | Services |
p | User | Unreal | Hidden Channels. Hides the channels from the user's /whois. | Unknown |
p | Channel | All | Private. Hides the channel from /whois. | ChanOps |
Q | Channel | Unreal | Kick Block. Only allows services to kick users from the channel. | Unknown |
q | User | Unreal | Kick Block. Only allows services to kick you from a channel. | IRCops |
q | Channel | Unreal | Owner. Marks the user as channel owner. | Services |
R | User | Ultimate | Restricted. Blocks user from becoming a channel operator or changing nicknames. | IRCd |
R | User | Unreal | Registered Messages Only. Blocks messages and notices from unregistered (-r) users. | Anyone |
R | Channel | Bahamut, Ultimate, Unreal | Registered Users Only. Prevents users who have not identified with services from joining the channel. | ChanOps |
r | User | Hybrid | Rejected Notice. Shows rejected client notices. | Unknown |
r | User | Bahamut, IRCu, Ultimate, Unreal | Registered. Marks the user as having identified with services. | Services |
r | User | Unknown | Restricted. Blocks user from becoming a channel operator or changing nicknames. | IRCd |
r | Channel | Bahamut, Ultimate, Unreal | Registered. Marks the channel as registered with services. | Services |
r | Channel | IRCu | Registered Users Only. Prevents users who have not identified with services from joining the channel. | ChanOps |
S | User | Ultimate, Unreal | Services Client. Prevents the user from being kicked, deoped, dehalfoped, devoiced, ans killed. Also hides the channel list from /whois. | Services |
S | Channel | Ultimate, Unreal | Strip Colours. Strips colours from text in the channel. | ChanOps |
s | User | Hybrid, Ultimate, Unreal | Server Notices. Allows the user to see local server notices. | Anyone |
s | Channel | All | Secret. Hides the channel from /whois and /list. | ChanOps |
T | User | Ultimate | Technical Administrator. Unknown. | Unknown |
T | User | Unreal | CTCP Block. Blocks CTCPs from getting to the user. | Anyone |
T | Channel | Unreal | Notice Block. Doesn't allow users to send notices to the channel. | ChanOps |
t | User | Unreal | V-Host. Signifies that the user is using a /vhost. | IRCd |
t | Channel | All | Only Operators Set Topic. Prevents users who are not channel operators from changing the channel topic. | ChanOps |
u | User | Hybrid | Unauthorized Notices. Shows unauthorized client notices. | Unknown |
u | Channel | Unreal | Auditorium. Makes /names and /who only show channel operators to regular users, and show everyone to channel operators. | ChanOps |
V | User | Unreal | WebTV. Marks the user as a WebTV user. | Unknown |
V | Channel | Unreal | Invitation Block. Prevents users from inviting anyone into the channel. | ChanOps |
v | User | Unreal | Infected DCC Notices. Unknown. | Unknown |
v | Channel | All | Voice. Allows the user to speak in a moderated channel. | ChanOps |
W | User | Ultimate | Watcher Notices. Unknown. | Unknown |
W | User | Unreal | Whois Notification. Allows the IRC operator to see when users /whois him or her. | IRCop |
w | User | All | Wallops. Lets the user view wallops when they are sent by IRC operators. This is restricted to server wallops in Hybrid | Anyone |
X | User | Ultimate | Network Monitor. Unknown. | Services |
x | User | Hybrid | External Notices. Shows remote splits and server connection notices. | Unknown |
x | User | IRCu, Ultimate, Unreal | Masked Hostname. Hides the user's hostname or IP address from other users. | Anyone |
x | Channel | Ultimate | Colour Block. Rejects any lines that contain colour codes. | ChanOps |
y | User | Hybrid | Spy Notices. Shows when users use /stats, /links, and /trace. | Unknown |
Z | User | Ultimate | Network Co-Administrator. Unknown. | IRCd |
z | User | Hybrid | Operator Wallops. Shows wallops that were sent by IRC operators. | Unknown |
z | User | Ultimate | IRC Co-Administrator. Unknown. | IRCd |
z | User | Unreal | Secure User. Marks the user as connected via SSL. | IRCd |
z | Channel | Unreal | Secure Users Only. Only allows secure (SSL) users join. | ChanOps |
donts:
Dos:
The Lab46 IRC server has basic file sharing support. Users are able to transfer files to other users. This can be accomplished by using the “dcc” command in irssi. One user must send a request to send a file and the other user must accept the file before a file transfer will begin. When a user sends a request to another user the recipient will be notified with a message in the chat window. Below are the commands used to send and recieve files.
To send a file in irssi use the following command,
/dcc send "recipient" "file to be sent" Example, /dcc send wedge /home/user/folder/data.txt
To receive a file in irssi use the following command,
/dcc get
linux/unix irc chat
Internet relay chat(irc) is a method of communicating with otehr people in real time around the world in real time fashion there are dozens of irc networks, many of which have channles devoted to linux
keep in mind that many channelsn are not support-oriented and are instead focused on highly technical discussions. beginning linux users may be better suited to one of the #linux help channles (undernet and DALnet)
EFNet
Undernet * #linux * #linux-help * #linuxhelp * #opers-fr * #redhat-linux * #redhat * #nzlinux * #linuxqc * #linuxQauke * #linuxspain * #linuxFr DALnet * #linux * #linuxhelp * #linuxtech * #linuxOS * #haqrdline IRCnet * #linux * #linuxOS * #linuxger * #linux.se AlternativeNet * #Linux * #slackware AlterNet BeyondIRC.net * #linuxhelp Brasnet ChatNet -#linux -#redhat cybernet -#linux FEFnet enter the game irc network -#linux galaxynet GR-net greece server -#linux icenet irc.chile -#linuxhelp irclink -#linux irvingnet -#linux kidlinkirc irc.freenode.net -#lfd -#mandrake -#wineHQ -#bash -#Xchat -#KDE -#Gnome -#Gaim -#tuxhacker irc.linuxchat.net -#linuxchat LinuxNet Mystical.net -#linux -#linuxhelp -#linuxcore NewNet OZ.org -#linux -#redhat PTNet -#linux -#linuxhelp Qnet Redesul irc network -#linux Relicnet -#linux sorcerynet -#linux starlink starlink-irc -#linux Superchat talkcity -#computer-linux warpednet oz.org network -#linux These are taken from linux.org/docs/irc.html DONT USE IRC AS YOUR ROOT OR ADMIN CAN AND WILL EVENTUALY CUASE PROBLEMS FOR YOU INCLUSDING POSSIBLE ID THIEFT TO AVOID ID THEIFT OR HACKING USE: * (please add more sections)
Internet Relay Chat (IRC) is a form of real-time Internet text messaging (chat) or synchronous conferencing. It is mainly for group communication in discussion forums, called channels, but also allows one-to-one communication via private message as well as chat transfers via Direct Client-to-Client.
IRC was created by Jarkko Oikarinen in August 1988 to replace a program called MUT (MultiUser Talk) on a BBS called OuluBox in Finland. Oikarinen found inspiration in a chat system known as Bitnet Relay, which operated on the BITNET.
IRC client software is available for nearly every computer operating system that supports TCP/IP networking.
Citation: Internet Relay Chat. (n.d.). In Wikipedia. Retrieved October 21, 2010, from Wikipedia.
This section provided by: Mr. Bradley D. Owlett
The phenny Internet Relay Chat bot (phenny irc bot), is an extensible irc bot written in Python and constructed by Sean B. Palmer.
* * * * * command to be executed - - - - - | | | | | | | | | +----- day of week (0 - 6) (Sunday=0) | | | +------- month (1 - 12) | | +--------- day of month (1 - 31) | +----------- hour (0 - 23) +------------- min (0 - 59)
crontab -e
Allows you to edit your cron entry
crontab -l
will print a list of defines crontab
Quick References
Keyword Action ------- ------ ! recalls previous commands for re editing ADMIN displays information about a server AWAY leaves a message saying you're not paying attention CLEAR puts some white space on your screen CTCP performs certain client specific actions
DATE shows server current date and time DCC handles direct connections to remote clients DESCRIBE sends anything about you to a person or channel HELP prints help on the given command HISTORY displays the command history
IGNORE removes output from specific people off your screen INFO shows useless information about IRC INVITE sends an invitation to another user JOIN sets your current channel KICK gets rid of someone on a channel
LASTLOG lists the most recent messages LEAVE leaves a channel LINKS shows servers on the IRC network LIST lists channels, number of users, topic LUSERS gives a brief listing of users, servers and operators
ME sends anything about you to a channel or QUERY MODE changes channel mode MOTD displays the server message-of-the-day MSG sends a private message NAMES shows the nicknames of users on each channel
NICK changes your nickname NOTICE sends a private message NOTIFY warns you of people logging in or out IRC QUERY starts a private conversation QUIT exits your IRC session
SERVER switches your primary server STATS shows some irc server usage statistics TIME shows server current date and time TOPIC changes the topic of the channel
TRACE shows the server connections of the given machine USERS prints users logged on the server machine VERSION shows client and server version number WHO gives a listing of users WHOIS displays information about someone
WHOWAS displays information about someone who just left