Skip to content

Instantly share code, notes, and snippets.

View phucnguyenv's full-sized avatar

Phuc Nguyen V. phucnguyenv

  • Ho Chi Minh - Vietnam
View GitHub Profile
@phucnguyenv
phucnguyenv / can.txt
Created July 3, 2017 08:55
Controller Area Network Protocol Family (aka SocketCAN)
============================================================================
can.txt
Readme file for the Controller Area Network Protocol Family (aka SocketCAN)
This file contains
1 Overview / What is SocketCAN
@phucnguyenv
phucnguyenv / cpp_testbed.cpp
Last active May 20, 2022 16:29
C++ testbed
#include <iostream>
/* implementing virtual functions */
class B
{
public:
B() { f1(); }
/* compilers typically number the virtual functions in the order
in which they're declared */
virtual ~B() {}
alt + tab: switch between program
alt: focus on menu and use arrow keys up, down, left, rift
shift + F10: Right click
ctrol + esc: start menu
alt + down arrow: open drop down list box
alt + f4: close current program
alt + enter: open properties for the selected object
@phucnguyenv
phucnguyenv / gist:678ebbda7466a2abdce8
Last active August 29, 2015 14:27
tcpdump basic commands
tcpdump [options] [protocol] [type]
options: -n : display no. not names
-nn : no. for machine and port
-i : sniff particular interface
-v : verbose (-vv or -vvv)
-w : dump packet to file
-r : read packets from file
-x : print hex
-X : print HEX and ASCII
@phucnguyenv
phucnguyenv / gist:03538b6ac601c4c77c59
Last active August 29, 2015 14:27
C#: Read a file into byte array
// Read a file into byte array
internal static byte[] ReadFile (string fileName)
{
FileStream f = new FileStream(fileName, FileMode.Open, FileAccess.Read);
int size = (int)f.Length;
var data = new byte[size];
size = f.Read(data, 0, size);
f.Close();
return data;
}