====== IRC howtos, freenode.net #labka channel, IRSSI magic & scripts, SECRETARY <3 ====== |**Project status:**| **ACTIVE** |**Language:** {{ project:irc:eng_flag_1_.png?30px }} || |**Project owner:**| [[user:overdrive|Overdrive]] | |**Interested:** | peterbay, [[user:dave@page]], [[user:embargo]] | |**Related:**| [[irc_logs:best_of_secretary|Best IRC Logs]] -- [[https://github.com/Labka-cz/Irssi_scripts|GitHub - Labka Repo : Secretary scripts]] -- [[https://github.com/Over23/Linux_Configs/blob/master/config|GitHub : Over's IRSSI config - comment-less]] | | **linkz:** | https://github.com/irssi/irssi/blob/master/docs/special_vars.txt; https://irssi.org/documentation/tips/; https://quadpoint.org/articles/irssi/; http://www.antonfagerberg.com/blog/my-perfect-irssi-setup/ | | **License:** | [[https://creativecommons.org/licenses/by-sa/3.0/|Uveďte původ-Zachovejte licenci CC BY-SA]] | ===== Total basics of IRSSI and screen ===== {{ project:irc:secretary.jpg?400}} * ssh yourself to Darkstar [exLabka Shell] : 193.84.207.21 ssh USERNAME@193.84.207.21 screen -U irssi /connect chat.freenode.net /nick your_nick /save /j #labka [ /wc ] - closing chat window [j #labka_secret] - connect to other chat room [/help any_command - will give you help for commands, it is accepting tab as Linux command line] ctrl+p or n - switching between chat windows [rooms] - ala alt+tab ctrl + number [or qwerty when over 10] - switching to direct number of window [/window list will show you which window is which #] screen -list - will give you list of all screens opened and running screen -rdU - will switch you to reattached screen window inside screen: screen is accepting ctrl + a [something] ctrl + a + d - detach screen [reattach by screen -rdU from command line] ctrl + a + c - create new screen window ctrl + a + a - rotate between screen windows [again like alt+tab] Nice howtos: * http://www.antonfagerberg.com/blog/my-perfect-irssi-setup/ * https://quadpoint.org/articles/irssi/ * moar about screen: http://aperiodic.net/screen/quick_reference * nice .screenrc hardstatus alwayslastline hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]' vbell off startup_message off defscrollback 2048 ==== Use hilight to show regexp word [typical your nick] ==== insight irssi /window new split /window name hilight /window size 6 /layout save ==== Channel with password ==== If you're an op on that channel, you can use the following /MODE #channel +k MyPrivateKey In order to join the above protected channel, use /JOIN #channel MyPrivateKey Remember to change the word "channel" with your channel name and "MyPrivateKey" to your desired password. ==== AutoJoin channels ==== * If you want to auto-join some channels, you can add them the same way as well: /channel add -auto #irssi Freenode /channel add -auto #xkcd Foonetic ==== IDLE-RPG ==== * https://idlerpg.lolhosting.net/index.php - game were you are supposed to do nothing, trust me and try it /msg IdleBot REGISTER NAME PASSWORD PROFESSION /msg IdleBot LOGIN NAME PASSWPRD /msg IdleBot LOGOUT /msg IdleBot NEWPASS /channel help /channel add -auto #idlerpg freenode ===== IRC applications and tools ===== * notify android cell phone : https://irssinotifier.appspot.com/ * connect IRC to Slack: https://sameroom.io/blog/connecting-a-channel-in-slack-to-a-channel-irc/ ===== SECRETARY BOT : How does it work ===== * you need running IRSSI instance and your bot is just one [[https://irssi.org/|IRSSI]] identity, best is to run single instance of [[https://quadpoint.org/articles/irssi/|IRSSI in screen somewhere]] * configuration of bot is done by IRSSI, so you want have it named, connect somewhere... [[https://irssi.org/|IRSSI]] is your friend * repository [[https://github.com/pasky/papalala|papalala]] will show you how to get data from IRC and return it back to IRC * in case you are going to test, please do not test your progress on [[http://webchat.freenode.net/?channels=Labka_Bot_War|#labka channel, create your own]] ==== Where to test existing instances ==== IRC Chat: [[http://webchat.freenode.net/?channels=labka|#labka on freenode]] (just enter a nickname, connect and chat) ==== Existing instances info ==== === Overdrive === https://github.com/Over23/Irssi_scripts actual functionality of **Secretary** bot on #labka channel: !spoj "jizdni rad -- from -- to" pro ostatni jizdni rady e.g. `spoj vlak -- from -- to !btc [x] - btc day average, czk-usd, [Xczk = Ybtc] !decide A -- B - will return you A or B, kind of random !skladiste - funny example how to query web page !csfd what film - CSFD.cz query !labka rss - show last 3 updates of this wiki !banka Secretary: whatever - hailobot will return you pseudo Alice bot answer === Peterbay === repo for IRSSI scripts: https://github.com/peterbay/Irssi-Scripts actual fucntionality by **pbbot** on #labka channel: `csfd what film - CSFD.cz query `dpo A -- B - public transport query, from A to B `labka rss - will give you updates of Labka page `wiki what - will return wikipedia query to you `spoj from -- to == Ostrava `spoj "jizdni rad -- from -- to" pro ostatni jizdni rady e.g. `spoj vlak -- from -- to `banka - parse Labka bank account == NonBOT commands == /alias ToDo /exec echo "$0-" >> ~/ToDo.txt - add something to file, called as /ToDo whatever /alias ToDol /exec cat ~/ToDo.txt - read that file, called as /ToDol /alias ToDod /exec grep -v "$0" ~/ToDo.txt > ~/ToDo.tmp && mv ~/ToDo.tmp ~/ToDo.txt - delete $0 from ~/ToDo.txt /alias Idea /exec echo "$0-" >> ~/Idea_irssi_note.txt - add something to file, called as /Idea whatever /alias Ideal /exec cat ~/Idea_irssi_note.txt - read that file, called as /Ideal /alias Random /exec dd if=/dev/urandom bs=1 count=23 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev /alias MOTD /exec cat /home/share/irssi_motd_news.txt - news for all to add and remove manually, will be shown at 9:00 and 23:59 == Cron == * script used for this command set is : https://scripts.irssi.org/scripts/cron.pl # Short help/usage: # /jobadd hour minute day_of_month month day_of_week command # Possibile switches for jobadd: # -disabled # -server # - # /jobs [-v] # /jobdel [-finished] | job_number # /jobdisable job_number # /jobenable job_number # /jobssave # /jobsload # # Examples of usage: # /jobadd 17 45 * * * /echo This will be executed at 17:45 # /jobadd -5 17 45 * * * /echo The same as above but only 5 times # /jobadd * 05 * * * /echo Execute this every hour 5 minutes after the hour # /jobadd */6 0 * * * /echo Execute at 0:0, 6:0, 12:0, 18:0 # /jobadd * */30,45 * * * /echo Execute every hour at 00, 30, 45 minute # /jobadd * 1-15/5 * * * /echo at 1,6,11 == Actually used cron on #labka channels == 01:03:22 -!- Irssi: Current Jobs: 01:03:22 -!- Irssi: 0) -server freenode 23 59 * * * /msg #labka `banka 01:03:22 -!- Irssi: 1) -server freenode 23 59 * * * /msg #labka !labka rss 01:03:22 -!- Irssi: 2) -server freenode 12 00 * * * /msg #labka !labka rss 01:03:22 -!- Irssi: 3) -server freenode 12 00 * * * /msg #labka `banka 01:03:22 -!- Irssi: 4) -server freenode 23 58 * * * /exec fortune -s | tr -d '\012\015\011'; 01:03:22 -!- Irssi: 5) -server freenode 01 00 28 04 * /topic #labka Labka.cz : Hackerspace Ostrava : Remember Shoah 01:03:22 -!- Irssi: 6) -server freenode 23 59 04 11 * /topic #labka Labka.cz : Hackerspace Ostrava : remember remember the 5th of november 01:03:22 -!- Irssi: 7) -server freenode * * 23 6 * /topic #labka Labka.cz : Hackerspace Ostrava : Happy Birthday Alan Turing & Johannes Gutenberg 01:03:22 -!- Irssi: End of List ====== BOT megabro ====== * owned and managed by : Embargo Adelajka> megabro: help Adelajka: (help [] []) -- This command gives a useful description of what does. is only necessary if the command is in more than one plugin. You may also want to use the 'list' command to list all available plugins and commands. Adelajka> megabro: version The current (running) version of this Limnoria is 2017.08.18, running on Python 3.6.3 (default, Oct 3 2017, 21:45:48) [GCC 7.2.0]. The newest versions available online are 2019.02.22 (in master), 2019.05.28 (in testing). ====== BOT megabro : known functionality ====== @roulett - - russian roulette @title [URL] - is returning HTML tag @Admin, @AutoMode @Channel @ChannelLogger @ChannelStats @Config @Games @Google @Misc @Network @NickAuth @Owner @Topic @User @Utilities @Web </code> ====== ToDo ====== * find a way how to query day events based on date and potentially [[https://en.wikipedia.org/wiki/Google_Doodle|Google Doodle]] ====== IRSII ====== * https://irssi.org/documentation/tips/ ===== Ignore connect, join, part ===== /ignore #openstack MODES JOINS PARTS QUITS ====== Notes [to remove and so] ====== * add complete dependences to git for easy deploy * write parser for IDOS * http://jizdnirady.idnes.cz/ostrava/spojeni/?f=lavka&t=UAN&date=6.12.2015&time=20:00&submit=true - most easy api call * http://www.chaps.cz/files/idos/IDOS-API.pdf - api ===== Wiky parser ===== deploy this according Pasky howto 20:00:25 < pasky_> jo, http://rover.ms.mff.cuni.cz/~pasky/rss/ 20:00:53 < pasky_> konkr. ./rssfeed.sh ./rssfeed-brmlab.pl brmwiki brmlab.cz \#brmlab 1 http://brmlab.cz/feed.php?view=pages http://soup.brmlab.cz/rss/original >>brmwiki.log 2>&1 & ===== JendaBot ===== * http://jenda.hrach.eu/gitweb/?p=jendabot;a=summary ===== Exectute command PERL ===== * by Veverak, Base48 : https://bpaste.net/show/e1143148fbbb <code> my $sourcedir = dirname(__FILE__)."/foh"; { local $CWD = $sourcedir; my @CMD = ("fop", "-c", "fop-config.xml", "-xml", $xml,"-xsl", "report-pdf.xsl", "-pdf", $pdf); my $string = join(' ', @CMD); $RT::Logger->debug("Executing command: ", $string ); my ($err, $out); IPC::Run::run( \@CMD, '>', \$out, '2>', \$err ); my @lines = split /\n/, $out; foreach my $line (@lines) { $RT::Logger->info("FOP STDOUT: ".$line); } my @erlines = split /\n/, $err; foreach my $erline (@erlines) { $RT::Logger->warning("FOP STDERR: ".$erline); } if ( $? == -1 ) { $m->out("command failed: $!\n"); return (0, "", ""); } else { if( $? >> 8 != 0 ) { $m->out("command exited with value ", $? >> 8); return (0, "", ""); } } } </code> ===== Usefull commands on freenode.net ===== * http://little418.com/2012/01/adding-ops-to-your-new-freenode-channel.html ## reguster your nick /msg NickServ REGISTER password youremail@example.com ## identify registered nick /msg NickServ identify PWD ## give nick OP ad hoc on channel /msg ChanServ OP #CHaNNel NICK * http://little418.com/2012/01/adding-ops-to-your-new-freenode-channel.html ## give nick op and auto-op /msg chanserv flags #CHANnEL NICK +Oo ## list flags of channel /msg chanserv flags #CHANnEL ## allow external messages to channel, use when configuring GitHub bot [repo, settings, webHooks] /msg ChanServ set #CHANNELNAME mlock -nc ===== screen ===== screen -U #to understand UTF-8 create new window C-a c change to last-visited active window C-a C-a (commonly used to flip-flop between two windows) ===== cpan / cpanm ===== * install cpanm curl -L http://cpanmin.us | perl - --sudo App::cpanminus cpanm Hailo.pm ===== channel modes ======= /msg ChanServ set #CHANNELNAME mlock -nc ===== ToDo : ToTest ======= ==== XDCC, DCC - File transfer - file server ==== * https://en.wikipedia.org/wiki/XDCC * https://github.com/irssi/scripts.irssi.org/blob/master/scripts/xdccget.pl * https://github.com/irssi/scripts.irssi.org/blob/master/scripts/xdcc_autoget.pl * https://raw.githubusercontent.com/irssi/scripts.irssi.org/master/scripts/xdcc.pl - to test file transfer functionality of IRC channel * search engine for DCC downloadable files: http://ixirc.com ==== Headline ==== * https://www.pushsafer.com/en/irssi - notify from IRC to IOS, Android and ... ==== rozmrdanej ssl cert ==== * https://github.com/irssi/irssi/issues/599