LinkedIn Reddit icon

Jingnan Si's Blog

Programming, Graphics Rendering and Life

How (and Why) to Assign the .local Domain to Your Raspberry Pi

Original URL:How (and Why) to Assign the .local Domain to Your Raspberry Pi

How the wifi adapter or automatically wifi configuration for device works?

It is very interesting technology. Basically the device to be configured put the wifi device in “monitoring” mode, and the app will send udp wifi packet with different length, which different length indicate different “character”. http://depletionregion.blogspot.ch/2013/10/cc3000-smart-config-transmitting-ssid.html http://electronics.stackexchange.com/questions/61704/how-does-ti-cc3000-wifi-smart-config-work

How to protect your cloud storage files with EncFS

Original Post URL:https://www.bestvpn.com/blog/11385/protect-cloud-storage-files-encfs/

Virus Bulletin : Dylib hijacking on OS X

Original Post URL:https://www.virusbtn.com/virusbulletin/archive/2015/03/vb201503-dylib-hijacking

Declare a global variable as link once only

summary

Introducing RancherVM: Package and Run Virtual Machines as Docker Containers | Rancher Labs

http://rancher.com/introducing-ranchervm-package-and-run-virtual-machines-as-docker-containers/

C++ Code Snippet - Print Stack Backtrace Programmatically with Demangled Function Names

Original Post URL:https://panthema.net/2008/0901-stacktrace-demangled/ // stacktrace.h (c) 2008, Timo Bingmann from http://idlebox.net/ // published under the WTFPL v2.0 #ifndef _STACKTRACE_H_ #define _STACKTRACE_H_ #include <stdio.h> #include <stdlib.h> #include <execinfo.h> #include <cxxabi.h> /** Print a demangled stack backtrace of the caller function to FILE* out. */ static inline void print_stacktrace(FILE *out = stderr, unsigned int max_frames = 63) { fprintf(out, "stack trace:\n"); // storage array for stack trace address data void* addrlist[max_frames+1]; // retrieve current stack addresses int addrlen = backtrace(addrlist, sizeof(addrlist) / sizeof(void*)); if (addrlen == 0) { fprintf(out, " <empty, possibly corrupt>\n"); return; } // resolve addresses into strings containing "filename(function+address)", // this array must be free()-ed char** symbollist = backtrace_symbols(addrlist, addrlen); // allocate string which will be filled with the demangled function name size_t funcnamesize = 256; char* funcname = (char*)malloc(funcnamesize); // iterate over the returned symbol lines.

How dynamic linking working on iOS8 or newer platform

The iOS8 or newer platform now supports dynamic library, here is a link details about the dynamic linking. http://ddeville.me/2014/04/dynamic-linking/

Software Engineering checklist

Orginal Post URL:http://bruzer.net/2014/12/13/software-engineering-checklist/ Science and Engineering are fundamentally different activities. Science produces knowledge and Engineering produces products. Computer Science is a body of knowledge about computers and their use. The Computer Science field is the scientific approach to computation and its applications. A Computer Scientist specializes in the theory of computation and design of computational systems. Software Engineering is the multi-person development of multi-version software programs. Software Engineering is about the application of engineering to the design, development and maintenance of software.

Client Certificate Authentication With Apache

Original Post URL:http://www.impetus.us/~rjmooney/projects/misc/clientcertauth.html

How to produce portable executable/dynamic library

When create executable or dynamic library, sometimes they need to depends on third-party shared library, so how system find the third-party shared library and how can you make sure the system find the right version of library instead of some library in same name? Solution could be pack the correct third-party library with your executable or library, but how to let system find the packed library? most platform has search directory list to find dependent libraries, even you put the third-party library in the same directory, the system still could find wrong one.

Useful resources when create thunderbird/firefox extension

jar.mn document http://dxr.mozilla.org/mozilla-central/source/build/docs/jar-manifests.rst https://developer.mozilla.org/en-US/docs/HowMozilla'sbuildsystemworks https://developer.mozilla.org/en-US/docs/UsingDependentLibrariesInExtension%5FComponents https://developer.mozilla.org/en-US/docs/Bundlingmultiplebinary%5Fcomponents https://code.google.com/p/gears/source/browse/trunk/gears/base/firefox/static%5Ffiles/components/stub.js https://developer.mozilla.org/en-US/Add-ons/CreatingCustomFirefoxExtensionswiththeMozillaBuildSystem https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Guide/Cross-threadcallsusing%5Frunnables

Dynamic_cast RTTI and class size

dynamic_cast requires RTTI flag when do compiling, the RTTI will increase object size. and RTTI only generate for polymorphic classes. class A { public: std::string m_Data; } although A class is not polymorphic, but the m_Data is a instance of polymorphic class, the sizeof(A) will change when compile with/without RTTI. programmer should be very carefully when link with third-party library, it is more difficult to find out the crash compare to pack problem.

What's the strategy when setup live-update of a product?

summary

How to create auto increment build numbers using Ant

To create auto increment build number without third-party component, script or other code, just pure ant tasks. please refer to http://stackoverflow.com/questions/1431315/build-numbers-major-minor-revision

Log4j Using EnhancedPatternLayout for database appender

summary

Use -noverify to avoid PowerMock fail

When using PowerMock https://code.google.com/p/powermock/ to do unit test, some times jvm may report bytecode version mismatch and refuse to run, it caused by PowerMock will dynamic change the bytecode. Add -noverify option to fix the problem

In java when using SSL may have error: Invalid session

The error message looks like Error occurred during the SSL handshake: invalid SSL session It may caused by JVM needs the JCE, download JCE from Oracle and follow instructions in README http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html

重温一下const char *和char * const

今天写代码的时候突然不能肯定const char * d; d++; 是不是对的了,就重温了一下经典的c++定义 结论: char * const p 定义一个指向字符的指针常数,即const指针 const char * p 定义一个指向字符常数的指针 char const*p 等同于const char* p 普通的指针d,进行d++肯定没问题了 http://blog.163.com/pei%5Fhua100/blog/static/805697592009550281616/

How to convert OpenSSH key to GnuPG

First we need to create a certificate (self-signed) for our ssh key: openssl req -new -x509 -key ~/.ssh/id_rsa -out ssh-cert.pem We can now import it in GnuPG openssl pkcs12 -export -in ssh-certs.pem -inkey ~/.ssh/id_rsa -out ssh-key.p12 gpgsm --import ssh-key.p12 Notice you cannot import/export DSA ssh keys to/from GnuPG The more key conversions, please refer to http://www.sysmic.org/dotclear/index.php?post/2010/03/24/Convert-keys-betweens-GnuPG,-OpenSsh-and-OpenSSL