AWS Glacier CLI Command

Archived some of my files in Glacier for cold storage, jot down some note which I think useful.

To Download

Response as below, “InProgress” indicate it’s currently retrieving your vault information.

OK, tried few hours later and it showed “Succeeded”, go on…

Get archive list with command below which will lead to output written in archive.json.

Then create a json file with sample content below indicate which archive to download (I use download.json in this case)

Then execute command below:

You get response as:

Check the status job status:

Come back few hours/minutes, check the status and it’s now turn to “Succeeded”

Finally you can download your file with command below:

To Upload

To Delete

 

Credit to: softwaredevelopmentstuff.com & madboa.com

 

Docker: exec user process caused “no such file or directory”

Have no idea why Docker showing this (un-friendly) error message.
In fact, it caused by the bash script file created in Windows having different line ending and cannot run properly in Linux container.

Here is the fix using Notepad++.
First show the linefeed symbol.

You will see this.

Convert the linefeed from Windows to Unix.

You will get this, and save it 🙂

 

MSSQL Configuration Tips

Happened to me hence jot down here for future reference, perhaps helpful to you also 🙂

Try to configure the TCP port as below from Sql Server Configuration Manager:

Try to configure as below from Microsoft SQL Server Management Studio:

 

Java Runtime Class Reload

Some call it hot deploy, some refer to runtime class reload/redefine, but whatsoever….
It is just mechanism to reload compiled class file during jvm runtime, to avoid ordinary java development life cycle of “code change -> build -> deploy”, which will significantly save lot’s of wait time (especially when you have multiple modules dependency project).

Both open source project: HotSwapAgent and Spring-Loaded works pretty well for me, but if you are looking for commercial product, JRebel will be the choice.

 

Windows Multiple Tab Terminal

I have been using Cygwin quite sometime for my development task before ubuntu bash on Windows. Even Windows can group similar program into single task bar icon but open different type of console still occupying task bar spaces and most importantly, it doesn’t look nice since all of them are console for me.

non-multitab

so I use Console to manage it.

console2

Everything working fine except it cannot maximize by clicking on the top right maximize icon, until I found ConEmu which solve my problem and I’m start using it from now on. Of course maximize the windows is just one of the highlight here and many more configuration is available.

multitab-terminal

If you notice from the image, I open Ubuntu Bash, PowerShell, Cygwin, Git Bash and Command Prompt in different tab 🙂

 

 

Refused to get unsafe header “Content-Disposition”

Hit into this error when tying to get the “Content-Disposition” header using XMLHttpRequest.

Finally found the solution is to include CORS access control headers in HTTP response….

Take note that it’s not Access-Control-Allow-Headers but Access-Control-Expose-Headers

Credit to this stackoverflow post.

 

Business Hour Format

I’m creating a form which allow user to key in multiple days of week with multiple operation hours.

I want the format to save as below, but I found it tedious to reformat for displaying using normal javascript. Look into lodash and found it very handy 🙂

Format to display:

Plunker here

Reference: schema.org