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
#!/bin/bash | |
# | |
# Steps to build GCC 10 on Debian Buster. | |
# | |
set -e -x | |
# Install all dependencies. | |
export DEBIAN_FRONTEND=noninteractive | |
apt update |
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
curl -d "@/home/daominhthuc/hello.txt" -X POST http://localhost:8080 |
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
/* | |
using official fcgi++ library | |
Reference to fcgi protocol at https://tools.ietf.org/html/rfc3875#section-6.2.1 | |
Build: g++ main.cpp -lfcgi++ -lfcgi -o main | |
Spawn: spawn-fcgi -a 127.0.0.1 -p 9105 -n -- main | |
*/ | |
#include <iostream> | |
#include <string> | |
#include <thread> |
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
/etc/nginx//conf.d/nginx.conf | |
server { | |
listen 9106; | |
error_log /var/log/nginx/thuc_test_fcgi.log; | |
access_log /var/log/nginx/thuc_test_fcgi_access.log; | |
location / { | |
include fastcgi_params; |
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 <iostream> | |
#include <map> | |
#include <memory> | |
#include <string> | |
#include <vector> | |
#include <cassert> | |
using namespace std; | |
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 <curl/curl.h> | |
int main(void) | |
{ | |
CURL *curl; | |
CURLcode res; | |
/* In windows, this will init the winsock stuff */ | |
curl_global_init(CURL_GLOBAL_ALL); |
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
/* Get bit-coin exchange rate */ | |
#include <iostream> | |
#include <memory> | |
#include <string> | |
#include <stdexcept> | |
#include <curl/curl.h> | |
using namespace std; | |
struct Curl_global | |
{ |
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
# Update submodule for module that have been initialized | |
git submodule update --recursive --remote --merge | |
# Pull submodule data for new clone | |
git submodule update --init | |
# Update submodule for module that haven't been initialized | |
git submodule update --init --recursive | |
# Git push to branch | |
git push -u origin branch-name | |
# Git push to delete a branch | |
git push origin --delete port_websession_stats2_to_take_input_data_from_clickhouse |
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
valgrind --leak-check=full ./main arg1 | |
# Stat with: | |
gdb executable | |
# Run with argument | |
r arg1 arg2 |
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 <iostream> | |
#include <string> | |
#include <fstream> | |
#include <cassert> | |
#include "boost/date_time/gregorian/gregorian.hpp" | |
using namespace std; | |
using namespace boost::gregorian; | |
int main() { | |
date d(from_undelimited_string(string{"20180101"})); |
NewerOlder