Skip to content

Instantly share code, notes, and snippets.

View thomasalvatran's full-sized avatar

To Van Tran thomasalvatran

View GitHub Profile
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 August 28, 2023 17:29
Networking Interview questions 30 questions in 30 minutes
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 March 31, 2019 11:37
2D Array (Matrix)
#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));
}
@thomasalvatran
thomasalvatran / test18_printshape.c
Created February 24, 2019 17:25
Print Shape in C
#include <stdio.h>
/* Implement your Sort class here. */
void checkStar(int i)
{
if (i > 9)
printf("*");
else
printf("%d", i);
@thomasalvatran
thomasalvatran / Odd_Even.cpp
Last active February 24, 2019 17:23
Class Output
#include <stdio.h>
#include <iostream>
#include <vector>
using namespace std;
class Integer
{
int num;
public:
@thomasalvatran
thomasalvatran / Abstract_Class.cpp
Last active January 29, 2019 20:37
Cache LRU Least Recently Used
//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 January 28, 2022 10:22
Google MAP API with search using API Key
<!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 January 23, 2019 15:14
Google MAP inquire for country need to provide API key
<!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 January 23, 2019 15:17
Google MAP inquire for lgn and lat no API_KEY is required
<!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">
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Read JSON From github</title>
</head>
<body>
<script>