03-13-2020
Quote:
Good job Ravinder.
Always a pleasure to see people learning new things and using that knowledge to solve real-world problems.
Can you use kind of system at your work?
Thank you for encouragement Neo
Yes, I did some stuff from this one(already written almost 8 to 9 functions).
But in company I believe they will NOT allow Telegram(since it could be information breach; usually sites apps like Whats app, telegram are NOT trusted in firms) so I am thinking to do this with Microsoft's Skype(which is official and is used in firms too). Let me have more hands on with this one at home then I will try to implement this with official communicator etc.
And again yes, its very powerful; right now I written functions for eg-->
- 1- Know number of opened files in a server(where code is deployed basically for time being, not connected to other servers).
- 2- Check disk space for mount(will enhance it to take input from user for mount).
- 3- Check number of running processes in system.
- 4- Get N number of lines(entered by user value) of log file.
- 5- Know system's uptime.
- 6- Starting and stopping tomcat in progress.
- 7- Installing few software (like tomcat, systemd etc) are in progress.
I will post a detailed version of it over weekend(migration cancelled this weekend).
Thanks,
R. Singh
This User Gave Thanks to RavinderSingh13 For This Post:
7 More Discussions You Might Find Interesting
1. Red Hat
Hi Everyone
Could you kindly advise on how I should do a chkconfig and uninstalling mysql rpm on Red hat ES.Please check the errors that I'm getting below. :eek:
I need to uninstall MySQL completely from my linux system ver 2.4.21-37 and use the chkconfig command to switch it on... (15 Replies)
Discussion started by: CollenM
15 Replies
2. What is on Your Mind?
I'm currently looking into ways to integrate the Telegram API into the forums:
Telegram Bots - Bot Code Examples
I'm thinking, first off, to use the Telegram API to get forum alerts and notifications (to Bot or Not?).
Second, I thinking of ways to more deeply integrate Telegram into the... (5 Replies)
Discussion started by: Neo
5 Replies
3. Web Development
This problem has been killing me all day, and I cannot solve it.
Basically, I am using node.js with the mysql module and it will not connect to the database.
Here is the JS code snippet in node.js:
app.get("/test", function(req, res) {
var mysql = require("mysql");
var con =... (4 Replies)
Discussion started by: Neo
4 Replies
4. Infrastructure Monitoring
After setting up MQTT and testing some ESP8266 and ESP32 modules, where I noted that testing in Programming ESP32 (ESP-WROOM-32) as an MQTT Client Subscribed to Linux Server Load Average Messages, I was so impressed with MQTT that I installed MQTT on three different computers, instantly and... (2 Replies)
Discussion started by: Neo
2 Replies
5. Programming
Various Node-Red crypto modules do not work with PHP, so to send an encrypted message from a PHP script (in this case from a Ubuntu server) to Node-RED we need our own code.
After a few hours of searching, testing various libs, more testing and debugging, I got this PHP to Node-RED code... (0 Replies)
Discussion started by: Neo
0 Replies
6. Programming
First, I want to thank Neo (LOL) for this post from 2018, Node.js and mysql - ER_ACCESS_DENIED_ERROR
I could not get the Node-RED mysql module to work and searched Google until all my links were purple! I kept getting ER_ACCESS_DENIED_ERROR with the right credentials. Nothing on the web was... (0 Replies)
Discussion started by: Neo
0 Replies
7. What is on Your Mind?
I have just completed the first phase of integrating all these devices and technologies:
MQTT, Node-RED, Linux, Apache2, MySQL, PHP, Telegram, ESP32, ESP8266, and the Arduino Uno
The glue that binds all this together is MQTT. In fact, MQTT makes this kind of integration nearly trivial to... (1 Reply)
Discussion started by: Neo
1 Replies
LEARN ABOUT DEBIAN
poe::component::irc::qnet
POE::Component::IRC::Qnet(3pm) User Contributed Perl Documentation POE::Component::IRC::Qnet(3pm)
NAME
POE::Component::IRC::Qnet - A fully event-driven IRC client module for Quakenet
SYNOPSIS
use strict;
use warnings;
use POE qw(Component::IRC::Qnet);
my $nickname = 'Flibble' . $$;
my $ircname = 'Flibble the Sailor Bot';
my $port = 6667;
my $qauth = 'FlibbleBOT';
my $qpass = 'fubar';
my @channels = ( '#Blah', '#Foo', '#Bar' );
# We create a new PoCo-IRC object and component.
my $irc = POE::Component::IRC::Qnet->spawn(
nick => $nickname,
port => $port,
ircname => $ircname,
) or die "Oh noooo! $!";
POE::Session->create(
package_states => [
main => [ qw(_default _start irc_001 irc_public) ],
],
heap => { irc => $irc },
);
$poe_kernel->run();
sub _start {
my ($kernel, $heap) = @_[KERNEL, HEAP];
# We get the session ID of the component from the object
# and register and connect to the specified server.
my $irc_session = $heap->{irc}->session_id();
$kernel->post( $irc_session => register => 'all' );
$kernel->post( $irc_session => connect => { } );
return;
}
sub irc_001 {
my ($kernel, $sender) = @_[KERNEL, SENDER];
# Get the component's object at any time by accessing the heap of
# the SENDER
my $poco_object = $sender->get_heap();
print "Connected to ", $poco_object->server_name(), "
";
# Lets authenticate with Quakenet's Q bot
$kernel->post( $sender => qbot_auth => $qauth => $qpass );
return;
}
sub irc_public {
my ($kernel, $sender, $who, $where, $what) = @_[KERNEL, SENDER, ARG0 .. ARG2];
my $nick = ( split /!/, $who )[0];
my $channel = $where->[0];
if ( my ($rot13) = $what =~ /^rot13 (.+)/ ) {
$rot13 =~ tr[a-zA-Z][n-za-mN-ZA-M];
$kernel->post( $sender => privmsg => $channel => "$nick: $rot13" );
}
return;
}
# We registered for all events, this will produce some debug info.
sub _default {
my ($event, $args) = @_[ARG0 .. $#_];
my @output = ( "$event: " );
for my $arg ( @$args ) {
if (ref $arg eq 'ARRAY') {
push( @output, '[' . join(', ', @$arg ) . ']' );
}
else {
push ( @output, "'$arg'" );
}
}
print join ' ', @output, "
";
return 0;
}
DESCRIPTION
POE::Component::IRC::Qnet is an extension to POE::Component::IRC specifically for use on Quakenet <http://www.quakenet.org/>. See the
documentation for POE::Component::IRC for general usage. This document covers the extensions.
The module provides a number of additional commands for communicating with the Quakenet service bot Q.
METHODS
"service_bots"
The component will query Q its default name on Quakenet. If you wish to override these settings, use this method to configure them.
$irc->service_bots(QBOT => 'W@blah.network.net');
In most cases you shouldn't need to mess with these >;o)
INPUT
The Quakenet service bots accept input as PRIVMSG. This module provides a wrapper around the POE::Component::IRC "privmsg" command.
"qbot_*"
Send commands to the Q bot. Pass additional command parameters as arguments to the event.
$kernel->post ('my client' => qbot_auth => $q_user => $q_pass);
OUTPUT EVENTS
All output from the Quakenet service bots is sent as NOTICEs. Use "irc_notice" to trap these.
"irc_whois"
Has all the same hash keys in "ARG1" as POE::Component::IRC, with the addition of 'account', which contains the name of their Q auth
account, if they have authed, or a false value if they haven't.
BUGS
A few have turned up in the past and they are sure to again. Please use <http://rt.cpan.org/> to report any. Alternatively, email the
current maintainer.
AUTHOR
Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
Based on the original POE::Component::IRC by:
Dennis Taylor, <dennis@funkplanet.com>
SEE ALSO
POE::Component::IRC
<http://www.quakenet.org/>
perl v5.14.2 2011-12-07 POE::Component::IRC::Qnet(3pm)