Skip to content

Instantly share code, notes, and snippets.

View rchatsiri's full-sized avatar
🎯
Focusing

Chatsiri Rattana rchatsiri

🎯
Focusing
View GitHub Profile
<nested:hidden property="termId" >
<tag:xxx property="termId" xxxx="false" xxx="format.string" />
</nested:hidden>
<nested:hidden property="terminalId" />
make zImage ARCH=arm CROSS_COMPILE=arm-elf-
CHK include/linux/version.h
make[1]: `arch/arm/kernel/asm-offsets.s' is up to date.
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/compile.h
CHK usr/initramfs_list
CC drivers/char/at91_spi.o
drivers/char/at91_spi.c:18:23: error: linux/clk.h: No such file or directory
drivers/char/at91_spi.c:19:35: error: linux/platform_device.h: No such file or directory
drivers/char/at91_spi.c:20:29: error: linux/atmel_pdc.h: No such file or directory
#ifndef TAG_DISPATCH_H
#define TAG_DISPATCH_H
struct apple_tag{};
struct banana_tag{};
struct orange_tag{};
struct apple
{
double reduis;
std::string name;
apple(std::string const& n): name(n){}
@rchatsiri
rchatsiri / stream_socket_service.h
Created September 16, 2011 03:38
Stream socket service wrapper class.
namespace service{
class stream_socket_service
{
private:
typedef boost::asio::stream_socket_service<Protocol> service_impl_type;
private:
service_imple_type& service_impl_;
};
}
@rchatsiri
rchatsiri / gist:1313273
Created October 25, 2011 16:05
scons_compile_source_step
chatsiri@chatsiri:~/workspace/clamav_cpp$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o clamav_optm.o -c -g -I/usr/include/c++/4.5.2 -I/home/chatsiri/Download2/boost/boost_1_43_0 -Iclamavservices -Iclamavlogger -I/home/chatsiri/Download2/boost/boost_1_43_0/boost-log-1.0 -I/home/chatsiri/clamav/clamav-devel/libclamav -I/home/chatsiri/clamav/clamav-devel/shared clamav_optm.cpp
g++ -o clamav_optm clamav_optm.o -L/home/chatsiri/clamav/clamav-devel/libclamav -L/home/chatsiri/Download2/boost/boost_1_43_0/stage/lib -L/home/chatsiri/Download2/boost/boost_1_43_0/bin.v2/libs/log/build/gcc-4.4.3/debug/link-static/runtime-link-static -lclamav -lboost_thread -lboost_regex -lboost_log -lboost_log_setup -lboost_log -lboost_system -lboost_filesystem
scons: done building targets.
chatsiri@chatsiri:~/workspace/clamav_cpp$ ./clamav_optm
./clamav_optm
### init logger status = [0] ###
@rchatsiri
rchatsiri / SConstruct
Created October 25, 2011 16:06
SConstruct for scons
#clam av library path
CLAMAV_LIBPATH = ['/home/chatsiri/clamav/clamav-devel/libclamav/',
'/home/chatsiri/Download2/boost/boost_1_43_0/stage/lib/',
'/home/chatsiri/Download2/boost/boost_1_43_0/bin.v2/libs/log/build/gcc-4.4.3/debug/link-static/runtime-link-static/']
#include c++ header
INCLUDE_CPPPATH = ['/usr/include/c++/4.5.2/',
'/home/chatsiri/Download2/boost/boost_1_43_0/',
'/home/chatsiri/workspace/clamav_cpp/clamavservices/',
'/home/chatsiri/workspace/clamav_cpp/clamavlogger/',
@rchatsiri
rchatsiri / clamav_logger.hpp
Created October 25, 2011 16:08
logger from boost-logging.
#ifndef INIT_LOGGER_HPP_
#define INIT_LOGGER_HPP_
#include <fstream>
#include <string>
#include <iostream>
#include <boost/log/sources/global_logger_storage.hpp>
#include <boost/log/sources/basic_logger.hpp>
#include <boost/log/utility/init/to_file.hpp>
#include <boost/log/utility/init/from_stream.hpp>
@rchatsiri
rchatsiri / clamav_init_engines.hpp
Created October 25, 2011 16:09
Clamav init engines for scanning virus.
#ifndef INIT_SERVICES_HPP_
#define INIT_SERVICES_HPP_
#include <iostream>
#include "clamav.h"
#include "optparser.h"
#include "clamav_logger.hpp"
@rchatsiri
rchatsiri / clamav_scan_engines.hpp
Created October 25, 2011 16:10
Clamav scanning virus.
#ifndef CLAMAV_SCANENGINE_HPP_
#define CLAMAV_SCANENGINE_HPP_
#include "clamav.h"
#include "clamav_logger.hpp"
extern int cl_scanfile(const char *filename, const char **virname, unsigned long int *scanned, const struct cl_engine *engine, unsigned int options);