Skip to content

Instantly share code, notes, and snippets.

View iJackUA's full-sized avatar
🦄

Yevhen Kuzminov iJackUA

🦄
View GitHub Profile
0x8E8927882a113083A639553491385CD2aAF4c907
@iJackUA
iJackUA / ActiveRecordClone.php
Last active March 24, 2019 10:43
Yii 1. Clone AR model and Relations
<?php
namespace common\models\traits;
trait ActiveRecordClone
{
/**
* Return new record with cloned attributes
*
* @param string $scenario
* @return static
@iJackUA
iJackUA / coffee.ex
Created June 6, 2016 08:01
Elixir coffee for @tonydspaniard :)
defmodule Water do
def boil(coffee, time) do
"#{coffee} | boil #{time}"
end
end
defmodule Coffee do
def spoons(coffee, time) do
"#{coffee} | coffee spoons #{time}"
end
#!/bin/bash
if [ "$(whoami)" != "root" ]; then
echo "ERROR : Run script as Root (sudo !!) please"
exit 1
fi
read -e -p "php_mongo version to be installed (change if needed) : " -i "1.4.4" VERSION
echo 'Installing php_mongo v.'$VERSION' ... '
@iJackUA
iJackUA / install-php-redis-ubuntu.sh
Last active April 9, 2016 05:33
Install php_redis extension from source (Ubuntu)
#!/bin/bash
if [ "$(whoami)" != "root" ]; then
echo "ERROR : Run script as Root (sudo !!) please"
exit 1
fi
read -e -p "php_redis version to be installed (change if needed) : " -i "2.2.4" VERSION
echo 'Installing php_redis v.'$VERSION' ... '
@iJackUA
iJackUA / install-redis-ubuntu.sh
Last active July 25, 2017 06:09
Install Redis from source (Ubuntu)
#!/bin/bash
if [ "$(whoami)" != "root" ]; then
echo "ERROR : Run script as Root (sudo !!) please"
exit 1
fi
read -e -p "Redis version to be installed (change if needed) : " -i "2.8.2" VERSION
echo 'Installing redis v.'$VERSION' ... '
@iJackUA
iJackUA / ffmpeg_build.sh
Last active May 30, 2023 20:03
Build ffmpeg and all needed codecs from latets git revisions
#!/bin/bash
sudo apt-get update
sudo apt-get -y install autoconf automake build-essential git libass-dev libfaac-dev libgpac-dev libmp3lame-dev libopus-dev libtheora-dev libtool libvorbis-dev libvpx-dev pkg-config texi2html yasm zlib1g-dev
# YASM
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xf yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure
@iJackUA
iJackUA / XHPROF installation in Ubuntu
Created May 13, 2013 11:35
XHPROF installation in Ubuntu
wget https://github.com/facebook/xhprof/archive/master.zip
unzip master.zip
cd xhprof-master/extension/
phpize
./configure
make
sudo make install
@iJackUA
iJackUA / MongoDb init.d script
Last active December 16, 2015 17:49
MongoDb init.d script
#! /bin/sh
### BEGIN INIT INFO
# Provides: mongod
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: MongoDB
# Description: Launches MongoDB
### END INIT INFO
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db