This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh -L 0.0.0.0:7875:0.0.0.0:7875 root@remote-hostname -Nf | |
tcptunnel --local-port=12001 --remote-port=12001 --remote-host=remote-hostname --stay-alive & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/test/minimal.hpp> | |
int test_main(int argc, char *argv[]) | |
{ | |
BOOST_ERROR("error"); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <memory.h> | |
#define WSC_ATTACH_STDIN_BUFFER_SIZE 1024 | |
int main() | |
{ | |
char wsc_attach_stdin_buffer[WSC_ATTACH_STDIN_BUFFER_SIZE] = {0}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int | |
ExeWindowsCmd(char *result, int reslen, const char *pszCmd) | |
{ | |
int rc = 0; | |
SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE }; | |
HANDLE hRead, hWrite; | |
if (!CreatePipe(&hRead, &hWrite, &sa, 0)) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* For Windows Only | |
* Find the network interface whose MAC address is "macstr", return the MTU size of this interface. | |
* | |
* Input parameters: | |
* ----macstr: IP address | |
* ----macsize: the buffer size of macstr | |
* | |
* Output parameters: | |
* None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* For Windows Only | |
* Find the network interface whose IP address is "ipstr", return the MAC address of this interface in output parameter (macstr), | |
* and the interface name (ifname) | |
* | |
* Input parameters: | |
* ----ipstr: IP address | |
* ----ipsize: the buffer size of ipstr | |
* | |
* Output parameters: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// studyLibCurl.cpp : Defines the entry point for the console application. | |
// | |
#include "stdafx.h" | |
#include <curl/curl.h> | |
#include <iostream> | |
#include <string> | |
size_t offset = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <thread> | |
#include <iostream> | |
void thread1_task() | |
{ | |
std::cout << "thread1" << std::endl; | |
} | |
void thread2_task() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
int main() | |
{ | |
int initv[] = {4,2,78,12,3,2,77,34}; | |
std::vector<int> a(initv,initv+sizeof(initv)/sizeof(int)); | |
sort(a.begin(), a.end()); | |
for (auto it = a.begin(); it != a.end(); ++it) { | |
std::cout << *it << std::endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fstream> | |
#include <iostream> | |
#include <string> | |
int main() | |
{ | |
std::string s; | |
int count = 0; | |
std::ifstream in("ConsoleApplication2.cpp"); | |
if (in.is_open()) { |
NewerOlder