Thursday, April 19, 2018

1 Wireless Adapter, 2 Wifi Network

Had an interesting problem today where I have to access 2 separate wifi networks at the same time so that I could use 1 to access the internet, and the other to access the local network that has been set up.

Found some guiding light from here. So some network adapters can actually handle themselves like they are more than 1 adapter. The trick is to create a sort of virtual network adapter. Into the terminal, type:
sudo iw dev wlan0 interface add wlan1 type station

Where wlan0 is the current device name of the wireless adapter. wlan1 is the new virtual adapter. You might find that you still can't connect because the mac address of the new adapter would still be the same as the original adapter. Change the mac address by typing:
sudo ip link set dev wlan1 address 

After changing the mac address, I had to switch off and on again the network adapter before it actually worked. And by golly it actually works.

Wednesday, December 6, 2017

It took me 3 days to install ubuntu

My father bought a new laptop for his shop, the Acer Aspire ES 14 (ES1-432-C9B6). He's been using ubuntu on all his computers for a long time now and asked me to install ubuntu on his latest laptop. And oh my God... it was so difficult....

Installing it was easy enough... just boot the usb installer and follow the wizard. But after that, it would say "No bootable device". I tried changing all the settings in the bios. But there wasn't a lot of settings. And no settings for uefi.. only for secure boot. And even the secure boot menu was disabled until you set the supervisor password. But even after toggling the secure boot option, it still won't boot.

Been googling to find the solution but not much luck, until I found this page, with the title "Fix No Bootable Device Found Error After Installing Ubuntu" I thought my luck has changed. But alas, his solution required that we choose the uefi file to boot from, which again, was not available as a menu in the bios.

And then I found this on the ubuntu forums. At the very end it mentions about how to add the UEFI entry with rEFind and linked to this page. The page actually teach you step by step on how to use rEFInd to add the ubuntu grub into uefi without going through the BIOS menu. You just need to:
1. download it from here
2. dd the image into a pen drive
3. boot the pen drive
4. enter the rEFInd UEFI shell
5. Type :- bcfg boot dump" to get a list of all available boot drive
6. Type :- bcfg boot add X fs0:\EFI\ubuntu\shimx64.efi "ubuntu"
    where X is changed with the next available number from step 5
7. Type :- bcfg boot mv 1 0
     to change the boot order
8. Restart

And it should be working great now.... finally..

Thursday, April 13, 2017

Do you remember?

Do you remember how it was?
What fun we had, what games we played.

Do you remember who we were?
Young and carefree, riding into the future.

Do you remember all of this?
Any of this?

Maybe one day we can look back again,
And be happy for who we were, for who we now are.

Do you remember?

Monday, August 22, 2016

Installing ftw.tika in Plone

I love being able to search in all the documents uploaded into plone. I keep on forgetting that this was an add-on and not natively provided. The latest add-on I tried to enable that feature was ftw.tika.

To install it, first download the tika.cfg file from their github page at https://github.com/4teamwork/ftw.tika. Once that has been downloaded, modify your buildout.cfg with:


[buildout]

extends =
       ...
       tika.cfg

eggs =
       ...
       ftw.tika

zcml =
       ...
       ftw.tika
       ftw.tika-meta

parts =
       ...
       tika-server-download
       tika-server

[client1]
...
zcml-additional += ${tika:zcml}
eggs += ftw.tika


[client2]
...
zcml-additional += ${tika:zcml}
eggs += ftw.tika


[client3]
...
zcml-additional += ${tika:zcml}
eggs += ftw.tika

[client4]
...
zcml-additional += ${tika:zcml}
eggs += ftw.tika


Once that is done, run buildout. Then you can start the tika server with "bin/tika-server". Then you can start your plone instance. After that make sure you login and enable the tika add-on in your "site-setup", "add-ons" page.

To allow the tika server to start automatically on Centos 7, create the file /etc/systemd/system/tika.service with the following content:

[Unit]
Description=Tika server
After=network.target

[Service]
Type=forking
ExecStart=/usr/bin/java -jar /opt/plone/zeocluster/parts/tika-server-download/tika-server.jar -h 0.0.0.0

[Install]
WantedBy=multi-user.target


Then enable the service with "systemctl enable tika".

Looks pretty nice. Now all office docs are searchable inside.

Sunday, August 21, 2016

Looking back

I haven't actually "looked" at this blog for quite a while. I write to it, of course, but that's mostly as reminders for myself. But today I took it upon myself to at least change the template of the site. And wow... so much memories flooding back.

As I check back the links, even they have to change. There is no more foss.org.my, there is no more kaeru.my. Just memories of them now.

My first post was on Feb 9, 2008. Now it is August 21, 2016. That's a good 8 years later. Thanks to this blog I remember I left OSCC around July 28, 2009. Following kaeru to start off Inigo. That didn't last long for me. By April 2, 2010 I was already working at Logistic Consulting Asia. Doing reports in java for their internally developed system. And that stint lasted even shorter. By June 1, 2010 I was working at CIMB. And am still here till this day.

Even my tools have changed somewhat. I barely do any PHP programming nowadays. Mostly writing groovy in great grails framework. And python using the flask framework. And whenever I can, I write a little bit of java for android development. I've been meaning to get into iOS development but haven't found the time nor the motivation yet. Bought the books but that's as much as I have done so far.

Times have changed.

Friday, June 10, 2016

haproxy on Centos 7 with SELinux

Setting up haproxy and varnish with reference to the configuration from these sites: http://sharadchhetri.com/2014/12/20/how-to-install-varnish-4-version-on-centos-7-rhel-7/ https://www.upcloud.com/support/haproxy-load-balancer-centos/ And finally can access plone on the server. But when I check the haproxy status, only client1 can be accessed. All other clients were down with general socket error, permission denied. Googling a bit I finally found out it was due to SELinux. Refer to this page: http://stackoverflow.com/questions/26420729/haproxy-health-check-permission-denied With the solution from that page, I installed policycoreutils-python and tried to run the command given:
semanage port --add --type http_port_t --proto tcp 8081
But that command failed with the error that the port was already defined. When I looked it up using:
semanage port -l | grep 8081
It belonged to some other type (transproxy_port_t). When I tried to delete the type using:
semanage port -d -t transproxy_port_t -p tcp 8081
Got the error that it belongs in the policy and cannot be deleted. After much frustation and further googling finally found out I can modify the port
semanage port -m -t http_port_t -p tcp 8081
And finally haproxy was able to use the other clients. Finally.....

Thursday, June 9, 2016

Installing Centos 7 on HP G7 Server

When I first initially tried it, the installer cannot detect any local hard disk to install to. After much googling found out that it was because a certain driver for the Smart Array Controller is no longer available on Centos 7. To allow for use of the new driver on old hardware, you need to enable the option. Once the DVD has booted and on the first menu screen, highlight the first option and then press tab which would bring you to a command line where you can add additional parameters to boot. Add the following parameters:
hpsa.hpsa_allow_any=1 hpsa.hpsa_simple_mode=1
And then press enter to boot. You should now be able to install as you wish. After installation, on the first boot, make sure at the menu, press 'e' to edit the parameters and add them again. Then once booted, go to /boot/grub2/grub.cfg to permanently add the parameters to the menu. Refer to http://serverfault.com/questions/611182/centos-7-x64-and-hp-proliant-dl360-g5-scsi-controller-compatibility and it's comments for the explaination.

Haiya ala Solah