Tailing in Windows with a Right-Click

Being late to Linux in my career, I’m fascinated by things many probably already find mundane, like tailing logs. Someone finally suggested to me that I could use Cygwin to do this in Windows. He was my hero for the day!

Speaking of heroes, the members of Stackoverflow have a great way to open a Cygwin console in any directory with a right-click, described at http://stackoverflow.com/questions/9637601/open-cygwin-at-a-specific-folder. I used the registry trick because the command-line approach didn’t work for me.

If you found this interesting, please share.

Tar That There Here

Authorization in Linux can be very fine-grained, a feature that admins take advantage of to keep the non-admins from making a mess of things. This is generally a good thing, though it can occasionally be frustrating. One such occasion is when newbies need to tar up a folder they have permissions on but do not have permissions to create files in that folder’s parent. For example, as a developer role on a machine I have ownership of myapp that is inside apps, which is owned by root. This would look something like:

[scott@mylinuxbox /]$ ls -l
drwxr-xr-x.   7 root   root    4096 Aug 11 16:13 apps
[scott@mylinuxbox /]$ cd apps
[scott@mylinuxbox apps]$ ls -l
drwxr-xr-x.  7 devs devs  4096 Jan  9 14:07 myapp

The tar command creates a tar file from where it is run. If I wanted to create myapp.tar.gz I would normally run tar czf myapp.tar.gz myapp from inside the /apps path. But with no create permissions in that folder, I just get a snarky response from Linux.

[scott@mylinuxbox apps]$ tar -czf myapp.tar.gz myapp
tar (child): myapp.tar.gz: Cannot open: Permission denied
tar (child): Error is not recoverable: exiting now

Skipping the details of head banging on desk and key banging on Google, I found the following approach that does the trick.

From a path you have write permissions to (almost always your home directory if no where else), run
tar -czf [TARFILENAME].tar.gz -C [PARENT_DIR]/ [DIR_TO_TAR]
For example:
tar czf folder.tar.gz -C /var/www/ folder

The ‘-C’ tells tar to start from the path following rather than where you are at. So the following steps:

[scott@mylinuxbox apps]$ cd ~
[scott@mylinuxbox ~]$ tar czf myapp.tar.gz -C /apps/ myapp
[scott@mylinuxbox ~]$ ls -l *.gz
-rw-rw-r--. 1 devs devs  675453427 Jan  9 14:33 myapp.tar.gz

creates myapp.tar.gz in my home directory.

Problem solved. Of course, I only made this tar file because there were problems with the app, so there is still the problem of debugging, but I think we can both do that already.

Cheers

If you found this interesting, please share.

WebLogic Server, Apache Commons and You

Oracle released Security Alert CVE-2015-4852 last night, their official security response to a much-publicized vulnerability with certain usage of the Apache Commons library with the major J2EE application servers.

If you have access to the Oracle Support Network, the best reference is https://support.oracle.com/rs?type=doc&id=2076338.1.

For an Apache POV of the situation, I suggest https://blogs.apache.org/foundation/entry/apache_commons_statement_to_widespread.

Infoworld has a calmer dissertation of the issue at http://www.infoworld.com/article/3003197/security/library-misuse-exposes-leading-java-platforms-to-attack.html.

I personally heard about this first from /., where this is an informative thread (with the usual trolling between) at http://developers.slashdot.org/story/15/11/08/0346258/vulnerability-in-java-commons-library-leads-to-hundreds-of-insecure-applications.

If you found this interesting, please share.