How to Receive Files in your Google Drive from Anyone

A school teacher wants to have a public drop box (not Dropbox) where students can upload homework assignments. A recruiter wants to have an online form where job applicants can upload their resumes. A news organization may need a public drop box where people can upload files anonymously.

Google Forms would have been a perfect solution here but unfortunately you cannot upload files to Google Drive through Forms.

The other option is to have a shared folder inside Google Drive but there are limitations. One, you need a Gmail Account and should be invited by the folder owner to upload files in a shared folder. Second, all collaborators can view and even remove files that have been uploaded in a shared folder on Google Drive.

Drive Form with File Uploads

Receive Files in Google Drive with Forms

What you can do is create a regular web form (written in HTML and CSS) and then use Google Apps Script to post the content of this form into Google Drive.

Before diving into the implementation, take a look at this sample form. When you upload a file, it will show up in a specific folder on my Google Drive. You don’t even need to have a Google Account to upload files and the Google Script based form even works on mobile devices.

  • Click here to make a copy of the Google Script into your Google Drive.
  • This is vanilla form with a text field, a file input field and a form submit button. You can open the form.html file to apply your own CSS styles or add more input and textarea fields.
  • From the Run menu, choose doGet and authorize the script. The script needs these permissions since the form will be uploading files to your Google Drive.
  • Next choose Deploy as Web App from the Publish menu. Click Save New Version, choose Anyone, even Anonymous from the drop-down and click the Deploy button.

The Google Script will now offer you a form URL. Anyone can now use this form to upload files to your Google Drive.

<form id="myForm">

    <label>Your Name</label>
    <input type="text" name="myName">

    <label>Pick a file</label>
    <input type="file" name="myFile">

    <input type="submit" value="Upload File" 
               onclick="google.script.run
                        .uploadFiles(this.parentNode);
                        return false;">
</form>

This is a bare-bones version of the form but it can be further enhanced through Apps Script. For instance, you may choose to save the form details in a Google Spreadsheet along with the Drive URLs of the uploaded files. The script can even email you the uploaded files as attachments similar to Mail Merge.

[*] If this looks a bit too technical, you can ask guests to send you files as email attachments and then use the Gmail to Google Drive program to automatically save these file attachments in your Drive.

[**] If you aren’t on Gmail or Google Apps, you can still receive files in Dropbox from anyone anonymously.

Awesome Google Scripts → Custom Google Scripts →


This story, How to Receive Files in your Google Drive from Anyone, was originally published at Digital Inspiration on 23/04/2014 under Google Drive, Internet

How to Track When People Print Web Pages on your Site

You have made your website printer-friendly but you are not too sure if people are actually printing any of web pages. And if they are, you would probably like to know how frequently they print pages from your site and what kind of content is printed more often.

There are multiple ways to print a web page.

You may use the File->Print menu in the browser or press the Ctrl+P keyboard shortcut (or Command+P on a Mac) to send the current web page to the printer. Some web pages have a dedicated PRINT button on the page itself that internally executes the window.print() method to print the document.

We therefore need a solution that can track and capture the print action on a web page irrespective of the method that was originally used to send that page to the printer. That’s where Google Analytics will help.

Track Printed Web Pages with Google Analytics

What we need to do is add an invisible 1×1 tracking image — similar to the one we used for Gmail read receipts — – to the printed version of our web pages. Now when a site visitor prints a web page, through any route, the Analytics tracking image will download on their computer and print action will be recorded into your Google Analytics.

The implementation is really easy. Simply copy-paste this code above the closing </body> tag in your website template. If you are on WordPress, you can paste the code in your footer.php file. Do remember to replace UA-1234-56 with your actual Google Analytics Profile ID.

<script>

var googleAccountID = "UA-1234-56";

function s4() {
    return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
}

function guid() {
    return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
}

(function(){

  var GIF = "https://ssl.google-analytics.com/collect?v=1&t=event" +
      "&ec=print&tid=" + googleAccountID + "&cid=" + guid() +
      "&z=" + (Math.round((new Date()).getTime() / 1000)).toString() +
      "&ea=" + encodeURIComponent(document.title) +
      "&el=" + encodeURIComponent(document.location.pathname);

  var rule = "body:after{content:url(" + GIF + ")}";
  var head = document.head || document.getElementsByTagName('head')[0];
  var css  = document.createElement('style');

  if (css && head) {

      css.setAttribute("type",  "text/css");
      css.setAttribute("media", "print");

      if (css.styleSheet) { // For IE
          css.styleSheet.cssText = rule;
      } else {
          css.appendChild(document.createTextNode(rule));
      }

      head.appendChild(css);
      
      /* Written by Amit Agarwal - labnol.org */
  }

})();

</script>

Once you have added the tracking JavaScript code to your web pages, log in to your Google Analytics dashboard, go to Real Time –> Events and choose Print for the event category. Alternatively, for old reports, you should go to Behavior -> Events report.

Also see: QR codes for Printed Pages

How Print Tracking with Analytics Works?

The above JavaScript code adds the following CSS rule to your web page. It append the Google Analytics tracking image to the page but the rule is only trigger when the print stylesheet is active.

<style type="text/css" media="print">
  body:after {
        content:url(GOOGLE_ANALYTICS_TRACKING_IMAGE);
  }
</style>

Some PDF writing programs also use the Print stylesheet when saving web pages to PDFs and thus, the same tracking code will work in those cases as well.


This story, How to Track When People Print Web Pages on your Site, was originally published at Digital Inspiration on 21/04/2014 under Google Analytics, Print, Internet

My Online Income Report – March 2014

Historically, March has always been one of my busiest months thanks to tax season.

When I’m busy “offline”…you guessed it…I’m highly unproductive online.  Fortunately, that wasn’t the case this March.  Despite the heat of tax season and being overall busier-than-normal at work, I still found time to continue working on my online projects (except for this income report, which is being published much later than usual!).

In fact, it was one of my best months in awhile (although still not great compared to what it once was – last March, I earned over $2,000 online).  Part of that was due to a non-recurring payment that I received, and although it won’t be something I’ll have in April, it was still a sign of good things to come.

Let’s see what else happened in March…

One Dilemma I’m Slowly Realizing

Before we get to the numbers, I want to point out a dilemma that I started to realize in March.

As you know, I’ve been running a daily blog over at The Daily Interview.  It’s been a time consuming endeavor, but one that I’ve enjoyed.  It’s truly been amazing meeting so many different people and learning about their stories and successes.

The problem is, simply maintaining the site’s basic operations (i.e. publishing content 5 days a week) consumes nearly all of my time dedicated to online work.  This is a problem – not only because it doesn’t leave me much time to work on other projects (which I’m OK with for the time being), but it doesn’t actually leave me time to work on the growth and monetization of The Daily Interview.

You see, publishing daily content isn’t enough.  Sure, there will be gradual organic growth and traffic, but there needs to be more.  A good product doesn’t always sell itself.

I have a partial solution for this, which I’ll explain in more detail below.

Now, on to the income report…

Freelance Writing Income

  • None!

Other Article-Related Income:

Squidoo

  • Amazon: $0.00
  • Revenue Sharing: $1.63

InfoBarrel

  • Revenue Sharing: $2.57
  • Amazon: $0.00

Total Writing Income: $4.20

Lending Club

Lending Club, as I’ve written about many times, is one of my favorite online passive income sources, because I believe it’s my only source of truly passive income. What I mean by this is, once you select your investments (which only takes a few minutes), you sit back and collect the monthly payments which include a repayment of your initial investment + a relatively high rate of interest.

If you’re interested – here’s the strategy I have used to select my investments. It’s pretty simple, as you’ll find.

Here are the statistics for this past month:

  • Annualized rate of return: 6.09% (+.11% from the previous month)
  • Number of loans: 200 (same as previous month)

If you’re interested in trying Lending Club, you can sign up with this link and get a free account. Investments can be made for as little as $25. I am an affiliate for Lending Club, so if you have any questions about it, I’d be more than happy to answer them in the comments (or feel free to contact me by e-mail).

Prosper

Prosper.com is another site where I invest, which is a social lending platform very similar to Lending Club.

Here are the statistics for this past month:

  • Annualized rate of return: 14.34% (no change from the previous month),
  • Number of loans: 4 (no change from the previous month).

It may seem that I’m doing much better here compared to Lending Club, but that’s somewhat misleading. Because I only invest in 4 loans (vs. 200 at Lending Club), and none of them have defaulted, my rate of return % is going to be very high.

I think I still prefer Lending Club to Prosper, only because you have more flexibility in choosing investments, and there is more transparency overall. I don’t think there’s anything wrong with investing on both platforms though; I will continue to do so.

If you’re interested, you can create a Prosper account here.

Here’s a summary of my niche site earnings:

  • Amazon: $10.42
  • Media.net: $0.00
  • Chitika: $0.00
  • InfoLinks: $0.00
  • Commission Junction: $0.00
  • Total: $10.42

The Daily Interview

As I mentioned near the start of this income report, time has become a real limiting factor in growing this website.  I have the time to keep up with the content, but not enough time to work on growing traffic and actually monetize the traffic.

Recently, I made a small change to the schedule of the site’s interviews.  While I am keeping up the “daily” interview model, I’m shortening the schedule to Monday through Thursday (instead of Friday).  This is a 20% reduction in the time I spent with the site’s content, which should allow me to have time for other things (in theory).

I think this change benefits the audience as well.  Posting five times a week can be overwhelming for a reader too, and may not allow each individual interview to get the attention it deserves. Overall, I feel pretty good about this decision, and hopefully it will allow me to do more and improve the site’s chance for success.

Now, for the numbers…

I thought it might be interesting this month to look at the search engine presence for this site, which is something I haven’t talked about or focused on myself.  After all, this site is really more about social media engagement – I haven’t put any time into SEO.

Here’s a look at the search queries for March from Google’s Webmaster Tools:

This graph shows the site’s impressions on Google – in other words, the number of times The Daily Interview shows up in someone’s search results.  As you can see, the site’s search engine presence continues to grow.

Traffic on the other hand was pretty similar to February.  Again, I know the site can grow slowly on its own (just by publishing more content), but to get significant growth, I need to put more time into promotion (for example, writing guest posts).

If you’re interested in reading the interviews, but may not remember to check the site daily, I send a short summary of each interview once a week, and you can check out whatever interview may interest you.

If you’d like to get the digest once a week (don’t worry – I’m not sending you anything else), you can sign up here:






Here’s what the site earned last month:

  • Amazon: $1.81
  • Other: $250.00
  • Total: $251.81

You’re probably wondering about the “Other” income of $250….

This was a one-time payment from one of the site’s guests as an incentive to try out his service (a unique advertising platform that is free to use as a publisher).  I’m keeping it a mystery for now because I plan to do a full-fledged write up on it later once I’ve used it for a month or two.

I’m happy to finally make some real money with The Daily Interview, but because this was a one time payment, I expect April to drop back down to virtually nothing.

Undisclosed Authority Site

This site is inactive, but continues to earn a bit of money.

  • Media.net: $0.66
  • Indeed.com: $0.92
  • Total: $1.58

Slow Carb Diet Experiments

  • Amazon: $17.97
  • Media.net: $1.40
  • Total: $19.37

Total Authority Site Earnings: $272.76

Here’s the breakdown for affiliate and other income earned during March. [Note: This income comes from other sites not discussed/listed above, including affiliate sales generated through this blog.]

Total Misc. Affiliate Earnings: $328.58

Income Summary

Here’s a summary of March’s earnings, organized by category:

  • Freelance Writing: $4.20
  • Niche Sites: $10.42
  • Authority Sites: $272.76
  • Misc. Affiliate Income: $328.58

Grand Total for March: $615.96 (+$289.91 from February)

Easily my best month so far this year, but still far away from where I want and need to be.  I won’t complain about a step forward though. :)

These were my top 5 most popular blog posts in March based on number of views:

1) 142+ Ways to Make Money Online

2) Is CashCrate Legit? Here’s My CashCrate Review

3) My Online Income Report – February 2014

4) How to Make Money Online by Losing Weight (Not as Crazy as it Sounds)

5) How to Make $2,000 Per Month Writing for InfoBarrel

How did March turn out for you? I’d love to hear from you in the comments!

If you enjoyed this income report, subscribe to the RSS feed (if you haven’t already) so that you don’t miss any future updates.

Also, follow me on Twitter and say hi!

-------------

Thanks for subscribing to my feed! For more great content, check out my Muse Creation Newletter for tips, tricks, and ideas that I won't share on my blog.

Also, follow me on Twitter!

Thanks again!

My Online Income Report – March 2014

Save your Gmail Attachments to Google Drive Automatically

Your email messages in Gmail have attachments – images, documents, videos, etc. – and you can automatically save them all to a specific folder inside Google Drive using the Send to Google Drive. The latest version lets you specify a list of file types and only file attachments belonging to those types will be saved to your Google Drive.

If you haven’t used Send to Google Drive before, here’s how it works.

You specify a Gmail label name in the sheet and the script will scan all your existing and incoming email messages inside that label for attachments. You can say “inbox” to monitor the inbox folder, or specify a user label or say “all” to monitor every folder in your Gmail mailbox. If the script finds an attachment, the file is downloaded to your Google Drive.

You neither have to install any browser extensions nor do you have to grant access to your Gmail or Google Drive to a third-party. And since Google Drive synchronizes with your mobile device and desktop, the saved email attachments will instantly become available on all your other devices.

Save files attachments from Gmail to any Google Drive folder.

Save files attachments from Gmail to any Google Drive folder.

Save Gmail Attachments to Google Drive

Here’s a step by step guide on how you can setup the Send to Google Drive program for your Gmail account. It takes less than a minute.

  1. Click here to create a copy of the Send to Google Drive sheet in your Google Drive.
  2. Open the sheet and you should see a new Gmail Attachments menu at the top (see screenshot). Choose Authorize (Step #1) and grant the necessary permissions. This is an open-source Google Script) that runs in your own Google account and no one else will have access to any of your data.
  3. Click the Gmail Attachments menu again and select Run (step #2). Close the Google sheet and the script will begin downloading attachments from Gmail to your Google Drive in the background.

The program will monitor the specified Gmail label every five minutes and as soon as it finds a message that has attachments, it will automatically save the file(s) to a folder in your Google Drive.

Once the attachments have been saved, a new label — Processed — is applied to the Gmail message indicating that the message has been processed by the script. It saves all types of attachments but you can also specify a list of extensions separated by commas.

If you would like to stop the script later, open the same Google Sheet and choose Uninstall from the Gmail Attachments menu.

Send to Google Drive – Premium

The premium version supports even more features:

  1. Whitelist Filetypes – You can specify a list of filetypes and the script will only save attachments that are the specified type. For instance, you can say jpg,gif,png to save only image attachments or say all to save every single file attachment irrespective of the file type.
  2. Nested Google Drive Folders – You can choose to save email attachments in a single folder or specify sub-folders per Gmail label. For instance, say \\Main Folder\\Sub Folder to save files in the sub folder under the main folder.
  3. Nested Gmail Labels – It can monitor Gmail messages that are under nested Gmail labels or folder.
  4. Monitor Multiple Labels – While the free version only supports one Gmail label, the premium version can help you save email attachments from one or more Gmail labels.
  5. Google Drive Organized – The free version dumps all Gmail attachments to one Google Drive folder while the premium version organizes them in sub-folders thus keeping your Drive cleaner and more organized.
  6. Premium Support – You can opt for the $49.99 edition for instant support.


Refer to this PDF Manual to know more about the premium version. Should you be interested, use the PayPal button to upgrade.

Awesome Google Scripts → Custom Google Scripts →


This story, Save your Gmail Attachments to Google Drive Automatically, was originally published at Digital Inspiration on 16/04/2014 under GMail, Google Drive, Internet

Better Ways to Embed Tables and Spreadsheets in Web Pages

It is easy to embed tabular data in  web pages. You can either use the standard <table> HTML tag or you can input the tabular data in a spreadsheet — like Excel Online or Google Spreadsheets — and embed the sheet in your web pages.

HTML tables are easy while spreadsheet based tables allow better formatting and complex layouts – like nested tables within a table – without fiddling with the code. Here are the different ways by which you can embed tables in your website and their pros and cons.

How to create an HTML table

If you have access to a WYSIWYG editor like Dreamweaver, you can easily create an HTML table using the built-in wizards but I prefer using Markdown for creating tables as it requires no tags. Go to gist.github.com (you don’t even need an account here) and enter the table  in the following format:

Column A | Column B
-------- | -------
Cell A1 | Cell B1
Cell A2 | Cell B2

Each column is separated by a pipe (|) while hyphens (-) indicate the table headings. Name the gist table.md (.md indicates markdown language) and click the “Create Secret Gist” button to render the markdown as a table.

Once you click the Save button, the gist will show you the visual table which you can copy-paste into any rich-text editor like the Gmail compose window. Alternatively, you can right-click the table on Github and choose Inspect Element to view the actual HTML tags for that table.

excel to html

Tableizer is another simple tool for converting spreadsheet data into HTML table code. Create a table inside Excel or the Numbers app on your desktop, copy the cells and paste it inside Tableizer. It will generate the HTML code that can be used on your blog or website.

Embed Google Sheets in your Website

A popular option for embedding tabular data in a web page is through Google Docs (Spreadsheets). The advantage with this approach is that you can modify the data in the spreadsheet and embedded table will update itself to reflect the edits. There’s no need to edit the web page containing the table.

Go to spreadsheets.google.com, enter some data in the sheet and the choose the Publish to the Web option from the File menu. Choose Start Publishing and Google Drive will offer you the IFRAME embed code for that particular sheet.

The embedded sheet – see live version – will preserve the original formatting of the cells but it will still be a static HTML document – there’s no option for sorting or filtering data in the HTML table.

Embed Excel Sheets in Web Pages

This is my favorite method for embedding spreadsheet data in web page and I’ll soon explain why.

Go to office.live.com and create new blank workbook. Enter the tabular data inside the Excel sheet and then choose File -> Share -> Embed -> Generate HTML.

Excel, unlike Google Docs, allows you to embed a select range of cells and not the entire spreadsheet. You can also include a download link in the embedded cells making it easier for your website visitor to download and open the table in their local spreadsheet app. The embedded spreadsheet also offers better copy-paste than Google Docs.

Here’s a live version of an HTML table embedded using the Excel web app.

Related: Capture Web Tables into Excel

Make Static HTML Tables Interactive

If you wish to go with static HTML tables, instead of interactive spreadsheet based tables, you can consider adding the Excel button that will make your HTML tables interactive.

You have the regular HTML code for your <table> and all you have to do is add another HTML tag to your web page that will turn the embedded static table into an interactive sheet – — see this live version.

<a href="#" name="MicrosoftExcelButton"></a>

<table>
  <thead><tr>
    <th>Column A</th>
    <th>Column B</th>
    </tr></thead>
  <tbody>
    <tr>
      <td>Cell A1</td>
      <td>Cell B1</td>
    </tr>
    <tr>
      <td>Cell A2</td>
      <td>Cell B2</td>
    </tr>
  </tbody>
</table>

<script type="text/javascript" src="http://r.office.microsoft.com/r/rlidExcelButton?v=1&kip=1"></script>

This code will add a little Excel button next to your HTML table and when someone clicks that button, it creates a beautiful and interactive view of table with support for sorting and filtering. You can even visualize the HTML table as graphs without leaving the page.

HTML Tables or Spreadsheets?

The advantage with static HTML tables is that they are SEO friendly (search engines can read your HTML table) while spreadsheet based tables are not. The latter however allow better formatting options and are relatively easy to update.

If you wish to have the best of both worlds, go with an HTML table and use the Excel interactive view that will let viewers interact with the table on demand.

Related Guide: How to Embed Anything in a Website


This story, Better Ways to Embed Tables and Spreadsheets in Web Pages, was originally published at Digital Inspiration on 16/04/2014 under Embed, Microsoft Excel, Software

Useful FFmpeg Commands

FFmpeg is an extremely powerful and versatile command line tool for converting audio and video files. It is free and available for Windows, Mac and Linux machines. Whether you want to join two video files, extract the audio component from a video file, convert your video into an animated GIF, FFmpeg can do it all and even more.

Extract the audio from a video file with this simple FFmpeg command.

Extract the audio from a video file with this simple FFmpeg command.

Useful FFmpeg Commands

FFmpeg supports all popular audio and video formats. Or you can running the command ./ffmpeg -formats to get a list of every format that is supported by your FFmpeg installation. If you are just getting started, here are some commands that will give you good idea of the capabilities of this tool.

1. Cut video file into a smaller clip

You can use the time offset parameter (-ss) to specify the start time stamp in HH:MM:SS.ms format while the -t parameter is for specifying the actual duration of the clip in seconds.

ffmpeg -i input.mp4 -ss 00:00:50.0 -codec copy -t 20 output.mp4

2. Split a video into multiple parts

If you want to split a large video into multiple smaller clips without re-encoding, ffmpeg can help. This command will split the source video into 2 parts – one ending at 50s from the start and the other beginning at 50s and ending at the end of the input video.

ffmpeg -i video.mp4 -t 00:00:50 -c copy small-1.mp4 -ss 00:00:50 -codec copy small-2.mp4

3. Convert video from one format to another

You can use the -vcodec parameter to specify the encoding format to be used for the output video. Encoding a video takes time but you can speed up the process by forcing a preset though it would degrade the quality of the output video.

ffmpeg -i youtube.flv -c:v libx264 filename.mp4
ffmpeg -i video.wmv -c:v libx264 -preset ultrafast video.mp4

4. Join (concatenate) video files

If you have multiple audio or video files encoded with the same codecs, you can join them into a single file using FFmpeg. Create a input file with a list of all source files that you wish to concatenate and then run this command.

ffmpeg -f concat -i file-list.txt -c copy output.mp4

5. Mute a video (Remove the audio component)

Use the -an parameter to disable the audio portion of a video stream.

ffmpeg -i video.mp4 -an mute-video.mp4

6. Extract the audio from video

The -vn switch extracts the audio portion from a video and we are using the -ab switch to save the audio as a 256kbps MP3 audio file.

ffmpeg -i video.mp4 -vn -ab 256 audio.mp3

7. Convert a video into animated GIF

FFmpeg is an excellent tool for converting videos into animated GIFs and the quality isn’t bad either. Use the scale filter to specify the width of the GIF, the -t parameter specific the duration while -r specifies the frame rate (fps).

ffmpeg -i video.mp4 -vf scale=500:-1 -t 10 -r 10 image.gif

8. Extract image frames from a video

This command will extract the video frame at the 15s mark and saves it as a 800px wide JPEG image. You can also use the -s switch (like -s 400×300) to specify the exact dimensions of the image file though it will probably create a stretched image if the image size doesn’t follow the aspect ratio of the original video file.

ffmpeg -ss 00:00:15 -i video.mp4 -vf scale=800:-1 -vframes 1 image.jpg

9. Convert Video into Images

You can use FFmpeg to automatically extract image frames from a video every ‘n’ seconds and the images are saved in a sequence. This command saves image frame after every 4 seconds.

ffmpeg -i movie.mp4 -r 0.25 frames_%04d.png

10. Merge an audio and video file

You can also specify the -shortest switch to finish the encoding when the shortest clip ends.

ffmpeg -i video.mp4 -i audio.mp3 -c:v copy -c:a aac -strict experimental output.mp4
ffmpeg -i video.mp4 -i audio.mp3 -c:v copy -c:a aac -strict experimental -shortest output.mp4

11. Resize a video

Use the size (-s) switch with ffmpeg to resize a video while maintaining the aspect ratio.

ffmpeg -i input.mp4 -s 480x320 -c:a copy output.mp4

12. Create video slideshow from images

This command creates a video slideshow using a series of images that are named as img001.png, img002.png, etc. Each image will have a duration of 5 seconds (-r 1/5).

ffmpeg -r 1/5 -i img%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p slideshow.mp4

13. Add a poster image to audio

You can add a cover image to an audio file and the length of the output video will be the same as that of the input audio stream. This may come handy for uploading MP3s to YouTube.

ffmpeg -loop 1 -i image.jpg -i audio.mp3 -c:v libx264 -c:a aac -strict experimental -b:a 192k -shortest output.mp4

14. Convert a single image into a video

Use the -t parameter to specify the duration of the video.

ffmpeg -loop 1 -i image.png -c:v libx264 -t 30 -pix_fmt yuv420p video.mp4

15. Add subtitles to a movie

This will take the subtitles from the .srt file. FFmpeg can decode most common subtitle formats.

ffmpeg -i movie.mp4 -i subtitles.srt -map 0 -map 1 -c copy -c:v libx264 -crf 23 -preset veryfast output.mkv

16. Crop an audio file

This will create a 30 second audio file starting at 90 seconds from the original audio file without transcoding.

ffmpeg -ss 00:01:30 -t 30 -acodec copy -i inputfile.mp3 outputfile.mp3

17. Change the audio volume

You can use the volume filter to alter the volume of a media file using FFmpeg. This command will half the volume of the audio file.

ffmpeg -i input.wav -af 'volume=0.5' output.wav

18. Rotate a video

This command will rotate a video clip 90° clockwise. You can set transpose to 2 to rotate the video 90° anti-clockwise.

ffmpeg -i input.mp4 -filter:v 'transpose=1' rotated-video.mp4

This will rotate the video 180° counter-clockwise.

ffmpeg -i input.mp4 -filter:v 'transpose=2,transpose=2' rotated-video.mp4

19. Speed up or Slow down the video

You can change the speed of your video using the setpts (set presentation time stamp) filter of FFmpeg. This command will make the video 8x (1/8) faster or use setpts=4*PTS to make the video 4x slower.

ffmpeg -i input.mp4 -filter:v "setpts=0.125*PTS" output.mp4

20. Speed up or Slow down the audio

For changing the speed of audio, use the atempo audio filter. This command will double the speed of audio. You can use any value between 0.5 and 2.0 for audio.

ffmpeg -i input.mkv -filter:a "atempo=2.0" -vn output.mkv

Stack Exchange has a good overview to get you started with FFmpeg. You should also check out the official documentation at ffmpeg.org or the wiki at trac.ffmpeg.org to know about all the possible things you can do with FFmpeg.

Also see: Essential Linux Commands


This story, Useful FFmpeg Commands, was originally published at Digital Inspiration on 14/04/2014 under Audio, Video Editing, Internet

Easily Unsubscribe from all LinkedIn Emails

LinkedIn is trying to reinvent itself as a social network for professionals and they are now sending way too many email notifications that one never really asked for. Whether it’s your colleague’s birthday, someone just completed two years at their current job or someone you know just joined LinkedIn – there’s a notification for everything.

linkedin

The worst part is that LinkedIn offers no one-click button for quickly and easily unsubscribing from all these email notification in one go. You have to select at least 20 drop-down boxes to unsubscribe yourself from every single email that LinkedIn can send to your mailbox.

Fortunately, there’s a solution in the form of a bookmarklet authored by @chengyin [via @webaficionado].

LinkedIn Unsubscribe

Drag the bookmarklet to your browser’s address bar, then go to the LinkedIn’s email settings page and click the bookmarklet link in the address. It will change the email frequency setting for every notification as “no email” thus saving your mailbox from the LinkedIn clutter.

Internally, the LinkedIn bookmarklet executes a series of JavaScript commands to automatically select the “No Email” option in drop-down boxes and then hits the Submit button to save your changes. Here are some more useful bookmarklets.

$('.settings li select:has(option[value=never])').val('never');
$('.settings li select:has(option[value=WEB])').val('WEB');
$('.settings li select:has(option[value=NEVER])').val('NEVER');
$('.settings li select:has(option[value=NONE])').val('NONE');
$('.settings li select:has(option[value=false])').val('false');
$('input[type=submit]').prop('disabled', false).click();

This story, Easily Unsubscribe from all LinkedIn Emails, was originally published at Digital Inspiration on 07/04/2014 under Bookmarklet, Linkedin, Internet

The 10 HTML Codes You Need to Know for Writing on the Web

The computer keyboard creates “dumb” punctuation marks that may not be acceptable in printed work but are common on web pages. It outputs straight quotation marks (") while your writing may require curly quotes. You can only type hyphens using the keyboard while an em or en dash may have made your text look more elegant and professional.

HTML Entities for Punctuation

HTML Entities for Punctuation

HTML Codes for Punctuation

Your keyboard lacks the keys for inserting the correct punctuation marks but there are simple HTML character codes, on entities, that you can use to mimic the typography of printed books on the web. Here’s a quick guide to using HTML codes for inserting typographically-correct punctuation marks in web writing.

Hyphens (-)

Hyphens, or half-dashes, are most commonly used to join together two or more words. You can type a hyphen directly without using any HTML codes.

  • The next-generation iPhone is expected to become available in mid-September.
  • The word email contains no hyphen but there’s one inside e-books and e-commerce.

Dashes (– —)

Dashes come in two sizes: the En dash (–) and the Em dash (—). The En dash is longer than a hyphen but shorten than an Em dash.

The En dash (&ndash;) is used for suggesting a range of numbers such as time periods, sports scores or page ranges.

  • Our bank is open 8a.m.–8p.m., Monday–Friday.
  • The players are disappointed after losing the match 3–1 to Spain.
  • Abraham Lincoln (1809–1865) was the 16th President of the United States.

The Em dash (&mdash;) is used to indicate breaks or pauses in a sentence, to quote sources or to separate a series of words within a phrase.

  • We plan to visit London this summer — if the visa is approved.
  • My three friends — John, Peter and Richards — are moving to New York.
  • “Well done is better than well said.” — Benjamin Franklin.

Ellipsis (…)

An ellipsis (&hellip;) is a series of three dots (periods) and two spaces in a row and they are used to indicate omission of one or more words in the quoted material. If the ellipses follow a complete sentence, end that sentence with a period, insert a space, then the ellipsis (…) followed by a space.

  • “All the world’s a stage, and all the men and women merely players.…” — Shakespeare
  • “I have a dream … they will not be judged by the color of their skin but by the content of their character.” — Martin Luther King, Jr

Quotes & Apostrophes (‘ ’ “ ”)

Your computer keyboard creates straight quotes (or dumb quotes) though what you really need to use are smart quotes (or curly quotes) that can be easily written in HTML. The dumb quotes are best used for writing programming code.

Use double quotation marks (&ldquo; and &rdquo;) to identify the exact words of a person, to indicate irony or for writing titles of creative works.

  • The last episode of “Friends” was the most-watched program of the year.
  • Thoreau said that “that government is the best which governs the least”.
  • They recalled the “toy safety” buttons as they were contained lead paint.

Use single quotes (&lsquo; and &rsquo;) to indicate quotes within quotes. The right curly quotation mark (&rsquo;) can also be used for smart apostrophe instead of the straight apostrophe.

  • John said, “I told her, ‘the traffic will only get worse.’”
  • Her answer was, “I’ll call you in the next hour or so.”

Prime (′ ″)

While we often use apostrophe (') or quotation marks to indicate units of measurement (like feet or seconds or degrees), the correct symbol is Prime that are likely slightly slanted quotes written as &prime; (single) and &Prime; (double).

  • The height of this Ferrari car is 47′8″
  • I am currently at 27° 11′ 45.315″N, 78° 1′ 27.1668″ W.

Web Typography: Further Reading & Resources

Punctuation MarkSymbolHTML EntityCode Decimal
Apostrophe&rsquo;&#8217;
En dash&ndash;&#8211;
Em dash&mdash;&#8212;
Ellipsis&hellip;&#8230;
Single Quote (open)&lsquo;&#8216;
Single Quote (close)&rsquo;&#8217;
Double Quote (open)&ldquo;&#8220;
Double Quote (close)&rdquo;&#8221;


This story, The 10 HTML Codes You Need to Know for Writing on the Web, was originally published at Digital Inspiration on 07/04/2014 under English, Internet

How to Force the Browser to Remember the Username and Password

When you enter your username and password to log into a website, Google Chrome will prompt you to remember the password. If you accept, Chrome saves the password internally and the next time you open that site, it will auto-fill the username and password fields for you.

The password-saving feature is available in all modern browsers but some websites, maybe for security reasons, disable this option for their login forms. For instance, the PayPal website doesn’t allow the browser to remember your password and thus you are forced to enter the password every time you open PayPal. Some banks websites do that as well.

TL;DR — Use the Remember Password extension for Chrome and it will force the browser to remember passwords even if the site has disabled the option.

You can force the browser to remember your password

You can force the browser to remember your password

How Websites Disable Password Saving

Websites can easily disable the auto-fill option for login forms by setting autocomplete=off for the password field. For instance, if the login form is written as below, the browser will never prompt the user to save the password field because form autocompletion is turned off.

<form>
 <input type="text" name="username">
 <input type="password" name="password" autocomplete="off">
</form>

Force the Browser to Remember Password

Now that you know how websites turn off the option to remember passwords, getting around this problem is simple.

You can set the autocomplete attribute of the password fields on a web page to on (if they are off) and you’ll be able to save passwords. Here’s a piece of JavaScript that will automatically turn on autocomplete for all password fields on a web page.

  var fields = document.querySelectorAll('input[type="password"]');
  for (var i = 0; i < fields.length; i++) {
    fields[i].autocomplete="on";   
  }

No, you don’t have to worry about the code as there’s a simple extension for Chrome – Remember Password – that does it automatically for you.

Install the Remember Password extension and then open a site like PayPal that does not allow you to save passwords. Login with your username & password and the browser will now prompt you to remember the password.

Also see: The Best Google Chrome Extensions


This story, How to Force the Browser to Remember the Username and Password, was originally published at Digital Inspiration on 04/04/2014 under Google Chrome, Password, Software

How to Delete your Google Chrome History Selectively

Would you not like Google Chrome (and Google) to keep a record of websites that you have visited recently? Well you can remove your browsing history from Chrome in two easy steps. Type chrome://history in the browser’s address bar, click the “Clear Browsing Data” button and your history will be deleted permanently.

Quickly select items in your Google Chrome history

Quickly select items in your Google Chrome history (video)

Remove Chrome History Selectively

Now consider a slightly different scenario. You want to preserve most of the browsing history in Chrome but would like to selectively remove certain items from the history. Maybe you want to remove all traces of visits to a particular website. Or you are trying to remove all web pages from Chrome’s history that contain a particular keyword.

That’s not difficult either. Use the search box in the Chrome history page to find web pages from a particular website, then hover your mouse over the items you wish to remove and select the checkbox. Do this for every page you need to remove and then click the “Remove Selected Items” button.

If you are to remove 50 pages from the history, you will have to select 50 different checkboxes manually. There’s no “Select All” button in Chrome’s history pages.

That can be tedious task so here’s a simple workaround that requires no Chrome extensions.

Select the checkbox against the first item in the history results and then scroll to the bottom of the history page. Now select the checkbox against the last item but keep the SHIFT key down. This will select the entire list and you can now remove them from history with a click.


This story, How to Delete your Google Chrome History Selectively, was originally published at Digital Inspiration on 02/04/2014 under Google Chrome, Software