Java – initialize string array
Initialize string array using curly braces {}
Linux – find listening ports
Sometimes it is useful to find what ports a machine is listening to. Here are some use cases: Display listening ports $ netstat -l Display read more
Enable query log without restarting mysql on Linux
Steps to enable mysql query log on mysql server without restarting mysql process on Ubuntu and other Linux flavours. Set general_log_file on SQL prompt: SET read more
Chrome – copy any request as cURL including headers
Chrome developer tools has a pretty handy feature to copy any GET/POST request in network tab to cURL. This also copies all headers involved in read more
Mac – how to change desktop icons size
Mac desktop icons size can be increased or decreased using Desktop view options. There are steps: Click anywhere on blank Desktop area. Click on View read more
Python clone/copy array
Python cloning an array (list) using slice operator.
Java Hello World
Here is a basic hello world java program. Run the following to compile and run it. $ javac HelloWorld.java $ java HelloWorld
CSS padding inside a box
CSS padding property specify the width of the padding area of a box. padding values padding property can be used to specify padding-top, padding-right, padding-bottom, read more
CSS margin area of a box
CSS margin property specify the width of the margin area of a box. margin values margin property can be used to specify margin-top, margin-right, margin-bottom, read more
Javascript – remove first item from array
Javascript code to remove first item from array using arr.shift() Remove first item from array