Skip to content

Instantly share code, notes, and snippets.

View SriramSakthivel's full-sized avatar

Sriram Sakthivel SriramSakthivel

View GitHub Profile
@SriramSakthivel
SriramSakthivel / m3u8.md
Created August 4, 2018 14:36 — forked from primaryobjects/m3u8.md
How to download m3u8 and ts video movie streams.

m3u8 Downloading

  1. Open Chrome Developer tools and click the Network tab.
  2. Navigate to the page with the video and get it to start playing.
  3. Filter the list of files to "m3u8".
  4. Find master.m3u8 or index.m3u8 and click on it.
  5. Save the file to disk and look inside it.
  6. If the file contains a single m3u8 master url, copy that one instead.
  7. Run the program m3u8x.
  8. Paste the same m3u8 url in both textboxes (URL and Quality URL) and click "Headers" and set the referral url and user-agent from the request as found in Chrome.
@SriramSakthivel
SriramSakthivel / git-extract-file.markdown
Created September 3, 2017 14:20 — forked from ssp/git-extract-file.markdown
Extract a single file from a git repository

How to extract a single file with its history from a git repository

These steps show two less common interactions with git to extract a single file which is inside a subfolder from a git repository. These steps essentially reduce the repository to just the desired files and should performed on a copy of the original repository (1.).

First the repository is reduced to just the subfolder containing the files in question using git filter-branch --subdirectory-filter (2.) which is a useful step by itself if just a subfolder needs to be extracted. This step moves the desired files to the top level of the repository.

Finally all remaining files are listed using git ls, the files to keep are removed from that using grep -v and the resulting list is passed to git rm which is invoked by git filter-branch --index-filter (3.). A bit convoluted but it does the trick.

1. copy the repository to extract the file from and go to the desired branch

@SriramSakthivel
SriramSakthivel / AsyncVoidProcessTakeDown.cs
Created February 23, 2015 19:33
Async void methods takes process down in .Net 4.5 even without the config ThrowUnobservedTaskExceptions enabled="true"
class Program
{
static void Main()
{
SomeAsyncVoid();
Console.Read();
}
private static async void SomeAsyncVoid()