Skip to content

Instantly share code, notes, and snippets.

View harikt's full-sized avatar
⛱️
Tanvish Technologies

Hari K T harikt

⛱️
Tanvish Technologies
View GitHub Profile
@harikt
harikt / youtube.txt
Created April 18, 2023 12:50 — forked from iredun/youtube.txt
Youtube API get thumbnail image
Each YouTube video has 4 generated images. They are predictably formatted as follows:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg
The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg
For the high quality version of the thumbnail use a url similar to this:
@harikt
harikt / Howto.md
Created December 23, 2021 06:20 — forked from brentjanderson/Howto.md
SSH Tunneling with Firefox

Sometimes it is useful to route traffic through a different machine for testing or development. At work, we have a VPN to a remote facility that we haven't bothered to fix for routing, so the only way to access a certain machine over that VPN is via an SSH tunnel to a machine that is reachable over the VPN. Other times, I have used this technique to test internet-facing requests against sites I am developing. It is pretty easy, and if you don't use firefox regularly, you can treat Firefox as your "Proxy" browser and other browsers can use a normal configuration (Although you can also configure an entire system to use the proxy, other articles exists that discuss this potential).

  1. Open a terminal

Set the base image to Ubuntu must be first instruction - use docker search to find images

FROM ubuntu # <image>
FROM ubuntu:latest # - <image>:<tag>
FROM ubuntu:precise (LTS)

Set the maintainer info

@harikt
harikt / gist:c149f7d52e57a73b1e7adbf5af36e920
Created October 28, 2020 13:46 — forked from tayvano/gist:6e2d456a9897f55025e25035478a3a50
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@harikt
harikt / zookeeper-solr-cloud.md
Created October 13, 2020 11:35 — forked from kalharbi/zookeeper-solr-cloud.md
Setting up an external Zookeeper Solr Cluster

Setting up an external Zookeeper Solr Cluster

This is a step by step instruction on how to create a cluster that has three Solr nodes running in cloud mode. These instructions should work on both a local cluster (for testing) and a remote cluster where each server runs in its own physical machine. This was tested on Solr version 5.4.1 and Zookeeper version 3.4.6

Installing Solr and Zookeeper

  • Download and extract Solr:
    • curl -O http://archive.apache.org/dist/lucene/solr/5.5.3/solr-5.5.3.tgz
    • mkdir /opt/solr
@harikt
harikt / SolrQuerySyntaxPrimer.md
Created July 13, 2020 15:26 — forked from mankyKitty/SolrQuerySyntaxPrimer.md
The documentation around the basics of the Solr query syntax is terrible, this is an attempt to alleviate the doc-shock associated with trying to learn some fundamentals.

Solr Query Syntax Basics

This is a super basic beginners guide to Solr Lucene query syntax. We're going to cover running a straightforward query, as well as some of the more useful functionality such as filtering and creating facets. We'll point out some things you can't do and generally give you enough instruction so that you can get yourself into trouble.

For testing you need a REST client capable of sending requests to your Solr instance. Either RESTClient for Firefox or Postman for Chrome are good choices.

Misc

Request Specific Fields

To specify a list of fields to return instead of the default Solr response use fl and provide a comma delimited list of fields:

@harikt
harikt / ubuntu_agnoster_install.md
Created October 22, 2019 06:51 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@harikt
harikt / log (example)
Created July 2, 2019 05:02 — forked from zaydek-old/log (example)
Example of some source code: this quotes the stock market (e.g. <2k stocks) at one-second intervals for all unique quotes throughout the day
$ head AAPL
09:30:00.000 166.6400
09:30:02.000 166.3000
09:30:03.000 166.2400
09:30:04.000 166.2050
09:30:05.000 166.2900
09:30:06.000 166.1500
09:30:07.000 166.2450
09:30:08.000 166.0675
09:30:09.000 166.0200
@harikt
harikt / APACHE_content-security-policy.conf
Created April 18, 2017 15:00 — forked from wkhayrattee/APACHE_content-security-policy.conf
APACHE to NGINX | content-security-policy.conf
# REF: https://github.com/h5bp/server-configs-apache/blob/master/src/security/content-security-policy.conf
<IfModule mod_headers.c>
Header set Content-Security-Policy "script-src 'self'; object-src 'self'"
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
Header unset Content-Security-Policy
</FilesMatch>
</IfModule>
@harikt
harikt / example.php
Created March 21, 2017 09:35 — forked from hikari-no-yume/example.php
function chaining for PHP 7
<?php declare(strict_types=1);
require_once "✨.🐘";
✨($_)->strlen("foo")->var_dump($_);