New Ubuntu Desktop Checklist

Long time no update on this blog. Feeling sad but also get blessed in same time 🙂

My old netbook get retired due to battery and screen problem. Windows license attached to my machine also useless on that case. I need to work and decide to get old friend help. Ubuntu desktop. Yes, I also use Ubuntu but for server only when FreeBSD not accepted by client. I need to setup my new environment quickly and make document for future reference.

I use Ubuntu 13.04 with these software :

  1. VirtualBox; I need this software for experiment purpose. Try new OpenBSD, NetBSD and FreeBSD folks. I hope I can create more post 🙂
  2. gphpedit; notepad++ replacement . Sublime text is another option but I think its enough at the moment.
  3. Shutter; screenshot tool also need to documentation.
  4. Blue Griffon; wysiwyg html editor. I need it for quick html.
  5. Xampp; apache, mysql and php installer.

Beside the software I need to learn shortcut too. CTRL+ALT+T is my friend for terminal access 🙂

in Work | 169 Words

Install Laravel 4 on Windows 7

Working with laravel Shirt I want to learn new things and it seem a lot of changes already happened. Specially PHP. First time I learn about this lang I see 4.0 version. Today, I see PHP already reach 5.3, 5.4 and so on. I don’t know about OOP in PHP so I decide to learn about OOP by doing it on project.

Laravel is my option after CodeIgniter . As usual, installation is big thing for me and my netbook run on Windos 7 starter.

Steps for Laravel installation on Windows 7 :

Download latest laravel version 

In time of writing I got 4.0.4 version.

Put it on Xampp htdocs directory.

I rename it to laravel after extract its content.

install_laravel_windows7_1

 

Install Git

Git work ‘distribution system control‘ . It will work together with composer.

Download latest version of Git for Windows from here.

Installation is straightforward. A few notes during installation :

– Make sure to choose “Run Git from the Windows Command Prompt” on adjusting your PATH environment section.

Checkout Window style,commit unix-style line endings on Configuring the line ending conversion section.

Install Composer for Windows

Get latest version from here. Install it as usual. Nothing serious here 🙂

Configuration

In this section we just need to check if everything is work.

1. Check php version
C:\Users\pc>php -v

PHP 5.4.7 (cli) (built: Sep 12 2012 23:48:31)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

C:\Users\pc>

2. Check Git version

Continue reading

Testing Newrelic on Ubuntu Server

I have chance to try newrelic software. Its advance monitoring service and analysis in one place.

As they said “application performance management and monitoring”.

After sign up for free account I continue to deploy it on Ubuntu server (most of my server use freeBSD but I prefer to try it on Linux based system first).

The process is easy and straightforward as you can see from the picture :

newrelic1

 

The only problem is PHP version since I downgrade it for compatible issue.

# php -v
PHP 5.2.10-2ubuntu6 with Suhosin-Patch 0.9.7 (cli) (built: Oct 23 2009 16:30:10)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

Continue

# wget -O - http://download.newrelic.com/548C16BF.gpg | apt-key add -

# nano /etc/apt/sources.list.d/newrelic.list

enter these line :

deb http://apt.newrelic.com/debian/ newrelic non-free

deploy newrelic agent:

# apt-get update

# apt-get install newrelic-php5

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
newrelic-daemon newrelic-php5-common
The following NEW packages will be installed:
newrelic-daemon newrelic-php5 newrelic-php5-common
0 upgraded, 3 newly installed, 0 to remove and 124 not upgraded.
Need to get 12.2 MB of archives.
After this operation, 31.7 MB of additional disk space will be used.
Do you want to continue [Y/n]? y

# newrelic-install install

new screen will show up

New Relic PHP Agent Installation (interactive mode)
===================================================
In order for the New Relic agent to function correctly it requires a license
key. Please enter that key now. If you do not have your license key handy you
can add it to your INI file(s) later. Please be aware that the license key you
specify here will be installed in the default INI files, and will be the key
used for any virtual host or directory / application that does not over-ride
the key on a per-host or per-directory basis. This is only relevant if you run
a multi-tenant site. Please contact [email protected] if you run such a
site and have any questions.

If you are upgrading from a previous version please leave this blank. Please
also note that the key you enter here will not replace any existing key in
your INI file(s). It applies only to newly created INI files or INI files that
have not been modified by this script before.

Enter New Relic license key (or leave blank):

Just follow on screen guide.

Then you’ll see this message :

New Relic is now installed on your system. Congratulations!

The last step before you will start seeing data in your account is to restart
your web server or servers, or whatever environment hosts the PHP you wish to
monitor. For example, you may need to restart Apache or nginx, or if you are
using php-fpm and FastCGI, you will need to restart php-fpm. If you installed
New Relic into multiple locations you may have multiple PHP hosts to restart.
If everything is working properly you should see the following two log files:

/var/log/newrelic/newrelic-daemon.log
/var/log/newrelic/php_agent.log

Now you should create a simple test php script that contains the line:

<?php phpinfo(); ?>

and point your browser at the test script, and you should see the New Relic
extension and its settings. If you still do not see those log files or data in
your account please contact our support staff at [email protected] and be
sure to include the following file in your bug report:

/tmp/nrinstall-20130420-105849-26070.tar

Thank you for choosing New Relic!

Checking log presence :

# ls -l /var/log/newrelic | grep log

-rw-rw-rw- 1 root root 997 2013-04-20 11:02 newrelic-daemon.log
-rw-r–r– 1 root root 3303 2013-04-20 11:01 php_agent.log

Yes,log file is exist.

newrelic2

 

phpinfo() also show information about newrelic.

My newrelic dashboard now give many information :

newrelic3

 

Wow, impressive report and many more.

 

Upgrade FreeBSD and The ‘pw’ command exited with unexpected status 74

I have a vps account and got problem with pw  and also from sysinstall  after upgrade FreeBSD from 8.2 to 8.3.

# uname -a
FreeBSD alamsyah-rasyid.cust.arpnetworks.com 8.2-RELEASE-p3 FreeBSD 8.2-RELEASE-p3 #0: Tue Sep 27 18:45:57 UTC 2011 [email protected]:/usr/obj/usr/src/sys/GENERIC amd64

# freebsd-update upgrade -r 8.3-RELEASE

….6680….6690….6700….6710….6720….6730….6740….6750….6760….6770….6780….6790….6800….6810….6820….6830….6840….6850….6860….6870….6880….6890….6900….6910….6920….6930….6940….6950….6960….6970….6980….6990….7000….7010….7020….7030….7040….7050….7060….7070….7080….7090….7100….7110….7120….7130….7140….7150….7160….7170….7180….7190….7200….7210….7220….7230….7240….7250….7260….7270….7280….7290….7300….7310….7320….7330….7340….7350….7360….7370….7380….7390….7400….7410….7420….7430….7440….7450….7460….7470….7480….7490….7500….7510….7520….7530….7540….7550….7560….7570….7580….7590….7600….7610….7620….7630….7640….7650….7660….7670….7680….7690….7700….7710….7720….7730….7740….7750….7760….7770….7780….7790….7800….7810….7820….7830….7840….7850….7860….7870….7880….7890….7900….7910….7920….7930….7940….7950….7960….7970….7980….7990….8000….8010….8020….8030….8040….8050….8060….8070….8080….8090….8100….8110….8120….8130….8140….8150….8160….8170….8180….8190….8200….8210….8220….8230….8240….8250….8260… done.
Applying patches…

# The following changes, which occurred between FreeBSD 8.2-RELEASE and
FreeBSD 8.3-RELEASE have been merged into /etc/group:
— current version
+++ new version
@@ -1,6 +1,6 @@
-# $FreeBSD: src/etc/group,v 1.35.10.1.6.1 2010/12/21 17:09:25 kensmith Exp $
+# $FreeBSD: src/etc/group,v 1.35.10.2.2.1 2012/03/03 06:15:13 kensmith Exp $

you should check this file and see if tis fit your setting.

Mergemaster work as expected and time for freebsd-update install.
# freebsd-update install
Installing updates…
Kernel updates have been installed. Please reboot and run
“/usr/sbin/freebsd-update install” again to finish installing updates.

After restart the machine I need to add new account but got this error :

The ‘pw’ command exited with unexpected status 74

Further search lead me to this command  :

cd /etc && pwd_mkdb -p master.passwd

This command work well and solve my problem.

in Unix | 177 Words

Find out which lan card device is active

I used to work with FreeBSD till I resign after working for 10 years. Not touch server for long time make bit nervous when a client ask me to install and configure new server using various OS but mainly still in Linux or BSD environment.

When client change lan card position or change rj45 location system will get error message and not working.

Identify lan card and its ip address in Linux

# ifconfig -a | more

eth0 Link encap:Ethernet HWaddr 00:21:5e:6b:f6:76
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Memory:91a80000-91aa0000

eth1 Link encap:Ethernet HWaddr 00:21:5e:6b:f6:77
inet addr:192.168.1.10 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::221:5eff:fe6b:f677/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4607 errors:0 dropped:0 overruns:0 frame:0
TX packets:7707 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:394554 (394.5 KB) TX bytes:10255745 (10.2 MB)
Memory:91980000-919a0000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:226 errors:0 dropped:0 overruns:0 frame:0
TX packets:226 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:36231 (36.2 KB) TX bytes:36231 (36.2 KB)

usb0 Link encap:Ethernet HWaddr 02:21:5e:6b:f6:79
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

# ifconfig -s
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth1 1500 0 4627 0 0 0 7724 0 0 0 BMRU
lo 16436 0 226 0 0 0 226 0 0 0 LRU

How about FreeBSD??

# ifconfig -a
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
ether 00:16:3e:9f:46:a1
inet 216.24.200.111 netmask 0xfffffff8 broadcast 216.24.200.199
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> metric 0 mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000

another FreeBSD machine

$ ifconfig -a
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC>
ether 5c:f3:fc:2a:53:35
inet 118.97.168.200 netmask 0xffffff00 broadcast 118.97.168.255
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
em1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC>
ether 5c:f3:fc:2a:53:36
inet 10.36.2.9 netmask 0xffffff00 broadcast 10.36.2.255
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
nd6 options=3<PERFORMNUD,ACCEPT_RTADV>

Message from this post :

1. use ifconfig -s in linux to check which lan card device connected with cable.

2. See status in FreeBSD to check which lan card connected with lan cable.

in Unix | 480 Words