lbottaro
lbottaro
Reputation Top 1%
Luca Bottaro
157 Snippets  (4th place)
Published
4 Channels
Created
43 Channels
Following
Sep 13, 2016
Last Visit
Jul 2, 2012
Registered
77696 points  (4th place)
Reputation
Top 1% Publisher
Junior Code Generator
Serious Code Generator
Senior Code Generator
Master Code Generator
Guru Code Generator
Junior Publisher
Serious Publisher
Senior Publisher
Master Publisher
Guru Publisher
Junior Topic Hub
Serious Topic Hub
Senior Topic Hub
Master Topic Hub
Junior Trend Maker
Serious Trend Maker
Senior Trend Maker
Master Trend Maker
Junior Influencer
Serious Influencer
Senior Influencer
Junior Commenter
Serious Commenter
Senior Commenter
Master Commenter
Junior Judge
Serious Judge
Senior Judge
Master Judge
Junior Popular Coder
Serious Popular Coder
Senior Popular Coder
Master Popular Coder
Guru Popular Coder
Junior Autobiographer
Serious Autobiographer
Senior Autobiographer
Junior Geek Aggregator
Serious Geek Aggregator
Junior Famous Coder
Serious Famous Coder
Senior Famous Coder
Master Famous Coder
Guru Famous Coder
Junior Wise Coder
Master Wise Coder
Guru Wise Coder

Recent Snippets See all snippets by lbottaro

public by lbottaro created Jun 17, 2015  2796  0  7  1

Stored Procedure to solve error about Agent XPs in SQL Server on Maintenance Plan

This is how to solve the error in Microsoft SQL Server Management Studio, when trying to create a Maintenance Plan. The error you get is the following. Error Message: ‘Agent XPs’ component is turned off as part of the security configuration for this server. A system administrator can enable the use of ‘Agent XPs’ by using sp_configure. For mo
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Agent XPs', 1;
GO
RECONFIGURE
GO            
;

public by lbottaro created Apr 17, 2015  2454  1  6  0

How to create a Java HashMap and iterate through keys and values

This is how to simply create a templated Map, using HashMap and loop through its keys and values
final Map<String, Object> myMap = new HashMap<String, Object>();
        myMap.put("key1", "true");
        myMap.put("key2", "123");

for (Map.Entry<String, Object> entry : myMap.entrySet())
{
    System.out.println(entry.getKey() + "/" + entry.getValue());
}                                                          
;

public by lbottaro created May 28, 2015  2503  8  6  0

How to use curl to send HTTP POST using file

Using curl you can send POST request, putting the content of your request in a separated file. Usage options: -d: where some contents to post --header : specify the content type of your request (eg json/xml/text)
For a RESTful HTTP POST containing XML:

curl -X POST -d @filename.txt http://example.com/path/to/resource --header "Content-Type:text/xml"
or for JSON, use this:

curl -X POST -d @filename.txt http://example.com/path/to/resource --header "Content-Type:application/json"
This will read the contents of the file named filename.txt and send it as the post request.
;

public by lbottaro created Apr 22, 2015  2383  15  7  1

How to git diff a file version excluding space differences

This git command allows to get differences on local modified file ignoring space or blanks as changes
>git diff --ignore-space-change myFile.txt            
;

public by lbottaro created Apr 22, 2015  2166  4  5  0

How to copy file remotely using scp in Linux

The scp command copies from a location to a remote path. In this example, the remote server is Linux based and the command will use 'root' as username and will copy into the /tmp directory. Root password will be requested before transferring file.
>scp myFile.txt root@1.2.3.4:/tmp/
;