Skip to content

Instantly share code, notes, and snippets.

View boo1ean's full-sized avatar
🎯
Focusing

Egor Gumenyuk boo1ean

🎯
Focusing
View GitHub Profile
#!/usr/bin/env bash
mkdir dir links
touch dir/node-1 dir/node-2 dir/node-3 dir/node-4 dir/node-5
ln dir/node-2 links/2_
ln dir/node-3 links/3_
ln dir/node-3 links/3__
#!/usr/bin/env bash
touch a aa aaa b bb bbb c cc ccc
echo "a" > aa
echo "a" > aaa
echo "bsdasdf" > bb
echo "bsdasdf" > bbb
echo "cccccc" > cc
#!/usr/bin/env bash
touch a aa aaa b bb bbb c cc ccc
echo "a" > aa
echo "a" > aaa
echo "bsdasdf" > bb
echo "bsdasdf" > bbb
echo "cccccc" > cc
#include <stdlib.h>
#include <dirent.h>
#include <utime.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/sendfile.h>
#include <iostream>
<?php
function read($filename) {
$file = fopen($filename, 'r');
while ($line = fgets($file)) {
yield $line;
}
}
$iterator = read(__FILE__);
@boo1ean
boo1ean / setup.sh
Last active December 21, 2016 18:54
Setup apache-2.4.4 + php-5.5.0 on CentOS 6.3
#!/usr/bin/env bash
# Install dependencies
yum update -y
yum install -y gcc apr-devel apr-util-devel openssl-devel pcre-devel libxml2-devel libcurl-devel
mkdir setup && cd setup
wget http://mirrors.besplatnyeprogrammy.ru/apache//httpd/httpd-2.4.4.tar.gz
tar -xvf httpd-2.4.4.tar.gz
@boo1ean
boo1ean / gist:5934467
Created July 5, 2013 13:15
port forwarding
insert_port_forwarding() { #port, dest_ip, protocol, dest_port
local port=$1
local dest_ip=$2
local protocol=$3
local dest_port=$4
if [ -z $dest_port ]
then
dest_port=$port
fi
iptables -t nat -A PREROUTING -p $protocol -d $LIN_WAN_IP --dport $port -j DNAT --to $dest_ip:$dest_port
// Line 271
if (entity.fixedRotation === true) {
bodyDef.fixedRotation = true;
} else {
bodyDef.angularDamping = entity.angularDamping;
}
<?
class Customer extends \yii\db\ActiveRecord
{
public function getOrders()
{
return $this->hasMany('Order', array('customer_id' => 'id'));
}
}
class Order extends \yii\db\ActiveRecord
<VirtualHost *:80>
ServerName yii
DocumentRoot /home/boo1ean/test/public/
<Directory /home/boo1ean/test/public/>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>