Easy and generic Linux kernel compilation procedure

  1. Become root.
    su # or sudo su on ubuntu
  2. Reach a source folder.
    cd /usr/src # or /usr/local/src
  3. Get the preferred version.
    wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.6.1.tar.xz
  4. Extract the downloaded archive.
    tar xvf linux-4.6.1.tar.xz
  5. Enter the extracted folder
    and copy the preferred configuration from /boot to .config in the current folder.
    cp /boot/config-4.6.0-1-pae .config
  6. Configure the kernel compilation using menuconfig,
    libncurses is required.
    make menuconfig
  7. Launch the build.
    Add deb-pkg parameter on debian to get packages.
    I did not test rpm.
    make LOCALVERSION=-centrino -j3 # deb-pkg
  8. Install the kernel, create initrd, and configure grub.
    On debian only extract the deb packages located in ../ using dpkg -i *.deb command.
    After rebooting the new kernel should be displayed in the grub menu.
    make modules_install && make install && mkinitrd -k 4.6.1-1-pae-centrino

Tested on Ubuntu and OpenSuse.


PSR-3 Security levels explained

The eight severity levels supported by PSR-3 are based on RFC 5424, and are described below:

Emergency – the system is unusable
Alert – immediate action is required
Critical – critical conditions
Error – errors that do not require immediate attention but should be monitored
Warning – unusual or undesirable occurrences that are not errors
Notice – normal but significant events
Info – interesting events
Debug – detailed information for debugging purposes

References:
http://www.sitepoint.com/logging-with-psr-3-to-improve-reusability/
https://tools.ietf.org/html/rfc5424 (page 10)


PHP7 – Build phalcon

Build phalcon for php7, binaries unavailable :s (20160503):

$ sudo su
$ apt-get install build-essential git php-dev libpcre3-dev
$ cd /usr/src
$ git clone https://github.com/phalcon/zephir.git
$ git clone https://github.com/phalcon/cphalcon.git
$ ln -sf /usr/src/zephir/bin/zephir /usr/bin/zephir
$ export ZEPHIRDIR=/usr/src/zephir
$ cd cphalcon
$ git checkout php7-parsers
$ zephir build -backend=ZendEngine3

References:
https://github.com/phalcon/cphalcon/tree/php7-parsers
http://phalcon.io/phalconphp-and-php7


Clean Oracle JDK install debian / ubuntu

ARM example

sudo su
cd /home/pi
wget http://download.java.net/jdk8/archive/b98/binaries/jdk-8-ea-b98-linux-arm-vfp-hflt-10_jul_2013.tar.gz?q=download/jdk8/archive/b98/binaries/jdk-8-ea-b98-linux-arm-vfp-hflt-10_jul_2013.tar.gz -O java.tar.gz
mkdir -p /opt
tar zxvf java.tar.gz -C /opt
rm java.tar.gz
update-alternatives –install “/usr/bin/java” “java” “/opt/jdk1.8.0/bin/java” 1
update-alternatives –set java /opt/jdk1.8.0/bin/java
java -version

Oracle download :

wget –no-check-certificate –no-cookies –header “Cookie: oraclelicense=accept-securebackup-cookie” http://download.oracle.com/otn-pub/java/jdk/8u73-b02/jdk-8u73-linux-x64.tar.gz


Memo : OwnCloud Manual Upgrade Procedure

From :

https://doc.owncloud.org/server/8.0/admin_manual/maintenance/upgrade.html

 

Always start by making a fresh backup.

If you are upgrading to a major release, for example from 8.1.3 to 8.2, you must review all third party applications (not core apps) for compatibility with your new ownCloud version. Then disable all of them before starting the upgrade.

Next put your server in maintenance mode. This prevents new logins, locks the sessions of logged-in users, and displays a status screen so users know what is happening. There are two ways to do this, and the preferred method is to use the occ command, which you must run as your HTTP user. This example is for Ubuntu Linux:

$ sudo -u www-data php occ maintenance:mode --on

The other way is by entering your config.php file and changing 'maintenance' => false, to 'maintenance' =>true,.

  1. Back up your existing ownCloud Server database, data directory, and config.php file. (See Backing up ownCloud.)
  2. Download and unpack the latest ownCloud Server release (Archive file) from owncloud.org/install/ into an empty directory outside of your current installation. For example, if your current ownCloud is installed in /var/www/owncloud/ you could create a new directory called /var/www/owncloud2/

Note

To unpack your new tarball:: tar xjf owncloud-latest.tar.bz2

  1. Stop your Web server.
  2. Rename or move your current ownCloud directory (named owncloud/ if installed using defaults) to another location.
  3. This creates a new owncloud/ directory populated with your new server files. Copy this directory and its contents to the original location of your old server, for example /var/www/, so that once again you have/var/www/owncloud .
  4. Copy and paste the config.php file from your old version of ownCloud to your new ownCloud version.
  5. If you keep your data/ directory in your owncloud/ directory, copy it from your old version of ownCloud to the owncloud/ directory of your new ownCloud version. If you keep it outside of owncloud/ then you don’t have to do anything with it, because its location is configured in your original config.php, and none of the upgrade steps touch it.

Note

We recommend storing your data/ directory in a location other than your owncloud/ directory.

  1. Restart your Web server.

  2. Now you should be able to open a Web browser to your ownCloud server and

    log in as usual. You have a couple more steps to go: You should see a Start Update screen, just like in the Upgrading With Your Linux Package Manager section, above. Review the prerequisites, and if you have followed all the steps click the Start Update button.

    If you are running a large installation with a lot of files and users, you should launch the upgrade from the command line using occ to avoid PHP timeouts, like this example on Ubuntu Linux:

    $ sudo -u www-data php occ upgrade
    

    Note

    The occ command does not download ownCloud updates. You must first download and install the updated code (steps 1-3), and then occ performs the final upgrade steps.

  3. The upgrade operation takes a few minutes to a few hours, depending on the size of your installation. When it is finished you will see a success message, or an error message that will tell where it went wrong.

Assuming your upgrade succeeded, take a look at the bottom of your Admin page to verify the version number. Check your other settings to make sure they’re correct. Go to the Apps page and review the core apps to make sure the right ones are enabled. Re-enable your third-party apps. Then apply strong permissions to your ownCloud directories (Setting Strong Directory Permissions).

Reverse Upgrade

If you need to reverse your upgrade, see Restoring ownCloud.

Troubleshooting

When upgrading ownCloud and you are running MySQL or MariaDB with binary logging enabled, your upgrade may fail with these errors in your MySQL/MariaDB log:

An unhandled exception has been thrown:
exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1665
Cannot execute statement: impossible to write to binary log since
BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited
to row-based logging. InnoDB is limited to row-logging when transaction
isolation level is READ COMMITTED or READ UNCOMMITTED.'

Please refer to MySQL / MariaDB with Binary Logging Enabled on how to correctly configure your environment.

Occasionally, files do not show up after a upgrade. A rescan of the files can help:

$ sudo -u www-data php console.php files:scan --all

See the owncloud.org support page for further resources for both home and enterprise users.

Sometimes, ownCloud can get stuck in a upgrade. This is usually due to the process taking too long and encountering a PHP time-out. Stop the upgrade process this way:

$ sudo -u www-data php occ maintenance:mode --off

Then start the manual process:

$ sudo -u www-data php occ upgrade

If this does not work properly, try the repair function:

$ sudo -u www-data php occ maintenance:repair

[debian][vpn] from tunnelblick to gnome by openvpn

– install required “bouzins” : sudo apt-get install network-manager network-manager-gnome network-manager-openvpn network-manager-openvpn-gnome network-manager-openvpn-gnome

– start or restart network-manager

– start gnome network tool and add a vpn connexion.

– fill remote, certs, keys (imported from /Library/Application\ Support/Tunnelblick/Users/zob/lamouche.tblk/Contents/Resources/ on OSX)

– Advanced : specify port and LZO compression and TUN if needed (no bullshit widouz params)

– To keep an Internet connexion up : IPV4 / Routes / Check: only for its own resources. (2nd box)

Have fun!


Roundcube upgrade

Get the latest version

Download it from http://www.roundcube.net/download and copy the Tarball to a directory on your server.

Unpack the tarball and read UPGRADING and INSTALL files and check system requirements of the new version.

cd <where-the-tarball-is-saved>
tar xf roundcubemail-*.tar.gz

Update your existing Roundcube installation

The easiest way to do this is to use the installto.sh shell script bundled with Roundcube.

cd <the-unpacked-roundcube-directory>
bin/installto.sh <your-existing-roundcube-directory>