#StackBounty: #server #kernel #maas Should I add HWE kernel to the Ubuntu server manual installation (not from a hosting provider)?

Bounty: 50

Manually installing Ubuntu server (not from a hosting provider) – Should I add a HWE kernel?

The moment I mount the ISO in my VirtualBox and starting the installation process, I am being asked for 4 options. 1 For a regular Ubuntu server, another one for an Ubuntu server that includes HWE and the last 2 for MASS including server.

It is clear to me MAAS is not something I need but I do understand that inclusion of the HEW kernel inside Ubuntu might result in better hardware utilization (I don’t know to say exactly way) and I was thinking that if tomorrow I change my PC to a new one there might be software discrepancies which HWE avoid.

Am I right? Should I choose HWE to ensure better software compatibility?

Get this bounty!!!

#StackBounty: #networking #16.04 #server #hostapd Is there a way to debug wireless access point issues that was setup with hostapd?

Bounty: 50

I am trying to setup a wireless access point with a home PC. I replaced my old Intel wifi link 5100 with Atheros AR9462. I recently did a fresh Ubuntu Server 16.04 install.

To setup wireless access point I installed hostapd and created a simple configuration

# cat /etc/hostapd/hostapd.conf 

And here is how my network interfaces are configured:

# cat /etc/network/interfaces
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto enp1s0
iface enp1s0 inet dhcp

auto wlp3s0
iface wlp3s0 inet static

After these configurations, I rebooted the device. My network is active (checked via /etc/init.d/networking status). hostapd (checked via service hostapd status) seems to be running fine. However, I cannot event detect the wireless access point from any other device.

My wireless card is functioning in master mode:

# iwconfig
wlp3s0    IEEE 802.11abgn  Mode:Master  Tx-Power=19 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off

lo        no wireless extensions.

enp1s0    no wireless extensions.

My network hardware results look like the following:

# lshw -C network
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: enp1s0
       version: 07
       serial: 00:e0:4c:68:18:fd
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168e-3_0.0.4 03/27/12 ip= latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
       resources: irq:120 ioport:e000(size=256) memory:a0004000-a0004fff memory:a0000000-a0003fff
       description: Wireless interface
       product: AR9462 Wireless Network Adapter
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: wlp3s0
       version: 01
       serial: 44:c3:06:31:a7:b0
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=4.4.0-62-generic firmware=N/A ip= latency=0 link=yes multicast=yes wireless=IEEE 802.11abgn
       resources: irq:18 memory:81200000-8127ffff memory:81280000-8128ffff

How can I troubleshoot this issue further and find out what is going wrong?

Get this bounty!!!

#StackBounty: #server #virtualbox #headless Accessing headless virtual box web server installed on a parent server

Bounty: 50

I have installed a headless Virtual Box on my server A, this virtual box contains another ubuntu server B. I can ssh from my laptop to server A, and from server A to server B, but how can I ssh directly from my laptop to server B ?

My goal is to access the web server which is on server B from my laptop.

Below are my current network settings.

  • ifconfig on server A
    ifconfig on server A

  • Headless VirtualBox settings (VB is on server A)
    VirtualBox : preferences
    VirtualBox : server B settings : Adaptater 1
    VirtualBox : server B settings : Adaptater 2

  • ifconfig on server B
    ifconfig on server B

Get this bounty!!!

Apache Commons DbUtils Mini Wrapper

This is a very small DB Connector code in Java as a wrapper class to Apache DBUtils.

The Commons DbUtils library is a small set of classes designed to make working with JDBC easier. JDBC resource cleanup code is mundane, error prone work so these classes abstract out all of the cleanup tasks from your code leaving you with what you really wanted to do with JDBC in the first place: query and update data.

Some of the advantages of using DbUtils are:

  • No possibility for resource leaks. Correct JDBC coding isn’t difficult but it is time-consuming and tedious. This often leads to connection leaks that may be difficult to track down.
  • Cleaner, clearer persistence code. The amount of code needed to persist data in a database is drastically reduced. The remaining code clearly expresses your intention without being cluttered with resource cleanup.
  • Automatically populate Java Bean properties from Result Sets. You don’t need to manually copy column values into bean instances by calling setter methods. Each row of the Result Set can be represented by one fully populated bean instance.

DbUtils is designed to be:

  • Small – you should be able to understand the whole package in a short amount of time.
  • Transparent – DbUtils doesn’t do any magic behind the scenes. You give it a query, it executes it and cleans up for you.
  • Fast – You don’t need to create a million temporary objects to work with DbUtils.

DbUtils is not:

  • An Object/Relational bridge – there are plenty of good O/R tools already. DbUtils is for developers looking to use JDBC without all the mundane pieces.
  • A Data Access Object (DAO) framework – DbUtils can be used to build a DAO framework though.
  • An object oriented abstraction of general database objects like a Table, Column, or Primary Key.
  • A heavyweight framework of any kind – the goal here is to be a straightforward and easy to use JDBC helper library.


Apache Solr vs Elasticsearch: The Feature Smackdown


Feature Solr 5.3.0 ElasticSearch 2.0
Binary API SolrJ TransportClient, Thrift (through a plugin)
JMX support ES specific stats are exposed through the REST API
Official client libraries Java Java, Groovy, PHP, Ruby, Perl, Python, .NET, JavascriptOfficial list of clients
Community client libraries PHP, Ruby, Perl, Scala, Python, .NET, Javascript, Go, Erlang, Clojure Clojure, Cold Fusion, Erlang, Go, Groovy, Haskell, Java, JavaScript, .NET, OCaml, Perl, PHP, Python, R, Ruby, Scala, Smalltalk, Vert.x Complete list
3rd-party product integration (open-source) Drupal, Magento, Django, ColdFusion, WordPress, OpenCMS, Plone, Typo3, ez Publish, Symfony2, Riak (via Yokozuna) Drupal, Django, Symfony2, WordPress, CouchBase
3rd-party product integration (commercial) DataStax Enterprise Search, Cloudera Search, Hortonworks Data Platform, MapR SearchBlox, Hortonworks Data Platform, MapR etcComplete list
Output JSON, XML, PHP, Python, Ruby, CSV, Velocity, XSLT, native Java JSON, XML/HTML (via plugin)


Feature Solr 5.3.0 ElasticSearch 2.0
Master-slave replication Only in non-SolrCloud. In SolrCloud, behaves identically to ES. Not an issue because shards are replicated across nodes.
Integrated snapshot and restore Filesystem Filesystem, AWS Cloud Plugin for S3 repositories, HDFS Plugin for Hadoop environments, Azure Cloud Plugin for Azure storage repositories


Feature Solr 5.3.0 ElasticSearch 2.0
Data Import DataImportHandler – JDBC, CSV, XML, Tika, URL, Flat File [DEPRECATED in 2.x] Rivers modules – ActiveMQ, Amazon SQS, CouchDB, Dropbox, DynamoDB, FileSystem, Git, GitHub, Hazelcast, JDBC, JMS, Kafka, LDAP, MongoDB, neo4j, OAI, RabbitMQ, Redis, RSS, Sofa, Solr, St9, Subversion, Twitter, Wikipedia
ID field for updates and deduplication
Partial Doc Updates with stored fields with _source field
Custom Analyzers and Tokenizers
Per-field analyzer chain
Per-doc/query analyzer chain
Synonyms Supports Solr and Wordnet synonym format
Multiple indexes
Near-Realtime Search/Indexing
Complex documents
Schemaless 4.4+
Multiple document types per schema One set of fields per schema, one schema per core
Online schema changes Schemaless mode or via dynamic fields. Only backward-compatible changes.
Apache Tika integration
Dynamic fields
Field copying via multi-fields
Hash-based deduplication Murmur plugin or ER plugin


Feature Solr 5.3.0 ElasticSearch 2.0
Lucene Query parsing
Structured Query DSL Need to programmatically create queries if going beyond Lucene query syntax.
Span queries via SOLR-2703
Spatial/geo search
Multi-point spatial search
Faceting Top N term accuracy can be controlled with shard_size
Advanced Faceting New JSON faceting API blog post
Geo-distance Faceting
Pivot Facets
More Like This
Boosting by functions
Boosting using scripting languages
Push Queries JIRA issue Percolation. Distributed percolation supported in 1.0
Field collapsing/Results grouping
Spellcheck Suggest API
Query elevation workaround
Joins Joined index has to be single-shard and replicated across all nodes. via has_children and top_children queries
Resultset Scrolling New to 4.7.0 via scan search type
Filter queries also supports filtering by native scripts
Filter execution order local params and cache property
Alternative QueryParsers DisMax, eDisMax query_string, dis_max, match, multi_match etc
Negative boosting but awkward. Involves positively boosting the inverse set of negatively-boosted documents.
Search across multiple indexes it can search across multiple compatible collections
Result highlighting
Custom Similarity
Searcher warming on index reload Warmers API
Term Vectors API


Feature Solr 5.3.0 ElasticSearch 2.0
Pluggable API endpoints
Pluggable search workflow via SearchComponents
Pluggable update workflow
Pluggable Analyzers/Tokenizers
Pluggable Field Types
Pluggable Function queries
Pluggable scoring scripts
Pluggable hashing
Pluggable webapps site plugin
Automated plugin installation Installable from GitHub, maven, sonatype or elasticsearch.org


Full article

How to install Weblogic Server 10.3.6

Follow the link: Weblogic Server 10.3.6

  • Accept the user agreement radio button. The link to download(Oracle WebLogic Server 11gR1 (10.3.6) ZIP Distribution) will be enabled.
    Note: You will be asked to login for the same.
  • click on the download link and the server jar file will be downloaded(wls1036_generic.jar)
  • Follow the complete steps mentioned here, or follow below steps:
    • Open CMD
    • Navigate to the directory where the file has been downloaded.
    • Run the following command as Admin

      java -jar wls1036_generic.jar

    • On Welcome, click the Next button.
    • On Choose Middleware Home Directory. select option

      Create a new Middleware Home

      click the Next button

    • On Register for Security Updates, enter email id, and unselect the security updates checkbox. This will disable update information.
      Click the Next button
    • Select Typical install on Choose Install Type Screen and keep clicking next for default options as shown:
      Click on Done.
    • Domain Configuration(Quick Start) will open:
    • On the QuickStart links panel, select this link

      Getting started with WebLogic Server 10.3.6

    • Follow the wizard as shown below:
      Enter domain related details
  • Your weblogic server is now installed.

How to make a dropdown as readonly in html

I encountered a problem where in it was required to make a drop down readonly.

While searching over internet i found THIS
But the solution mentioned there, didn’t appeal me much. As i had to make server side code changes while saving the value using the hidden field.

How do we do this? The common thought is to disable the drop down menu. Well, yes, but there’s a choice

When you use disabled, it prevents the user from using the drop down, or form element. You can see the year, but it is grayed out. Your mouse can’t select or change it, and you can’t tab to it with the keyboard. Disabled is used a lot with checkboxes. Sounds like just what we want, but you unknowingly might have caused yourself a small development problem.

The problem is “disabled” does just that. Disabled means that in your $_POST or $_GET that element will not show up in your controller. If you want to use the year in your controller, you won’t be able to recover it from that form. All you can do it look at the value on the web page.

What if we want to read the year, prevent the user from changing the year, and recover the year in the form data sent back to the controller. The solution for this is

Make a replica of your dropdown with a different name and different id.

Hide your original drop down with
This makes the element available in the form, so it will flow to the server side as well.
At the same time, it will give a look and feel of disabled to the user.

Example :



How to use logger in your Java application

How to log Messages in your application?

Java’s logging facility has two parts: a configuration file, and an API for using logging services. It is suitable for simple and moderate logging needs. Log entries can be sent to the following destinations, as either simple text or as XML:
· The console
· A file
· A stream
· Memory
· TCP socket on a remote host

The LEVEL class defines seven levels of logging enlightenment :
FINEST, FINER, FINE, CONFIG, INFO, WARNING, SEVERE .ALL and OFF are defined values as well

The levels in code may be modified as required :
· Upon startup, by using CONFIG to log configuration parameters
· During normal operation, by using INFO to log high-level “heartbeat” information
· When bugs or critical conditions occur, by using SEVERE.
· Debugging information might default to FINE, with FINER and FINEST used occasionally, according to user need.

There is flexibility in how logging levels can be changed at runtime, without the need for a restart:
· By simply changing the configuration file and calling LogManager.readConfiguration.
· By changing the level in the body of code , using the logging API ;
For example, one might automatically increase the logging level in response to unexpected events

The logging levels are in descending order SEVERE, WARNING, INFO, CONFIG, FINE, FINER and FINEST. If we specify log level as

INFO then all the log messages which are equal to INFO and greater (WARNING, SEVERE) levels will be logged.

Levels are attached to the following items:
· An originating logging request (from a single line of code)
· A Logger (usually attached to the package containing the above line of code)
· A Handler (attached to an application)

Here is an example of a logging configuration file :

Properties file which configures the operation of the JDK

logging facility. # The system will look for this config file, first using

a System property specified at startup:

>java -Djava.util.logging.config.file=myLoggingConfigFilePath

If this property is not specified, then the config file is retrieved

from its default location at:


Global logging properties.


The set of handlers to be loaded upon startup.

Comma-separated list of class names.

(? LogManager docs say no comma here, but JDK example has comma.)

handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler

Default global logging level.

Loggers and Handlers may override this level




Loggers are usually attached to packages.

Here, the level for each package is specified.

The global level is used by default, so levels

specified here simply act as an override.




— ConsoleHandler —

Override of global logging level


— FileHandler —

Override of global logging level


Naming style for the output file:

(The output file is placed in the directory

defined by the “user.home” System property.)


Limiting size of output file in bytes:


Number of output files to cycle through, by appending an

integer to the base file name:


Style of output (Simple or XML):


Here is an example of using the logging API :

package myapp.business;
import java.util.logging.*;
* Demonstrate Java's logging facilities, in conjunction
* with a logging config file.
public final class SimpleLogger {

  public static void main(String argv[]) {
    SimpleLogger thing = new SimpleLogger();
   public void doSomething() {
   //Log messages, one for each level
   //The actual logging output depends on the configured
    //level for this package. Calls to "inapplicable"
    //messages are inexpensive.
     fLogger.finest("this is finest");
    fLogger.finer("this is finer");
    fLogger.fine("this is fine");
    fLogger.config("this is config");
    fLogger.info("this is info");
    fLogger.warning("this is a warning");
    fLogger.severe("this is severe");

    //In the above style, the name of the class and
    //method which has generated a message is placed
    //in the output on a best-efforts basis only.
    //To ensure that this information is always
    //included, use the following "precise log"
    //style instead :
    fLogger.logp(Level.INFO, this.getClass().toString(), "doSomething", "blah");

    //For the very common task of logging exceptions, there is a
    //method which takes a Throwable :
    Throwable ex = new IllegalArgumentException("Some exception text");
    fLogger.log(Level.SEVERE, "Some message", ex);

    //There are convenience methods for exiting and
    //entering a method, which are at Level.FINER :
    fLogger.exiting(this.getClass().toString(), "doSomething");

    //Display user.home directory, if desired.
    //(This is the directory where the log files are generated.)
    //System.out.println("user.home dir: " + System.getProperty("user.home") );

  // PRIVATE //

  //This logger will inherit the config of its parent, and add
  //any further config as an override. A simple style is to use
  //all config of the parent except, perhaps, for logging level.

  //This style uses a hard-coded literal and should likely be avoided:
  //private static final Logger fLogger = Logger.getLogger("myapp.business");

  //This style has no hard-coded literals, but forces the logger
  //to be non-static.
  //private final Logger fLogger=Logger.getLogger(this.getClass().getPackage().getName());

  //This style uses a static field, but hard-codes a class literal.
  //This is probably acceptable.
  private static final Logger fLogger = Logger.getLogger(SimpleLogger.class.getPackage().getName());


Problem making DSN with SQL server from other machine.

I faced this problem when I was trying to connect to SQL server 2005 from another machine.

The error message said, that SQL server does not exist or access denied.

Solution :

  1. Start SQL Server Configuration Manager
  2. Expand SQL Server network configuration
  3. Select Protocols for MSSQLSERVER
  4. Double click TCP/IP in the right pane.
  5. Change enabled to true
  6. Click IP Addresses Tab and change the IP address to the IP address of the client.

Start SQL Server Area Configuration
Select Surface area configuration for services and connections.
Go to Database Engine -> Remote Connections and verify that remote connections are enabled. (The correct radio button is selected)