Thursday, March 7, 2013

Bookmarks Organizer Google Chrome Extension

Bookmarks Organizer Google Chrome Extension helps us in keeping the bookmarks sorted. By default Chrome does not sort bookmarks by title. This extension monitors for newly added or moved bookmarks and auto arranges them in ascending order by title. There is a reorder button to manually order the whole bookmark, which can be used initially after installation. The only down side is that there is API restriction on the number of bookmarks that can be reordered (moved) per min, per hour and the number is a bit low.

This extension is available at Chrome Web Store. The code is licensed under GNU GPL v3 and is available at the github repository.

Update on Thu 08 June 2023
This extension is now featured in the Chrome Web Store!

Monday, March 4, 2013

Copy Files with Excludes

The cp command does not have an excludes option. One way to copy files ignores some files or directories is to create a tarball. The tar command has an exclude option. The exclude patterns can be mentioned in a separate file and passed in to the tar command.
# Directory Structure
BO
│ .git
│ .gitignore
│ books.html
│ book.js
│ build.sh
│ buildExcludes
│ main.js
│ manifest.json

├───bin
│ └───BO
│ │ books.html
│ │ books.js
│ │ main.js
│ │ manifest.json
│ │
│ └───res
│ └───icons
│ bo-128.png
│ bo-16.png
│ bo-256.png
│ bo-32.png
│ bo-48.png
│ bo-512.png
│ bo-64.png

└───res
└───icons
bo-128.png
bo-16.png
bo-256.png
bo-32.png
bo-48.png
bo-512.png
bo-64.png
bo.fla
In the above directory structure, I want to copy certain file to bin/BO but ignore others like .git, fla files in the res/icons directory, the build scripts etc. For that first create an file say buildExcludes with the exclude pattern.
Content of the exclude file is given below.
.git
.gitignore
bin
res/icons/*.fla
build.sh
buildExcludes
Create the tar, deflate to the destination directory and delete the tar once done.
tar -cvf bo.tar * -X buildExcludes  #create tar
tar -xvf bo.tar -C bin/BO/ #deflate to destination directory
rm -f bo.tar #cleanup