Skip to content

Instantly share code, notes, and snippets.

Avatar

To Van Tran thomasalvatran

View GitHub Profile
View ubuntu-12.04-LTS-install-docker
sudo su -
# Kernels older than 3.10 lack some of the features required to run Docker containers.
uname -r
3.11.0-15-generic
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo deb https://apt.dockerproject.org/repo ubuntu-trusty main > /etc/apt/sources.list.d/docker.list
@thomasalvatran
thomasalvatran / Interview_CSE.txt
Last active Jan 28, 2022
Networking Interview questions 30 questions in 30 minutes
View Interview_CSE.txt
First part: Interview CSE Communication security establisment. Each question has 1 minute to answer.
Routing protocol OSPF algorithm
1.In your own term describe what is the Border Getaway.
3 Which ones depending only Hop Count
4 ARP request which layer of OSI
6 Why must all areas connect to an Area 0 backbone in OSPF?
5 What is used for ?
7 Clear transmit username pw which protocol? telnet sftp?
8 Write MPLS what is MPLS
9 Write OSPF what is OSPF
@thomasalvatran
thomasalvatran / fill_shape_2.c
Last active Mar 31, 2019
2D Array (Matrix)
View fill_shape_2.c
#include <stdio.h>
#include <malloc.h>
#include <memory.h>
const int COLS = 7;
const int ROWS = 9;
void matriscopy (void * destmat, void * srcmat)
{
memcpy(destmat,srcmat, 9*7*sizeof(int));
}
View test18_printshape.c
#include <stdio.h>
/* Implement your Sort class here. */
void checkStar(int i)
{
if (i > 9)
printf("*");
else
printf("%d", i);
View Odd_Even.cpp
#include <stdio.h>
#include <iostream>
#include <vector>
using namespace std;
class Integer
{
int num;
public:
@thomasalvatran
thomasalvatran / Abstract_Class.cpp
Last active Jan 29, 2019
Cache LRU Least Recently Used
View Abstract_Class.cpp
//https://www.hackerrank.com/challenges/abstract-classes-polymorphism/problem
//Ans: https://github.com/leocamello/HackerRank/blob/master/Domains/C%2B%2B/Classes/Abstract%20Classes%20-%20Polymorphism/main.cpp
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <cassert>
using namespace std;
@thomasalvatran
thomasalvatran / Google_MAP_API_lnglat_with_search.php
Last active Jan 28, 2022
Google MAP API with search using API Key
View Google_MAP_API_lnglat_with_search.php
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Places Search Box</title>
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
@thomasalvatran
thomasalvatran / Google_MAP_Country_Need_API.php
Created Jan 23, 2019
Google MAP inquire for country need to provide API key
View Google_MAP_Country_Need_API.php
<!DOCTYPE html>
<html>
<head>
<title>Demo One</title>
<style type="text/css">
#map_canvas { width: 500px; height: 500px; }
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <!--NO LONGER WORK -->
@thomasalvatran
thomasalvatran / Google_MAP_lnglat_No_API.php
Last active Jan 23, 2019
Google MAP inquire for lgn and lat no API_KEY is required
View Google_MAP_lnglat_No_API.php
<!DOCTYPE html>
<html>
<head>
<title>Demo Two</title>
<style type="text/css">
#map_canvas { width: 500px; height: 500px; }
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
View index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Read JSON From github</title>
</head>
<body>
<script>