Install an ircbot that handles greetings of certain users - bots

I want to greet a certain user ffki-besucher in a certain IRC channel.
Whenever that user logs in, it should get a special message written directly into the channel. I heard weechat is a good solution, but how can I achieve this?
How do I install weechat on debian wheezy?
I already installed some packages:
apt-get install weechat-curses weechat-plugins weechat-scripts perl
I use this cool guide at https://weechat.org/files/doc/stable/weechat_quickstart.en.html
Then I start weechat as user (not root):
weechat-curses
(in case you want to quit, use /quit)
Now I need the scripts, but I am stuck how to get this command running:
/script install buffers.pl
I also tried to load the script plugin again with
/plugin autoload script
The script plugin seems to be missing on debian! weechat in debian wheezy is quite old (0.3.8 which has a bug that the script plugin is not included in the debian package)
(I tried to install weechat from jessie, but that would give dependencie problems with some pelrl libs, that go down to the kernel)

Uninstall the repository packages with
apt-get remove weechat*
and install the new packages directly from the weechat download site which are version 1.0.1-1:
cd /tmp/
wget https://weechat.org/debian/dists/stable/main/binary-amd64/weechat-core_1.0.1-1_amd64.deb
wget https://weechat.org/debian/dists/stable/main/binary-amd64/weechat-curses_1.0.1-1_amd64.deb
wget https://weechat.org/debian/dists/stable/main/binary-amd64/weechat-plugins_1.0.1-1_amd64.deb
install guile:
aptget install guile-2.0-libs
then install the packages:
dpkg -i weechat-*
Now you can start weechat as user (not as root) and install the scripts:
/script install buffers.pl
/script install jnotify.pl
Connect to your server:
/server add oftc irc.oftc.net/6667
further set your connection like described here: https://weechat.org/files/doc/stable/weechat_quickstart.en.html#irc_server_options
some tips:
autocomplete with TAB or Shift-TAB
change buffer with Alt+1 or Alt+2,...
install beep.pl to send a notification through screen to your desktop (needs some configuration)
use /help jnotify to achieve the auto notifications to certain users, etc

Install irssi instead:
apt-get install irssi
su into your user and add the trigger.pl script. create:
mkdir -p ~/.irssi/scripts
cd ~/.irssi/scripts
git clone https://github.com/coekie/irssi-scripts/ coeki-irssi-scripts
ln -s coeki-irssi-scripts/trigger.pl
mkdir autorun
cd autorun
ln -s ../trigger.pl
Now start irssi as user
/connect irc.hackint.org
/join #ffki
/nick bot-rubo77
You can later edit your ~/.irssi/config file to autojoin your server and channel with a certain nick:
{ address = "irc.hackint.net"; chatnet = "hackint"; port = "6697"; use_ssl="yes"; autoconnect="yes"; },
...
chatnets = {
hackint = {
type = "IRC";
nick="bot-rubo77";
};
};
change to the status window (ESC 1) and create the trigger:
/trigger add -joins -channels "#ffki" -masks "*ffki-b*#*" -command "msg #ffki Hi $N! Please be patient! Not everyone is at the keyboard but you will be noticed in a few minutes ..."
/trigger save
some tips:
ESC 1 - switch to status window
ESC 2 - switch to window 2 (usually your first chat window) ...
/names shows all users in the channel
you can change the trigger in ~/.irssi/triggers and then type /trigger reload in the status window

Related

How to setup git to work with QtCreator on Fedora29 Linux?

How to setup / configure / make settings to get git to work with QtCreator on Fedora29 Linux beyond the default installations of each?
QtCreator has a nice series of built in menus which call the git CLI command using the correct arguments to get things done.
It does however rely on having the following packages installed:
$ sudo dnf install git openssh-askpass git-cola
Also the following "options" settings are required:
options>Version Control>General>
:SSH prompt command: /usr/libexec/openssh/ssh-askpass
options>Version Control>Git>
:Repository Browser: /usr/bin/git-cola

adding tk-8.6.8 package for cygwin

I install and run PWgui-6.2 in cygwin, and get this message
"couldn't load file "/usr/bin/tk86.dll": No such file or directory
while executing
"load /usr/bin/tk86.dll Tk"
("package ifneeded Tk 8.6.8" script)".
I guess the package tk-8.6.8 is lacked in cygwin so I try to add this package. However I can't find out this package from repository.
Could you help me to solve this problem?
The answer is here: Cannot launch git gui using cygwin on windows, and this is essentially a duplicate question. The problem is that
gitk and git gui require X11 in Cygwin.
Solution
Install some of the Cygwin X11 packages:
Run the Cygwin installer again.
Install "xinit" under the X11 category, accepting all the dependencies.
(Windows Start menu should now include: Cygwin-X)
Start menu > run XWin Server
In Cygwin shell, run
export DISPLAY=:0.0
At this point I got "Authorization required, but no authorization protocol specified", so to fix that set
enable_xauth=0 in \bin\startxwin
(Note:)
Will need to run XWin Server every time you reboot, and set export DISPLAY=:0.0 every time you open a new Cygwin shell. (Run echo "export DISPLAY=:0.0" >>~/.profile to have it run automatically whenever a new shell is started).
If you get couldn't connect to display ":0.0", mouse over the X that should be in Windows taskbar tray, the pop-up should say something like Cygwin/X Server:1.0. Use that ":1.0" (or similar) instead as the value for export DISPLAY.
Install windows Git.
Uninstall git from cygwin repo.
Set the environment Path for Git "C:\Program Files\Git\cmd" and move it above C:\cygwin64\bin

How to start Matlab after a clean install?

I have downloaded and run the installer for matlab with destination /home/matlab, where matlab is the folder I created. Installation completed successfully. Now how do I start the program in Ubuntu?
To start MATLAB® on Linux® platforms, type matlab at the operating system prompt.
Create A MATLAB Launcher/shortcut
Automatic option: install package "matlab-support", sudo apt-get install matlab-support or via the Software Center on the dashboard.
Manual option as follows.
Get an icon:
sudo wget http://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png -O /usr/share/icons/matlab.png
Get the launcher file:
sudo wget 'https://help.ubuntu.com/community/MATLAB?action=AttachFile&do=get&target=matlab-r2012a.desktop' -O /usr/share/applications/matlab.desktop
If you have the student version of MATLAB (or simply the 32 bit version) on a 64 bit system, you will need to modify this file. Run
gksudo gedit /usr/share/applications/matlab.desktop
Then uncomment #Exec=matlab -arch=glnx86 -desktop and comment Exec=matlab -desktop (by adding or removing the # character).
If you get two MATLAB launcher icons in your Unity laucher, try uncommenting the following line in /usr/share/applications/matlab.desktop:
StartupWMClass=com-mathworks-util-PostVMInit
Original article at matlab community
Start it from command line:
/usr/local/MATLAB/R2020b/bin/matlab &
(replace the path with wherever is your installation located)
or
Install sudo apt-get install matlab-support to get the MATLAB shortcut.

How to install SQL * PLUS client in linux

I am working on AWS services. I have an ec2 ( centos ) instance. I need to configure SQL*Plus client on this centos machine.
The server with whom I want to connect is at some remote area. The server version is oracle-se(11.2.0.2)
How can I get the client installed on the CentOS machine?
Go to Oracle Linux x86-64 instant clients download page
Download the matching client
oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm
oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm
Install
rpm -ivh oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm
rpm -ivh oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm
Set environment variables in your ~/.bash_profile
ORACLE_HOME=/usr/lib/oracle/11.2/client64
PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_HOME
export LD_LIBRARY_PATH
export PATH
Reload your .bash_profile by simply typing source ~/.bash_profile (suggested by jbass) or Log-out user and log-in again.
Now you're ready to use SQL*Plus and connect your server. Type in :
sqlplus "username/pass#(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.2.1)(PORT=1521))(CONNECT_DATA=(SID=YOURSID)))"
The solution by #ChamaraKeragala is good, but it is unnecessary to logout/login. Instead type:
source ~/.bash_profile
For everyone still getting the following error:
sqlplus command not found
The original post refers to a set of environment variables, the most important of which is ORACLE_HOME. This is the parent directory where the oracle binaries get installed.
Depending on what version of oracle you downloaded you'll have to change the ORACLE_HOME accordingly. For example, the original question's ORACLE_HOME was set to:
ORACLE_HOME=/usr/lib/oracle/11.2/client64
My version of Oracle happens to be 12.1, so my ORACLE_HOME is set to:
ORACLE_HOME=/usr/lib/oracle/12.1/client64
If you are unsure of the version that you downloaded, you can:
cd /usr/lib/oracle after the installation and find the version.
Look at the RPM file oracle-instantclient12.1, where the bolded bits would refer to the version number.
There's a good blog post[1] on $subject. setup oracle client in ubuntu with minimum effort. Following are the main steps on how to step up the client.
In my case, I was installing rpm files using alien package.
Install alien and related packages
sudo apt-get install alien
Install oracle client packages using alien.
sudo alien -i oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
sudo alien -i oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm
In my opinion these two steps are the easiest way to install oracle client rpm's on your ubuntu system. (I'm not going to mention about export oracle specific variables as it's already clearly explained in above answers)
Hope it helps someone.
[1] http://pumuduruhunage.blogspot.com/2016/04/setup-oracle-sql-plus-client-on-aws.html
For any one who is using proxy, you'd need to add an extra line to the bash profile. At least this is what made it work for me. I'm using cntlm.
export no_proxy=
Install via zip (tried with 12_2)
First of all there is no need to set ORACLE_HOME.
Simply download the .zip files from here starting with the first one Basic: followed by SQL*Plus: and any additional zips you may need.
Extract them all under /opt/oracle
You will then have a directory: /opt/oracle/instantclient_x_y
On ubuntu I had to do also:
sudo apt install libaio1
To run:
# This can be also done by adding only the path below in: /etc/ld.so.conf.d/oracle-instantclient.conf
export LD_LIBRARY_PATH=/opt/oracle/instantclient_x_y:$LD_LIBRARY_PATH
# This can be added in ~/.profile or ~/.bashrc
export ORACLE_HOME=/opt/oracle/instantclient_x_y
/opt/oracle/instantclient_x_y/sqlplus user/pass#hostname:1521/sidorservicename
At the bottom of the the above link page there are more details.

Composer & Cygwin

Composer doesn't run correctly in Cygwin if you try to install it "globally".
Putting composer.phar into /usr/local/bin/composer, then trying to run it will result in the error:
Could not open input file: /usr/local/bin/composer
Just tripped over the same problem and found a solution. Posting it here, just in case I'll ever have to look it up again.
Set up a bin directory right under /home/my-username:
cd ~
mkdir bin
Move the composer.phar (or any other of those nifty new PHP imps that are on the rise)
into the ~/bindirectory and make sure to set it's execution bit:
# Notice how I got rid of the superfluous `.phar` extension
mv /path/to/composer.phar ~/bin/composer
chmod +x ~/bin/composer
Tell cygwin to include your ~/bin directory in the search path:
Open up the file ~/.bash_profile and uncomment the following paragraph ...
# Set PATH so it includes user's private bin if it exists
if [ -d "${HOME}/bin" ] ; then
PATH="${HOME}/bin:${PATH}"
fi
Now, for the most important part:
A wrapper script that helps Win's native PHP resolve Unix style paths (which is causing
the problem after all as Windows doesn't know how to handle /cygdrive/... paths).
cd ~/bin
touch php
chmod +x php
After editing the wrapper script ~/bin/php should read:
#!/bin/bash
# e.g. php="/cygdrive/c/Program Files (x86)/php/php.exe"
php="/path/to/php.exe"
for ((n=1; n <= $#; n++)); do
if [ -e "${!n}" ]; then
# Converts Unix style paths to Windows equivalents
path="$(cygpath --mixed ${!n} | xargs)"
case 1 in
$(( n == 1 )) )
set -- "$path" "${#:$(($n+1))}";;
$(( n < $# )) )
set -- "${#:1:$((n-1))}" "$path" ${#:$((n+1)):$#};;
*)
set -- "${#:1:$(($#-1))}" "$path";;
esac
fi
done
"$php" "$#"
Now restart your shell and it should correctly invoke the PHP interpreter whenever it
stumbles upon a #!/usr/bin/env php shebang. Simply issue a:
composer --help
How about this one?
In ~/.bashrc, add: alias composer='php c:\\your\\path\\to\\composer.phar'
Restart cygwin or reload the bashrc by running source ~/.bashrc
Works for me using both Cygwin's native php.exe and XAMPP's Windows-specific one.
I think what might work is to build a proxy instead:
Put composer.phar in /usr/local/bin/composer.phar
Create a bash proxy as /usr/local/bin/composer with the following:
#!/bin/sh
c:/path/to/php c:/path/to/composer.phar $#
chmod +x /usr/local/bin/composer
Try this:
Install Cygwin PHP and use it to run composer in Cygwin.
You can choose one of two ways to work fine with PHP+Composer in Cygwin:
Install Cygwin PHP and install composer.phar in Cygwin.
Install Windows PHP and install Winodows Composer, then call then from Cygwin. (Windows XAMMP+Composer with alias in cmd)
Your problem is caused by that Cygwin Composer is ruining by Windows PHP on Cygwin, so it can not recognize the file path.
After install Cygwin PHP, the composer will integrates with Cygwin PHP then fit to Cygwin's filepath.
Cygwin PHP extensions for composer usage:
php
php-json
php-mbstring
php-phar
php-zip
php-posix
You can install other PHP extension when composer's package is needed such as php-xmlwriter, php-tokenizer, php-ctype.
Installation commands guide:
If you have already installed apt-cyg, there are installation command above:
apt-cyg install php php-json php-mbstring php-phar php-zip php-posix
apt-cyg install php-xmlwriter php-tokenizer php-ctype
Then install Composer via Cygwin PHP:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
chmod +x ./composer.phar
mv ./composer.phar /usr/bin/composer
composer -v
Conclusion
I recommend using Windows PHP + Windows Composer, and call then in Cygwin, it because the Cygwin PHP is not much stable than Windows PHP.
I had the same problem. After reading the final instruction from composer installer, it says that the $PATH variable should be reloaded. I rebooted my computer and then linked the Composer bin to /usr/local/bin.
First locate the composer bin :
/cygdrive/c/ProgramData/ComposerSetup/bin/composer
Then according to Seldaek answer, after trying a non-working symlink, I did :
nano /usr/local/bin/composer
#!/bin/sh
/cygdrive/c/ProgramData/ComposerSetup/bin/composer $#
chmod +x /usr/local/bin/composer
And it's working.
What I did (very simple):
Install Composer normally with the Windows installer
Open a Cygwin console an type composer you will see something like Could not open input file: /c/route/to/your/composer/installation/bin
Create an alias composer='composer.bat' on your bash profile or bashrc or whatever
Done
I'm running Windows 8.1
I was having this issue. Most of the responses were over my head but I fixed it with no problems.
Step 1) Reinstall Composer globally as per https://getcomposer.org/download/
Step 2) Leave it alone. All the special stuff you want to do, don't do that.
Step 3) Download the latest setup-xxx.exe from https://cygwin.com/
Step 4) Click it with your mouse.
NOTE: During step 5 you will feel a sudden urge to read instructions, browse the web for info and start checking little boxes on the menu. Don't do that.
Step 5) Click 'next' until it stops asking. It will look at your existing
settings, fix things up and add any missing dependencies.
This worked for me.
Getting composer to work globally inside Cygwin is a pain in the butt...
The solutions I have come up with:
Don't use it globally. If you are using the PHP CLI from a Windows installation, it won't recognize the Linux paths that Cygwin uses.
What I have done is put it in the base directory of all the projects I use composer with, and do ../composer.phar to run it.
It works fine this way, and it's almost globally available...
Download, and compile your own PHP binaries within Cygwin... Yea, kind of a overkill.
I solved the problem like this in a Cygwin/XAMPP setup:
Install composer.phar to XAMPP's php directory
Create an executable Bash script named composer in XAMPP's php directory:
#!/bin/bash
script_dir=$(cygpath -w $(dirname $0))
php "$script_dir/composer.phar" $#
It's important to use cygpath -w to convert the path to a path in Windows form.
Make sure XAMPP's php directory is accessible in Cygwin's $PATH:
$ export PATH=$PATH:/cygdrive/i/dev/server/xampp/php
Now it's possible to call composer from anywhere you like without problems:
$ composer -V
Composer version 264f433ca3f007d39568b3722b4bf418f58ba15b
I fixed it by adding a /usr/local/bin/composer file:
nano /usr/local/bin/composer
with the following content:
#!/bin/bash
/cygdrive/c/wamp/bin/php/php5.4.3/php "C:\wamp\bin\php\php5.4.3\composer"
Basically, you have to call PHP with a Windows style path, not a cygwin path.
The easiest way is to install composer using the Windows installer from their website and then copy the two files 'composer' and 'composer.phar' from "C:\ProgramData\Composer" into a directory which is in the PATH variable. E.g. you could copy the files into the /bin/ directory of cygwin. Afterwards you can again uninstall the "Windows version" of composer.
Update! This is what I did:
Install PHP and needed modules from the Cygwin Ports project
Download the latest composer snapshot
Rename 'composer.phar' to 'composer' and save it to /usr/local/bin
Open /bin/dash.exe and run '/usr/bin/rebaseall'
Also if 4. gives you an error, composer should run now
I suggest you use babun, it is based cygwin, but you can install package by pact, you can do this:
pact install php php-json php-phar
php -r "readfile('https://getcomposer.org/installer');" | php
then enjoy yourself.
I was having trouble getting Composer to work in Cygwin and none of the solutions above were resolving my problem. Eventually I stumbled across this comment in the Composer github bugs discussion:
Yeah TBH using php from cygwin isn't a great idea, cygwin is just too different an environment. Too many hacks that create failures.. In any case closing here as there isn't much we can do I'm afraid :)
I don't know precisely where composer/Cygwin/php was tripping up, but, broadly, my problem was that I had two conflicting installations of PHP in environmental variables, one from an installation of WAMP, and another installed with Cygwin. The Cygwin PHP installation seemed to be struggling with some sort of path issue. I removed it, using only the WAMP PHP, and composer ran in Cygwin just fine.

Resources