Binary Data Posting with curl

You don’t need –header “Content-Length: $LENGTH”. curl –request POST –data-binary “@template_entry.xml” $URL Note that GET request does not support content body widely. Also remember that POST request have 2 different coding schema. This is first form: $ nc -l -p 6666 & $ curl –request POST –data-binary “@README” http://localhost:6666 POST / HTTP/1.1 User-Agent: curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o … Read more

How to convert a string to lower case in Bash?

The are various ways: POSIX standard tr AWK Non-POSIX You may run into portability issues with the following examples: Bash 4.0 sed Perl Bash Note: YMMV on this one. Doesn’t work for me (GNU bash version 4.2.46 and 4.0.33 (and same behaviour 2.05b.0 but nocasematch is not implemented)) even with using shopt -u nocasematch;. Unsetting that … Read more

Create timestamp variable in bash script

In order to get the current timestamp and not the time of when a fixed variable is defined, the trick is to use a function and not a variable: If you don’t like the format given by the %T specifier you can combine the other time conversion specifiers accepted by date. For GNU date, you can find the complete list of … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)