During you are working in your office, you might need to share some files with your friends temporarily. You don't need to find a pen drive or scp the files by asking passwords...etc. Below describes a simple way of sharing them over HTTP.
1. Open your terminal
2. Go to the directory you want to share the files
3. Execute the below command
python -m SimpleHTTPServer 8000
4. Then access the files using a browser http://[your_ip_address]:8000
Once the file sharing finished, simply exit the console.
Friday, July 10, 2015
Tuesday, July 7, 2015
Checking out and tracking a remote branch
When you work with GIT, you might have multiple remote branches for various reasons such as to distinguish releases, new feature developments...etc. So, you need to checkout those remote branches and need to track on those.
After pulling from master branch the execute the below command with your remote branch name.
After pulling from master branch the execute the below command with your remote branch name.
git checkout --track -b remote_branch_name origin/remote_branch_name
Push a new local branch to remote and tracking in GIT
This is an easier way of creating a remote feature branch. First you need to create a local branch from master and then push it to the remote and tracking also will get enabled on that.
git checkout master
git pull
git checkout -b feature_branch_name
git push -u origin feature_branch_name
git checkout master
git pull
git checkout -b feature_branch_name
git push -u origin feature_branch_name
Monday, July 6, 2015
Rolling back Transactions for checked exceptions
If you are a developer of enterprise applications with Java related technologies, then transaction management is a critical area for your enterprise applications. In transaction management, we have container managed transactions(CMT) and bean managed transactions(BMT).
Most of the scenarios, we would like to go ahead with container managed transactions where you need demarcate the methods of your service layer with the transaction attributes. When using container managed transactions, it rollbacks the transactions only for run time exceptions either you used EJB or Spring transactions.
But, there might be some requirements to rollback your transactions for specific checked exceptions as well. Here if you are using EJB CMT, then your specific checked exception class needs to be applied with @ApplicationException(rollback=true) annotation.
But in Spring, the approach is more flexible as you don't need to apply any annotations for exception class. You have more options with the below attributes with roll backing transaction along with the @Transactional annotation.
Most of the scenarios, we would like to go ahead with container managed transactions where you need demarcate the methods of your service layer with the transaction attributes. When using container managed transactions, it rollbacks the transactions only for run time exceptions either you used EJB or Spring transactions.
But, there might be some requirements to rollback your transactions for specific checked exceptions as well. Here if you are using EJB CMT, then your specific checked exception class needs to be applied with @ApplicationException(rollback=true) annotation.
But in Spring, the approach is more flexible as you don't need to apply any annotations for exception class. You have more options with the below attributes with roll backing transaction along with the @Transactional annotation.
- rollbackFor - Optional array of exception classes that must cause rollback.
- rollbackForClassName - Optional array of names of exception classes that must cause rollback.
- noRollbackFor - Optional array of exception classes that must not cause rollback
- noRollbackForClassName - Optional array of names of exception classes that must notcause rollback
Fixing incorrect HTTPS Port re-direction in Wildfly 8.0 with a Spring secured web application
Due to an operational issue, I had to downgrade the Wildfly 8.2 deployment into a Wildfly 8.0 deployment. Then a strange issue occurred as despite all the correct configurations in place for enabling the Spring security and HTTPS.
Problem was, when incorrect login details entered, redirection URL comes with an incorrect port where it goes with the AWS load balancer's actual port. But with the Wildfly 8.2 it is working correctly as expected.
When searching for a solution, found the below discussion
https://github.com/undertow-io/undertow/pull/125
This where the beauty of Wildfly modules comes into play. Simply I replaced the existing undertow 1.0 (Web implementation of wildfly) to the undertow 1.0.3 in Wildlfy modules and changed it's module xml. So the solution worked perfectly.
Problem was, when incorrect login details entered, redirection URL comes with an incorrect port where it goes with the AWS load balancer's actual port. But with the Wildfly 8.2 it is working correctly as expected.
When searching for a solution, found the below discussion
https://github.com/undertow-io/undertow/pull/125
This where the beauty of Wildfly modules comes into play. Simply I replaced the existing undertow 1.0 (Web implementation of wildfly) to the undertow 1.0.3 in Wildlfy modules and changed it's module xml. So the solution worked perfectly.
Solving 'ORA-01882: timezone region not found' in SQL Developer
Recently I installed latest version of Oracle SQL Developer and got an error when I was trying to connect to a remote database as 'ORA-01882: timezone region not found'.
Here is the way to fix it.
Here is the way to fix it.
- Go to the installation directory of Oracle SQL Developer.
- Open the file located at:
sqldeveloper/bin/sqldeveloper.conf - At the end of file, add the following line:
AddVMOption -Duser.timezone=GMT+5.30.
Subscribe to:
Comments (Atom)