Skip to content

Instantly share code, notes, and snippets.

View vigneshv01-ship-it's full-sized avatar

Vignesh Vaidyanathan vigneshv01-ship-it

  • Tata Consultancy Services
  • Chennai, India
View GitHub Profile
@vigneshv01-ship-it
vigneshv01-ship-it / create-react-app.sh
Created March 29, 2022 04:42
React Code snippets
## Terminal 1
# Create React App with TS
npx create-react-app my-app --template typescript
# Install Bootstrap
npm install react-bootstrap [email protected]
npm start
## Terminal 2
# Install SASS
npm install react-bootstrap [email protected]
@vigneshv01-ship-it
vigneshv01-ship-it / DownloadHLSVideo.txt
Created December 5, 2021 22:00
How to download HLS Video
Get the HLS Video link via videoDownloaderTool (ex: https://addons.mozilla.org/en-US/firefox/addon/video-downloadhelper/)
- example HLS Video link: https://example.video.com/VideoFile.m3u8
Have ffmpeg installed in your machine (https://ffmpeg.org/download.html)
Run in powershell or cmd with the below:
ffmpeg -i "https://example.video.com/VideoFile.m3u8" -c copy -bsf:a aac_adtstoasc "output.mp4"
@vigneshv01-ship-it
vigneshv01-ship-it / Merge_Video_Audio.sh
Created July 18, 2020 00:48
FFMPEG Merge Video + Audio
## cut video to 1 minute
ffmpeg -i video.mp4 -ss 00:00:01 -t 00:01:00 -async 1 cut.mp4
## merge video (mp4) with audio (mp3) and export as mp4
ffmpeg -i cut.mp4 -i play.mp3 -c:v copy -map 0:v:0 -map 1:a:0 output.mp4
@vigneshv01-ship-it
vigneshv01-ship-it / wp-download.sh
Created June 30, 2019 10:41 — forked from HoundstoothSTL/wp-download.sh
Download Wordpress through terminal and cleanup
#!/bin/bash
#Download the latest copy of WordPress into a directory, grab all the files in the new /wordpress folder
#Put all the files in the current directory, remove the now empty /wordpress directory
#Remove the tarball
#download latest wordpress with wget
wget http://wordpress.org/latest.tar.gz
#OR using CURL
# Change ownership with access
sudo chown -R www-data:www-data /usr/local/www/woocommerce/wp-content/
Install:
sudo apt-get install apache2 php7.0 libapache2-mod-php7.0
Verify:
a2query -m php7.0
Load:
@vigneshv01-ship-it
vigneshv01-ship-it / start.sh
Created May 10, 2019 18:10
My Personal Assistant - Ubuntu GIST
#!/bin/bash
CURRTIME=$(date +"%k")
if [ $CURRTIME -ge 00 -a $CURRTIME -lt 12 ];
then
spd-say -r -40 "Good Morning, Vignesh. How are you doing today?"
read how
else
if [ $CURRTIME -gt 12 -a $CURRTIME -le 23 ];
then
spd-say -r -40 "Good Evening, Vignesh. How was your day today?"
@vigneshv01-ship-it
vigneshv01-ship-it / LAMP_Command.sh
Created March 23, 2019 16:02
Ubuntu LAMP Command snippets
# Start Service
sudo service apache2 start
sudo service mysql start
# Check status of service
sudo systemctl status apache2.service
mv subfolder subfolder_tmp
git submodule deinit subfolder
git rm --cached subfolder
mv subfolder_tmp subfolder
git add subfolder
@vigneshv01-ship-it
vigneshv01-ship-it / WP_Code_Snippets.php
Last active September 27, 2018 03:06
Wordpress Code snippets
<?php
/**
* Manually highlight Wordpress admin menu item
*/
add_filter('parent_file', 'my_plugin_select_submenu');
function my_plugin_select_submenu($file) {
global $plugin_page;
if ('__my-current-submenu-slug__' == $plugin_page) {
$plugin_page = '__my-submenu-slug-to-select__';