Wednesday, September 10, 2014

On Linux Server Documentation

The following information about a server are what I usually take note of:
  1. Purpose
  2. Linux distribution version (lsb_release -a)
  3. Kernel version (uname -a)
  4. Processor information (cat /proc/cpuinfo)
  5. Memory information (cat /proc/meminfo)
  6. Disk partitions (fdisk -l)
  7. Network configuration (cat /etc/network/interfaces)
  8. Hostname (cat /etc/hostname)
  9. Hosts file (cat /etc/hosts)
  10. DNS Servers (cat /etc/resolv.conf)
  11. Allowed users/Sudoers  (cat /etc/passwd; cat /etc/sudoers)
  12. SSH server configuration (cat /etc/ssh/sshd_config )
  13. Firewall/IPTables settings ( iptables -L )
  14. APT sources ( cat /etc/apt/sources.list ) 
  15. Nagios settings
  16. Backup process (depends on the solution being used: rsync, bacula, etc. )
  17. more to follow...
If you know the specific function of the server, say a MySQL database server, document the configuration (/etc/my.cnf).

Don't forget to backup the config and the data!

Sunday, August 24, 2014

A quick-and-dirty Java implementation of Topological Sort

Loading or something, this is just text to display while the browser pulls the gist....

Thursday, July 3, 2014

Reset/Reinitialize nova (openstack)

Sometimes the contents of the nova database are not updated properly when instances are deleted through the dashboard. This creates clutter because the instances with ERROR status remain in the dashboard list and cannot be deleted (in my case, no matter how many times I try). Some guides describe how to delete the problematic instances manually by accessing the nova database then deleting the appropriate entries in the affected tables using SQL. If you are working on an experimental system, reinitializing the entire nova database may be easier and faster. Perform the steps below on the controller node. WARNING: This will delete everything in the nova database. This is tested only on the havana version of openstack.

$mysql -u root -p
mysql>drop database nova;
mysql>create database nova; 
mysql>grant all privileges on nova.* to 'nova'@'%' identified by 'yournovapassword';
mysql>grant all privileges on nova.* to 'nova'@'localhost' identified by 'yournovapassword';
mysql>flush privileges;
mysql>exit
$sudo nova-manage db sync
After issuing the above commands, you need to restart all nova services on the controller node.

$sudo service nova-api restart
$sudo service nova-cert restart
$sudo service nova-consoleauth restart
$sudo service nova-scheduler restart
$sudo service nova-conductor restart
$sudo service nova-novncproxy restart
$sudo service nova-network restart

You also need to restart nova-compute on the compute nodes.

$sudo service nova-compute restart

You may need to do the following after:
  • Add custom flavors (nova flavor-create)
  • Add VM networks (nova net-create)
  • Add floating IP pool (nova floating-ip-bulk-create)
  • Edit the security rules for a project to access instances (best done through the dashboard)
*Note: The common cause of being unable to terminate instances is that the hypervisor is unreachable.
References:

Friday, January 10, 2014

ICS-Outdoor Society (ICS-OS) Season 2014

Jan 18. Mt Romelo / Buruwisan Falls
              Siniloan, Laguna
              to coincide with ICS week kick-off activity Mountain Clean-up Drive
              http://www.pinoymountaineer.com/2007/09/mt-romelo-240.html

Feb 22-25 Tirad Pass Traverse to Sagada
              Gregorio del Pilar, Ilocus Sur to Sagada, Mt. Province
              http://www.pinoymountaineer.com/2008/12/tirad-pass-traverse-sagada-1312.html

Mar 15 Makiling Traverse
     Sto. Tomas, Batangas to UPLB
       http://www.pinoymountaineer.com/2008/01/mt-makilingsto-tomas-trail-1090.html

Apr 6-9 Mt. Pulag Akiki Trail
              Kabayan, Benguet
              http://www.pinoymountaineer.com/2008/02/mt-pulagakiki-trail-2922.html

May 24-25 Cinco Picos - Silaguin Cove
              Subic, Zambales
              http://www.pinoymountaineer.com/2008/10/mt-cinco-picostraverse-to-silanguin.html

June 12 Freedom Climb
               Mt. Kalisugan, Calauan, Laguna
              http://www.pinoymountaineer.com/2007/08/mt-kalisungan-760.html

Wednesday, November 13, 2013

Six ways to access the start address of a two-dimensional array in C


#include <stdio.h>
#include <stdlib.h>
int d[2][2]={1,2,3,4};
int main(){
  printf("%x\n",(unsigned int)d);
  printf("%x\n",(unsigned int)&d);
  printf("%x\n",(unsigned int)&d[0]);
  printf("%x\n",(unsigned int)&d[0][0]);
  printf("%x\n",(unsigned int)d[0]);
  printf("%x\n",(unsigned int)*d);
  return 0;
}

Saturday, November 2, 2013

National Conference on IT Education (NCITE) 2013 Best Papers

This year's NCITE was held at Camiguin Island last October 24-26. The following papers were awarded Best Paper for the conference.


Simulating the Effects of Various Road Infrastructure Improvements to Vehicular Traffic in a Busy Three-road Fork 
by Marian Arada, Merly Tataro and Jaderick Pabico

Abstract
Using Microsimulations of vehicular dynamics, we studied the effects of several proposed infrastructure developments to mean travel delay time~$\Delta$ and mean speed~$\Sigma$ of vehicles passing a busy three-road fork, particularly in the non-signalized roundabout junction of Lower Bicutan, Taguig City, Metro Manila. We designed and implemented multi-agent-based microsimulation models to mimic the autonomous driving behavior of heterogeneous individuals and measured the effect of various proposed infrastructure developments on~$\Delta$ and~$\Sigma$. Our aim is to find out the best infrastructure development from among three choices being considered by the local government for the purpose of solving the traffic problems in the area. We created simulation models of the current vehicular traffic situation in the area using the mean travel times~$\tau$ of statistically sampled vehicles to show that our model can simulate the real-world at a significance level of $\alpha=0.05$. Based on these models, we then simulated the effect of proposed infrastructure developments on~$\Delta$ and~$\Sigma$ and used these metrics as our basis of comparison. We found out that the proposed widening of one fork from two lanes to three lanes has the most improved metrics at the same $\alpha=0.05$ compared to the metrics we observed in the current situation. Under this infrastructure development, the~$\Delta$ increases linearly ($R^2=0.98$) at the rate of 1.03~$s$, while the~$\Sigma$ decreases linearly ($R^2>0.99$) at the rate of 0.14~$km/h$ per percent increase in the total vehicle volume~$\mathcal{V}$. 

LINK APP: Linked Independent Kiosks for Application Processing
by Juan Miguel Carlos Abriol-Santos

Abstract
LINK APP is a web application that uses HTML 5 and JavaScript to access and record loan application details in a centralized server through a local database. The local database uses localStorage and WebSQL to store data. To protect the data stored in the LINK APP database, RSA and AES encryption were used for transmitting and storing data. The end users use the website of the office to generate application forms which contain a QR code. LINK APP is used by the staff members of the office to process the loan application forms. A downcast webcam is used to read the data. LINK APP supports offline usage so the application works even if Internet connection is intermittent. The University saves about 5000 sheets of paper every semester because of LINK APP.


WebGauge: An Agent-based Stress Testing Tool with Performance Data Visualization Targeted at Web Applications
by Michael De La Cruz, Dante Dinawanao and Jeyran Labrador

Abstract
WebGauge is an agent-based tool designed for stress-testing web applications written in PHP and Erlang. It accepts a sequence of HTTP requests, obtained from a recorded session of a user accessing a particular web-based application, and then executes them in several instances using software agents, as if they were executed concurrently by real users. Also, the number of users to simulate, requests and intervals can be configured according to your target end-user (e.g., a company with 1000 employees). Once started, WebGauge monitors resource utilization (e.g., memory, network, CPU) of the target application server while at the same time, keeps track of each transaction performed inside the target application itself, like the execution of an SQL query or rendering a page. After which, WebGauge displays performance data via tabular summaries and visually plotted in charts for analysis.


Acceptance Rate: 32/74 = 43.24%


The complete list of the accepted papers and abstracts is here.