Embed A Document Using Google Docs

You can embed a document viewer for any PDF or PPT using Google Docs.

You will get something similar to this:

The code I used for the above is:

1
<iframe src="http://docs.google.com/gview?url=https://agora.cs.illinois.edu/download/attachments/10456143/vim.pdf?version=1&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>

Or in general:

1
<iframe src="http://docs.google.com/gview?url=DOCUMENT_URL_HERE&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>

Where DOCUMENT_URL_HERE should be replaced by the document’s URL ;)

via Google Operating System.
Smile ;)

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Tags: ,

Sunday, September 27th, 2009 Google No Comments

Re-Use A Bash Command With Different Parameters

Suppose you have typed and executed this command in your Linux shell:

1
./script_a.sh 1.23 && ./script_b.sh 1.23 && ./script_c.sh 1.23.45

Now you want to run the same command, but with 2.34 instead of 1.23
A nice way to do it is this:

1
!!:gs/1.23/2.34

Meaning, run the last command (!! is also called ‘bang bang’, and it’s substituted by the last command you executed), and replace every instance of 1.23 by 2.34

via Unix Bash Scripting.
Have fun ;)

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Tags: ,

Sunday, September 27th, 2009 Bash No Comments

Make Shell Scripts Executable By Default

If you use vim to write shell scripts, you might want to save the “chmod +x” command after saving the script.

By adding the following line to your vimrc file (typically, it’s located at ~/.vimrc), scripts will automatically become executable.

au BufWritePost * if getline(1) =~ “^#!” | if getline(1) =~ “/bin/” | silent !chmod a+x <afile> | endif | endif

(meaning, if the file includes #! with “/bin/” in the path, apply “chmod a+x” on this file).

via shell-fu.

Have fun ;)

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Tags: , , ,

Saturday, September 26th, 2009 Vim No Comments

Fetch Links From Twitter Into Your RSS Reader

Twitter streams are usually full of links, most of them are shortened by a URL shortener, and filtering them might be time consuming.

A cool service, Readtwit, solves this problem intelligently: Using Readtwit, you can easily create a RSS feed of all links appearing in your twitter stream. The service will fetch the links, and send the full story to your RSS reader. It allows you to filter the tweets (block people and block hashtags).

Neat and time-saving. Try it and have fun ;)

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Tags: , ,

Saturday, September 26th, 2009 Twitter No Comments

Google Reader Useful “Send To” Services

Recently, Google have added a “send to” feature to Google Reader, which allows one to share an item in social networks (Facebook, Twitter, etc…).

The greatest thing in this feature is, that Google allows you to add custom sites to the “Send To” destinations. A few nice sites are listed below:

1. Download item as PDF (via)

Name: Save as PDF
URL: http://savepageaspdf.pdfonline.com/pdfonline/pdfonline.asp?cURL=${url}
Icon URL: http://www.adobe.com/lib/com.adobe/template/icon/pdf.gif

› Continue reading

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Tags: , ,

Saturday, September 26th, 2009 Google No Comments

Tools to Improve the Quality of Your Code

Just found a nice link at Wikipedia with a collection of tools to help analyzing the quality of your code.

One interesting one is PMD (for Java), which is opensource. It statically analyses your code and alerts for potential problems.

For C, there is splint (opensource as well), which statically analyses your code for potential coding mistakes and security vulnerabilities.

The full list at Wikipedia is here.

Another great tool, which is not directly related to the above, is Valgrind. While the above statically analyze your code (i.e., they find potential problems by “just looking at the code”), Valgrind is a tool for dynamic analysis, which means, it analyses the code by monitoring the way it runs. It can report possible memory leaks, possible deadlooks, and many other information. (The full tool suite description can be found here). The output of Valgrind is not very easy to read, but with a little practice one can feel more comfortable with it.

There is also a list of tools for dynamic analysis at Wikipedia. It’s located here and may be worths a glance.

Enjoy coding ;)

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Tags: ,

Saturday, September 26th, 2009 Programming No Comments

Computer Security Articles

I just found a great collection of computer security related articles. They’re informative yet simple and well explained.
One interesting article is the “Buffer Overrun Attacks” found here.
The complete collection can be found here.

via rootsecure.net

Enjoy :)

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Tags: , ,

Sunday, September 6th, 2009 Security No Comments

Trimming Bash Variables – A Summary

This post should summarize the subject of stripping out bash variables, we already talked about on previous posts

Let’s say we have a bash variable (say x), which stores a string (say “ExExampleStringStr”)

Then we can do the following manipulations:

1.

1
y=${x%Str*}

This will trim out the shortest match of the pattern “Str*” from the end of the string.
Thus, y will have the value “ExExampleString”.
› Continue reading

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Tags:

Saturday, September 5th, 2009 Bash No Comments

Free Programming Books

A great collection of freely available programming books in various languages (Bash, C, C++, Java, Perl, Python and more) is available in this link via stackoverflow.com

Enjoy ;)

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Tags: ,

Saturday, September 5th, 2009 Ebooks No Comments

Strip Leading Characters Off A String

Say you have a bash variable (say x) storing the string “MyLongString”

This bash command:

1
    echo ${x##My}

Will strip the leading string “My” off the original string. And thus the output will be:

LongString

via @bashcookbook

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Tags: ,

Friday, September 4th, 2009 Bash No Comments
my email
my photo
Hi,
My name is Amir Watad. I have a BSc. in biomedical engineering from The Biomedical Engineering school , Technion , Israel, and a BSc. in electrical engineering from The Electrical Engineering school , Technion , Israel.
I'm a Verification Engineer in Mellanox Technologies Ltd.
I love Linux, the Command Line and the OpenSource Community.
I used to write Poems (Arabic) when I was able to find time for this.
June 2012
S M T W T F S
« Sep    
 12
3456789
10111213141516
17181920212223
24252627282930
SEO Powered by Platinum SEO from Techblissonline

Twitter links powered by Tweet This v1.7.4, a WordPress plugin for Twitter.