Tag Archives: devenv

Using SETLOCAL and ERRORLEVEL together in Batch

Interesting thing about using SETLOCAL and ERRORLEVEL together.
Consider two files:


@echo off

echo %ERRORLEVEL% in first bat before setlocal


echo Some actions with error finished here...

echo %ERRORLEVEL% in first bat.

exit /b %ERRORLEVEL%


@echo off

echo %ERRORLEVEL% in second bat before setlocal


echo %ERRORLEVEL% in second bat after setlocal

Exec in series:

C:\first.bat && second.bat

You’ll see the next output:

0 in first bat before setlocal
Some actions with error finished here...
1 in first bat.
1 in second bat before setlocal
0 in second bat after setlocal

More info http://ss64.com/nt/setlocal.html

Set file and folder permissions in Linux

Convenient way to apply permissions in Linux is to save alias in .bashrc file:

Set all permissions for FTP:

alias setftpperm="chown -R _pure-ftpd:_pure-ftpd /usr/serv/ftp/anonymous && \
    chmod -R u+rwX,go+rX,go-w /usr/serv/ftp/anonymous && \
    chmod -R u+rwX,go+rX,go+w /usr/serv/ftp/anonymous/PUBLIC && \
    chmod -R u+rwX,go+rX,go+w /usr/serv/ftp/anonymous/TORRENTS"

Next is permissions for Apache:

alias setapacheperm="chown -R _pure-ftpd:daemon . && \
  chmod 666 . && chmod -R u+rwX,go+rX,go-w ."

alias setapachewperm="chown -R _pure-ftpd:daemon . && \
  chmod 666 . && chmod -R u+rwX,go+rX,go+w ."

Copy files by mask in destination in BATCH

If you want to copy some file from known location to location by mask (unknown), use next:

@echo off
setlocal enableextensions enabledelayedexpansion

set pathFrom=D:\ScriptCopyTest\my1.java
set pathTo=D:\ScriptCopyTest\Test*

set copy_opts=/I /Y /R /V /F /H

for /d %%f in (%pathTo%*) do ( xcopy %pathFrom% %%f %copy_opts% )


Using clipboard via SSH in Linux

To use clipboard on SSH you can install package Parcellite

pacman -S parcellite

Check out sync property!

Connect to DB2 via JDBC in Database Manager

To connect you’d point a URL to databse, a driver and its location.





Driver location (for Windows OS):

  C:\Program Files\Aqua Data Studio 8.0 - 32bit\lib\drivers\db2jcc.jar

Also, read http://docs.aquafold.com/ads/4.7/docs-jdbcdrivers-db2.html

Eclipse IDE vs others

How many hollywars around development IDE better what. After reading, discussing and trying I’ve released my own opinion. For me, the best dev. env. is ECLIPSE. Cause, it’s free, fast and very convenient. Yes, there is one unpleasant moment: it may close unexpectedly. But you can find the reason in web-search.

Anyway, no better IDE ever.