Could not open /var/folders/n_/ laravel-excel.maatwebsite - laravel

i want to create download excel function using laravel-excel.maatwebsitelibrary. my code like below :
return Excel::download(new PembukuanExport, 'pembukuan.xlsx');
but when i ran it, it gave me error like this
Could not open /var/folders/n_/xh_10hm50dvbwg23cfq_kw3h0000gn/T/laravel-excel-DMBN3reNUrSiamYT for writing.
my laptop is macbook, been googling but cant find the right answer

It might be too late to answer this, but I guess you need to configure your excel.php config files.
Publish excel config files:
php artisan vendor:publish --provider="Maatwebsite\Excel\ExcelServiceProvider"
Now in config/excel.php files you need to do configuration:
'temporary_files' => [
/*
|--------------------------------------------------------------------------
| Local Temporary Path
|--------------------------------------------------------------------------
|
| When exporting and importing files, we use a temporary file, before
| storing reading or downloading. Here you can customize that path.
|
*/
'local_path' => storage_path(),
/*
|--------------------------------------------------------------------------
| Remote Temporary Disk
|--------------------------------------------------------------------------
|
| When dealing with a multi server setup with queues in which you
| cannot rely on having a shared local temporary path, you might
| want to store the temporary file on a shared disk. During the
| queue executing, we'll retrieve the temporary file from that
| location instead. When left to null, it will always use
| the local path. This setting only has effect when using
| in conjunction with queued imports and exports.
|
*/
'remote_disk' => null,
],
This will set the temporary folder to your storage path which has permission to execute things. Hope this find helpful to others.

i solved this by changing User & Group in `httpd.conf.
Open httpd.config.
Search keyword "User or Group" and change it.
User your_mac_user and fill in Group staff

Related

How to work with packages in Liquibase

We use liquibase with oracle. So we have some packages with procedures inside.
In our case changelog structure looks like:
master.xml
|
| release1
| |
| release-maser.xml
| release2
| |
| release-maser.xml
| softObjects
| |
| package-master.xml
| packages
| |
| somePackage.pkb
| somePackage.pks
change sets inside "releases" with runOnChange=false and "softObjects"(that can be create used CREATE OR REPLACE) with runOnChange=true like in best practices:
Try to maintain separate changelog for Stored Procedures and use
runOnChange=”true”. This flag forces LiquiBase to check if the
changeset was modified. If so, liquibase executes the change again.
So every update intall some "delta" change sets from "release" and AFTER reinstal all "softObjects" that was changed and in usual case all is OK.
But if I need to setup new DB, I will get a problem:
in change set from second release I use somePackage(v1), but in next release i need to change logic/API somePackage so I will get somePackage(v2) that can not be used in previously created change sets. So for now I have change set that on update will try to use wrong package version.
For avoid this I can add soft objects directly inside release folder without runOnChange=true when i create it. When I need to change it, i should just copy previous version of file to my new release and make changes inside a COPY.
This approach has some disadvantages:
you make a lot of copy files that can consist from thousands lines of
code(yes I know that it isn`t good)
version control system recognize it as a new file (good challenge for
reviewers)
What i undestand wrong? How should I work with "softObjects", if this objects might be changed?

How to install and use the JMeter plugin "Standard Set"

Hi I have downloaded the Standard Set from the JMeter plugin site.
I installed it as it says here:
http://jmeter-plugins.org/wiki/PluginInstall/
The problem is that I don't get to see any option in the Listener Menu that let me add a new Graphs Generator Listener as described here:
http://jmeter-plugins.org/wiki/GraphsGeneratorListener/
I need to create a Transactions per Second graph , but I don't know how to do it.
I really appreciate if you could help me out.
Thanks in advance.
If you do not see the extra elements in the menu, there is something wrong with your jmeter-plugins installation.
Make sure you unpacked the zip in the folder above 'bin', that is not clear in the instructions.
At the same folder level as 'bin' there should also be a 'lib', and beneath this, 'ext'.
Check that the 'ext' folder contains the jmeter plugin jar and other support files.
it should look like this:
|-apache-jmeter-2.11
| |-bin
| | |-jmeter.bat
| | |-ApacheJMeter.jar
| | |-...
| |-lib
| | |-ext
| | | |-JMeterPlugin-Standard.jar
| | | |-...
| | |-...
| |-...
|-...
Make sure you restart jmeter after moving these files. If you have the jar in the right place, the extensions will be loaded and available from menu options.
To install the JMeter Plugins,
-> Copy the JMeterPlugins.jar file from JMeterPlugins-VERSION.zip
-> Paste the file to JMETER_INSTALL_DIR/libexec/lib/ext

How to configure Laravel paths?

I'm a trying to install Laravel
My problem is:
/localhost/laravel displays its content like the folders under it.
but I am expecting something like the logo of laravel and the text "You have arrived."
I believe that the error is something in my paths.php:
return array(
/*
|--------------------------------------------------------------------------
| Application Path
|--------------------------------------------------------------------------
|
| Here we just defined the path to the application directory. Most likely
| you will never need to change this value as the default setup should
| work perfectly fine for the vast majority of all our applications.
|
*/
'app' => __DIR__.'/../app',
/*
|--------------------------------------------------------------------------
| Public Path
|--------------------------------------------------------------------------
|
| The public path contains the assets for your web application, such as
| your JavaScript and CSS files, and also contains the primary entry
| point for web requests into these applications from the outside.
|
*/
'public' => __DIR__.'/../public',
/*
|--------------------------------------------------------------------------
| Base Path
|--------------------------------------------------------------------------
|
| The base path is the root of the Laravel installation. Most likely you
| will not need to change this value. But, if for some wild reason it
| is necessary you will do so here, just proceed with some caution.
|
*/
'base' => __DIR__.'/..',
/*
|--------------------------------------------------------------------------
| Storage Path
|--------------------------------------------------------------------------
|
| The storage path is used by Laravel to store cached Blade views, logs
| and other pieces of information. You may modify the path here when
| you want to change the location of this directory for your apps.
|
*/
'storage' => __DIR__.'/../app/storage',
);
and index.php
require __DIR__.'/../bootstrap/autoload.php';
$app = require_once __DIR__.'/../bootstrap/start.php';
$app->run();
It's not your path. You should create a virtual host and point the virtual host's root to laravel/public.

Creating alias (or something similar) that activates when cd into a specific folder

Is it possible to create aliases when I enter a certain folder?
What I want:
I use composer a lot (a PHP package manager), which installs binaries in ./vendor/bin. I would like to run the binaries directly from ..
For example:
/path/to/project
| - composer.json // dictates dependencies for the project
| - vendor // libs folder for composer, is created by composer
| | - bin // if lib has bin, composer creates this folder
| | | phpunit // binary
| | | phinx // binary
| | - somelib1 // downloaded by composer
| | - somelib2 // downloaded by composer
Is it possible to get this to work:
> cd /path/to/project
> phpunit
And get phpunit to execute?
Something like "sensing" the composer.json file and dynamically find the binaries in ./vendor/bin and then do something like alias="./vendor/bin/<binary-name> $#" automatically?
I use OS X 10.9 and the boxed in Terminal app.
You can override cd, trap my_function DEBUG to run something on every command, or add a command into PS1 or PROMPT_COMMAND.
These have different behaviour and caveats, and I can't recommend doing any of them for this use case (after having used each of them at some point). They are bad solutions to X-Y problems.
An alternative which is much less likely to break things horribly is to create a custom function to do both things:
cdp() {
cd "$#" && phpunit
}

fanotify unable monitor entire system for FAN_OPEN_PERM event by multi-threaded program, and to ignore directories

I want to monitor whole system for FAN_OPEN_PERM | FAN_CLOSE_WRITE events by a multi - threaded program, and ignore some directories (say /home/mydir). I used fanotify_init() and fanotify_mark() in main() as:
//Is there any way to use FAN_GLOBAL_LISTENER?
fd = fanotify_init(FAN_CLOEXEC| FAN_NONBLOCK | FAN_CLASS_CONTENT | FAN_UNLIMITED_QUEUE | FAN_UNLIMITED_MARKS, O_RDONLY | O_LARGEFILE)
...
//Marking "/" (doesn't work as multi-threaded program) or "/home" (works fine)
fanotify_mark(fd, FAN_MARK_ADD | FAN_MARK_MOUNT, FAN_OPEN_PERM | FAN_CLOSE_WRITE | FAN_EVENT_ON_CHILD, AT_FDCWD, "/")
....
//Now, to ignore directory
fanotify_mark(fd, FAN_MARK_ADD | FAN_MARK_ONLYDIR | FAN_MARK_IGNORED_MASK | FAN_MARK_IGNORED_SURV_MODIFY, FAN_OPEN_PERM | FAN_CLOSE_WRITE | FAN_EVENT_ON_CHILD, AT_FDCWD, "/home/mydir")
In my program, main() reads events and pass it to multiple threads to process further.
Problems : 1) System hangs for this multi-threaded program in case of monitoring "/", but works fine for "/home". 2) Still I am getting notifications for "/home/mydir" (marked "/home" & ignored "/home/mydir").
How to mark entire system without any problem with multi-threaded program?
How to use ignore mask to ignore entire directory (recursively)?
(Kernel 2.6.38-8-generic)
Read the man page.
the FAN_OPEN_PERM flag fires up an event when privileges are required to open the file. If you open a file, let say in /tmp, it does nothing.
Instead you should use FAN_OPEN.

Resources