By default in Linux, an SSH can freely navigate around your file system. I recently needed to restrict an SSH user to their home directory. You need rbash.
CentOS doesn’t ship with rbash enabled as default. It was easy enough to solve.
ln -s /bin/bash /bin/rbash
Then change /etc/passwd so that the user’s shell is /bin/rbash.
A super quick, one line install of wkhtmltopdf
wget https://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.10.0_rc2-static-amd64.tar.bz2 && tar xvjf wkhtmltopdf-0.10.0_rc2-static-amd64.tar.bz2 && mv wkhtmltopdf-amd64 /usr/bin/wkhtmltopdf
Quite often you’ll need pdftk also
wget http://pkgs.repoforge.org/pdftk/pdftk-1.44-2.el6.rf.x86_64.rpm && rpm -Uvh pdftk-1.44-2.el6.rf.x86_64.rpm && pdftk
Batik for HighCharts allows you to create static PNGs from dynamic data. HightCharts offers a hosted export server, sometimes I don’t want to use a 3rd party service.
Here’s how I installed the Apache Batik SVG Toolkit to create PNGs from HightCharts on CentOS
You’ll need a HighCharts download also.
yum install batik
yum install batik-rasterizer
chmod 777 highcharts/exporting-server/php/php-batik/temp
cp batik-rasterizer.jar lib/ ../highcharts/exporting-server/php/php-batik/ -r
yum install bitmap*
yum install dejavu*
ln -s /usr/share/fonts/dejavu /usr/share/fonts/dejavu-lgc
Installing nano is done using the yum system.
yum -y install nano
System Default Editor
During login, a number of scripts are run to setup the environment. In CentOS, a file for each subject is used. These are stored in a system profile directory, /etc/profile.d/. There are two environment variables that control which editor to use.
cat <<EOF >>/etc/profile.d/nano.sh
MariaDB is an enhanced, drop-in replacement for MySQL – best of all, nobody from Oracle phones you trying to sell you a premium version!
I see many applications moving over to soon when Oracle steps up it’s marketing, after all, I assume that is why Oracle bought MySQL.
Here’s how I replaced MySQL with MariaDB on cPanel/WHM. Continue reading “How to replace MySQL with MariaDB in 11.36”
There is a fruity issue with the munin RPM on Fedora/CentOS.
You may encounter this message;
[root@foo ~]# /usr/share/munin/plugins/mysql_ suggest
Missing dependency Cache::Cache at /usr/share/munin/plugins/mysql_ line 716.
You are simply missing two Perl modules – perl-Cache-Cache and perl-IPC-ShareLite.
yum install perl-Cache-Cache perl-IPC-ShareLite
Ignoring all the panic-mongers on the rest of the internet upgrading MySQL from 5.0 or 5.1 to 5.5 shouldn’t be that difficult. My task was to upgrade from 5.0 to 5.5 on CentOS (Remi Repos). It was to fix a bug with MySQL 5.0 ignoring the wait_timeout parameter in my.cnf.
Five to five on a Friday, I dive into the swamp, which turns out to be full of alligators.
Alligator 1: Version depenencies
Alligator 2: /usr/libexec/mysqld: unknown option ‘–skip-locking’
Alligator 3: [ERROR] Error message file ‘/usr/share/mysql/english/errmsg.sys’ had only 481 error messages,
but it should contain at least 641 error messages.
Or some other variation of numbers.
Continue reading “MySQL 5.0 or 5.1 to 5.5 Upgrade Traumas on CentOS”
The Remi Repo is a yum repository maintained by a French dude – Remi Collet. It contains much more up to date packages (January 2012) such as MySQL 5.5 and PHP 5.3.
Heres how I installed it on CentOS. Continue reading “Install the Remi Repo in CentOS”
Following up from a previous post, some hypervisors like Xen are a bit fruity when trying to control the time via NTP. Here’s how we managed it.
Firstly, if your installation doesn’t have ntp install. Install that.
yum install ntp
Continue reading “Alternate ‘Messing with time and date on Linux’”
Whilst installing FFmpeg and ffmpeg-php for a client that required server-side MP4 processing, I ran into a few errors.
The error I came across was while compiling ffmpeg-php Continue reading “Installing FFmpeg and ffmpeg-php on CentOS”