Applications


NotePad++: Remove multi-line (/**/) comments automatically 4

We are going to use NotePad++ replace functionality (CTRL+H) to remove all multi-line comments that are enclosed in a pair of /* and */.

While in the source file you want to edit, open up the ‘Replace’ window either from the ‘Search’ menu or by using CTRL+H.

Set ‘Search Mode’ to ‘Regular expression’ and tick the ‘. matches newline’.

In the ‘Find what:’ input type /\*(.*?)\*/\n and leave the ‘Replace with:’ input empty.

NotePad++ Remove Multi-Line CommentsTo find the next comment, you can click the ‘Find Next’ button and then hit ‘Replace’.

To make the change on all comments just hit ‘Replace All’.


Batch convert NEF photos to JPEG using ufraw

ufraw converts camera RAW images to standard image files (like jpeg).
Using the ufraw-batch we can massively convert the images in a folder in one call without the need of external scripts to invoke each separate call.

ufraw-batch --out-type=jpeg --out-path=./ ./*.NEF

In the above example we set the output type to jpeg, the folder to write the new images the one we are currently in (./) and the input all NEF files in the current folder.


Delete a paste from a private hosted Stikked installation

To delete a paste from a Stikked installation that you have database access do the following:

Visit the post you like to delete: e.g http://example.com/stikked/htdocs/view/267c4d64
From this URI we need to get the part after view which is the pid (paste ID) of the paste you want to delete. In this case we get 267c4d64.

Then, you need to login to your MySQL DB. In case you are connecting via a terminal you would be using a similar command to this:

mysql -D MY_DB -h MY_HOST -u MY_USER -p

Replace MY_DB, MY_HOST and MY_USER with your credentials, afterwards you will be prompted for you password (if any).

Once in the MySQL console, issue the following:

DELETE FROM `pastes` WHERE `pid` = "267c4d64";

The above line will find the paste we want to delete and perform the deletion.

If you want to see the structure of the pastes table issue the following: SHOW COLUMNS FROM `pastes`;

Type exit to exit the MySQL console.