Wednesday, August 19, 2015

-SNAPSHOT amd64 X200: Drupal 7 module installation error.

Hi,

So far I'm still learning about Drupal. I have a project in mind using this. So I wanted to install a module into this Drupal-o-mine.

First, I need to enable FTPd. I edited /etc/rc.conf.local file and add this:

ftpd_flags=

Then I start the daemon by using:

# sudo /etc/rc.d/ftpd start

I open Drupal's page using web browser. In Drupal's Home page, I click on "Modules" link on the top bar and then click on "+ Install new module" link on the Module's page. I've already downloaded the module's tar.gz file so choose that file and then click "Install".

The "Update Manager" page appears. The "Connection method" only have "FTP" so nothing to change there. The "User" is my login's user name. Then the password is my login pass. I leave the "ADVANCE SETTINGS" as it is then click on "Continue" button.

Error message

Installation failed! See the log below for more information.

recipe

  • Error installing / updating
  • File Transfer failed, reason: Cannot create directory /htdocs/drupal7/sites/all/modules

Next steps



This is the error I received. Yeah I know it's permission issue (and might even be the current Drupal's bug) and I tried everything below without success:

-Change "htdocs/drupal7/sites/all/modules" owner and permission.
-Change the tar.gz file permission.

I will search for answer and if this is the current Drupal's bug (https://www.drupal.org/node/842620), I might try manual module installation. Later

Friday, August 07, 2015

SNAPSHOT amd64 X200: httpd + PostgreSQL + Drupal 7.

Hey,

Starting with 5.7, OpenBSD have their own httpd replacing nginx in base. This httpd is fairly new and un/fortunately I'm trying to learn Drupal nowadays. Sure I can install Apache or nginx from port but I want to test the new httpd.

Take note!
1) I'm currently on -CURRENT using snapshot.
2) I never installed drupal or any web app before.
3) This is a Work In Progress and will be updated until it's done.

So I guess that's quite a warning for you guys. My installation might not be the correct one or might not even install correctly but I will try to make sure I find out how to make this work. Googling for info on the new httpd with Drupal only return less than handful of info. But as always, web searching is needed. So without any delays, here I go.


SETTING UP HTTPD.
As I'm going Openbsd's own (and new) httpd, the program has been already installed. To enable it, I just need to edit /etc/httpd.conf. I commented all the entries in that file except for this few lines (mostly the "A minimal default server" entries).

---- /etc/httpd.conf start ----
# Macros
ext_addr="*"

# A minimal default server
server "default" {
listen on $ext_addr port 80

location "*.php" {
fastcgi socket "/run/php-fpm.sock"
}
root "/htdocs"

}

# Include MIME types instead of the built-in ones
types {
include "/usr/share/misc/mime.types"
}
---- /etc/httpd.conf end ----

As a simple rule-of-a-thumb, start with the minimum configuration then adjust from there. It's easier to check for error/mistakes. As Drupal is a PHP program, I need to install PHP. I also will be using PostgreSQL for the database. What I've installed is:

php-5.6.11
php-fpm.5.6.11p0
php-gd-5.6.11 (this might be dependency, I can't recall right now)
php-pdo_pgsql-5.6.11 (I'll be using PostgreSQL instead of MySQL)
postgresql-client-9.4.4
postgresql-contrib-9.4.4
postgresql-docs-9.4.4 (optional, but I want it)
postgresql-server-9.4.4

As we can see in the /etc/httpd.conf, there's "php-fpm" entry. As the package has been installed, I need to make it start at boot along with httpd by editing /etc/rc.conf.local.

---- /etc/rc.conf.local start ----
httpd_flags=
slowcgi=
pkg_scripts=php_fpm postgresql

---- /etc/rc.conf.local end ----

The "slowcgi" came with httpd, so I add it in /etc/rc.conf.local. Now we can either start httpd, slowcgi & php-fpm manually now or reboot. Unlike Apache, there's no template webpage that you can see after your httpd has started. So I created a Hello World-like index.html file inside the webserver's root directory which is /var/www/htdocs/. So now I open up my web browser and insert the URL as either "localhost" or "127.0.0.1" (without quotes), I can see the Hello World page. Httpd is running fine. To test the PHP function, I created a phpinfo.php file inside the same directory with this value:

---- /var/www/htdocs/phpinfo.php start ----
<?php phpinfo(); ?>
---- /var/www/htdocs/phpinfo.php end ----

I open the URL "localhost/phpinfo.php" in my browser, the PHP Version page is displayed and I know PHP is working fine.


INSTALLING DRUPAL.
I just pkg_add drupal-7.32.p1. Then I read the info in /usr/local/share/doc/pkg-readmes/drupal-7.32p1 telling me to symlink (symbolic link) the drupal7.conf and follow the database setup for PostgreSQL which is:

ln -sf /var/www/conf/modules.sample/drupal7.conf /var/www/conf/modules

createuser -U postgres --pwprompt --no-superuser --createdb --no-createrole drupal
createdb -U drupal -E UTF8 drupal

The "postgres" name is my PostgreSQL's admin name. There will be input request for password so I create a password, verify it and make sure I don't forget it. For drupal7.conf, I haven't touch anything, yet.


SETTING UP DRUPAL.
Webserver running? Check. PostgreSQL running? Check. Drupal running? Not yet. I tried putting "localhost/drupal7" and "127.0.0.1/drupal7" in the browser but both didn't work. I got Error 403 Forbidden. Ouch. I'm seriously lack of experience for this httpd and drupal stuff so I thought that maybe I need to install either Apache or Nginx (assuming that nobody done drupal with httpd yet). That's until I read a hint in www.drupal.org. So, I insert this in my browser:

http://localhost/drupal7/install.php

And wallah!, the Drupal installation page appears!. Yes! It's making progress. So I proceed with the installation as below:

Choose profile = Standard > Save and continue
Choose language = English (built-in) > Sane and continue
Verify requirements = all is ok except for "Unicode library = Error"

7th August: Ok. The error is about a deprecated function in PHP which must be disabled for Drupal's installation to continue. Yeah quite confusing. The exact error is:

Unicode libraryError
Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini mbstring.http_input setting. Please refer to the PHP mbstring documentationfor more information.

I opened the PHP mbstring documentation but nothing can help me on this. So I google for tips and found that there's 2 ways to resolve this.

1) Add this lines in .htaccess in Drupal's web root (/var/www/htdocs/drupal7)

---- .htacces start ----
php_value mbstring.http_input pass
php_value mbstring.http_output pass
---- .htaccess end ----

I checked the Drupal's web root, but there's no .htacces file inside. I think this is related to Apache but just to make sure, I downloaded a sample .htacces file from www.drupal.org . Restarted the httpd, open the installation page and still have that error. So this is not working for me.

2) Add this line in ../drupal7/sites/default/setting.php

---- setting.php start ----
ini_set('mbstring.http_input', 'pass');
ini_set('mbstring.http_output', 'pass');

---- setting.php end ----

Restarted the httpd. And open the installation page and greeted by this warning message:

  • Deprecated function: ini_set(): Use of mbstring.http_input is deprecated in include_once() (line 318 of /htdocs/drupal7/sites/default/settings.php).
  • Deprecated function: ini_set(): Use of mbstring.http_output is deprecated in include_once() (line 319 of /htdocs/drupal7/sites/default/settings.php).

When I click Save and continue, this message appears in every page. But then the Verify requirement page passed successfully (although the warning is still there). So I'm now at the Set up database page.

Set up database:
Database = PostgreSQL
Database name* = drupal (the one I set before in PostgreSQL)
Database username* = drupal
Database password* = (the password I entered back then in PostgreSQL)

But now I'm in dilemma. I don't know if that "Deprecated function:" warning is harmless or not. I think I will search for more clue before I click on that "Save and continue" button.

Update 9th August: Searching on the net point me out to the most relevant issue stated in drupal's site at:

https://www.drupal.org/node/2332295

There's patch files listed on the top of that page and the most relevant one is the file:

drupal7-unicode_requirements-2332295-23.patch

That file will be patching /includes/unicode.inc file in the root Drupal's folder. I read the patch file, and compared with the current unicode.inc file and found that this is the correct patch. Now to patch it.


PATCHING DRUPAL
I downloaded the patch file, and move it to Drupal's root folder at /var/www/htdocs/drupal7 . Patching is something I rarely do so I refresh what I can by using man patch.

I need to test the patch first, to see if it's working as it's supposed to be. So I proceed with the testing command:

# sudo patch -C includes/unicode.inc drupal7-unicode_requirements-2332295-23.patch

Then the result came:

---- message snipped ----
Patching file includes/unicode.inc using Plan A...
Hunk #1 succeeded at 116.
done

Looks fine to me. So then I proceed with the actual patching:

# sudo patch includes/unicode.inc drupal7-unicode_requirements-2332295-23.patch

Done. Now to test the Drupal's installation. Just remember to delete/comment back both the "ini_set" lines I added in sites/default/settings.php. Restarted httpd and proceed with installation again.

INSTALLATION.
- Get browser to open http://127.0.0.1/drupal7/install.php
- Choose profile > Standard > Save and continue = passed
- Choose language > English (built-in) > Save and continue = passed
- Verify requirements = passed
- Set up database
 > Database name = drupal
 > Database username = drupal
 > Database password = (same as when I set in PostgreSQL)
 > Save and continue

Got this error:

In order for Drupal to work, and to continue with the installation process, you must resolve all issues reported below. For more help with configuring your database server, see the installation handbook. If you are unsure what any of this means you should probably contact your hosting provider.
Failed to connect to your database server. The server reports the following message: SQLSTATE[08006] [7] could not translate host name "localhost" to address: no address associated with name.
  • Is the database server running?
  • Does the database exist, and have you entered the correct database name?
  • Have you entered the correct username and password?
  • Have you entered the correct database hostname?

Ok. I read that because httpd in OpenBSD is chrooted, I need to copy /etc/hosts and put it in /var/www/etc/. By default there's no etc/ folder in www so I need to mkdir it. Make sure that "hosts" file at least have this line:

127.0.0.1   localhost www.example.com

Now that should be it. Restarted httpd again and run throught the installation again.

- Set up database
 > blablabla
 > Save and continue = passed
- Install profile (it will take a moment = passed
- Configure site
 > Site name* = default
 > Site e-mail address* = noreply@example.com (can be changed)
 > Username = karl
 > E-mail address = (real email address)
 > Password* = *********
 > Confirm password* = *********
 > Default country = Malaysia
 > Default time zone = Asia/Kuala Lumpur
 > Check for updates automatically = checked
 > Received e-mail notifications = checked
 > Save and continue = FINISHED!

Congratulations, I installed Drupal. Now to visit my local site.

Unfortunately, currently I can't use http://127.0.0.1/drupal7/ to visit my site (which if my httpd configured correctly, should be the correct address) but I can visit the site by using complete URL instead.

http://127.0.0.1/drupal7/index.html

For Drupal, all seems ok. I need to further test out and start exploring. For httpd issue above, I will also do the same. I will update on these issues when I found any tips. Enjoy the screenshot. Later.


UPDATE!: Bah although Drupal has been installed successfully, it's not functioning as it should. I have a feeling it's related to OpenBSD's httpd's setting. I would be grateful if someone can point me to relevant setting for this issue. Thanks in advance.

Update 10th August: Ok I have configured the /etc/httpd.conf file and now Drupal is working fine. Here's my configuration:

---- /etc/httpd.conf start ----
ext_addr="*"

server "default" {
    listen on $ext_addr port 80

    directory {
        index "index.php"
    }

    location "*.php" {
        fastcgi socket "/run/php-fpm.sock"
    }

    location "/cgi-bin/*" {
        fastcgi
        root "/"
    }

    root "/htdocs/drupal7"
}
---- /etc/httpd.conf end ----

Restarted the httpd server. Now when I type www.example.com or 127.0.0.1 or localhost in my browser, I can see the Drupal start page. I typed my Username and Password then I can see the site correctly. No more errors.


I've also posted a Hello World! entry to test it out. Enjoy the screenshot. Later.

Thursday, May 28, 2015

5.7 amd64 X200: Rotating random wallpaper using feh + cron. And more.

Hi,

Searching for rotating wallpaper on the web has given me a few good shell scripts to use. But what if I just want to use the good ol' crontab and feh? Here's what I've done.

What I'm on now:
- CWM
- feh

Obviously CWM is my WM of choice nowadays. And I've installed feh. My lappy's screen resolution is 1280x800 so I went searching for beautiful nature's wallpaper. Get more than 2 so I'll have many rotation choices.

For me, I mkdir a Wallpapers folder. So it's look like:

~/Wallpapers

I put all the pictures into that folder. Now for the cron part.

$ crontab -e

This is my first cron so the file is empty. I want this wallpaper to rotate using random picture every 5 minutes. So my cron is like this:

*/5 * * * * DISPLAY=:0.0 feh --bg-fill -z --no-fehbg ~/Wallpapers/

In short, human-readable meaning is every 5 minutes (*/5) the screen (DISPLAY=:0.0) will be used by feh to fill the picture as wallpaper (--bg-fill) randomly (-z) without writing a ~/.fehbg file (--no-fehbg) using pictures from the folder ~/Wallpapers .

Then press :WQ to write the changes and quit so the process will start. Enjoy the rotating wallpapers guys.

Ok. Now. What if I want to use random wallpapers everytime I log in to cwm? The command is the same like crontab there but I need to ready 2 things.

Editing ~/.xsession and put this line (before exec cwm or any WM of your choice).

eval `cat ~/.fehbg`
exec cwm

Now create/edit ~/.fehbg and put the command like in crontab (without the DISPLAY=:0.0 bit):

feh --bg-fill -z --no-fehbg ~/Wallpapers/

And it's done. Oh wait, how about another one? Get a menu to change to a random wallpaper in cwm. Open up ~/.cwmrc and put this:

command ChangeWP "feh --bg-fill -z --no-fehbg ~/Wallpapers/"

Then refresh the cwm (by default should be pressing Ctrl+Alt+Shift+R) and click the menu.

Man crontab / feh for more info. Later.

Wednesday, May 27, 2015

5.7 amd64 X200: Downgraded back to 5.7-RELEASE but accidently clean installed.

Ouch,

This is one of those days. One of those days. I was having problem building libreoffice port in -current. Then found a latest snapshot, I upgraded to that latest snapshot but still having a problem building libreoffice. I didn't remember the exact error but it's related to GCC and lib-java or something similar.

I need to use libreoffice for my office works. So I thought on downgrading to 5.7-RELEASE. Downgraded I did. But failed miserably. I stupidly reinstall the -release. No. Cleanly installed. Yeah. I know. All my files are gone now.

My dotfiles, my data. Ouch. I mean a big OUCH. Yeah I know I should've kept my backup current. It's a stupid mistake on my side.

And now I will most probably start from (near) scratch. What I've learned?

1) Make sure the libreoffice is in packages for the -current version I want to upgrade as building libreoffice in port is a big pain in the butt.

2) Take backup seriously. I mean SERIOUSLY.

Later.

Tuesday, May 26, 2015

5.7 amd64 X200: New experiences

Hi,

This is what I noticed when I upgraded my X200 to 5.7. Take note that I don't have a lot of packages installed so my experience here is minimum.

TMUX:
mode-mouse no longer works. Documentation is saying that setting mouse on is enough now. Tried that but currently mouse not working as expected.
UPDATE: Previously when you scroll the mouse wheel, tmux will automatically scroll. Now you need to press ^B+[ (Ctrl+B [) then you can use the mouse wheel to scroll.

/etc/login.conf:
Now the datasize-cur has been upped in the default installation to 1536M. Great. Firefox and other memory hogging package rarely crash now.

Xombrero:
There's issue with /usr/local/lib/libestdc++.so.16.0 WARNING. Sometime Xombrero would crash and then starting the program will also coredump. After a few tries then Xombrero will run again.

There are others which I can't recall right now as I'm now on -CURRENT and using port to install Libreoffice. More on this later.

5.7 amd64 X200: Creating / Using Easy2Boot installer for OpenBSD

Hi,

OpenBSD 5.7 is out and what am I gonna wait for? Ok now I'm running 5.7-CURRENT using snapshot, newly upgraded from 5.7-RELEASE but more on that later. Right now I want to share another good way to install OpenBSD using USB Drive.

If you read my Creating USB Flashdrive post, you may notice that the previous way will create a flashdrive installer solely for OpenBSD. It's a good option for a small capacity flashdrive, or for a big capacity flashdrives, if you want to store your favourite packages in it. But what if you wanted to make a multi OS installer flashdrive?

Why I wanted to have a multiboot flashdrive? Well, OpenBSD is not perfect. There's something that OpenBSD lack that other OS have. It is wider packages availability. There's a time that I wanted to install something and it's not yet available in OpenBSD. Be it lack of porter's interest and/or lack of resources to port it, there's that time that I need to use the specific application. Heck the only minus point for OpenBSD to me is less packages than GNU/Linux. And then I sometime have that sort of need to test other *BSD OS or GNU/Linux distro. That's why.

After a brief comparison of tools that I need to use, I choose Easy2Boot. I'm not going to write in details about setting up Easy2Boot. You can check their website for instructions. It's fairly easy to setup Easy2Boot as the installer will take care of almost everything IIRC.

What OSes I wanna put in there?
1) OpenBSD (of course!)
2) FreeBSD
3) Ubuntu Linux
4) Maybe UBCD or other tools

Again, I won't write in details about other things than OpenBSD. As Easy2Boot is Linux-friendly, there will be no problem preparing Linux distro for Easy2Boot. As for FreeBSD, you can check out Easy2Boot for FreeBSD section.

For OpenBSD, I tried using install57.iso and the result is:
Booting - booting is ok. Can go through (U)pgrade option but then Easy2Boot cannot mount the ISO file correctly so I cannot install the packages contained in it.

What's the option? I need to use the minimum installation ISO = cd57.iso. Easy2Boot can take care of booting up the minimal ISO and I can run the installation/upgrade process. Take note that I'm using Windows to prepare this.

1)  Download cd57.iso from OpenBSD FTP site.
2) Rename the cd57.iso into some filename that easy to figure out. eg: OpenBSD57-AMD64.iso. Easy2Boot is very picky about "." (dot). Make sure to only have 1 dot only.
3) Move the ISO into the prepared Easy2Boot flashdrive:
/_ISO/MAINMENU/
4) Run the /MAKE_THIS_DRIVE_CONTIGUOUS.cmd inside the root folder of the flashdrive.

Ok the booting part is done. As the ISO is just a minimal boot, I need to get the base packages ready.

1) Go to the root flashdrive. eg: /
2) Create 5.7/amd64/ folder.
3) FTP into OpenBSD FTP site to download the base packages. For -RELEASE, it's ftp.openbsd.org/pub/OpenBSD/5.7/amd64/ .
4) Download all the bsd* , *tgz and optionally-but-recommended SHA256* files into the /5.7/amd64/ inside the flashdrive.

Done. Now, this method is more like the usual installation method, right? And who said that OpenBSD is hard?

For installation:
1) After Easy2Boot is booted, choose your OpenBSD ISO to boot OpenBSD image and do (U)pgrade.
2) When the installer ask for the packages, choose disk, then choose not mounted, and then choose sd1i (depending on your system).
3) Point your installer to the directory 5.7/amd64 inside the mounted sd1i.
4) If you created the folder correctly and put the files in there, the installer should list all the files needed to do the installation/upgrade.
5) Install/Upgrade!

Let the installation continues and reboot. After reboot, do sysmerge, the usual stuff. Starting from 5.7, the etcXX.tgz and xetcXX.tgz is now in base. So the sysmerge command is much simpler now.

# sysmerge

That's it. I've tried installing both OpenBSD and Ubuntu Linux using Easy2Boot and so far it's great. I haven't tried FreeBSD though. I hope you will find this useful. Later then.

Saturday, April 11, 2015

5.6 AMD64 X200: Tryton ERP, "no module named stdnum" error when installing "bank" module.

Hey,

I'm currently trying out Tryton ERP, a fork of OpenERP which is now known as Odoo ERP. Both are open-source, although some would differ on which is more open-source than the other.

Anyway, I have a test "server" in my office now, although not much of a server as it's just an Intel Atom netbook but sufficient for my testing usage. Its role? Well I want it to be a testbed for database server, probably an ERP/CRM/HRM server the company I work at can use.

In that "server", I have Odoo installed. And in my lappy, I have Tryton installed. I like how Odoo (v8) have (in my opinion) a mature web ui, which currently Tryton don't (yes I know tryton have SAO). But that is somewhat a plus-point because I want the staff to use the web ui. Also Odoo's module can be installed via their web ui. Then their HR app is good.

Why didn't I install Odoo in my laptop too? Well, because Tryton is a fork of the same base ERP, and then Tryton is already in OpenBSD's package. Also there's quite convincing arguement from Tryton's dev on why their program is better (in term of coding, stability, security) from Odoo (or OpenERP as I read the comparison between Tryton vs Odoo/OpenERP v7 only). But Tryton's module installation is quite a hassle as you need to do pkg_add then import the installed module using trytond -i all -d "dbname".

Speaking of which, I was trying out some of the modules available for Tryton. I was a bit frustrated when on OpenBSD there's no trytond-module-all module so I can install all available module just in 1 go; but then this have it merits as I stumbled on an issue while installing the "trytond-module-bank" module.

pkg_add trytond-module-bank installation went fine. The problem arose when I tried to import the module using trytond -i all -d tryton32 (take note "tryton32" is my database name). I received this error message:

$ no module named stdnum

After searching for answer, I found that this module (trytond-module-bank) requires a python module called "python-stdnum" which is not the OpenBSD's package system. So I search for it using "pip".

$ sudo pip search stdnum

And there it is. "python-stdnum" module sitting there waiting for me to install it. And that's what I did.

$ sudo pip install python-stdnum

Installation went ok. Good. Then I proceed with importing the module in Tryton.

$ sudo trytond -i all -d tryton32

Success! Now I can continue experimenting with this great software.

Oh another thing. In /etc/trytond.conf, take note for these settings:

jsonrpc = localhost:8000

Make sure that if you're using Tryton client, the "hostname" is set to localhost, not the local IP Address (127.0.0.1) because I've done that and it won't connect.

Later then.

Friday, November 14, 2014

5.6 AMD64 X200: Using "Browser Back" & "Browser Next" keys in Xombrero.

Hi,

I was thinking of utilizing the "Browser Back" &"Browser Next" keys (located just above the "Left" & "Right" keys respectively) so that I can switch between previous and next open tabs in Xombrero browser.

So I start xev and after checking I found that the keysym for "Browser Back" is "XF86Back" and "Browser Next" is "XF86Forward". Good. Then I opened up ~/.xombrero.conf and add the keybindings such as:

keybinding = tabnext,XF86Forward
keybinding = tabprevious,XF86Back

Then restart Xombrero. Good times. Later.

Monday, November 03, 2014

5.6 AMD64 X200: Update to 5.6! Package update problem and pkg_check to the rescue.

Hi,

I updated my X200 lappy to 5.6 today using the trusted upgrade using USB thumbdrive method. Upgrading went smooth until I done upgrading my packages.

Well, "done" isn't the correct word. I exited the pkg_add -u while it was updating my packages and I should've known that it will haunt me sooner or later. I re-run the pkg_add -u without realising that previous update wasn't done correctly. So I paid the price when I saw that GIMP, LibreOffice and GTK+2 can't be updated due to some libraries error. Something like:

Can't install gtk+2-2.24.24 because of libraries
| avahi-client.0.0 not found
| bla bla not found

Oh my. So what do I need to do now? The answer is:

pkg_check

This neat command checks the packages, dependencies and lots more. It's kind of interactive, so it will ask if problematic packages needs to be repaired or not, or like what I choose, [a]utomatic answer. Then it will do its job. And it does it well.

After it's done, I re-run pkg_add -u and all is ok. All updated correctly. Wallah!

Saturday, July 12, 2014

5.5 amd64 X200: Alpine S/MIME, finally managed to sign with CACert.

Hi,

I finally managed to get my Alpine to sign outgoing emails with Digital Certs from CACert.org, "community-driven Certificate Authority that issues certificates to the public at large for free."

If you're using Thunderbird, setting up Digital Signature is quite easy, just a matter of getting your personal Digital ID and importing it in Thunderbird. There's a few steps in detail but it's just a matter of a bit of adventure in the Thunderbird's Option window.

But if you're like me, who uses Alpine and would like to have the ability to sign with Digital Signature, there's quite a challenge. I've been stuck with this for some time, but as it's not a super-urgent thing, I took my time to solve this. So here I'm posting the steps needed to get my Alpine to sign my email with Digital Cert attained from CACert.org.

1) Register with CACert.org and create a personal Digital Cert.
This step is self-explanatory, go to http://www.cacert.org, register your own account and create your personal Digital Certificate. I don't want to pay for Digital Certificate offered by more trustworthy company so this is a great option for me.

2) Download the Digital Certificate from CACert.org and import in Firefox.
Ok for this, you will need to have Firefox. After you downloaded your Digital Certificate, you will need to open up Firefox, and in Edit > Preferences > Advanced > Certificates > View Certificates > Your Certificates, click on the Import button and import your Digital Cert.

3) Backup Digital Cert from Firefox in PKCS12 format.
From Edit > Preferences > Advanced > Certificates > View Certificates > Your Certificates, choose the Digital Cert you want to use and then click the Backup button. You will need to create a password for it. Remember to save it at pkcs12 format. For example, save it as karl@mail.com.p12.

4) Create PEM format from the PKCS12 file.
Open your xterm, and create a PEM file from the PKCS12 (*.p12) file you just backed up.

$ openssl pkcs12 -in karl@mail.com.p12 -out karl.@mail.com.pem

Now the newly created karl@mail.com.pem file can be edited with vi or any text editor you use.

5) Create CRT and KEY file for Alpine use.
Some people suggested to use openssl to create CRT and KEY file. I didn't managed to do this successfully using the openssl method, and the result is that my Alpine gave out "Couldn't find the certificate needed to sign." prompt when I try to sign my outgoing emails. So I went with the manual way.

Remember that the PEM format is plain text and editable? So I vi the karl@mail.com.pem file. I can see there's 3 section there. The top part is something like this:

Bag Attributes
    *snipped*
-----BEGIN ENCRYPTED PRIVATE KEY-----
*blablabla*

That top portion is the private key. Delete everything before the:

-----BEGIN ENCRYPTED PRIVATE KEY-----

and delete everything after the:

-----END ENCRYPTED PRIVATE KEY-----

then save it to something as karl@mail.com.key. Remember, this is your private key. And don't overwrite the original file you've edited.

Open the karl@mail.com.pem file again. You would see the just below the private key portion, there's something like:

Bag Attributes
    friendlyName: CAcert.org Class 1 Certification Authority
    *snipped*
-----BEGIN CERTIFICATE-----

Now this is you Certificate Issuer portion. I edited the file and deleted everything before the immediate:

-----BEGIN CERTIFICATE-----

and deleted everything after the immediate:

-----END CERTIFICATE-----

then save the file as cacert.org.crt. Do take note that this file could be named as anything but make sure the filename ends with ".crt".

Open the PEM file again, and the 3rd portion is you public key. The "Bag Attributes" details should contain your email address you created the Digital Cert with. So I deleted everything before the:

-----BEGIN CERTIFICATE-----

then save the file to something as karl@mail.com.crt.

6) Setup Alpine to use the karl@mail.com.key Digital Cert.
By default, Alpine needs ~/.alpine-smime directory to store the Digital Certs. But in my case, it didn't exits. So I mkdir these directories:

~/.alpine-smime/ca
~/.alpine-smime/public
~/.alpine-smime/private

Then move all your *crt & *.key files to the correct directory such as:

~/.alpine-smime/ca/cacert.org.crt
~/.alpine-smime/public/karl@mail.com.crt
~/.alpine-smime/private/karl@mail.com.key

That should be it. In Alpine, I use Roles so the From address is the same as my Digital Cert so Alpine can Digitally sign the email composed. So far signing email is ok but I haven't tested the encryption. Later.

References.
- http://www.cacert.org
- http://comments.gmane.org/gmane.mail.alpine.info/4969
- Roles in Alpine
- Alpine S/MIME - http://patches.freeiz.com/alpine/alpine-info/misc/smime.html

5.5 amd64 X200: Firefox always crashing? Then try raising datasize.

Heyya,

My Firefox crashed sometime. Been like this since forever I think. Didn't bother to look at it until a few days ago when I think "hey I commonly sees this crashing but why other didn't flame the net about it?". So I went out to search for answers.

Then I found that this is not application or OpenBSD issue, but rather limited default setting. Firefox is quite a resource hog and by default, the datasize limit is set for 512Mb, which is by Firefox, quite low.

So I edited /etc/login.conf and find the default setting like below:

default:\
    *snipped*
    :datasize-max=512M:\
    :datasize-cur=512M:\
    *snipped*

and changed the value to:

default:\
    *snipped*
    :datasize-max=2048M:\
    :datasize-cur=1024M:\
    *snipped*

As I have about 4Gb of ram, this setting should be ok. So far this setting is ok and Firefox haven't crashed yet. Later.

References:

- man login.conf
- http://daemonforums.org/showthread.php?t=7894

Thursday, May 22, 2014

5.5 amd64 X200: Upgraded to 5.5!

Heyya,

I've upgraded my system to 5.5 yesterday using the USB Flashdrive upgrade method. Do check the links on the left side for info about creating USB Bootable Flashdrive for OpenBSD installation/upgrade.

Be sure to check http://www.openbsd.org/faq/upgrade55.html as there's quite major changes been done on this new version.

Oh also OpenBSD have provided disk images for us to create bootable flashdrive installation media. Do check http://www.openbsd.org/faq/faq4.html#MkInsMedia. I personally haven't tried this yet as I upgraded my flashdrive using my old method.

Make sure to create new openbsd.pbr if you're like me, dual-booting. Later.

Monday, November 04, 2013

5.4 amd64 X200: dmesg with "render error detected".


OpenBSD 5.4 (GENERIC.MP) #41: Tue Jul 30 15:30:02 MDT 2013
    deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4168814592 (3975MB)
avail mem = 4050112512 (3862MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xe0010 (68 entries)
bios0: vendor LENOVO version "6DET72WW (3.22 )" date 10/25/2012
bios0: LENOVO 745AU5L
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT ECDT APIC MCFG HPET SLIC BOOT ASF! SSDT TCPA SSDT SSDT SSDT
acpi0: wakeup devices LID_(S3) SLPB(S3) IGBE(S4) EXP0(S4) EXP1(S4) EXP2(S4) EXP3(S4) USB0(S3) USB3(S3) USB5(S3) EHC0(S3) EHC1(S3) HDEF(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpiec0 at acpi0
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz, 2394.34 MHz
cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,NXE,LONG,LAHF,PERF
cpu0: 3MB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
cpu0: apic clock running at 265MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz, 2394.00 MHz
cpu1: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,NXE,LONG,LAHF,PERF
cpu1: 3MB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
ioapic0 at mainbus0: apid 1 pa 0xfec00000, version 20, 24 pins
ioapic0: misconfigured as apic 2, remapped to apid 1
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-63
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (AGP_)
acpiprt2 at acpi0: bus 2 (EXP0)
acpiprt3 at acpi0: bus 3 (EXP1)
acpiprt4 at acpi0: bus -1 (EXP2)
acpiprt5 at acpi0: bus 5 (EXP3)
acpicpu0 at acpi0: C3, C2, C1, PSS
acpicpu1 at acpi0: C3, C2, C1, PSS
acpipwrres0 at acpi0: PUBS
acpitz0 at acpi0: critical temperature is 127 degC
acpitz1 at acpi0: critical temperature is 104 degC
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: SLPB
acpibat0 at acpi0: BAT0 model "42T4650" serial  8341 type LION oem "Panasonic"
acpibat1 at acpi0: BAT1 not present
acpiac0 at acpi0: AC unit online
acpithinkpad0 at acpi0
acpidock0 at acpi0: GDCK not docked (0)
cpu0: Enhanced SpeedStep 2394 MHz: speeds: 2401, 2400, 1600, 800 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel GM45 Host" rev 0x07
vga1 at pci0 dev 2 function 0 "Intel GM45 Video" rev 0x07
intagp0 at vga1
agp0 at intagp0: aperture at 0xd0000000, size 0x10000000
inteldrm0 at vga1
drm0 at inteldrm0
inteldrm0: 1280x800
wsdisplay0 at vga1 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
"Intel GM45 Video" rev 0x07 at pci0 dev 2 function 1 not configured
"Intel GM45 HECI" rev 0x07 at pci0 dev 3 function 0 not configured
puc0 at pci0 dev 3 function 3 "Intel GM45 KT" rev 0x07: ports: 1 com
com4 at puc0 port 0 apic 1 int 17: ns16550a, 16 byte fifo
com4: probed fifo depth: 15 bytes
em0 at pci0 dev 25 function 0 "Intel ICH9 IGP M AMT" rev 0x03: msi, address 00:1f:16:0c:9d:56
uhci0 at pci0 dev 26 function 0 "Intel 82801I USB" rev 0x03: apic 1 int 20
uhci1 at pci0 dev 26 function 1 "Intel 82801I USB" rev 0x03: apic 1 int 21
uhci2 at pci0 dev 26 function 2 "Intel 82801I USB" rev 0x03: apic 1 int 22
ehci0 at pci0 dev 26 function 7 "Intel 82801I USB" rev 0x03: apic 1 int 23
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
azalia0 at pci0 dev 27 function 0 "Intel 82801I HD Audio" rev 0x03: msi
azalia0: codecs: Conexant CX20561
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 "Intel 82801I PCIE" rev 0x03: msi
pci1 at ppb0 bus 2
ppb1 at pci0 dev 28 function 1 "Intel 82801I PCIE" rev 0x03: msi
pci2 at ppb1 bus 3
iwn0 at pci2 dev 0 function 0 "Intel WiFi Link 5300" rev 0x00: msi, MIMO 3T3R, MoW, address 00:21:6a:18:0c:5c
ppb2 at pci0 dev 28 function 3 "Intel 82801I PCIE" rev 0x03: msi
pci3 at ppb2 bus 5
uhci3 at pci0 dev 29 function 0 "Intel 82801I USB" rev 0x03: apic 1 int 16
uhci4 at pci0 dev 29 function 1 "Intel 82801I USB" rev 0x03: apic 1 int 17
uhci5 at pci0 dev 29 function 2 "Intel 82801I USB" rev 0x03: apic 1 int 18
ehci1 at pci0 dev 29 function 7 "Intel 82801I USB" rev 0x03: apic 1 int 19
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb3 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0x93
pci4 at ppb3 bus 13
pcib0 at pci0 dev 31 function 0 "Intel 82801IEM LPC" rev 0x03
ahci0 at pci0 dev 31 function 2 "Intel 82801I AHCI" rev 0x03: msi, AHCI 1.2
scsibus0 at ahci0: 32 targets
sd0 at scsibus0 targ 0 lun 0: SCSI3 0/direct fixed naa.5000cca6d5c57bed
sd0: 305245MB, 512 bytes/sector, 625142448 sectors
ichiic0 at pci0 dev 31 function 3 "Intel 82801I SMBus" rev 0x03: apic 1 int 23
iic0 at ichiic0
usb2 at uhci0: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci1: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci2: USB revision 1.0
uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb5 at uhci3: USB revision 1.0
uhub5 at usb5 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb6 at uhci4: USB revision 1.0
uhub6 at usb6 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb7 at uhci5: USB revision 1.0
uhub7 at usb7 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
aps0 at isa0 port 0x1600/31
render error detected, EIR: 0x00000010
  IPEIR: 0x00000000
  IPEHR: 0x00000000
  INSTDONE_0: 0xfffffffe
  INSTDONE_1: 0xffffffff
  INSTDONE_2: 0x00000000
  INSTDONE_3: 0x00000000
  INSTPS: 0x00000000
  ACTHD: 0x00000000
page table error
  PGTBL_ER: 0x00000003
error: [drm:pid0:i915_report_and_clear_eir] *ERROR* EIR stuck: 0x00000010, masking
mtrr: Pentium Pro MTRR support
ugen0 at uhub3 port 2 "Lenovo Computer Corp ThinkPad Bluetooth with Enhanced Data Rate II" rev 2.00/3.99 addr 2
uhidev0 at uhub5 port 2 configuration 1 interface 0 "Logitech USB-PS/2 Optical Mouse" rev 2.00/20.00 addr 2
uhidev0: iclass 3/1
ums0 at uhidev0: 3 buttons, Z dir
wsmouse1 at ums0 mux 0
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
root on sd0a (6dbd1ba38f84ab48.a) swap on sd0b dump on sd0b

5.4 amd64 X200: Error in dmesg.

Hey,

Today I received error in the dmesg. My OpenBSD can boot fine though.

render error detected, EIR: 0x00000010
  IPEIR: 0x00000000
  IPEHR: 0x00000000
  INSTDONE_0: 0xfffffffe
  INSTDONE_1: 0xffffffff
  INSTDONE_2: 0x00000000
  INSTDONE_3: 0x00000000
  INSTPS: 0x00000000
  ACTHD: 0x00000000
page table error
  PGTBL_ER: 0x00000003
error: [drm:pid0:i915_report_and_clear_eir] *ERROR* EIR stuck: 0x00000010, masking


drm issue? Not sure. I'll be doing another reboot to check. Weird as there's no error after upgrading. Tried xscreensaver, ok. Tried mplayer playing Full HD (1080) mkv file, wow it was great! So ok. Except for it hangs when I tried to skip forward while playing the movie. Tried mplayer SD clips, ok.

Will try some testing or else will do another installation to test out.

5.4 amd64 X200: Now on 5.4! VIM-python not updated.

Hey,

I've just upgraded my X200 to 5.4. On first reboot, I noticed the framebuffer console. Wow. Nice. Finally we have this.

I've updated all my installed packages except for VIM. Something is wrong with the update. I installed my VIM via ports last time because I need the python flavor. Starting VIM also give error.

After the failed attempt to update via pkg_add, so I uninstalled it and tried to install it via ports. Also failed becuase of library bad major issue. Ouch.

Then I remembered that I haven't updated by port tree yet. Sheesh.

# cd /usr/ports
# cvs -d anoncvs@server.openbsd.org:/cvs update -Pd -rOPENBSD_5_4

Let em updated. And then install the VIM back.

# cd /usr/ports/editor/vim
# env FLAVOR="gtk2 python" make install clean

Wallah! Now it's nice and dandy.

5.4 amd64 X200:dmesg



OpenBSD 5.3 (GENERIC.MP) #62: Tue Mar 12 18:21:20 MDT 2013
    deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4184543232 (3990MB)
avail mem = 4050657280 (3863MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xe0010 (68 entries)
bios0: vendor LENOVO version "6DET72WW (3.22 )" date 10/25/2012
bios0: LENOVO 745AU5L
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT ECDT APIC MCFG HPET SLIC BOOT ASF! SSDT TCPA SSDT SSDT SSDT
acpi0: wakeup devices LID_(S3) SLPB(S3) IGBE(S4) EXP0(S4) EXP1(S4) EXP2(S4) EXP3
(S4) USB0(S3) USB3(S3) USB5(S3) EHC0(S3) EHC1(S3) HDEF(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpiec0 at acpi0
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz, 2394.31 MHz
cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,NXE,LONG,LAHF,PERF
cpu0: 3MB 64b/line 8-way L2 cache
cpu0: apic clock running at 266MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz, 2394.00 MHz
cpu1: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,NXE,LONG,LAHF,PERF
cpu1: 3MB 64b/line 8-way L2 cache
ioapic0 at mainbus0: apid 1 pa 0xfec00000, version 20, 24 pins
ioapic0: misconfigured as apic 2, remapped to apid 1
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-63
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (AGP_)
acpiprt2 at acpi0: bus 2 (EXP0)
acpiprt3 at acpi0: bus 3 (EXP1)
acpiprt4 at acpi0: bus -1 (EXP2)
acpiprt5 at acpi0: bus 5 (EXP3)
acpicpu0 at acpi0: C3, C2, C1, PSS
acpicpu1 at acpi0: C3, C2, C1, PSS
acpipwrres0 at acpi0: PUBS
acpitz0 at acpi0: critical temperature is 127 degC
acpitz1 at acpi0: critical temperature is 104 degC
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: SLPB
acpibat0 at acpi0: BAT0 model "42T4650" serial  8341 type LION oem "Panasonic"
acpibat1 at acpi0: BAT1 not present
acpiac0 at acpi0: AC unit online
acpithinkpad0 at acpi0
acpidock0 at acpi0: GDCK docked (15)
cpu0: Enhanced SpeedStep 2394 MHz: speeds: 2401, 2400, 1600, 800 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel GM45 Host" rev 0x07
vga1 at pci0 dev 2 function 0 "Intel GM45 Video" rev 0x07
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
intagp0 at vga1
agp0 at intagp0: aperture at 0xd0000000, size 0x10000000
inteldrm0 at vga1: apic 1 int 16
drm0 at inteldrm0
"Intel GM45 Video" rev 0x07 at pci0 dev 2 function 1 not configured
"Intel GM45 HECI" rev 0x07 at pci0 dev 3 function 0 not configured
puc0 at pci0 dev 3 function 3 "Intel GM45 KT" rev 0x07: ports: 1 com
com2 at puc0 port 0 apic 1 int 17: ns16550a, 16 byte fifo
com2: probed fifo depth: 15 bytes
em0 at pci0 dev 25 function 0 "Intel ICH9 IGP M AMT" rev 0x03: msi, address 00:1f:16:0c:9d:56
uhci0 at pci0 dev 26 function 0 "Intel 82801I USB" rev 0x03: apic 1 int 20
uhci1 at pci0 dev 26 function 1 "Intel 82801I USB" rev 0x03: apic 1 int 21
uhci2 at pci0 dev 26 function 2 "Intel 82801I USB" rev 0x03: apic 1 int 22
ehci0 at pci0 dev 26 function 7 "Intel 82801I USB" rev 0x03: apic 1 int 23
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
azalia0 at pci0 dev 27 function 0 "Intel 82801I HD Audio" rev 0x03: msi
azalia0: codecs: Conexant CX20561
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 "Intel 82801I PCIE" rev 0x03: msi
pci1 at ppb0 bus 2
ppb1 at pci0 dev 28 function 1 "Intel 82801I PCIE" rev 0x03: msi
pci2 at ppb1 bus 3
iwn0 at pci2 dev 0 function 0 "Intel WiFi Link 5300" rev 0x00: msi, MIMO 3T3R, MoW, address 00:21:6a:18:0c:5c
ppb2 at pci0 dev 28 function 3 "Intel 82801I PCIE" rev 0x03: msi
pci3 at ppb2 bus 5
uhci3 at pci0 dev 29 function 0 "Intel 82801I USB" rev 0x03: apic 1 int 16
uhci4 at pci0 dev 29 function 1 "Intel 82801I USB" rev 0x03: apic 1 int 17
uhci5 at pci0 dev 29 function 2 "Intel 82801I USB" rev 0x03: apic 1 int 18
ehci1 at pci0 dev 29 function 7 "Intel 82801I USB" rev 0x03: apic 1 int 19
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb3 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0x93
pci4 at ppb3 bus 13
pcib0 at pci0 dev 31 function 0 "Intel 82801IEM LPC" rev 0x03
ahci0 at pci0 dev 31 function 2 "Intel 82801I AHCI" rev 0x03: msi, AHCI 1.2
scsibus0 at ahci0: 32 targets
sd0 at scsibus0 targ 0 lun 0: SCSI3 0/direct fixed naa.5000cca6d5c57bed
sd0: 305245MB, 512 bytes/sector, 625142448 sectors
cd0 at scsibus0 targ 1 lun 0: ATAPI 5/cdrom removable
ichiic0 at pci0 dev 31 function 3 "Intel 82801I SMBus" rev 0x03: apic 1 int 23
iic0 at ichiic0
usb2 at uhci0: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci1: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci2: USB revision 1.0
uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb5 at uhci3: USB revision 1.0
uhub5 at usb5 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb6 at uhci4: USB revision 1.0
uhub6 at usb6 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb7 at uhci5: USB revision 1.0
uhub7 at usb7 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
aps0 at isa0 port 0x1600/31
mtrr: Pentium Pro MTRR support
uhub8 at uhub0 port 5 "Lenovo product 0x1005" rev 2.00/0.01 addr 2
uhidev0 at uhub8 port 2 configuration 1 interface 0 "Primax Electronics USB Opti
cal Mouse" rev 2.00/2.00 addr 3
uhidev0: iclass 3/1
ums0 at uhidev0: 3 buttons, Z dir
wsmouse1 at ums0 mux 0
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
root on sd0a (6dbd1ba38f84ab48.a) swap on sd0b dump on sd0b
iwn0: radio is disabled by hardware switch
iwn0: radio is disabled by hardware switch
iwn0: radio is disabled by hardware switch
umass0 at uhub1 port 2 configuration 1 interface 0 "Kingston DataTraveler 2.0" rev 2.00/1.00 addr 2
umass0: using SCSI over Bulk-Only
scsibus3 at umass0: 2 targets, initiator 0
sd1 at scsibus3 targ 1 lun 0: SCSI0 0/direct
removable serial.095116075B810A000B85
sd1: 1906MB, 512 bytes/sector, 3903488 sectors


Friday, October 18, 2013

5.3 amd64 X200: MP3 file not detected in ncmpcpp / mpd / mpc.

Hi,

I have collections of mp3 audio in my lappy. Nowadays, instead of mplayer which I use specifically for videos, I use mpd. For the frontend, I use ncmpcpp which is a curse-based console, uh, GUI(?). I has many great features which you can refer to from the link I've given.

Ok, there's a collection of mp3s I'm currently listening to. Around 114 files. Then I realised that a few files is not listed in ncmpcpp even when I tried (U)pdating the file browser. When I do ls in the directory, the file is there. I can play the file using mplayer.

I tried using mpc, command line for mpd but I still cannot list the file.

Fearing that I may have a corrupted mp3 file, I was prepared to download that hundred Mbs worth of files when I saw this:

$ ls -lh
-rw-r--r-- Audio_that_is_ok.mp3
-rw-r--r-- Audio_that_is_ok_2.mp3
-rw------- Audio_that_is_not_detected.mp3
-rw-r--r-- Audio_that_is_ok_3.mp3

*ting!*. Ohhhh. That's the reason. Ahah! That files is set to (r)ead/(w)rite for me only. So I chmod 644 the affected files and after (u)pdating my ncmpcpp, all is well.

Sometime we overlooked the simplest thing. Oh ok maybe just me. Later.

Wednesday, May 29, 2013

5.3 amd64 X200: Upgrading OpenBSD using USB Flashdrive.

Hey,

This is related to Creating USB Flashdrive installer. I posted previously. I have another OpenBSD machine in my office, not that the company requires it but as it's my machine, I installed whatever I want. The machine is still on 5.2, so this is a good chance to test my shiny USB Flashdrive installer.

If your machine is just like mine, which support USB Booting, I just boot from USB Flashdrive. Bolded is my input.

Welcome to the OpenBSD/amd64 5.3 installation program.
(I)nstall, (U)pgrade or (S)hell?
u

Available disks are: sd0 sd1.
Which disk is the root disk? ('?' for details) [sd0]
?
sd0: ST9160823AS (149.1G)
sd1: DataTraveler 2.0 (1.9G)


As you can see it asked for the root disk. Which is the disk I want to upgrade. I choose ? to check which device is for my primary disk and which is for the USB Flashdrive. As you can see, sd1 is my Kingston DataTraveler USB Flashdrive. So then I just press ENTER for the default choice [sd0] for the root disk.

Let's upgrade the sets!
Location of sets? (cd disk ftp http or 'done') [cd]
disk

Remember the sets are in the USB Flashdrive so I need to set the location correctly. So I choose disk.

Is the disk partition already mounted? [no] ENTER
Available disks are: sd0 sd1.
Which one contains the upgrade media? (or 'done') [sd1]
ENTER
  a:        1228768             64        4.2BSD    2048    16384    1
  i:        2658867        1228863        MSDOS
Available sd1 partitions are: a i.
Which one has the upgrade sets? (or 'done') [a]
Enter
Pathname to the sets? (or 'done') [5.3/amd64] 5.3

The sd1 is not mounted, so I need to answer accordingly. I then choose sd1 and then the a partition (remember sd1a is for OpenBSD, sd1i is for MSDOS). My 5.3 sets is in sd1a/5.3/ so I just input the directory name 5.3.

Select sets by entering a set name, a file name pattern or 'all'. De-select sets by prepending a '-' to the set name, file name pattern or 'all'. Selected sets are labelled '[X]'.

Now I can see the list of sets I have in the 5.3 directory. Continue to upgrade as usual. After it's upgraded, I rebooted the machine to change the timezone, then mount the USB Flashdrive again to do sysmerge. The usual stuff.

Installation via USB Flashdrive is FAST! Later.

Wednesday, May 22, 2013

5.3 AMD64 X200: Upgrading, the OpenBSD way.

Hi,

Remember 5.1 AMD64: Following -current & Radeon 6.14.3 installation?. Well, I have an apology to make.

The correct way to upgrade is:

1) Copy bsd* and *tgz files for upgrade.
2) Copy the bsd.rd to / .
3) Reboot, then boot> boot bsd.rd . Proceed with upgrade.
4) sysmerge.
5) Upgrade packages.

As you can see, sysmerge should be after upgrading, not before as I've posted previously. Sorry bout that. Yes I used my method from 5.0 until 5.3 without any issue but it's not the official way. It might break the upgrade process.

So, from now on, I will follow the official way.

Friday, May 17, 2013

5.3 AMD64 X200: Creating USB Flashdrive installer.

Heyya,

I've been thinking about some sort of installation method without using CDs. As OpenBSD release new version every 6 month, burning CDs for new ISO is just wasting CD. Currently I still hang on with my 5.0 installation CD and have all the installation files of 5.1 to 5.3 in an external drive. So, if my X200 went crazy, I need to install 5.0 then upgrade all the way to 5.3.

I thought of creating another partition in my X200, just to hold installation files. It will be something like an OS Recovery partition. It's a nice idea to play with, but then Recovery Partition is useless if my hard disk have hardware issue.

So I thought of using a thumbdrive as OpenBSD installation media. Good thing is, I can just update the OpenBSD version on the thumbdrive when new version is released.

I have a Kingston DataTraveler 2.0 USB thumbdrive, 2Gb capacity. 2Gb for OpenBSD installation media is too much, so I think of creating 2 partition on it, 600Mb for OpenBSD installer + all the installation files and the rest for normal thumbdrive usage (FAT32 filesystem).

After searching for relevant informations, this is how I did it. First, I need to clear the thumbdrive. The thumbdrive I want to use is identified as sd1 so yours might be different. Do take note as you don't want to wipe the wrong drive. So I booted my X200 into 5.3, then get to the console. I plugged in my thumbdrive and proceed with this command (bold is my input):

$ sudo fdisk -iy sd1
Writing MBR at offset 0.


Then I proceed to edit the thumbdrive's slice (partition) using fdisk.

$ sudo fdisk -e sd1
Enter 'help' for information


You can check your thumbdrive's slice but mine have 4 (0 to 3) with number 3 for OpenBSD. So I edit the slice's information for OpenBSD part.

fdisk: 1> e 3
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
*3: A6      0   1   2 -    241 254  63 [          64:     3887666 ] OpenBSD     Partition id ('0' to disable) [0 - FF]: [A6] (? for help) ENTER
Do you wish to edit in CHS mode? [n] ENTER
Partition offset: [64] ENTER
Partition size: [3887666] 600m


Take note that I didn't use the CHS mode. For the OpenBSD slice, it's ok. But I need to use the CHS mode for the FAT32 slice or else I won't get the 2 partitions I needed.

fdisk: 1> e 0
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused     
Partition id ('0' to disable) [0 - FF]: [0] (? for help) 0B
Do you wish to edit in CHS mode? [n] y
BIOS Starting cylinder [0 - 241]: [0] 76
BIOS Starting head [0 - 254]: [0] 125
BIOS Starting sector [1 - 63]: [1] 49
BIOS Ending cylinder [0 - 241]: [0] 241
BIOS Ending head [0 - 254]: [0] 254
BIOS Ending sector [1 - 63]: [1] 63


As you can see, slicing the FAT32 part is a bit tricky. I need to verify my OpenBSD's slice CHS information (Ending) and adjust the FAT32 CHS informations (Starting - Ending) accordingly. As you can see, my OpenBSD's CHS ended at 241 - 254 - 63 so I used that info as Starting CHS detail for the FAT32 slice. The Ending part should be the maximum of the CHS available.

Now I flag the OpenBSD slice to make it active.

fdisk:*1> flag 3
Partition 3 marked active.

Then quit and save changes.

fdisk:*1> quit

That was only the slicing part. In Window's world it's called partitioning. But now I need to partition the OpenBSD slice created. For this I need to use disklabel.

$ sudo disklabel -E sd1
Label editor (enter '?' for help at any prompt)
> a
partition: [a] ENTER
offset: [64] ENTER
size: [1228799] *
FS type: [4.2BSD] ENTER
Rounding size to bsize (32 sectors): 1228768

As the thumbdrive will just be an installation media, no need to create SWAP or any other partition. To confirm, I need the partition info.

> p m
OpenBSD area: 64-1228864; size: 600.0M; free: 0.0M
#                size           offset  fstype [fsize bsize  cpg]
  a:           600.0M               64  4.2BSD   2048 16384    1
  c:          1906.0M                0  unused                  
  i:          1298.3M          1228863   MSDOS

Looks good. Remember that sd1a is the a (OpenBSD) partition and sd1i is for the FAT32. Now quit and save changes.

> q
Write new label?: [y] ENTER

Sliced and partitioned, the thumbdrive is ready to be formatted. I use newfs.

$ sudo newfs /dev/rsd1a
$ sudo newfs /dev/rsd1i

It might take a while depending on how big your thumbdrive's capacity is. When done, I mount the OpenBSD's slice sd1a.

$ sudo mount /dev/sd1a /mnt

Then I copy my X200's /boot file to that thumbdrive.

$ sudo cp /boot /mnt

After that I make the slice bootable.

$ sudo /usr/mdec/installboot -v /mnt/boot /usr/mdec/biosboot sd1

Then I need to create a folder named 5.3 and copy all 5.3 installation files (bsd* & *tgz) into it.

$ sudo mkdir /mnt/5.3

Then I need to create an etc folder, create a boot.conf file inside it.

$ sudo mkdir /mnt/etc
$ sudo touch /mnt/etc/boot.conf

Edit /mnt/etc/boot.conf and add:

set image /5.3/bsd.rd

Finally, I unmount the thumbdrive, reboot to test. The bsd.rd got booted nicely but I haven't tested the installation or upgrade procedure. Didn't want to mess with my current installation. If you tried this, do comment on how it goes. Later.

Update: Here's my experience on Upgrading OpenBSD using USB Flashdrive that I've created above.

6.5 amd64: Modify existing certbot certificates.

Hi, It's been quite some time eh. As you can see, I still upgrade my OpenBSD system regularly but currently I do not have the time to ...