Tagged: command

FreeBSD: zzz command

While I was researching on suspend/resume capability for FreeBSD on my notebook, I came across with the zzz command. Guess, what it does! It puts the system in the sleep mode (zzz(8)).

Similar command for APM is:$ apm -z

For ACPI:$ acpiconf -s3

In the FreeBSD wiki page for Laptops, it asks to boot up a laptop with a FreeBSD CURRENT image and gathers some hardware info with the following commands: # mount -u -o rw / # dmesg > /dmesg.out # pciconf -lv > /pciconf.out # devinfo -v > /devinfo.out # acpidump -dt > /acpidump.out # mount -u -o ro / ; sync # zzz

Maybe, I'll give those commands a try next time when I go to a store...

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

That's all!
-gibb

FreeBSD: Disabling System Bell/Beep (Hardware Bell)

One of annoying things with notebook is the beep when you hit a wrong key. This is a way to disable system beep/bell.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

This is a recommended way to disable it but it did not work for me.# sysctl hw.syscons.bell=0 hw.syscons.bell: 1 -> 0 # sysctl -a | grep bell hw.syscons.bell: 0

Here is another way that worked for my HP Pavilion dm3-1130us notebook. Try this on a console and see if it disables a beep:# kbdcontrol -b quiet.off

If this works, make it permanent by editing /etc/rc.conf: # vim /etc/rc.conf ---------------------------------- allscreens_kbdflags="-b quiet.off"

That's all!
-gibb

FreeBSD: Displaying Installed video Driver

A few days ago, I was finally able to install FreeBSD 11-RELEASE on my HP Pavilion dm3-1130us notebook (see FreeBSD: gptzfsboot: No ZFS pools located, can't boot on FreeBSD 11-RELEASE) and started configuring it. Then, time to time, I needed to find the installed video driver for my system. So, here is the command: $ pciconf -lv | grep -B3 display vgapci@pci0:1:5:0 class=0x030000 card=0x3656103c chip=0x96121002 rev=0x00 hdr=0x00 vendor = 'Advanced Micro Devices, Inc. [AMD/ATI]' device = 'RS780M [Mobility Radeon HD 3200]' class = display

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

That's all!
-gibb

/usr/lib/libjpeg.so: could not read symbols: File in wrong format collect2: error: ld returned 1 exist status

I was in need of installing software on my Slackware64 14.1 on the other day and got a following error message: ... /bin/sh ../libtool --tag=CC --mode=link gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -fPIC -module -avoid-version -o export_jpg.la -rpath /usr/lib64/transcode export_jpg_la-export_jpg.lo -L/usr/lib -ljpeg -lm -lm -lz -ldl libtool: link: gcc -shared -fPIC -DPIC .libs/export_jpg_la-export_jpg.o -L/usr/lib /usr/lib/libjpeg.so -lm -lz -ldl -O2 -Wl,-soname -Wl,export_jpg.so -o .libs/export_jpg.so /usr/lib/libjpeg.so: could not read symbols: File in wrong format collect2: error: ld returned 1 exit status make[2]: *** [export_jpg.la] Error 1 make[2]: Leaving directory `/tmp/SBo/transcode-1.1.7/export' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/SBo/transcode-1.1.7' make: *** [all] Error 2

From the error message, I can tell that it has something to do with linker and libraries, perhaps using 32-bit library on my 64-bit Slackware. I checked the LDFLAGS variable in its MakeFile and it was empty.

Ok, is there a way to force the compiler to use 64-bit libraries with SlackBuild scripts?

YES! A variable can be passed to SlackBuild script. To force the SlackBuild script to use 64-bit library, simply add variable with its value before executing a SlackBuild script.

$ LDFLAGS="-L/usr/lib64" ./[SlackBuildScript_name]

VoilĂ . The compilation went through without any more errors!

Disclaimer: The information in this site is the result of my researches in the Internet and of my experiences. It is solely used for my purpose and may not be suitable for others. I will NOT take any responsibility of end result after following these steps (although I will try to help if you send me your questions/problems).

That's all!
-gibb

Debian Wheezy (7.5): LAMP (Linux, Apache, MariaDB, and PHP)

LAMP used to refer to Linux, Apache, MySQL, and PHP but nowadays the trend is transitioning from MySQL to MySQL's drop-in replacement MariaDB. The Slackware project switched the default database to MariaDB back in March 2013 for the version 14.1 and forward.

I was a little concerned about this change and wasn't sure if my web sites would work with Mhttp://blog.ataboydesign.com/wp-admin/post.php?post=959&action=editariaDB. However, my worry was trivial. MariaDB uses the same files as MySQL so this makes migration a lot easier.

So it's natural for me to try MariaDB on my new Debian Wheezy (7.5) system.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. It is solely used for my purpose and may not be suitable for others. I will NOT take any responsibility of end result after following these steps (although I will try to help if you send me your questions/problems).

Installing Apache2

Firts, make sure the system is up-to-date: # apt-get update && apt-get upgrade -y

Then, install apache2: # apt-get install apache2

Add apache2 to system start up and start it up now: # update-rc.d apache2 enable update-rc.d: using depndency based boot sequencing # service apache2 start [ ok ] Starting web server: apache2.

If you open a web browser and point it to http://localhost, you'll see the message It works!

Installing php5

Next, install php5 along with the apache php5 module, MySQL(MariaDB) php module, and other modules: # apt-get install php5-curl php5-xmlrpc php5-gd php5-intl libapache2-mod-php5 php5 php5-common php5-dev php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-mysql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy

Restart the web server: # apache2 restart

Test the php support by creating a php file (phpinfo.php) in the default document root, /var/www: # vim /var/www/phpinfo.php -------------------------------------------- < ?php phpinfo(); ?>

With successful installation/configuration, below page should be loaded:
debian_lamp_install_phpinfo

Installing MariaDB

To properly install and configure MariaDB, I need to know the version/codename of this Debian. I already know its Wheezy but to check, type the following command: # lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 7.5 (wheezy) Release: 7.5 Codename: wheezy

Now, open a web browser and go to MariaDB's download page to get the repository information for MariaDB: debian_lamp_install_mariadb_config

Above selection produces below repository info:
debian_lamp_install_mariadb_repo

Create a file called mariadb.list under /etc/apt/sources.list.d and copy & paste the repository info: # vim /etc/apt/sources.list.d/mariadb.list -------------------------------------------- # MariaDB 10.0 repository list - created 2014-05-10 06:44 UTC # http://mariadb.org/mariadb/repositories/ deb http://mirror.jmu.edu/pub/mariadb/repo/10.0/debian wheezy main deb-src http://mirror.jmu.edu/pub/mariadb/repo/10.0/debian wheezy main

Add MariaDB to the system: # apt-get install python-software-properties # apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db # apt-get update # apt-get install mariadb-server

Follow the on-screen instructions to set up a root password for MariaDB server.

Let's see if MariaDB server was successfully installed: # mysql -u root -p Enter password: Welcome to the MariaDB monitor. Command end with ; or \g. Your MariaDB connection id is 38 Server version: 10.0.10-MariaDB-1~wheezy mariadb.org binary distribution Copyright (c) 2000, 2014 Oracle, SkySQL Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>

VoilĂ ! With above steps, I have successfully installed LAMP stack on my Debian Wheezy server.

If you are interested, take a look at my post on VirtualHost: Name-Based Web Sites on a Single IP Address

That's all!
-gibb