Skip to content

Instantly share code, notes, and snippets.

View achristodoulou's full-sized avatar

Andreas Christodoulou achristodoulou

View GitHub Profile
@achristodoulou
achristodoulou / combos.php
Last active October 5, 2015 09:41 — forked from fabiocicerchia/combos.php
PHP - Generate all the possible combinations among a set of nested arrays.
<?php
/**
* Generate all the possible combinations among a set of nested arrays.
*
* @param array $data The entrypoint array container.
* @param array $all The final container (used internally).
* @param array $group The sub container (used internally).
* @param mixed $val The value to append (used internally).
* @param int $i The key index (used internally).
*/
@achristodoulou
achristodoulou / Run On Boo
Created July 22, 2015 10:42
Load or run a Linux command on boot
$ cat /etc/rc.local
/usr/local/bin/composer selfupdate > /dev/null 2>&1
@achristodoulou
achristodoulou / Multiple MySql records update
Created June 26, 2015 12:30
Update multiple MySql records
create temporary table tmp(
client_id INT(11),
amount char(2)
);
INSERT INTO tmp
SELECT client_id, amount + 10
FROM clients;
UPDATE clients as r
@achristodoulou
achristodoulou / Installing Java SE Runtime Environment as alternative to OpenJava
Created June 22, 2015 06:49
Installing Java SE Runtime Environment as alternative to OpenJava
#Download the latest java rpm from their site
http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
$ sudo dnf install jre-8u45-linux-x64.rpm
$ sudo alternatives --install /usr/bin/java java /usr/java/latest/bin/java 20000
$ sudo alternatives --config java
@achristodoulou
achristodoulou / Upgrade Fedora 21 to 22
Last active August 29, 2015 14:22
Upgrade Fedora 21 to 22
#Update any packages
$ yum update
#Upgrade to Fedora 22
$ clear && \
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-22-$(uname -i) && \
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-22 && \
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-nonfree-fedora-22 && \
yum -y update yum* && \
yum clean all && \
#!/bin/bash
if [ "$1" == "-h" ] ; then
echo "Send a friendly weekly report of git commits to the specified email"
echo "Usage: `basename $0` [-h] recepient_email email_subject"
exit 0
fi
if ! git ls-files >& /dev/null; then
echo "You can only run this command inside a git repository!"