Skip to content

Instantly share code, notes, and snippets.


Luboš Remplík LubosRemplik

View GitHub Profile
LubosRemplik / gist:7012852
Created Oct 16, 2013
Split tar files and cat them together again.
View gist:7012852
You can use split for this:
tar czpvf - /path/to/archive | split -d -b 100M - tardisk
This tells tar to send the data to stdout, and split to pick it from stdin - additionally using a numeric prefix (`-d`), a chunk size (`-b`) of 100M and using 'disk' as the base for the resulting filenames (tardisk00, tardisk01, etc.).
To extract the data afterwards you can use this:
cat tardisk* | tar xzpvf -
View gist:4662886
protected function _findAllWithFolders($state, $query, $results = array()) {
if ($state == 'before') {
return $query;
$results = array_merge(
return $results;
View gist:3511899
'ColorWheel' => array(
'ColorWheel' => array(
(int) 0 => '1',
(int) 1 => '34'
'ColorWheelRange' => array(
'ColorWheelRange' => array(
(int) 0 => '1',
(int) 1 => '2'
View gist:3511858
public $hasAndBelongsToMany = array(
'ColorWheel' => array(
'className' => 'Color'
'ColorWheelRange' => array(
'className' => 'Color'
colors_wheels, colors_wheel_ranges
View gist:3272058
'titleTranslation' => array(
(int) 0 => array(
'id' => '1',
'locale' => 'eng',
'model' => 'Category',
'foreign_key' => '2',
'field' => 'title',
'content' => 'English text'
(int) 1 => array(
View gist:3176160
if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) {
trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
View gist:3170278
It is not about sitemap.xml and it is not about PHP, using curl to show you there is something wrong with server (some firewall, security issue).
I am sshed into server and doing
curl -v connection refused
curl -v connection refused
curl -v works fine!!!
I am sshed to local server (or oi-dev).
curl -v works fine!!
curl -v works fine!!
View gist:3170108
-bash-4.1$ curl -v localhost
* getaddrinfo(3) failed for localhost:80
* Couldn't resolve host 'localhost'
* Closing connection #0
curl: (6) Couldn't resolve host 'localhost'
View gist:3170037
-bash-4.1$ curl -v
* About to connect() to port 80 (#0)
* Trying Connection refused
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host
View gist:3168706
Warning Error: file_get_contents( failed to open stream: Connection refused in [.../cake/lib/Cake/Utility/Xml.php, line 101]
2012-07-24 07:59:42 Warning: file_get_contents( failed to open stream: Connection refused in [.../cake/lib/Cake/Utility/Xml.php, line 101]
Error: String could not be parsed as XML
You can’t perform that action at this time.