Skip to content

Instantly share code, notes, and snippets.

View sushruth's full-sized avatar
👋

Sushruth Sastry sushruth

👋
View GitHub Profile
@sushruth
sushruth / Instructions.md
Last active May 26, 2016 20:17
Solution for annoying license agreements on chocolatey on Windows

Automatically accept license agreement in Chocolatey on WIndows

Are you annoyed by the license agreement prompts while installing Windows software through Chocolatey ? Run this once in command window (not sure if you need admin privileges)

choco feature enable --name allowGlobalConfirmation
@sushruth
sushruth / info.md
Created May 26, 2016 20:22
Git fetch all remote branches

Git snippet to get all branches from remote

Source : Wookie88 on StackOverflow

git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
@sushruth
sushruth / content.md
Created May 27, 2016 15:50
Remove folders from git

Removing a folder from git (from being tracked)

If you ever wanted to remove an existing tracked folder from git but not delete the actual folder (other than by using .gitignore file), run this in your terminal

git rm -r --cached YOUR_DIRECTORY_OR_FILE_NAME_HERE

From the grub rescue> prompt, type this command.

Code:

ls

You should see some listing of drive and partition in this format. hd0,3 would translate to the first hard drive and partition 3. Note the hard drive numbering starts at 0 but the partition numbering starts at 1.

Then follow these commands. If you get any errors or have any questions, just post them.

#cloud-config
hostname: "cachy.org"
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQzoN2PgwJ+ly5dbVay2O2+LZNPmc1x03e6Pig348+X+ESnnyk3VWectCIrTUD0Dy7QAJmInFfcm8FgqhKsx0BL2sjW/np2XwgNOUfWS02qOuaOCyZmWWG6X5+XUWeaWci+CoFNFKdYfH7jrE4YDToYr+rnegjKocJgcgtoV5XQuUF0dwOPAQltw3KY/9ZrvLDnElDY9ySfOmwzNeUc0R8SW1DrfweJsi4HsiXW2mdIVRaK4xOOKqjxYh3tk22ANfHXCoADFBcMpNVsJ6i8PJdUjExS5FQW8SK/6ZtfVdpxVDWAiFCz1RUiMObroY46LEPfegY7eJQLPakDoN7utcZ MSI\sushr@MSI
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDi7a4PYwobazN0pfL1VvF/eTEcFccMLDXZuaTIdAC9kPHNjVu4L5hwVE/jyFvNgysmxkbHbU9GEMIk2+D4gnR8gEU5qvC82l3lYWcrmq9Yyvj+UYK6YBpU4kUtMrQH8H8IYSYj78uF5J+kOZ4A2OThPne1IFQJJL63HNmw5DlGX5yppYBCE3fHRYmKS0AwMwWGYb5/MPaHFzbMPjblV4kPBeQOaxdBJvOS/IlOAq59RswL/BY2ndwyL6wxFoXJxaCAB4vr+DIs4LqhLj4IWsHVrcWWLhhbv89O6nN+UWlFDjMMkOzh9FC+khUpbDdvub2U51rwyHoV0ynFXeJIVIr6LEEw0aY8WpSvib4mrPP8lz/Jkq6HimP+uJfH1C4ANkdjIAPlCSAkRU9i33yR6lLEt3WJsQmlcUiTRIPkN1WIjV0HFSuO4C1twJroaP6jFfB5zA434BcrcbP3C207l/74PbSJHwOPKeG3t4l5Z2+Z5iEOrWli92D3i+t6Wd/fmHwWxQPd0yVgvhES

Here is the command you could run to open a particular URL in Edge browser (Win 10)

start microsoft-edge:http://windowsclan.com
@sushruth
sushruth / GRE.md
Last active September 15, 2016 01:58

GRE

The motivation behind the exam

The GRE exam was mainly designed as a complete aptitude test for undergraduates aiming for higher studies. Usually it tests all-round ability of survival in a higher education institution, making sure you have enough prerequisite knowledge though probably unrelated to your area of study directly, but still used in the daily business of that area. Like, having enough knowledge in English to understand publications textbooks and general professor level communication, having enough knowledge in math to be able to grasp concepts easily, etc. GRE is mainly for technology fields but students from other fields also take this exam.

Points to note

  • GRE score is not sufficient for university selection criteria
  • The score expires every 5 years per person
@sushruth
sushruth / matlab.md
Last active September 13, 2016 18:33

Everything is case sensitive :

N = 1000; % size of the array
fs = 8000;

noise = randn(1,N);

Fnoise = fft(noise);

#Source http://stackoverflow.com/a/14711517

  1. Why is the WebSockets protocol better? WebSockets is better for situations that involve low-latency communication especially for low latency for client to server messages. For server to client data you can get fairly low latency using long-held connections and chunked transfer. However, this doesn't help with client to server latency which requires a new connection to be established for each client to server message. Your 48 byte HTTP handshake is not realistic for real-world HTTP browser connections where there is often several kilobytes of data sent as part of the request (in both directions) including many headers and cookie data. Here is an example of a request/response to using Chrome: Example request (2800 bytes including cookie data, 490 bytes without cookie data):
GET / HTTP/1.1
Host: www.cnn.com