Upgrade tmux version - openshift

I am using OpenShift scallable gear with Django installed and I need to log everything from running tmux session to a file. On my local machine I am just using tmux-logging plugin but it need tmux version >1.9.
But 1.6 is installed on server(Why so old?).
It is possible to upgrade package version in gear without sudo/root privileges?
Or how I can log to a file with tmux 1.6 with same convenience as with tmux-logging plugin? Thanks.

You can use e.g. this script to install tmux without root privileges. Replace the $HOME with $OPENSHIFT_DATA_DIR before running it (you can't write directly to ~ on OpenShift + you want your tmux to be persistent) and adjust the $TMUX_VERSION (worked for me with $TMUX_VERSION=1.9).
Running the script will then install tmux into ~/app-root/data/local/.

Using
sh <(wget -qO- s.minos.io/s) -x tmux-2.0
You can fetch the static binary with static-get and no compiler required then, so no root privileges requeired.
Fiala´s solution looks good but it not worked for me and this is even simpler.

Related

Install MySQL on Windows Docker Image

Anyone had success adding MySQL to a Windows docker image? I tried two different ways of deploying MySQL to my image.
I tried using the msi from MySQL in non-interactive mode. Does not work at all in a container.
While Installing Mysql.msi through powershell getting below error
I tried extracting the zip to set things up manually using the mysqld commands does nothing at all. Literally nothing, the exectutables behave as if they just run and exit (no output, nothing):
https://github.com/Somesh-K/Automation-Mysql/blob/main/1.mysql_setup_v2.ps1
Something is very weird about all of this.
Yes, I know that there's a perfectly good MySQL docker linux container published by Oracle to Docker hub. This works. The problem is that running a Windows container and Linux container that need to interact creates a really unnecessary frustration for the user in terms of networking between the two.
Using a different back-end (like SQL server) for our application is not feasible and using .NET core instead of .NET framework is not feasible. To simplify, I'd like to just install MySQL on our windows based webserver docker image. This seems do-able using the two methods described in the links above, but as noted, it does not work and there's very odd behavior from the MySQL binaries when they are run in the container.
Here's an example of the odd behavior:
Install Docker Desktop for Windows
Download the Win32 install zips from MySQL and place in C:\mydata
https://dev.mysql.com/downloads/mysql/
Pull down the ASPNET image from Docker Hub, Run it, and Open up Powershell:
# docker pull mcr.microsoft.com/dotnet/framework/aspnet:4.8
# docker run --name testweb -v C:\mydata:C:\mydata:R -d mcr.microsoft.com/dotnet/framework/aspnet:4.8
# docker exec -it testweb powershell
C:\ > cd C:\mydata
C:\mydata\ > Expand-archive -path .\mysql-5.7.36-winx64.zip .
C:\mydata\ > cd \mysql-5.7.36-winx64\bin
C:\mydata\mysql-5.7.36-winx64\bin\ > .\mysql.exe -version
[zero output, acts like it's an empty executable]
Results
None of the executables/binaries in the extracted mysql bin directory on the container do anything at all. They behave as if someone wrote and executable that just exits. I thought I had a bad install zip so I extracted the same zip on my regular Windows 10 workstation. All of the binaries at least return errors or do something.
This is super odd. Any help would be appreciated.
Downloading this executable and putting it into my container seemed to do the trick:
https://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x64.exe
Placed this on my container and started it
C:\vcredist.exe /Q
After doing this, the executables starting working:
C:\ > cmd.exe /C "C:\mysql\bin\mysqld" --initialize-insecure
C:\ > cmd.exe /C "C:\mysql\bin\mysqld" --install
C:\ > start-service mysql
C:\ > cmd.exe /C "C:\mysql\bin\mysql" -u root

How do I enable the intl extension in CakePHP?

I am using CakePHP 3 and MAMP Pro server for my project. When I am trying to bake the cake, this error shows up:
Fatal error: You must enable the intl extension to use CakePHP.
I have even included intl.so and extension=php_intl.dll in my php.ini file but couldn't figure out solution for this error.
this issue was happening to me some days ago. I had installed Ubuntu 18.04 and php 7.1.
I was trying to run the comman php cake.php bake in orden to use cakephp's console but I was getting the following error message:
You must enable the intl extension to use CakePHP.
This extension (intl) was installed for php 7.1 (php7.1-intl) but this message was appearing every time I used php cake.php bake
After some google searches, I saw that I have to install the extension but with the following command:
sudo apt-get install php-intl
The same issue happened with mbstring extension, I used the command:
sudo apt-get install php-mbstring
then I restarted the apache server with:
sudo service apache2 restart
It's difficult to pinpoint exactly what's wrong without seeing your system setup. However based on what was said in the question, you may be setting up the intl extension incorrectly.
First off, if your OS is Linux/macOS and the PHP extension is a shared library (i.e. has a .so extension) then the php.ini entry should be extension=intl.so not extension=php_intl.dll. Also make sure the intl.so file is in the directory configured under the ini entry extension_dir. Otherwise make sure the extension ini entry is fully qualified (e.g. extension=/path/to/extension/dir/intl.so).
If you are using a Linux OS that has a package manager such as Debian/Ubuntu, you may be able to more easily install the extension for the PHP packaged for that distro. For example, in Ubuntu/Debian the package php5-intl provides the intl extension for PHP5 (I assume it's something similar for PHP7 if you've enabled those repos).
If you build PHP from source, you can try bundling the extension into your PHP. See the instructions from the manual.
I faced the same issue.
I added extension="php_intl.dll" in php.ini and restarted the Apache server.
Now it is working.
I had the same issue. After starting from scratch, I did :
$ brew install php
$ composer install && composer update && composer dump-autoload --optimize
$ composer self-update && composer create-project --prefer-dist cakephp/app:^3.8 cms
$ cd cms
$ bin/cake server
And it was working !

Openshift asks to change permission of file to 600 on Windows

while executing rhc setup i got following error
Your private SSH key file should be set as readable only to yourself. Please run CHMOD 600 C:/user/myuser/.ssh/id_rsa
Now how can i execute such command on windows.
However, I tried to use git bash. But have not got any success.!!
You can execute Linux commands on windows machine using Cygwin.
There are a couple of more tools using which you can do the same but I found Cygwin great!!!

How to install ioncube Loader in OpenShift with WorkFlow Guide

I create an Application with following cartridges
- PHP 5.4
- MySQL 5.5
- Phpmyadmin 4.0
What is the full workflow to make the ioncube fully function, and each time I push the repo data won't not deleted / reset?
I do read about
https://www.openshift.com/forums/openshift/how-to-install-ioncube-loader
But not really clear for the step.
Credit to cdaley: https://www.openshift.com/forums/openshift/how-to-install-ioncube-loader
First, you have to have created a gear with the Zend cartridge. (why? because you can go to zend/configuration/etc/php.ini to add the php.ini setting)
ssh into your gear and cd app-root/data
wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar -xvzf ioncube_loaders_lin_x86-64.tar.gz
You will end up with a
folder called 'ioncube'
Run echo $OPENSHIFT_DATA_DIR and make note of the output
nano $HOME/zend/configuration/etc/php.ini
Add this line to the END of the file you are editing (this one depend your php version, can be 5.3, 5.4, 5.5 or even latest version)
zend_extension=<OPENSHIFT_DATA_DIR>ioncube/ioncube_loader_lin_5.3.so
Where you replace with the path from Step 6.
Put the loader-wizard.php into your $OPENSHIFT_REPO_DIR/php directory
Exit out of your ssh connection
Run rhc app restart $appname where $appname is the name of your application OR you can restart on the web console.
View the $appname-$domain.rhcloud.com/loader-wizard.php in your browser and it should say that the extension is installed correctly now.

about mysql installation in a LAMP environment

When I build a LAMP environment in ubuntu-12.10,
first I installed mysql by mysql-5.5.12.tar.gz,but it told me that it can not find configure
file,it was here:
root#tryandchange-QTH6:/usr/local/src# cd mysql-5.5.12
root#tryandchange-QTH6:/usr/local/src/mysql-5.5.12# ./configure --prefix=/usr/local/mysql
bash: ./configure: 没有那个文件或目录(not exists the document or the file)
who can tell me why?Or tell me that a good way to build a LAMP environment,
but not 'apt-get install'.
XAMPP has downloadable Linux binaries, you just download, extract and run /path/to/xampp/xampp start - I'd recommend those as the easiest way to set up a LAMPP stack.
Link to XAMPP for Linux
Obviously by eschewing the use of apt, you are working with the knowledge that your apache/php/mysql will become obsolete and you will have to work to keep them secured and up-to-date.