Setting a Simple Channel Ban

Channel bans allow you to block someone from joining your channel. These bans offer a lot of flexibility, letting you ban someone in several different ways. This article will explain a simple ban. You can check the Extended Ban tutorial for additional options. You can also use the AKICK command to ban someone permanently.

To ban someone from your channel, you need to know the hostmask for the connection. Use the WHOIS command to get the details. For the user LordBaconCheeseburger, you’d use this command:

/whois LordBaconCheeseburger 

In your status window, you’ll see something like this in response:

LordBaconCheeseburger is ~TFlash@protectedhost-BACONYUM.hsd1.ze.comcast.net 
LordBaconCheeseburger is a registered nick
LordBaconCheeseburger on #jupiterbroadcasting #theshed
LordBaconCheeseburger using Komma.GeekShed.net Subwolf.org
LordBaconCheeseburger has been idle 3mins, signed on Fri Sep 28 21:00:28
LordBaconCheeseburger End of /WHOIS list.

You need the information from the first line to set your ban. The information listed after the @ symbol is the hostmask. To set a simple ban for your channel, use this command:

/mode #channel +b *!*@hostmask

If you wanted to ban LordBaconCheeseburger from the channel #topgear, for instance, you’d type:

/mode #topgear +b *!*@protectedhost-BACONYUM.hsd1.ze.comcast.net

That’s all there is to it. Anyone with that hostmask is now banned from #topgear. Next week’s post will explain more complicated channel bans, so be sure to come back!

—posted by Tengrrl/Bunny

 

GeekShed Embed v2 Released

NOTE: This is a plugin for users of the self hosted wordpress.org software; it is not for users of wordpress.com. (Although I would love it if at some point in time… well, that’s me dreaming…)

As I posted last month, I have been working on updated to the GeekShed Embed plugin for WordPress that I wrote. This update provides shortcodes to easily embed the TFlash client, the userlist, and the userbadge that GeekShed provides for its users.

In addition to the TFlash shortcode, the plugin now offers a settings page where you can input the options (similar to our chat generator) and select the page that you want TFlash to appear on; TFlash will appear on that page without requiring you to copy and paste any code at all. This settings page also allows you to set more than one channel; simply enter the channel names as you would in a regular client – e.g. #chan1,#chan2,chanN. There are additional usage notes on the settings page.

Although the plugin has not been tested in a WordPress MultiSite environment, the plugin uses the built-in settings API that WordPress offers, so it is very likely that it will work (please let me know if you use WPMS and if the plugin works or not).

The plugin does reside in the WordPress Plugin Repository, so it can be installed via the Plugin Installer in your WordPress admin section, and if you already have it installed, will notify you that there is an update available.

If you require any assistance in using the plugin, please leave a comment here or at the plugin page here. Also, comments and/or suggestions are always welcome.

Note2: It can take a little bit for the WordPress servers to process that the plugin has been upgraded. Please be patient.

Channel topic on your site – using Javascript

We have set up a JSONP service to allow you to use a simple bit of Javascript to get your GeekShed channel topic on your website. This has been possible for a while with PHP (http://www.geekshed.net/2009/10/topic-rss/), which provides a more flexible solution. This, however, cannot be used on hosting services that do not support PHP. The Javascript method works in all modern browsers and doesn’t require anything special on your hosting server.

All you need do is paste the following code into your page’s HTML where you require your topic to be shown, change phil to your own channel name (without the #) and style it all appropriately:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>

<script type="text/javascript">
jQuery(document).ready(function() {
   var channel = 'phil';

   jQuery.getJSON("http://rss.geekshed.net/jsonp.php?channel=" + channel + "&callback=?",
      function(data) {
         jQuery('#geekshed-topic').html(data['topic']);
      }
   );
});
</script>

<div id="geekshed-topic"></div>



If you’re stuck, ask in #help.

Twitter in your channel

GeekShed provides a twitter bot, aptly named “Twitter”, to provide you with a twitter feed in your channel. It’s very easy to use and doesn’t require that you give over your twitter login. Remember, GeekShed will never ask you for your Twitter login! To use it, follow these simple steps:

All of the commands below need to be done in a PM (private message) with the bot (Twitter).

Register with the bot

Send a PM to the IRC user “Twitter” with the !register command. The syntax of this is: !register <username> <password>. Username and password are the credentials you will use to log into the bot in future. An example of this is:

!register fred asecretpassword

Allow the bot to read your twitter feed

When you register, you will be presented with a URL that you must go to and log into your twitter account. Click the “Allow” button and you will be given a PIN code. Now return back to the bot and use the !pin command to tell the bot what your PIN number is. The syntax of this is: !pin <usernam> <password> <pin>. An example of this is:

!pin fred asecretpassword 5984934

If this is successful, the bot will tell you so.

Add your channel(s)

You can add up to 10 channels to the bot. You must be an op in a channel in order to add the bot to it. To make the bot announce your tweets in a channel, you need to use the !addchan command. This will make the bot join that channel if it’s not already in there. The syntax of this command is: !addchan <username> <password> <channel>. An example of this is:

!addchan fred asecretpassword #fred

You can do this command again to add your twitter feed to more channels.

Tweet and wait

Due to the limitations of Twitter’s API, the bot looks for new tweets every 60 seconds. Within 60 seconds of you tweeting, your tweet will show up in all of the channels you have added.

Other commands

You can delete your account and remove the bot from a channel using other commands in the bot. PM the bot “!help” to see these commands.

If you have any issues with this, please let us know in #help.

How to block specific phrases from your channel

GeekShed maintains a list of words which will be censored when chmode +G is set and also a spamfilter of URLs or phrases that are blocked network wide. You can block or censor certain phrases in your own channel regardless of whether or not you have chmode +G set. To do this, you can use the extended ban type ~T. The format of this is:
/mode #channel +b ~T::
Action can either be ‘block’ or ‘censor’. ‘block’ will stop any line containing ‘text’ from being sent to users of the channel and ‘censor’ will replace the banned phrase with ‘<censored>’. Text can also be a wildcard string (i.e. * matches anything). For example, sugar* would match ‘sugar’, ‘sugarpuffs’, ‘sugarstuff’, etc. Example usages of this command are:
/mode #channel +b ~T:block:sugar
The result of this is:
(20:26:15) sugar #foo Message blocked due to a text ban (#foo)
/mode #channel +b ~T:censor:sugar*
The result of this is:
(20:27:31) I love <censored>
Because of the way IRC works, as with chmode +G, the person saying the censored word will not see it as censored on their client however every other channel user will.

If you have any questions, come see us in #help.

Redirecting one channel to another

If you have changed the name of your channel or would like to merge a few channels into one, you can use ChanServ to create a redirect from your old channel to your new channel. To do this, use the following command:

/cs redirect #oldchannel #newchannel


There are various restrictions on this command. These are as follows:

  • You must be the real founder of #oldchannel
  • You must be a founder of #newchannel
  • You cannot create loops or chains by redirecting a channel to one which is already a redirect
  • Once the command is done, you cannot undo it! This must be done by a services admin


The following restrictions apply to active redirects:

  • A redirected channel will be dropped 60 days after you set the redirect
  • You can change the channel the redirect points to but this will not reset the 60 day expiry time
  • If the new channel is +L users will not be redirected. This is to stop chaining and looping
  • The redirect will walk any keys (+k) you have on the new channel. This means you can redirect a keyed channel to another keyed channel
  • The redirect will not walk any other channel mode restrictions (+l, +O, +A, +R, +b, +I, +z). If any of those modes are set, the user will have to conform with their requirements to be successfully redirected


This can be used with the ChanServ MIGRATE command to move all of your settings from one channel to another. Example use of this is:

/cs migrate #oldchannel #newchannel

Setting a ban appeal procedure for your channel

We have written and loaded a module into services to allow you to specify a ban appeal procedure for your channel. This module will allow users to see your ban appeal information when they do /cs info #yourchannel and also online at http://www.geekshed.net/chanban/. We have made this URL easy to remember so that you can point people to it if they enter your channel asking about a ban in another channel.

Note: Because of the nature of services, this web page may be up to 5 mins out of date. Every channel with a ban appeal procedure specified will show up on this web page. If you do not wish your channel to show up do NOT specify a ban appeal procedure.

To specify ban appeal information for your channel use the following command:

/cs SET channel BANINFO [info]

An example of this would be:

/cs set #phil baninfo Bans cannot be appealed

To remove this, do the command with no appeal procedure specified. For example:

/cs set #phil baninfo

If you have any questions, ask in #help.

How to add a list of users in your GeekShed IRC channel to your website

GeekShed now provides a live XML formatted output of users in your channel. This can be parsed and placed on your own website in the form of a list, table, etc.

The XML output can be found at http://www.geekshed.net/usertable.php?chan=. An example of the use of this for #phil is http://www.geekshed.net/usertable.php?chan=phil. To parse this into a table on your website, you can use the following PHP code. All you need do is place the code at the required location on the page and adjust the channel name at the top of the code. Following this, you can adjust the HTML to fit your site’s requirements.

<?php
// Edit This
$chan = 'phil';

// Don't edit this
$xml = simplexml_load_file('http://www.geekshed.net/usertable.php?chan='.$chan);
?>

<!-- Edit this HTML to suit your layout -->

<table>
   <tr>
      <td style="text-align: center;"><strong>Nickname</strong></td>
      <td style="text-align: center;"><strong>Status</strong></td>
      <td style="text-align: center;"><strong>Clones</strong></td>
      <td style="text-align: center;"><strong>Active (Not Away)</strong></td>
   </tr>

<?php
foreach ($xml->user as $user) {
   echo "\t<tr>\n";
   echo "\t\t<td style=\"text-align: center;\">{$user->nick}</td>\n";
   echo "\t\t<td style=\"text-align: center;\">{$user->status}</td>\n";
   echo "\t\t<td style=\"text-align: center;\">{$user->clones}</td>\n";
   echo "\t\t<td style=\"text-align: center;\">{$user->away}</td>\n";
   echo "\t</tr>\n";
}
?>
</table>


You can also access the away message left by a user who is away using $user->awaymsg inside the foreach loop.

The DTD for the XML can be found at http://www.geekshed.net/xml/userlist.dtd.

As at 08 April 2010 the returned XML now has double escaped entities (e.g. < goes to &lt; and ASCII char 2 goes to &#002;). SimpleXML in the above example will do a single unescape on these such that &lt; goes to < such that it can be used in web pages whilst keeping them valid. If you use it for anything else you will need to be sure to unescape sufficiently to give you the original characters.

If you have any questions about this, ask in #help.

Can I Make A Private/Secret/Restricted Channel?

At least twice a month, someone will come into #help asking about private channels or how they can secure their channel to prevent anyone except those they want in it. Since there are probably those that would like to know, but don’t ask, here is the quick and dirty guide to private/secret channels.

Every channel is able to be either private (+p), or secret (+s). The two modes are similar, but it is possible for people to find out about a channel that is marked private (+p). Therefore, if you want a channel nobody will be able to find out about unless they’re told, it is recommended that you mark it as secret, +s. Unless you are in the channel or an IRCop, the server will pretend that the channel doesn’t exist.

There is also channel mode +i, which will let people in only when they have been invited. If the channel is registered with chanserv, those on the access list can /msg chanserv invite #channel, and chanserv (or the botserv bot, if the channel has one) will invite the person into the channel. Standing invites can also be set using channel mode +I, which takes a nick!ident@host mask as a parameter. If the person is not on the access list, and does not have +I set for themselves, they are able to “knock” on the channel by doing /knock #channel optional_message.

You can also set a “key” on the channel using channel mode +k, which takes the key to use as a parameter. If I wanted to set a key on my channel, I would do /mode #serenity +k Kaylee. In order to get in the channel, someone would need to specify the key when they try to join – /join #serenity Kaylee. Alternatively, they can also be invited into the channel and will not need the key.

If the channel is registered, those modes can be mlock’ed, so that they will be reapplied when the channel is recreated (i.e. is empty and someone joins). It is important to note that if the channel is empty, needing a key or an invite is not necessary to join the channel. That is where the next item comes into play.

It is also possible to set a channel to have restricted access. When this option is set, only the people you add to the access list will be able to join. When someone that is not on the list attempts to join, they are kickbanned by chanserv (or the botserv bot, if you have added one) with the reason “You are not permitted to be on this channel”.

Since when you set your channel to restricted access you normally don’t want people to know about it, it is recommended to also mlock it +s. To set both the restricted access and mlock, you need to enter the following two commands, replacing #channel with your actual channel:
/msg chanserv set #channel mlock +s
/msg chanserv set #channel restricted on
Note: If you already have some modes set with mlock, you will need to respecify them when you add +s. So if you have +n (no external messages) set with mlock, you would need to do /msg chanserv set #channel mlock +sn.

Should you have any questions concerning setting your channel to restricted access, feel free to stop in #help and ask.

Grouping a Nick: Why and How?

So you’ve registered your nick, but have more than one computer/device that you join IRC from. You might be wondering “do I need to register a new nick and have people add that nick to access lists as well? Certainly there must be an easier way.”

Well luckily for you, there is. You are able to group nicks together so that permissions and other data are shared among accounts. Some of the items that are shared include (but are not limited to): channel ownership, permission levels (owner, halfop, etc.) on channels, group info that was provided when you registered, password, and virtual host. Pretty much anything your single nick has associated with it will be associated with the group of nicks that you have registered.

Here’s how to group a nick to one that you already have registered:
  1. Switch to the nick that you want to group
    • NOTE 1: Before you enter the next command, make sure that you are using the nick you want to add to your existing group. Do NOT be using your main nick. Example: if I wanted to group JayneCobb to my account, I would /nick JayneCobb.
    • NOTE 2: If you use a registered nick when the next step if performed, it will first be dropped, then grouped to the main nick. Example: if I try to group JayneCobb (which is registered) to my main nick MalcolmReynolds, Services will first drop JayneCobb, then have it join the MalcolmReynolds group. By being dropped, any permissions JayneCobb had will be gone.
  2. Enter the following command in the server/status window: /msg nickserv group main_nick password, where main_nick is your primary nick, and password is the password belonging to the primary nick.
    Example: I want to group JayneCobb to my primary nick, MalcolmReynolds, and the password for it is S3reni+yV@ll3y (you do use something secure for your passwords, right?). I would type the following as JayneCobb: /msg nickserv group MalcolmReynolds S3reni+yV@ll3y
  3. Look for nickserv to either tell you that you have joined the group of your primay nick or give you an error message, such as “you must wait at least 60 seconds before using the group command again”.
And just to give you the commands again, they are, in order:
/nick theNewNick
/msg nickserv group main_nick password


Now what if you want to delink a nick, i.e. remove it from the group, is there some way to do that? Yes there is, you just drop it by switching to the nick, and doing /msg nickserv drop. Doing that will make nickserv completely drop the nick – it will no longer exist, have any permissions, etc.

Is there someway to delink it without dropping, or without it losing the permissions and other information? Not currently, although I suppose it is possible that it could end up in a future version of anope, or someone could create a module that could drop a nick and register it using the credentials of the former group and preserving permissions, etc.

Should you have any questions about grouping nicks, feel free to leave a comment here, or to join #help and ask in there.