If you’ve tried to serve files with Sencha Cmd on port 80, you’ll probably see an error like this.
user@localhost ~/dev/extjs/extjsapp $ sencha web -p 80 start Sencha Cmd v126.96.36.199 [INF] Starting server on port : 80 [INF] Mapping http://localhost:80/ to .... [WRN] FAILED SelectChannelConnector@0.0.0.0:80: java.net.SocketException: Permission denied [WRN] FAILED org.eclipse.jetty.server.Server@5d25ad3: java.net.SocketException: Permission denied Exception in thread "Thread-5" com.sencha.exceptions.BasicException: Permission denied at com.sencha.exceptions.BasicException.wrap(BasicException.java:54) at com.sencha.exceptions.BasicException.stealthify(BasicException.java:43) at com.sencha.exceptions.BasicException.raise(BasicException.java:35) at com.sencha.util.http.Server.start(Server.java:265) at com.sencha.util.JettyServer.start(JettyServer.java:102) at com.sencha.command.filesystem.StartCommand$1.run(StartCommand.java:72) at com.sencha.util.ThreadUtil$1.run(ThreadUtil.java:65) at com.sencha.util.ThreadUtil$2.run(ThreadUtil.java:162) at java.lang.Thread.run(Thread.java:745) Caused by: java.net.SocketException: Permission denied at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Net.java:433) at sun.nio.ch.Net.bind(Net.java:425) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187) at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316) at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at org.eclipse.jetty.server.Server.doStart(Server.java:288) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at com.sencha.util.http.Server.start(Server.java:263) ... 5 more
Sencha Cmd defaults to serving files port 1841, but sometimes there is a need to serve on port 80. One reason is if you are setting ‘localhost’ as an allowed cross-origin domain.
On Linux, only root is allowed to bind processes to reserved ports - those up to 1023. There are a few methods to get
around this, such as configuring port routing or authbind. I prefer allowing java processes to bind to port 80
by granting the
CAP_NET_BIND_SERVICE permission permenantly to java. Authbind can be used for
one time access, and may be more appropriate if there are security concerns.
The following steps will demonstrate how to use setcap to allow java to bind on port 80. I would prefer to only grant Sencha Cmd with the permission, but was unable to determine how to do this.
First, determine where java is installed, by following the symbolic links.
> whereis java
The output will be similar to:
java: /usr/bin/java /usr/share/java /usr/share/man/man1/java.1.gz and we see that java is in
Let’s take a look at that.
> ls -l /usr/bin/java lrwxrwxrwx 1 root root 22 Jul 24 19:41 /usr/bin/java -> /etc/alternatives/java
We can see that
/usr/bin/java is a symbolic link to
/etc/alternatives/java, let’s take a look at that.
> ls -l /etc/alternatives/java lrwxrwxrwx 1 root root 46 Jul 24 19:41 /etc/alternatives/java -> /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
We can now see that the actual location of java is
Now that we know where java is, we can grant permission to bind to low-numbered ports.
sudo setcap CAP_NET_BIND_SERVICE=+eip /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
Here we are granting with the following permissions.
- e:Effictive activates the capability
- p:Permitted allows the capability
- i:Inherites the capability is inherited by child processes.
Now that the
CAP_NET_BIND_SERVICE capability has been granted, let’s try serving on port 80.
user@localhost ~/dev/extjs/extjsapp $ sencha web -p 80 start Sencha Cmd v188.8.131.52 [INF] Starting server on port : 80 [INF] Mapping http://localhost:80/ to ....
That looks much better.
A Currency Number Field for ExtJS
My attempt at a number field that displays formatted currency and works with MVVM.
WebSphere and WebSphere Portal create temporary directories for managing publish state, session state, and other data that can accumulate, degrading performance and causing publishing synchronization issues, especially on a development machine. If you begin to experience slow startup times or have publishing errors from RAD, cleaning temp folders can often resolve these issues.
On Windows, use Robocopy to delete long file paths
Note: On Windows, long directory paths can sometimes cause problems when trying to delete files in the WebSphere directory. Robocopy.exe is a bundled utility that has support for long file paths. Robocopy can be used to all files in a directory by mirroring an empty directory.
- Create an empty directory.
- Using the empty directory as the source directory, you can use Robocopy’s
/MIRswitch to mirror the empty directory, effectivly deleteing all files in the destination directory.
>robocopy.exe C:\temp\empty C:\folder\to\delete\ /MIR
- Stop the server.
profile_root/wstemp profile_root/temp profile_root/logs profile_root/tranlog
Visual Studio Code, my current go-to editor on Windows and Linux. I prefer Xubuntu for it’s combination of speed, configurability, and Git integration. It’s just a really nice editor.
As a relativly new product in Beta status, it’s getting fairly frequent updates. This isn’t really a problem on Windows since it has an installer to take care of updates. This is probably true for Mac as well, but on Linux VSCode is provided as a .zip archive.
The official installation instructions for Linux are to extract this .zip file to a directory and open the code executable. Honestly, as a relativly novice Linux user, this method for installation isn’t very hard. However, there is an arguably easier way, by using Ubuntu Make, which I came across on from an answer to a question about this topic on AskUbuntu.
I wasn’t previously aware of Ubuntu Make, here’s the definition from the Ubuntu Wiki.
Ubuntu Make is a command line tool which allows you to download the latest version of popular developer tools on your installation, installing it longside all the required dependencies (which will only ask for root access if you don’t have all the required dependencies installed already), enable multi-arch on your system if you are on a 64 bit machine, integrate it with the Unity launcher… Basically, one command to get your system ready to develop with!
Sounds great, and it is. Installing with Ubuntu Make gives the added benefits of making upgrading a one step process and making the Code icon available in menus and launchers.
Ext.Array is a singleton class that provides static methods for working with arrays.
Quick reminder of how to set tell Git to use an HTTP proxy. This overrides the
http_proxy environment variable that Git will look to first.
During a development project, I needed to run fme’s dqMan to query Documentum, but didn’t want to install the Documentum client as well. The following procedure shows how to get the required Documentum files off of an existing install so dqMan can run.
The following procedure is for Documentum 6.5, it may be applicable for other versions
- Download dqMan from the fme website. You will receive the license file in an email.
- Extract and install dqMan
- From the content server, copy the
dmcl.dllfile from the
Documentum\product\6.5\bindirectory to a location on your system Path.
Create a dmcl.ini file and place the following section.
ini [DOCBROKER_PRIMARY] host=yourContentServer #IP or Hostname
- Create and Environmental Variable named
DCML_CONFIGthat points to the
I just saw this interesting article about Google’s new Windows Phone 7 homepage on wpcentral.com where it showed how you can add a custom tile to your home page for their website. I thought that’s pretty cool, but wondered how they did it. First, I logged into my server and tailed the web server log, loaded up my website on my WP7 phone, pinned the page to the home screen using the bottom menu and checked the logs to see if it was re-requesting an iPhone like apple-touch-icon.
MarkdownPad is a full-featured Markdown editor for Windows.
Often a field is inserted into a Word document to indicate the last time the document was updated. Many times
Todays date is used for this field, but unfortunately is doesn’t accurately reflect the last update since the field will show today’s date even when the document is unmodified. A better indication for last update is the Last Saved date field.
How to insert the Last Saved date using Word
- Insert Ribbon > Quick Parts > Field…
- Select the ‘Date and Time’ category
- Insert the
How to use Calibre and plugins so your purchased ebooks can be backed up and used on other devices.
Open Process Explorer instead of Task Manager.
Websites that do this:
A rant on how to make bootstrap not look like bootstrap. Article isn’t that good, but it has links.
This article describes how to determine which version(s) and service pack level(s) of the Microsoft .NET Framework are installed using the Registry.
Slideshow on responsive design techniques.
Audit Schema changes with DDL Triggers
MRemoteNG picks up wherre MRemote left off. It works on Win7, which is the important part.
If trying to use hg push with SSH and receiving the error TortoisePlink.exe has stopped working, make sure that the Pageant.exe that is running is the one from the TortoiseHg install directory.
I have PuTTY installed in C:\Program Files(x86)\PuTTY\ and a copy was installed with TortoiseHg.
The error was caused when I started the Pageant.exe from the PuTTY installation directory, and not the Pageant from the TortoiseHg installation directory.
Console2 is a great frontend on Windows for cmd.exe and PowerShell. It provides re-sizable windows, a tabbed interface, and transparent windows.
It can also be used with PuTTY, but it takes a little bit of work. The issue is apparently with ANSI escape codes. Thankfully David A. Sjøen (@dasjoen) commented on Scott Hanselman’s Console2 article with the solution using ANSICON.
From the ANSICON ReadMe
ANSICON provides ANSI escape sequences for Windows console programs. It provides much the same functionality as `ANSI.SYS’ does for MS-DOS.
Download ANSICON (Github) and extract the contents from the
x64folders to your Console2 installation folder.
I now have the following files in my
Open Console2 and create a new tab with the command line, replacing
aPuttyProfileNamewith the name of a saved PuTTY profile:
Final 1-Day PowerShell v2 Workshop (by powershelldon)
Right click on a folder or file and copy the UNC path to the clipboard. This is a great way to share links on network drives or machines since most people don’t have the same drive letter for mapped drives.
A nice function from David Mohundro to create a WebClient that authenticates with a proxy.
Is this email address valid? Email validation checker and Java, .NET, and PHP libraries. Validation based on RFC.
I often need to check for duplicates in SQL and find myself coming back to Pete Freitag’s post on the subject.
SELECT email, COUNT(email) AS NumOccurrences FROM users GROUP BY email HAVING ( COUNT(email) > 1 )
To find near duplicates check out Sql Remove Almost Duplicate Rows on Stackoverflow. There are three different approaches to finding rows that only slightly different, where the data only varies in a few columns.
- Duly noted
- I require
- I have acquired
- I do not understand the question and I will not respond to it.
- Like ships in the night