Skip to content

Instantly share code, notes, and snippets.

View Ashwinning's full-sized avatar

Ashwin Sinha Ashwinning

View GitHub Profile
@Ashwinning
Ashwinning / version-control-your-bash-rc-file-with-gist.md
Last active October 4, 2023 00:09
Version control your `.bashrc` file (or any other file) with Github Gist #gistblog #ubuntu #bash

Version control your .bashrc file with Github Gist

Install Gist on your machine

If you have ruby installed (how to install ruby):

sudo gem install gist

‌If you're using Bundler:

@Ashwinning
Ashwinning / __YoutubeMp3DownloadAndSplit.md
Last active July 21, 2023 15:25
Python Youtube MP3 Splitter #gistblog #python

Python Youtube MP3 Splitter

A Python program that splits mp3 files from YouTube albums into individual songs.

Dependencies

  • Python 2.7+
  • ffmpeg

Getting Started

@Ashwinning
Ashwinning / EnableDisableHyperV.md
Created June 9, 2016 00:22
Powershell scripts to enable disable Hyper-V.

Open Powershell as admin

To Enable

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V –All

To Disable

Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All
@Ashwinning
Ashwinning / OpenCVTextureinOpenGL.md
Last active May 21, 2023 11:54
Using webcam video as texture in OpenGL

OpenCV Texture in OpenGL.

The following code was found at http://www.alecjacobson.com/weblog/?p=1875

The page suffered from bad formatting so the contents have been pasted here for easier readibility.

// Modified from "Video Texture" code
// Copyright (C) 2009  Arsalan Malik (arsalank2@hotmail.com)
//                                                                            
@Ashwinning
Ashwinning / GetRandomVector3Between.cs
Last active April 19, 2023 18:45
Find a random point between two Vector3 points. #gistblog #unity3d #c#
/// <summary>
/// Returns a random vector3 between min and max. (Inclusive)
/// </summary>
/// <returns>The <see cref="UnityEngine.Vector3"/>.</returns>
/// <param name="min">Minimum.</param>
/// <param name="max">Max.</param>
/// https://gist.github.com/Ashwinning/269f79bef5b1d6ee1f83
public Vector3 GetRandomVector3Between (Vector3 min, Vector3 max)
{
return min + Random.Range (0, 1) * (max - min);
@Ashwinning
Ashwinning / AddBashonUbuntuonWindowsToContextMenu.md
Last active April 11, 2022 14:31
Add Bash on Ubuntu on Windows to context menu #gistblog #ubuntu #bash #windows

Add Bash on Ubuntu on Windows to context menu

Bash on Ubuntu on Windows (installation instructions) is a Linux Subsystem for Windows.

To add it to the Windows right click context menu, perform the following steps:

  • Open regedit from the run menu Win + R.
@Ashwinning
Ashwinning / HowToOpenAnotherTerminal-BashInstanceInARunningDockerContainer.md
Last active February 17, 2022 18:26
How To Open Another Terminal/Bash Instance In A Running Docker Container #gistblog #bash #docker

How To Open Another Terminal/Bash Instance In A Running Docker Container

Add the following to your bashrc.

#Add another docker window
function dock()
{
  if [ "$1" == "-h" ]
 then
@Ashwinning
Ashwinning / how-to-disable-microsoft-virtual-wifi-network.md
Created July 15, 2016 07:14
How to disable wifi microsoft virtual wifi adapter.

How to disable Microsoft WiFi Direct Virtual Adapter


**I think ** this is how it worked

As Admin

netsh wlan stop hostednetwork
@Ashwinning
Ashwinning / OpenPowershellAsAdminOnRight-Click.md
Last active December 28, 2020 10:57
Open Powershell as Admin on Right-Click (Context Menu) #gistblog #windows #powershell

Open Powershell as Admin on Right-Click

I described how to set a context menu option to open a Powershell console on right click earlier.

To open Powershell as admin on right click, we can add a command to be executed on start to our registry entry like so

$stpath = pwd; Start-Process PowerShell -ArgumentList \"-NoExit\", \"-Command cd $stpath\" -verb RunAs

So our Command in the registry entry will look like the following

@Ashwinning
Ashwinning / Super Simple Python Timer.md
Last active December 27, 2020 00:40
Super Simple Python Timer #gistblog #python

Super Simple Python Timer

Timer module for python to measure elapsed time.

Import

Copy Timer.py to the same folder as your python files.

Linux

wget "https://gist.githubusercontent.com/Ashwinning/313a4bed6af3f7599ac168c4de82b555/raw/Timer.py"