Thrift is used to define interfaces and generate code to build RPC clients and servers. The document discusses installing tools and libraries needed for Thrift including GCC, Boost, Java, Ant, Autoconf and others. It then covers generating code for C++, Java and PHP from a Thrift IDL file and running a sample Thrift server and clients in C++ and Java.
Docker Practice for beginner.
- docker install on ubuntu 18.04 LTS
- docker pull/push
- making docker-compose file which serving spring-boot+ mySql application
A Journey to Boot Linux on Raspberry PiJian-Hong Pan
Each processor/chip architecture has its own procedure to boot the kernel. It works with desgined partition layout and vendor specific firmwares/bootloaders in the boot partition. We can learn the related knowledge from the Raspbian image for Raspberry Pi, which is the board we can obtain easily. However, the diversity between the special booting procedures with specific firmwares/bootloaders increases the complexity for distribution maintainers. It will be great if there is a way to make it more generic that can be applied to most of the chip architectures/boards to boot up the system.
After referring to some Linux distributions, we learned U-Boot may play a role in the solution. It splits the booting procedure into hardware specific and generic system parts. This helps distribution maintainers deploy the generic system with OSTree, including device trees.
Let’s deep dive into this magic booting procedure!
Docker Practice for beginner.
- docker install on ubuntu 18.04 LTS
- docker pull/push
- making docker-compose file which serving spring-boot+ mySql application
A Journey to Boot Linux on Raspberry PiJian-Hong Pan
Each processor/chip architecture has its own procedure to boot the kernel. It works with desgined partition layout and vendor specific firmwares/bootloaders in the boot partition. We can learn the related knowledge from the Raspbian image for Raspberry Pi, which is the board we can obtain easily. However, the diversity between the special booting procedures with specific firmwares/bootloaders increases the complexity for distribution maintainers. It will be great if there is a way to make it more generic that can be applied to most of the chip architectures/boards to boot up the system.
After referring to some Linux distributions, we learned U-Boot may play a role in the solution. It splits the booting procedure into hardware specific and generic system parts. This helps distribution maintainers deploy the generic system with OSTree, including device trees.
Let’s deep dive into this magic booting procedure!
Raphaël Pinson's talk on "Configuration surgery with Augeas" at PuppetCamp Geneva '12. Video at http://youtu.be/H0MJaIv4bgk
Learn more: www.puppetlabs.com
Getting Started on Packaging Apps with Open Build ServiceAndi Sugandi
Getting Started on Packaging Apps with Open Build Service - Learn How To Build Package.
An OBS workshop at openSUSE.Asia Summit 2016, Yogyakarta, Indonesia
Raphaël Pinson's talk on "Configuration surgery with Augeas" at PuppetCamp Geneva '12. Video at http://youtu.be/H0MJaIv4bgk
Learn more: www.puppetlabs.com
Getting Started on Packaging Apps with Open Build ServiceAndi Sugandi
Getting Started on Packaging Apps with Open Build Service - Learn How To Build Package.
An OBS workshop at openSUSE.Asia Summit 2016, Yogyakarta, Indonesia
Programming is hard. Programming correct C and C++ is particularly hard. Indeed, both in C and certainly in C++, it is uncommon to see a screenful containing only well defined and conforming code.Why do professional programmers write code like this? Because most programmers do not have a deep understanding of the language they are using.While they sometimes know that certain things are undefined or unspecified, they often do not know why it is so. In these slides we will study small code snippets in C and C++, and use them to discuss the fundamental building blocks, limitations and underlying design philosophies of these wonderful but dangerous programming languages.
This content has a CC license. Feel free to use it for whatever you want. You may download the original PDF file from: http://www.pvv.org/~oma/DeepC_slides_oct2012.pdf
Node.js® is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
Introcution to use GNU GDB on Android Froyo 2.2. Target board is Nvidia Tegra2.
The testing C source files could be downloaded at :
https://www.dropbox.com/s/5gmzreichenii8b/Android.GDB.Debugging_TestFile_shareLib.7z
This presentation is primarily based on Oracle's "Java SE 6 HotSpot™ Virtual Machine Garbage Collection Tuning" document.
This introduces how Java manages memory using generations, available garbage collectors and how to tune them to achieve desired performance.
Code testing and Continuous Integration are just the first step in a source code to production process. Combined with infrastructure-as-code tools such as Puppet the whole process can be automated, and tested!
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Carlos Sanchez
Continuous Integration, with Apache Continuum or Jenkins, can be extended to fully manage deployments and production environments, running in Tomcat for instance, in a full Continuous Delivery cycle using infrastructure-as-code tools like Puppet, allowing to manage multiple servers and their configurations.
Puppet is an infrastructure-as-code tool that allows easy and automated provisioning of servers, defining the packages, configuration, services,... in code. Enabling DevOps culture, tools like Puppet help drive Agile development all the way to operations and systems administration, and along with continuous integration tools like Apache Continuum or Jenkins, it is a key piece to accomplish repeatability and continuous delivery, automating the operations side during development, QA or production, and enabling testing of systems configuration.
Traditionally a field for system administrators, Puppet can empower developers, allowing both to collaborate coding the infrastructure needed for their developments, whether it runs in hardware, virtual machines or cloud. Developers and sysadmins can define what JDK version must be installed, application server, version, configuration files, war and jar files,... and easily make changes that propagate across all nodes.
Using Vagrant, a command line automation layer for VirtualBox, they can also spin off virtual machines in their local box, easily from scratch with the same configuration as production servers, do development or testing and tear them down afterwards.
We will show how to install and manage Puppet nodes with JDK, multiple Tomcat instances with installed web applications, database, configuration files and all the supporting services. Including getting up and running with Vagrant and VirtualBox for quickstart and Puppet experiments, as well as setting up automated testing of the Puppet code.
Webinar: Creating an Effective Docker Build Pipeline for Java AppsCodefresh
It's easy to make mistakes when Dockerizing your Java applications. In this webinar, Alexei Ledenev (Cheif Researcher at Codefresh) shared his experience on how to craft the perfect Java-Docker build flow. He explained best practices and common pitfalls, then demonstrated how to create a build pipeline that consistently produces small, efficient, and secure Docker images. View the webinar recording and summary here- https://codefresh.io/blog/webinar-creating-efficient-docker-build-pipeline-java-apps/
This article will help you fetch details about the Ubuntu based AWS EC2 instance. You need to deploy the Python (2.7) based REST Services in Apache webserver. The core of application is Python DJango framework, which uses a custom virtual environment (vitualenv). The Apache uses mod_wsgi for connecting the WSGI application and mod_sec for security purposes.
Deploying Django with Apache and mod_wsgi is a method to get Django into production. mod_wsgi is an Apache module which is supposed to host any Python WSGI application, which includes Django. Django can work with any version of Apache that supports mod_wsgi.
Read the article further, to understand the step-by-step deployment process.
Ubuntu Server is lean, fast and powerful. Its services are reliable, predictable and economical. It is the perfect base on which you can build your instances. Django is a web framework which is written in Python. One can easily guess that everything, in Django, is also done in Python. Django was developed to simplify the creation of database driven sites. The best feature in Django is that it, probably, is the fastest website framework to create a fully functioning website.
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...Carlos Sanchez
Extend Continuous Integration to automatically test your infrastructure.
Continuous Integration can be extended to test deployments and production environments, in a Continuous Delivery cycle, using infrastructure-as-code tools like Puppet, allowing to manage multiple servers and their configurations, and test the infrastructure the same way continuous integration tools do with developers’ code.
Puppet is an infrastructure-as-code tool that allows easy and automated provisioning of servers, defining the packages, configuration, services, … in code. Enabling DevOps culture, tools like Puppet help drive Agile development all the way to operations and systems administration, and along with continuous integration tools like Jenkins, it is a key piece to accomplish repeatability and continuous delivery, automating the operations side during development, QA or production, and enabling testing of systems configuration.
Using Vagrant, a command line automation layer for VirtualBox, we can easily spin off virtual machines with the same configuration as production servers, run our test suite, and tear them down afterwards.
We will show how to set up automated testing of an application and associated infrastructure and configurations, creating on demand virtual machines for testing, as part of your continuous integration process.
The manual of the GTK+ 2.0 application - Desktop App Chooser which let the user to browse all installed X desktop applications and retrieve the Desktop Entry content of each application.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
I have heard many times that architecture is not important for the front-end. Also, many times I have seen how developers implement features on the front-end just following the standard rules for a framework and think that this is enough to successfully launch the project, and then the project fails. How to prevent this and what approach to choose? I have launched dozens of complex projects and during the talk we will analyze which approaches have worked for me and which have not.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
The field of Information retrieval (IR) is currently undergoing a transformative shift, at least partly due to the emerging applications of generative AI to information access. In this talk, we will deliberate on the sociotechnical implications of generative AI for information access. We will argue that there is both a critical necessity and an exciting opportunity for the IR community to re-center our research agendas on societal needs while dismantling the artificial separation between the work on fairness, accountability, transparency, and ethics in IR and the rest of IR research. Instead of adopting a reactionary strategy of trying to mitigate potential social harms from emerging technologies, the community should aim to proactively set the research agenda for the kinds of systems we should build inspired by diverse explicitly stated sociotechnical imaginaries. The sociotechnical imaginaries that underpin the design and development of information access technologies needs to be explicitly articulated, and we need to develop theories of change in context of these diverse perspectives. Our guiding future imaginaries must be informed by other academic fields, such as democratic theory and critical theory, and should be co-developed with social science scholars, legal scholars, civil rights and social justice activists, and artists, among others.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Usage Note of Apache Thrift for C++ Java PHP Languages
1. Usage Note of
Apache Thrift
for C++ / Java / PHP
Languages
William.L
wiliwe@gmail.com
2015-06-02
2. Index
What is Apache Thrift? .................................................................................................................................. 3
Install Tool & Library .................................................................................................................................... 4
GCC 4.9............................................................................................................................................................ 4
Boost C++ Library.................................................................................................................................. 5
Oracle/Sun Java 8 ................................................................................................................................... 5
Configure Ant.................................................................................................................................. 9
Upgrade Autoconf / Automake / Bison.................................................................................................. 9
LibEvent................................................................................................................................................. 10
Apache Thrift ........................................................................................................................................ 10
Add Server Listen Port Number into Firewall/iptables .................................................................... 12
Using Thrift ................................................................................................................................................... 14
C++ Server/Client ......................................................................................................................................... 15
Java Server/Client......................................................................................................................................... 16
PHP Client ..................................................................................................................................................... 25
3. What is Apache Thrift?
Apache Thrift is an interface definition/description language (IDL) and binary communication protocol
that is used to define and create scalable services for numerous programming languages and combines a
software stack with a code generation engine to build services that work efficiently. It is used as a remote
procedure call (RPC) software framework.
Thrift was developed at Facebook to expedite development and implementation of efficient and scalable
cross-language (Web)services.
Its primary goal is to enable efficient and reliable communication across programming languages by
abstracting the portions of each language that tend to require the most customization into a common library
that is implemented in each language. Specifically, Thrift allows developers to define datatypes and service
interfaces in a single language-neutral file and generate all the necessary code to build RPC (remote
procedure call) clients and servers.
The Apache Thrift official site and tutorial:
https://thrift.apache.org/
https://thrift.apache.org/tutorial/
The Thrift white paper from Facebook could be downloaded from:
https://thrift.apache.org/static/files/thrift-20070401.pdf
Example codes and Apache Thirft source archive for this documentation could be downloaded from the
GitHub:
https://github.com/wiliwe/apache-thrift-example
4. Install Tool & Library
The environment used in this document:
* Linux CentOS 6.5 64-bit (could be updated to 6.6 or 6.7)
* GCC C/C++ compiler v4.9.0 (which support C++11 and C++14 standards)
* Apache Thrift v1.0.0 Dev (through Git)
* Boost C++ library v1.58.0
* Java 8 update45
* PHP v5.3.3
* LibEvent v2.0.22 Stable
* Qt Creator v3.3.1 IDE
* Eclipse v4.4 Luna (with JDT installed for Java)
Here using v1.0.0 (a development version) for example and the target programming languages are C++, Java
and PHP.
Apache Thrift install guide:
* http://thrift.apache.org/docs/install/
* http://thrift.apache.org/docs/install/centos
Update & Install Linux System Library
1) Update system package repository.
$ su (change to root)
# yum update
2) Install development tools, such GCC compilers.
# yum -y groupinstall "Development Tools"
3) Install required libraries.
# yum install php php-devel php-common pcre-devel php-pecl-memcache automake libtool flex bison
pkgconfig gcc-c++ zlib-devel python-devel openssl-devel glib2-devel.x86_64 libev-devel.x86_64
bzip2-devel.x86_64 libicu-devel.x86_64
GCC 4.9
You could use other version of GCC that supports C++11 standard. GCC v4.7 or above supports C++11, while
v4.9 or above supports C++14.
The built-in GCC in CentOS 6.5 is v4.4.7, this is too old to build most libraries!
If you want to upgrade GCC, it could refer to the documentation:
http://www.slideshare.net/wiliwe/upgrade-gcc-install-qt-54-on-centos-65
5. Boost C++ Library
The version MUST be v1.53 or above. Here using v1.58.0.
1) First of all, remove Boost library installed defaultly by Linux
$ su (change to root)
# yum erase boost*
2) Download Boost v1.58.0 source archive, boost_1_58_0.tar.gz, from
http://sourceforge.net/projects/boost/files/boost/1.58.0/
3) Unpack source archive and it will generate a folder name boost_1_58_0.
4) Enter folder boost_1_58_0 folder and run below commands:
$ ./bootstrap.sh --prefix=/usr --libdir=/usr/lib64
$ su (change to root)
# ./b2 install
Oracle/Sun Java 8
For enabling Java language generation, it needs to install JDK and Ant into the system.
Current Version
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Older Version
http://www.oracle.com/technetwork/java/javase/archive-139210.html
Here using JDK 1.8 update 45.
http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html#jdk-8u45-oth-JPR
* for RHEL/CentOS/Fedora 32-bit, download the archive jdk-8u45-linux-i586.tar.gz.
* for RHEL/CentOS/Fedora 64-bit, download the archive jdk-8u45-linux-x64.tar.gz.
, here using the archive jdk-8u45-linux-x64.tar.gz.
6. 1) First of all, to check the already installed Java version, enter the following command:
$ java -version
$ which java
$ ll /usr/bin/java
$ ll /etc/alternatives/java
If Java 1.6, 1.7 or 1.8 have been installed already, you can uninstall them using the following commands:
$ su (change to root)
# yum remove java-1.6.0-openjdk
or
# yum remove java-1.7.0-openjdk
or
# yum remove java-1.8.0-openjdk
One of version of the above OpenJDK may be used for LiberOffice tool, so you might not want to remove it.
For this case, it could use alternatives utility to change current used Java tools; this will be mentioned later.
2) Upack the downloaded archive jdk-8u45-linux-x64.tar.gz and it will generate a folder named jdk1.8.0_45.
3) Next, to configure the absolute path to folder jdk1.8.0_45 that the Linux system could find Java tools (e.g.
java (interpreter), javac (compiler), javaws (Web Start), Java standard librariese (class files), etc) when
7. you type these tool/command under console or use a Java IDE (Integrated Development Environment) tool.
There have two ways to configure the path to Java tools:
<I> Using alternatives Tool
If there have more than one versions of JDK in your Linux system, it might need to use alternatives utility to
install Java tools (to add symbolic links to individual executable files to the /usr/bin directory).
alternatives utility is available in "chkconfig" package, you could install it if it is absent:
$ su (change to root)
# yum install chkconfig.x86_64
To setup javac, jar and javaws commands path using alternatives:
$ su (change to root)
# alternatives --install /usr/bin/java java /opt/jdk1.8.0_45/bin/java 2
# alternatives --set java /opt/jdk1.8.0_45/bin/java
# alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_45/bin/javac 2
# alternatives --set javac /opt/jdk1.8.0_45/bin/javac
# alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_45/bin/jar 2
# alternatives --set jar /opt/jdk1.8.0_45/bin/jar
# alternatives --install /usr/bin/javaws javaws /opt/jdk1.8.0_45/bin/javaws 2
# alternatives --set javaws /opt/jdk1.8.0_45/bin/javaws
To verify configurations:
# alternatives --config java
# alternatives --config javac
8. # alternatives --config jar
# alternatives --config javaws
# java -version
# javac -version
# javaws -version
<II> Set Environment Variables
Setup JAVA_HOME variable.
$ export JAVA_HOME=/ home/william/jdk1.8.0_45
Setup JRE_HOME variable.
$ export JRE_HOME=/ home/william/jdk1.8.0_45/jre
Setup CLASSPATH variable.
$ export CLASSPATH= $JAVA_HOME/lib: :$JAVA_HOME/jre/lib:.
(the last path is “current directory”, being presented as a dot ".")
Add path to PATH variable for searching Java tools.
$ export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
9. Configure Ant
The version of Ant must be v1.7 or above. Download current release of Ant from the site:
https://www.apache.org/dist/ant/binaries/
Here using v1.9.6.
1) Download the archive apache-ant-1.9.6-bin.tar.gz.
2) Unpack the archive and it will generate a folder named apache-ant1.9.6.
3) Set ANT_HOME environment variable with the path to the unpacked Ant folder.
$ export ANT_HOME=/home/william/apache-ant-1.9.4
4) Add the path to Ant’s tool to PATH variable for searching ant tools.
$ export PATH=$PATH:$ANT_HOME/bin
It could write the above exporting commands(for Java and ANt) in user’s bashrc file,
/home/UserName/.bashrc, this lets the system could find Java tools each time a user login or open a virtual
terminal (shown as below snapshot).
Upgrade Autoconf / Automake / Bison
1) Download source archives of these three tool
$ wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
$ wget http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz
$ wget http://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.gz
2) Unpack each archives, enter separate folders and run commands:
$ ./configure
$ make
$ su (change to root)
# make install
10. LibEvent
1) Download the archive libevent-2.0.22-stable.tar.gz from
http://sourceforge.net/projects/levent/files/libevent/libevent-2.0/
2) Unpack the archive to generate a source folder named libevent-2.0.22-stable.
3) Enter the folder libevent-2.0.22-stable and run commands:
$ ./configure --prefix=/usr --libdir=/usr/lib64
$ make
$ su (change to root)
# make install
If this library does not exist in the system or the version of the installed one is too old, it will show below error
messages:
<Case-I>
In file included from src/thrift/server/TNonblockingServer.cpp:24:0:
./src/thrift/server/TNonblockingServer.h:41:33: fatal error: event2/event_compat.h: No such file or directory
#include <event2/event_compat.h>
libthriftnb.so error: undeclared reference evbuffer_pullup
<Case-II>
Apache Thrift
1) Download source archive from
https://thrift.apache.org/download
, or using Git tool:
$ git clone https://git-wip-us.apache.org/repos/asf/thrift.git
$ cd thrift
$ ./bootstrap.sh
$ ./configure --prefix=/usr --libdir=/usr/lib64 --with-python=no --with-perl=no --with-haskell=no
--with-go=no --with-haxe=no --with-d=no --with-lua=no --with-ruby=no --with-csharp=no
--with-erlang=no --with-nodejs=no --with-boost=yes --with-boost-libdir=/usr/lib64
Note that if it uses “” parameter, it will lead Thrift configuration fail to find Boost library.
During configuring compilation environment, it may issue some problems:
<Solution>
To resolve this, you'll need to find your pkg.m4 (installed by the pkg-config package) file and copy it to the
Thrift-Src /aclocal directory.
[Thrift syntax error in ./configure]
"syntax error near unexpected token"
11. In Thrift source folder, copy pkg.m4 to the sub-directory aclocal:
$ cp /usr/share/aclocal/pkg.m4 Thrift-Src-Folder/aclocal
Then, re-run ./bootstrap.sh and ./configure.
(Note that pkg.m4 is created by the pkg-config tool. If your /usr/share/aclocal directory doesn't contain the
pkg.m4 file, you may not have pkg-config installed.)”
More information about this problem could be found in the sites:
* https://thrift.apache.org/docs/install/windows
* http://wiki.apache.org/thrift/FAQ
2) If everything is okay, the result of successful configuration will be as below snapshot:
Now, start to build and install Thrift library and tool:
$ make
12. $ su (change to root)
# make install
After installing successfully, verify Thrift’s thrift tool as this:
Note
* If it show error messages that it could not find .plo files for building files under "thrift/lib/cpp/test"
, I tried to run "./bootstrap", "./configure" again and it succeeded to complie.
* If you want to use Thrift T_LOG or T_LOG_T macro to print debugging messages, it must set the below
macro to 1 in "ThriftSrc/lib/cpp/src/thrift/TLogging.h" :
#define T_GLOBAL_DEBUGGING_LEVEL 1.
Add Server Listen Port Number into Firewall/iptables
To allow Apache Thrift server could be connected from the clients locating on other host, it needs to add listen
port number to the firewall/iptables configuration file.
1) Open the configuratoin file, /etc/sysconfig/iptables, using a text editor.
$ su (change to root)
13. # vi /etc/sysconfig/iptables
2) Add this lines:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8989 -j ACCEPT
Here using port number 8989 for example, it needs to be replaced with you wanted number.
3) Restart iptables:
# service iptables restart
14. Using Thrift
Basic steps of using Thrift are as below:
1) Write a Thrift interface file describing the interface name and its parameter. The interface files usually end
with “.thrift” extension name.
Below snapshots are examples for Thrift interface writing. It could declare all interfaces name in the
interface file or use a header to contain it and include this header file into the interface file.
2) Use Thrift tool, thrift, with the written interface definition file as input to generate source files for target
programming language (such as C++, Java, PHP, etc), run:
thrift --gen <language> <Thrift filename>
To recursivly generate source code from a Thrift file and all other Thrift files included by it, run
thrift -r --gen <language> <Thrift filename>
The Thrift interface file used for this documentation is named Person.thrift whose content is as below:
15. C++ Server/Client
The guide for Thrift C++ language programming is: https://thrift.apache.org/tutorial/cpp
To generate C++ source from Thrift interface fiel, run:
$ thrift --gen cpp Person.thrift
Here using Qt Creator IDE and Qmake to maintain C++ client and server codes. In Qt project file (.pro), it
needs to add below lines for building codes:
16. Java Server/Client
The guide for Thrift Java language programming is: https://thrift.apache.org/tutorial/java
To generate Java source from Thrift interface fiel, run:
$ thrift --gen java Person.thrift
After building Thrift library and tool successfully, it generates JAR files for Thrift Java. These JARs locate
under folders Thrift-Source/lib/java/build/ and Thrift-Source/lib/java/build/lib (as below snapshot).
When installing, these JAR files will put to /usr/local/lib defaultly. If you want to change the installation path
for JARs, you could use JAVA_PREFIX option when doing configuration.
You could copy these JARs into a folder for later usage. Here copying them into a folder named lib together
with a folder named src containing server and client codes (as below snapshot).
Here showing how to use Eclipse IDE to maintain Java client and server codes.
1) Click “File -> New -> Java Project”
17. 2) In “New Java Project” dialogue, fill “Project name” field, navigate “Location” to your Java source folder.
18. The source folder for Thrift Java is as
Click Next button.
3) It could view source code and libraries Eclipse found. For Source tab, check “Allow output folders for
source folders”
Finally, click Finish button. You could see the project content in Project view as below snapshot:
19. In the Thrift Java source folder, it could find two files (.classpath, .project) are added for Eclipse project
management.
4) Now, invoke server application by righ click server source file, PersonServer.java, and click menu item
“Run As -> Java Application”
20. Then, you could see the message coded in server source code in the Console view (as below snapshot).
5) Next, invoke client application by righ click client source file, PersonClient.java, and click menu item
“Run As -> Java Application”
21. Then, you could see the response message after calling RPC interface in the Console view (as below
snapshot).
6) To terminate the running server, switch to Debug perspective by clicking
“Window -> Open Perspective -> Debug”
In Debug perspective, you could see the running server application.
Right click the running server application, and click “Terminate” item to terminate it.
22. After terminating the server application, right clicking Debug perspective and click “Remove All Terminated.”
23. If you want to load an existent project in Eclipse, just follow below steps.
1) Clicke “File -> Import…”
2) In “Import” dialogue, select “General -> Existing Projects into Workspace” and click Next.
24. 3) In “Select root directory” field, nevigate to the existent Eclipse project folder and then click Finish.
25. PHP Client
The guide for Thrift PHP language programming is: https://thrift.apache.org/tutorial/php .
For testing PHP client, it should have a Web server with PHP interpreter installed in your testing host. Here
having a documentation for setting up LAMP (Linux, Apache, MySQL DB and PHP), you could refer to how
to setup Apache Web server and install/configure PHP module into Apache server.
http://www.slideshare.net/wiliwe/lamp-installation-note-centos-65
To generate PHP source from Thrift interface file, run:
$ thrift --gen php Person.thrift
In Thrift source folder, there have PHP library files for Thrift communication. They locate under folders
Thrift-Source/lib/php/lib/Thrift (as below snapshot). You could copy the Thrift folder under
Thrift-Source/lib/php/lib/ for later usage.
To use Thrift PHP client, follow below steps:
1) Put generated Thrift PHP code and Thrift provided PHP library into Web server’s document root folder. Here
using /var/www/html/ for example (as below snapshot) and using a folder named “thrift” to contain
generated PHP source folder “IDV” and Thrift PHP library folder “Thrift”.
2) Follow Thrift tutorial Web site, write a PHP Thrift client and put it into /var/www/html/ . The PHP Thrift
client here is the personClient.php.
3) Change mode of “thrift” folder to executable recursively.
$ su (change to root)
# chmod –R 755 ./thrift/
If it does not be set to executabe, all Thrift PHP libraries and generated codes would not be loaded when
26. executing personClient.php and the Web server will log error messages showing that it has no permission to
access those files (as below snapshot).
The output of successfully executing personClient.php would be as below snapshots when using “php” tool
and Web browser: