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.

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 ...