Skip to content

Instantly share code, notes, and snippets.

View dmadan86's full-sized avatar

Madan dmadan86

View GitHub Profile
@dmadan86
dmadan86 / docker-examples.md
Created October 21, 2019 19:29 — forked from thaJeztah/docker-examples.md
Some docker examples

Commit, clone a container

To 'clone' a container, you'll have to make an image of that container first, you can do so by "committing" the container. Docker will (by default) pause all processes running in the container during commit to preserve data-consistency.

For example;

docker commit --message="Snapshot of my container" my_container my_container_snapshot:yymmdd
@dmadan86
dmadan86 / script2Image.js
Created October 21, 2019 07:00
JS to Image
var _canvas = require('canvas'),
fs = require('fs');
fs.readFile('jquery.js', 'utf8', function (err,data) {
if (err) {
return console.log(err);
}
var stringData = data,
dataLen = stringData.length,
@dmadan86
dmadan86 / install-gcc.sh
Created July 19, 2019 07:05
Install GCC any version
#!/bin/bash
# this script installs GCC
# to use it navigate to your home directory and type:
# sh install-gcc.sh veersion
# download and install gcc
wget https://ftp.gnu.org/gnu/gcc/gcc-$1/gcc-$1.tar.gz
tar xzf gcc-$1.tar.gz
cd gcc-$1
@dmadan86
dmadan86 / helpful-docker-commands.sh
Created February 5, 2019 08:41 — forked from garystafford/helpful-docker-commands.sh
My list of helpful docker commands
###############################################################################
# Helpful Docker commands and code snippets
###############################################################################
### CONTAINERS ###
docker stop $(docker ps -a -q) #stop ALL containers
docker rm -f $(docker ps -a -q) # remove ALL containers
docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter
# exec into container
@dmadan86
dmadan86 / application.js
Created June 6, 2016 04:10 — forked from dshaw/application.js
socket.io application and haproxy configuration
var express = require('express');
var redis = require('redis');
const serverType = process.argv[2];
const serverHost = process.argv[3];
const serverPort = parseInt(process.argv[4]);
const redisPort = 6379;
const redisHost = '127.0.0.1';
@dmadan86
dmadan86 / gist:a2d633ff15dba44dcde6
Created February 13, 2016 10:23 — forked from alexmcpherson/gist:97a4160c08a5e06a0acb
Google.com <enter> interview question

This was my very first take with no research on what happens when you press in Chrome with Google.com in the address bar:

  • press enter on keyboard
    • some switch gets connected
    • hardware encodes signal for key to go over USB
    • sends signal over USB
  • computer gets enter signal
    • driver gets signal from keyboard
    • signal translated into an OS-level event probably was pressed
  • OS knows what program has focus, dispatches event to that program
@dmadan86
dmadan86 / gist:8482ec791a99f6f05f23
Created February 13, 2016 10:13 — forked from 0x8badf00d/gist:83e9c7ad92cf1e2a9b95
Google Interview Prep
1) Algorithm Complexity - Big-O
2) Sorting - Merge, Insert, Bubble
3) Hashtables - Implement using Arrays
4) Trees - Binary, n-ary, trie-trees; balanced binary tree - Red/Black tree, splay tree, AVL tree
Tree traversal algorithm - BFS, DFS ; difference between inorder, postorder, preorder
5) Graphs - Representation of graphs using: objects and pointers, matrix, adjacency list
Graph traversal algorithm - BFS, DFS
A* and Dijkstra
6) Data Structures - NP-complete problems: traveling salesman and knapsack problem
7) Discrete Mathematics - combinatorics and probability

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go