Difference between revisions of "NetBeans"
(better example of sshfs) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
</blockquote> | </blockquote> | ||
e.g. | e.g. | ||
− | * [http://sourceforge.net/p/fuse/wiki/Mounting_SSHFS/ SSHFS] (one of | + | * [http://sourceforge.net/p/fuse/wiki/Mounting_SSHFS/ SSHFS] (one of [http://fuse.sourceforge.net/ FUSE]) |
* [http://avf.sourceforge.net/ AVFS] | * [http://avf.sourceforge.net/ AVFS] | ||
− | * | + | * [http://www.maketecheasier.com/quick-easy-guide-to-kde-kio-slaves/ KIO] |
<source lang="bash"> | <source lang="bash"> | ||
sudo sshfs -o IdentityFile=/home/greg/.ssh/id_rsa -o allow_other greg@eqt:/var/www/freephile.com/www/wikireport /mnt/droplet | sudo sshfs -o IdentityFile=/home/greg/.ssh/id_rsa -o allow_other greg@eqt:/var/www/freephile.com/www/wikireport /mnt/droplet | ||
+ | </source> | ||
+ | Actually, that's a bad example. You shouldn't need sudo to sshfs. Create a mountpoint that you have write permission on. Then use the <code>-o idmap=user</code> option to translate your local user to the remote user (giving you the same permissions on the remote files as remote user would have). | ||
+ | <source lang="bash"> | ||
+ | sudo mkdir /mnt/foo | ||
+ | sudo chown $USER:$USER /mnt/foo | ||
+ | sshfs -o idmap=user -o ssh_command='ssh -t -i /home/$USER/.ssh/id_rsa -o IdentitiesOnly=true -o ForwardAgent=true -L 127.0.0.1:43306:10.0.50.53:3306 centos@ec2-52-203-160-83.compute-1.amazonaws.com ssh -A' centos@10.0.50.161:/ /mnt/foo | ||
</source> | </source> | ||
Then, setup a project in NetBeans with existing sources, and use the mountpoint | Then, setup a project in NetBeans with existing sources, and use the mountpoint | ||
+ | == Troubleshooting == | ||
+ | See the [[process]] page for info on using the <code>ps</code> command to find out about your NetBeans process. | ||
+ | |||
+ | <code>ps</code> will tell you things about the various options (like Heap Size) that can be passed to the program on the command line, or set in defaults. For defaults, look at <code>/etc/netbeans.conf</code> Then, depending on your installation directory, look at the contents of the log file - which you can find using <code>locate messages.log</code> | ||
+ | |||
+ | === Slow Startup (NetBeans background scanning projects takes too long) === | ||
+ | When I tailed the messages.log file, I found out that the indexing took over 40 minutes. So, startup did actually finish as I spent an hour trying to figure out why it was taking so long. | ||
+ | <pre> | ||
+ | INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Complete indexing of 11 source roots took: 2,443,238 ms (New or modified files: 11,926, Deleted files: 2,371) [Adding listeners took: 23 ms] | ||
+ | </pre> | ||
== Specific Resources == | == Specific Resources == | ||
* https://netbeans.org/kb/docs/php/code-templates.html#using-templates | * https://netbeans.org/kb/docs/php/code-templates.html#using-templates |
Latest revision as of 09:56, 17 November 2017
NetBeans is a really decent editor, but it lacks one important feature (who knows why?). If you ever wanted to work on a remote server without having to download files and/or synchronize them (which NetBeans is horrible at), then use this simple hack:
Use a remote filesystem available in your Operating System
e.g.
sudo sshfs -o IdentityFile=/home/greg/.ssh/id_rsa -o allow_other greg@eqt:/var/www/freephile.com/www/wikireport /mnt/droplet
Actually, that's a bad example. You shouldn't need sudo to sshfs. Create a mountpoint that you have write permission on. Then use the -o idmap=user
option to translate your local user to the remote user (giving you the same permissions on the remote files as remote user would have).
sudo mkdir /mnt/foo
sudo chown $USER:$USER /mnt/foo
sshfs -o idmap=user -o ssh_command='ssh -t -i /home/$USER/.ssh/id_rsa -o IdentitiesOnly=true -o ForwardAgent=true -L 127.0.0.1:43306:10.0.50.53:3306 centos@ec2-52-203-160-83.compute-1.amazonaws.com ssh -A' centos@10.0.50.161:/ /mnt/foo
Then, setup a project in NetBeans with existing sources, and use the mountpoint
Troubleshooting[edit | edit source]
See the process page for info on using the ps
command to find out about your NetBeans process.
ps
will tell you things about the various options (like Heap Size) that can be passed to the program on the command line, or set in defaults. For defaults, look at /etc/netbeans.conf
Then, depending on your installation directory, look at the contents of the log file - which you can find using locate messages.log
Slow Startup (NetBeans background scanning projects takes too long)[edit | edit source]
When I tailed the messages.log file, I found out that the indexing took over 40 minutes. So, startup did actually finish as I spent an hour trying to figure out why it was taking so long.
INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Complete indexing of 11 source roots took: 2,443,238 ms (New or modified files: 11,926, Deleted files: 2,371) [Adding listeners took: 23 ms]