2011-05-20

Puppet - How to list facts in facter in Puppet


Was messing around puppet and trying to get a list of "facts". Google & searching on puppet labs didn't return any luck. Most of the search result points to bug reports.

With no luck at all, I gotta skim through the docs to find the list of facts for my new toy (puppet). Stumble this link that actually points where the light is.

In short, to list the facts of puppet, do this in command line :
facter  | less

Hopefully this post will shed some light onto people searching on how to list facts in puppet.

Ciao !!!

2011-04-29

FreeBSD - CPU code in dmesg meanings

Platform :
FreeBSD








Objective :
What are those CPU features flags means in "dmesg", e.g.
Features=0xfebfbff&ltFPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,
PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS&gt
Features2=0x82982203&ltSSE3,PCLMULQDQ,SSSE3,CX16,SSE4.1,SSE4.2,POPCNT,
AESNI,&ltb31&gt&gt
AMD Features=0x28100000&ltNX,RDTSCP,LM&gt
AMD Features2=0x1&ltLAHF&gt

2011-04-22

Mysql - Error about packet too big while importing sql database












Q : While importing database in mysql, an error message pops out "ERROR 1153 (08S01) at line 232: Got a packet bigger than 'max_allowed_packet' bytes"
E.g.
$ mysql5 -u db_user -p db_table < db_table.sql 
Enter password: 
ERROR 1153 (08S01) at line 232: Got a packet bigger than 'max_allowed_packet' bytes
A : The file importing contains a statement that's probably too big, increase the value "max_allowed_packet" in my.cnf:

2011-04-18

Subversion - Branching and merging to release, stable or something else

Previously, we talk about the basic stuff of Subversion. This is still basic stuff :p


Is about managing source codes by branching. Branching is a way to have 2 or more sets of source code with each has it's own development, but eventually, merging them into the main trunk.

Example, in most development, we normally have "development" & "release" version. As word means, the "development" version is meant for development & testing. But the "release" version, would be the ultimate version that roll out for production use. For this example, "release" will be the trunk & "development" will be the branch.

A view of it :

web_blog(repository)
   |
   +release
   |  |
   |  +front_end
   |  |
   |  +engine
   | 
   | 
   +development
      |
      +front_end
      |
      +engine



To create this hierarchy :

2011-04-15

FreeBSD - How to check what services or port opening in tcp/udp

Platform :
FreeBSD

How to :
List/show what services or port is listening/opening.

Installation :
The command comes with base system.

2011-04-12

Nagios - Time within nagios is incorrect

Platform :
FreeBSD

Server :
Nagios

Problem :
Nagios's time stamp are incorrect, e.g. the comments section, the log file's time stamp. But the server's date, time & time zone are correct.

Cause :
Nagios configuration needs to specify the time zone offset, as well as the Apache's CGI module. These both settings make sure that nagios's time is in sync with the server's time.

Solution :

2011-04-11

AboutBSD.net - 20110411 Is back online, most of it

Managed to moved the site to another server and brought it back. If you're still seeing the "... Check back later ..." message, it is because the DNS record have not yet been refresh. Check back in another few hours.

The RSS feeds are up though. :)

2011-04-08

bash - working with ps

Platform :
FreeBSD

Objective :
To grab the process details of a pid, without resorting to parse the output of process status command , "ps" :
E.g.
ps aux | grep -i pid

2011-04-07

AboutBSD.net - 20110406 not accessible

AboutBSD.net, a BSD news planet maintain by me is currently unavailable due to some hardware issue. Please check back later.

2011-04-04

Bash - How to debug shell script

Although Bash will spit out the errors onto the screen whenever it hits one, but some times, we want to know what exactly was being done every single command it executed.

This is how to do it :
Before running the bash script, do a :
set -x
then run the script and it'll be tell every action that it performs.

This is especially useful when debugging logic.

After finding out what's wrong, this is how to turn it off :
set +x

Alternatively, to debug only when running this script, put the below line in the start of the script :
set -x
Arrivederci !!!

2011-04-01

FreeBSD - Behold, The Great Committer

Please don't scroll pass this post. This urgent & definitely needs your attention :
FreeBSD has always been something of a meritocracy, where the respect given to committers is directly proportional to the amount and quality of code they commit. This is tracked in the commit statistics. For many years, Poul-Henning Kamp (phk@) was the undisputed leader, but in 2010 his total was exceeded by relative newcomer John Baldwin (jhb@). Baldwin’s commits show no sign of slowing, and if he continues at this pace, he will soon overtake the combined totals of Foundation President Robert Watson and embedded emeritus Warner Losh.

Oh ya, make sure you have a mattress or you're stepping on a soft ground before you get hurt. Read on more here !!!

Ciao !!!

Perl - How to DOS your processor

Here's a way to maximize the CPU processor,

2011-03-28

Sendmail - How to test sending email, verbosely using Sendmail




Mail Server :

Sendmail

Purpose :

To verbosely test sending of email using sendmail

Here how :

Prepare a file with name "mail.txt". This will be the email header & contents that we wanna include when test sending this email. The contents of the file should look like below :

2011-03-25

PC-BSD - Error when restarting pf firewall or within Ports Jail

Trigger :

When pf service is restarted







Error messages :

# /etc/rc.d/pf restart
Disabling pf
pf disabled
.
Enabling pf
no IP address found for lo1:network
/etc/pf.conf:4: could not parse host specification
no IP address found for lo1:network
/etc/pf.conf:5: could not parse host specification
pfctl: Syntax error in config file: pf rules not loaded
pf enabled
.

Side Effect :

When running "Ports Jail" terminal with portsnap or installation, it will failed because there's not internet connection present.

Why :

The interface "lo1:network" is missing due to abnormal shutdown of "portjail" service.

2011-03-18

RFC 2606 - Domain names for testing

In this blog, often the output or the example used needed to be masked before posting. To protect the original server/identity. But when it comes to domain names, we can't simple quote some random name, it might be an active domain (in the future, if not now).


Also, for documentation or presentation, we tend to use mock up domain, server or host name. How to make sure that server, domain or host name is not in used?

In RFC 2606, there are domain names that serve this purpose :

2011-03-11

RFC 2142 - Mailbox Names for Common Services, Roles and Functions

RFC stands for Request For Comments. Not all RFC documents end up as standards. But it is indeed a good read to find out how standards works. For example, RFC 2142 list emails that should be reserve for its purpose :

2011-03-07